Registering XSLT report templates in custom plug-ins

You can register XSLT report templates in a custom plug-in that you create, instead of in the standard plug-in.

To register an XSLT template in an existing plug-in for templates:

  1. In a text editor, open the plugin.xml file for the plug-in that you want to contain the report template.
    Note: You can reuse an existing Eclipse plug-in or create a new one. You can include multiple XSLT templates in a single plug-in.
  2. Copy the templates that you want to register into any folder in the plug-in folder.
  3. Add the following XML code to the plugin.xml file to define the extension:
    <extension
       point="com.ibm.ccl.erf.ui.services.IntegratingClient"
    </extension>
  4. Add the following XML code to the extension to define a client:
    <extension
       point="com.ibm.ccl.erf.ui.services.IntegratingClient"
       <client
                class="com.ibm.xtools.publish.ui.internal.XSL_UML2XML_IntegratingClient"
                description=""
                display_name=""
                report_file_extensions="*.xslt;*.xsl"
                reporting_system="XSLT"
                uid="com.ibm.xtools.publish.uml2"> 
        </client>
    </extension>
    Note: The description and display_name attributes are reserved for future use.
  5. Within the client element, add XML code to create a report_design_definitions and a resource_info element with the attributes shown in the following code:
    <extension
       point="com.ibm.ccl.erf.ui.services.IntegratingClient">
       <client
                class="com.ibm.xtools.publish.ui.internal.XSL_UML2XML_IntegratingClient"
                description=""
                display_name=""
                report_file_extensions="*.xslt;*.xsl"
                reporting_system="XSLT"
                uid="com.ibm.xtools.publish.uml2"> 
        <report_design_definitions>
             <resource_info>
                categoryID="mycategoryID"
                description="%report1_description"
                display_name="%report1.name"
                path="<path to template>/<file>.xslt"
                type="FILE"
             </resource_info>
          </report_design_definitions>
        </client>
    </extension>
    • The report description and display_name attributes are displayed in the Generate Report window and the Report Explorer view.
    • The path attribute is the location of the report in the file system. It is convenient to locate the report in the plug-in where you define this extension point. In this case, the location is relative to the root folder of the plug-in; for example, /reports/myReport.xsl.
    • The categoryID attribute is the category in which the report is displayed in the Report Explorer view. The category uml2.models category is the default value.
    • You can define a new category by including the following code after </client> tag:
      <category
         id="<category ID>"
         name="<category display name>"
      </category>
      If you use the default category definition, do not include a category definition.
  6. 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"
  7. Save the plugin.xml file.
  8. Specify plug-in dependencies in the manifest.mf file as follows:
    1. Open the manifest.mf file in a text editor
    2. In the Require-Bundle section, add the following files if they are not already listed: com.ibm.ccl.erf.ui.services and com.ibm.xtools.publish.ui. The section should look like the following example:
      Require-Bundle: org.eclipse.core.runtime,
       com.ibm.ccl.erf.ui.services,
       com.ibm.xtools.publish.ui
  9. Save the manifest.mf file.

You must ensure that the XSL file validates and can locate all the XSL files that it depends on.

The changes take effect when you restart Eclipse.


Feedback