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.
Procedure
To register an XSLT template in the com.ibm.xtools.publish.ui plug-in:
- Locate the com.ibm.xtools.publish.ui folder
in the plug-in directory.
- Back up a copy of the plugin.xml file.
- In a text editor, open the plugin.xml file.
- In the file, locate the following extension point:
<extension
point="com.ibm.ccl.erf.ui.services.IntegratingClient"
- 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>
- Copy the resource_info element and paste
it after the element that you copied, within the report_design_definitions tags.
- 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>
- Save the plugin.xml file.
- 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.
- 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"
Results
The changes take effect when you restart Eclipse.