Use an auto-generated template

Rational® Rhapsody® includes an option to generate HTML reports, using an auto-generated Rational Publishing Engine template that is model-specific. The auto-generated template is based on a template that references a collection of snippet templates. These mini-templates represent elements such as classes. If you want to customize the report, you only have to modify the individual snippet templates that are of interest to you.

Generating reports

  1. From the main menu, select Tools > Publish > Report using auto-generated template....
  2. When the Generate Document window is displayed, complete the following fields:
    Generate Document window
    • Scope: select the relevant report scope from the drop-down list
    • Output Folder: select the folder where the report should be generated
      Note: When a report is generated, a number of subfolders are created in the output folder that you specified. Therefore, if you try to generate a second report to the same folder, Rational Rhapsody tells you to select a different folder.
    • Report Type: select a report type from the drop-down list. If you have defined your own compatible templates, you can click the folder selection button and locate the folder that contains your report types. The drop-down list will be re-populated accordingly.
  3. Click Generate.

Customization - working with snippets

To customize the auto-generated template:

  1. Open Rational Publishing Engine Studio.
  2. Open one of the snippet templates located in the folder <Rhapsody installation directory>\Share\RPE\SnippetBasedReportGenerator\templates\uml\snippettemplates or the folder <Rhapsody installation directory>\Share\RPE\SnippetBasedReportGenerator\templates\SysML\snippettemplates.
  3. Make changes to the template.
  4. Save the template changes.

The next time you generate an HTML report, the output will reflect the changes that you made to the snippet template.

When customizing the auto-generated template, keep the following points in mind:

  • The file general.dta includes basic element information such as the element description. As such, it is included in most of the other snippet templates.
  • The content in general.dta includes information that ends up in the navigation browser on the side of the generated document. If you want general information included for an element type but don't want the element to show up in the navigation browser, use the snippet template generalnobrowser.dta
  • For most elements, there are two different .dta files, one with the name of the element and one with "summary" appended to the element name, for example, port.dta and portsummary.dta
  • The Javascript code that is used for defining conditions includes a number of global variables.

Feedback