Registering XSLT report templates in the standard plug-in

You can register XSLT templates in the com.ibm.xtools.publish.ui plug-in, along with the ready-to-use templates that are supplied to support the reporting capability.

To register an XSLT template in the com.ibm.xtools.publish.ui plug-in:

  1. Locate the com.ibm.xtools.publish.ui folder in the plug-in directory.
  2. Back up a copy of the plugin.xml file.
  3. In a text editor, open the plugin.xml file.
  4. In the file, locate the following extension point:
    <extension
       point="com.ibm.ccl.erf.ui.services.IntegratingClient"
  5. Under the report_design_definitions section for the extension point, locate a resource_info section. The code should look similar to this example:
     <report_design_definitions>
             <resource_info>
                categoryID="uml2.models"
                description="%report1_description"
                display_name="%report1.name"
                path="$com.ibm.xtools.publish.uml2$/resources/reports/ModelDiagramReport.xsl"
                type="FILE"
                <property
                   name="USING_ICONS"
                   value="true"/>
                <property
                   name="EXTRACTING_DIAGRAMS"
                   value="true"/>
                <property
                   name="DIAGRAM_FORMAT"
                   value="JPG"/>
                <property
                   name="DETAIL_LEVEL"
                   value="FULL"/>
             </resource_info>
          </report_design_definitions>
  6. Copy the resource_info element and paste it after the element that you copied, within the report_design_definitions tags.
  7. Modify the new element to declare your custom report template. The following code shows an example:
     <resource_info>
                categoryID="uml2.models"
                description="My Custom Report Description"
                display_name="MyCustomReportName"
                path="$com.ibm.xtools.publish.uml2$/resources/reports/MyCustomReport.xsl"
                type="FILE"
                <property
                   name="USING_ICONS"
                   value="true"/>
                <property
                   name="EXTRACTING_DIAGRAMS"
                   value="true"/>
                <property
                   name="DIAGRAM_FORMAT"
                   value="JPG"/>
                <property
                   name="DETAIL_LEVEL"
                   value="FULL"/>
             </resource_info>
    • The report description and display_name attributes are listed in the Generate Report window and the Report Explorer view.
    • The path attribute specifies the location of the report in the file system.
    • The categoryID attribute specifies the category in which the report is displayed in the Report Explorer view. The uml2.models category is the default value.
    • You can define a new category by including the following code after the </client> tag
      <category
         id="<category ID>"
         name="<category display name>"
      </category>
      If you use the default category definition, do not include a category definition.
  8. Save the plugin.xml file.
  9. Copy all the file artifacts for your template to the path that you specified in the resource_info declaration, com.ibm.xtools.publish.uml2<version>/resources/reports directory. In this case, you would copy the file MyCustomReport.xsl to this location. You must ensure that the XSL file validates and can locate all XSL files that it depends on.
  10. If you need to support additional attributes that were previously available in the reports.manifest file, add them as properties under the resource_info node. You can supply the following properties for XSLT templates:
    • oclSelfType="Class"
    • oclQuery="self.oclIsKindOf(Class)"
    • USING_ICONS="false"
    • EXTRACTING_DIAGRAMS="false"
    • DIAGRAM_FORMAT="JPG"
    • DETAIL_LEVEL="FULL"
The changes take effect when you restart Eclipse.

Feedback