Custom Templates XML (Start Screen/Deployment)

Started by danielle, November 12, 2014, 05:05:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

danielle

Hi,

I have created some custom visio templates using an XML file and i was just wondering if anyone knows what the application id is for Visio?

Example below - I can only find what it is for Excel Powerpoint and word.


?xml version="1.0" encoding="utf-8"?>
<o:featuredcontent lcid="1033" xmlns:o="urn:schemas-microsoft-com:office:office">
    <o:application id="WD">
        <o:featuredtemplates startdate="2011-03-01" enddate="2013-03-01">

Nikolay

#1
Hi, it is "VO"

Nikolay

#2
BTW, it looks like danielle found an easy way to make Visio templates appear on the start screen!
All you need to do is to author an xml file with the content like this one (note the "VO"):


<?xml version="1.0" encoding="utf-8"?>
<o:featuredcontent lcid="1033" xmlns:o="urn:schemas-microsoft-com:office:office">
   <o:application id="VO">
        <o:featuredtemplates startdate="2007-01-01" enddate="2017-01-01">

           <!-- TEMPLATE 1 -->
           <o:featuredtemplate title="[Your template title]" source="[path to the template].vst" >
              <o:media mediatype="gif" filename="[thumbnail file name].gif" source="[path to thumbnail file].gif" />
              <o:preview filename="[preview file name].gif" source="[path to preview file].gif" />
           </o:featuredtemplate>

        </o:featuredtemplates>
    </o:application>
</o:featuredcontent>


Then set ServiceURL registry value at path HKEY_CURRENT_USER\Software\Microsoft\Office\[office version]\Common\Spotlight\Providers\[category name] to the path to that file, and you are done!

AFAIR historically this was sort of hardcore actually. Interesting that there seems to be an easy option.
I mean, there is this "Solution Publishing Tool" in Visio SDK which allows one to "publish" templates (and other things).
I've even authored a Visual Studio extension to allow easier integration of that "publishing" stuff in setup.

Visio Guy

#3
Interesting. My Office\14.0 and \15.0 don't even have a Spotlight leaf by default. Some questions that come to mind:

  • Also, I wonder what you do if you want more than one template? Or is it for a category that maps to a directory full of templates?
  • What are the rights of an install program to create these registry keys?
  • Does the solution publishing tool create these registry entries and xml files?
I'm investigating some more...
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Nikolay

Quote from: Visio Guy on November 13, 2014, 01:23:55 PM
Interesting. My Office\14.0 and \15.0 don't even have a Spotlight leaf by default. Some questions that come to mind:

  • Also, I wonder what you do if you want more than one template? Or is it for a category that maps to a directory full of templates?
  • What are the rights of an install program to create these registry keys?
  • Does the solution publishing tool create these registry entries and xml files?
I'm investigating some more...

I have also investigated a bit :)

- By default, there is no "Spotlight" key, one has to create it manually.
- It looks like you can have as many templates and categories as you want. To create a category, you register a new file under [category name] in the registry. To add more templates to the category, you append them to the list in the XML file - seems to work fine.
- The key can be created by a restricted user (it's under HKCU). No Admin permissions required.
- The "solution publishing tool" does something completely different (it uses the "PublishComponent" MSI table to fill the publication data windows installer registry). Nothing like "Sportlight" or this XML file is created.

That means, it looks like Visio has 2 alternative (hopefully not conflicting) ways to fill templates on the start screen. First is the "old" method which gets the data from the windows installer; the second one is this "Spotlight" way which obviously comes from the Office package.

Visio Guy

#5
These are my findings:

First, two articles:

Interesting points:

  • The xml configuration file can point to several templates, which will fall into your custom category
  • The category shows as a folder under Custom Templates in Visio's "Start" page
  • The configuration has options for a template thumbnail and a preview image
  • The templates and images can be in different folders, as long as the configuration points to the right location
  • The configuration can't use relative or %userprofile%-style paths. They have to be absolute paths
  • The articles show paths to a server, but local paths work fine.
  • You create a registry key under e.g. ...Common\Spotlight\Providers\MyCoolCategory
When Visio starts, it adds another key at ...Common\Spotlight\Content\MyCoolCategory (see second attached image). This has a bunch of keys under it. These are generated the first time you start Visio after adding the configuration file and the reg keys.
  • Every time you change the xml configuration file, you need to refresh the Content\MyCoolCategory key just mentioned, and delete everything under it (or at least the MyCoolCategory key that relates to your changes). Even a machine reboot doesn't cause Visio to look again at the paths. So you'll be stuck with any errors until you delete Content\MyCoolCategory and force Visio to regenerate the info under that key.
  • You can use VSDs instead of VSTs, and Visio treats them just like templates (and opens unsaved copies.) If you are using this method to "install" your own custom templates, it is much easier to edit VSD files than VSTs (because you don't have to browse to a VSD and select "open original", you can just double-click the VSD file.)

Below you can see the result for Visio 2010. Note the Custom Template category "Chris" in the top screenshot. In the bottom, not how the template icon and preview are different images (the preview has red squiggles).
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Visio Guy

#6
I should mention here what I usually do for customers, i.e. a THIRD way to "publish" content and custom templates:

  • Edit Visio's File Paths so that the templates path includes %userprofile%\Documents\MyShapes - the location where your Favorites stencil is.
  • I then add custom templates to this location, in addition to any stencils.
  • When Visio starts, it looks to the templates path and creates folders in the Start screen.

This way is much easier than the xml/registry version. But the method discussed in this thread allows you to have separate template and preview images. So, say, a template icon could be fairly simplistic, but the preview image could be more detailed.

I would also propose that putting templates in My Shapes might be a "standard" that Visio content developers follow. It makes a lot of sense, and it is easy to track down files, debug errors, etc.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Visio Guy

One more note:

Using the xml/categories method is Visio version-specific. I run both Visio 2010 and 2013 on my machine. After configuring for Visio 2010 and checking that everything worked, I then switched to Visio 2013. The custom category and templates did NOT appear.

If you use the File Paths method to specify a templates directory, this does carry from Visio 2010 to Visio 2013, as they must read the same registry settings...? Perhaps this explains the lengthy "Installing..." procedure that occurs every time you start different versions of Visio on the same machine.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010