Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Create report to show where transformations are used View modes: 
User avatar
Member
Member
epogburn-nola - 3/25/2013 1:13:40 PM
   
Create report to show where transformations are used
Is it possible to create a report or run a SQL query to display where a specific transformation is being used? For example, if I wanted to find all the uses of CMS.File.AttachmentList.

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 3/25/2013 2:08:39 PM
   
RE:Create report to show where transformations are used
Its possible but you need to have a very, very good understanding of how a "page" is created in order to actually find the page template, document, web part and transformation ID. Right now, I'd say your best bet is to say look at the document type and see what documents that particular document type is being used on and just assume the transformation is used on that page.

You may be able to use the API as well although I'm unsure of where you might start for this.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 3/26/2013 12:22:07 PM
   
RE:Create report to show where transformations are used
Hi,

This is true. It would be pretty complex SQL query to check the XML web part definition for given template and search for the transformation code name in it. (CMS_PageTemplate table - PageTemplateWebParts column). And then get information which documents are using this page template.

Best regards,
Juraj Ondrus

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 3/26/2013 3:29:47 PM
   
RE:Create report to show where transformations are used
With what Juraj said, if you're open to creating a user control you could do this in code with some XML and LINQ to XML. This should get you started:
CMS.PortalEngine.PageTemplateInfo pti = CMS.PortalEngine.PageTemplateInfoProvider.GetPageTemplateInfo("TemplateName", 1);
var doc = XDocument.Parse(pti.WebParts);
List<string> elements = doc.Descendants("webpart").Select(el => el.Attribute("guid").Value).ToList();
From there the elements List<string> object will have all the guid's of the webparts. Then you can create another List<string> and query the XML again but go a node lower to get the property name="transformationname", "selecteditemtransformationname", etc. and get those values.

So its not entirely impossible, but SQL isn't the option, you'd have to write some code.