cancel
Showing results for 
Search instead for 
Did you mean: 

How to determine a template type in xMII 11.5

Former Member
0 Kudos

I'm writing a BLS transaction to scan through all of my templates and give me a list of what type each template is. I've been looking at some of the predefined queries such as Predefined/TemplateListQuery and it will give me a list of templates that match a doctype. However what I really need to find out if there is a predefined query will give me the template type if I give it the template path. For instance if I send it a filepath of Doug/SomeTemplatename it will tell me if the template is a iChart, or SQL query template. I'm thinking of using Predefined/TemplateDetailQuery but I don't know what the proper parameters are to send to this.

My BLS transaction already can recursively scan and give me all the templates, so I already have that part done. So really all that is left now is finding out what the template type is.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Programmatically loading a template is a bit tricky if you don't know the "secret code".

The following example shows you how to load the template details using the TemplateService, which will return an XML document in MII Rowset format with two columns, ParameterName and ParameterValue.

http://localhost/Lighthammer/Illuminator?Service=TemplateService&Mode=Load&TemplateName=Defaults/TagQuery&Content-Type=text/xml

The first item will always be the DocType. You can use an XPath expression such as

/Rowsets/Rowset/Row[0]/ParameterValue 

...or...

/Rowsets/Rowset/Row[ParameterName == 'DocType']/ParameterValue

...to access the template type.

Edited by: Rick Bullotta on Jan 5, 2009 8:49 AM

Answers (3)

Answers (3)

Former Member
0 Kudos

Oh just for completeness for others that might view this thread, Xpath uses only a single equal sign

 
/Rowsets/Rowset/Row[ParameterName = 'DocType']/ParameterValue

Former Member
0 Kudos

Thank you Rick that was EXACTLY what I was looking for.

jcgood25
Active Contributor
0 Kudos

You'll have to load the template in order to find out. If a directory structure or naming convention was used you might be able to use all the templates in a given location or use the Mask parameter to get the xxxxChart ones.