Creating a template with the Rational DOORS sample data

Rational® DOORS® sample data is provided in the Rational Publishing Engine installation, which you can use to generate a Rational DOORS template and report.

Basic overview

Create a document template, add the data source, add template elements, such as queries, master pages and styles, to the template, and then generate the document.

You can find the Rational DOORS sample data source schema used in this topic in %RPE_HOME%\source\DOORS\examples\doors-multimodule\RPE_DOORSDataList.xsd.

You can find the finished template that this topic helps you to create in %RPE_HOME%\source\DOORS\examples\Tutorial_DOORS.dta.

1. Creating a document template

A document template defines what data is to be extracted from the data source and how to format the presentation of that data. A template is built of static and dynamic content. The static content is defined by the data such as texts and images, which are provided when the template is designed. Dynamic content is represented by placeholders, usually in the form of queries, and is obtained from the data sources at document generation time. A document template does not refer to concrete data sources.

Templates operate with data source schemas not with actual data sources. You can add new data source schema to the currently open template.

The data structure is defined with a schema. A schema allows for the template to be applied to any data source that has a matching structure.

To create a template:
  1. In the Document Studio, click File > New > New Template Wizard and click Next in the welcome window.
  2. Click Create a New Template and click Next.
  3. Select Define Template Title Page and then select these fields to include in the template:
    • Add Title
    • Add Subtitle
    • Add Table of Contents
    • Add Section Break at the end of the Title Page
    Then click Next.
  4. In the Data Sources window, click Add to add the sample Data Source Schema.
    1. In the Data Source type field, select the Rational DOORS type of the schema from the list.
    2. In the Data Source file field, select the sample included with the installation, which is located in C:\Program Files\IBM\Rational\Publishing Engine\1.1.2.2\source\DOORS\schema\simpleDOORSSchema.xsd.
    3. In the Data Source ID field, type a name for the data source, like DOORS 1.
    4. In the Data Source Description field, type a description for the data source, like DOORS example data source.
    5. Click OK and Next.
  5. In Master Page Structure window, click Add.
    1. In the Name field, enter a name for the Master Page, such as MP Data.
    2. In the Description field, enter a description for the Master Page.
    3. In the Orientation field, select an orientation for the template. This selection is not applied to the output.
    4. In the Size field, select letter for the template size. This selection is not applied to the output.
    5. Click OK and Next.
  6. In the Variables window, click Add. Create a variable for document titles.
    1. In the Name field, enter a name for the variable, such as DocumentTitle.
    2. In the Description field, enter a description for the variable, such as The title to use for the document.
    3. In the Default Value field, enter a default value, such as DOORS Data.
    4. In the Access field, select External.
    5. Click OK and Next.
  7. In the Summary window, review the information and click Finish.
  8. Save the template.
  9. Save the document specification.

2. Adding template elements and conditions

You can add a range of template elements, queries, and conditions to build a template.

  1. In the Document Studio, drag the Container element from the Palette view to the Template Content editor.
  2. From the Data Source Schemas view, expand Module (DOORSModule) and drag the Object (DOORSObject) into the Container element. The query displays in the element as Data_Source_ID Module/Object.
  3. From the Data Source Schemas view, expand Object (DOORSObject) and drag the Object Heading (string) attribute into the Container element. A text element is created automatically within the Container element.
    Assigning Queries and Attributes
  4. If the Object Heading contains a value, assign a condition to the display of the text element:
    1. Right-click on the Object Heading element and click Data > Edit Condition. The Set Condition for Current Element window opens.
    2. In the Script Expression section, expand Attributes and select the check box for the Object_Heading attribute.
    3. For the Left operand field, select the _element_level condition.
    4. For the Operator field, select Not equal to.
    5. Click Add to create the condition script.
      Assigning Condition
    6. Click OK to save the condition
  5. From the Palette view, drag a Paragraph element into the Template Content editor and place it under the Text element, also inside the Container element.
  6. From the Data Source Schemas view, expand Object (DOORSObject) and drag the Object Text (string) attribute into the Paragraph element. A text element is created within the Paragraph element.
  7. If the Object Text contains a value, assign a condition to the display of the text element:
    1. Right-click the Object Text element and click Data > Edit Condition. The Set Condition for Current Element window opens.
    2. In the Script Expression section, expand Attributes and select the check box for the Object_Text attribute.
    3. For the Left operand field, select the _element_level condition.
    4. For the Operator field, select Not equal to.
    5. Click Add to create the condition script.
    6. Click OK to save the condition
  8. From the Palette view, drag the Table of contents element to the Template Content editor and place it above the Container element.
  9. Add an image to the template:
    1. From the Palette view, drag an Image element to the Template Content editor.
    2. In the Template Content editor, right-click the Image element and click Image > Load Image.
    3. Select the image to add and click OK. The image is added to the template.
  10. Add a document title placeholder:
    1. From the Palette view, drag the Paragraph element to the Template Content editor.
    2. Select the Paragraph element.
    3. In the Properties view, expand the Metadata section.
    4. In the name field, enter a name such as Document Title Placeholder.
    5. From the Palette view, drag the Text element to the Template Content editor and place it in the Paragraph element.
  11. Add the DocumentTitle variable to the placeholder:
    1. In the Outline view, expand Variables.
    2. Drag the DocumentTitle variable to the Text element in the Document Title Placeholder paragraph. Assigning a variable to a paragraph
    3. Save the template.
  12. Define a style in the template:
    1. In Document Studio, click Style > New Style. The New Style wizard opens. In the welcome window, click Next.
    2. In the Style name field, type the style name as RPE_Title and click Next.
    3. In the Select Style Properties window, select the property or group of properties to apply to the template element. For example, select text and click Selecting a style to add the fields to your style, and then click Next.
      Adding style property
    4. In the Set Property Value window, expand the text and font property names. Enter values in the Property Value column for each property:
      • For bold, enter true.
      • For font color, enter hexadecimal number, such as 0000EE for blue.
      • For font size, enter a point size, such as 16.
      Then click Next.
      Adding property value
    5. Review the summary and click Finish.
    6. Assign the created style to the Document Title Placeholder paragraph by dragging the style from the Outline view to the Paragraph element.
      Assigning a style to the paragraph
  13. Add a master page to the template:
    1. In the bottom of the template editor, click the Master Page tab.
    2. In the Palette view, select the Paragraph element and drag it into the Header element in the template editor.
    3. In the Palette view, select the Text element and drag it into the Paragraph element you added to the Header.
    4. In the Outline view, right-click Variables and click Insert > New Variable..
    5. Enter the details for a HeaderData variable.
      • Name: HeaderData
      • Description: Header information
      • Default Value:
      • Access: External
    6. Drag the HeaderData variable from the Outline view into the Text element in the Template Content editor.
    7. From the Palette view, select the Page Number element and drag it into the Footer element in the Template Content editor.
      Adding a master page
    8. Click the Template Content tab.
    9. From the Outline view, drag the Master Page: MP Data into the Template Content editor and place it in the Container element.
      Assigning a master page
    10. Save the template.
  14. Adding Rational DOORS links in the template:
    1. In the Palette view, drag the Container element into the Template Content editor. Place it into the existing Container element under the Paragraph element.
    2. From the Data Source Schemas view, expand Object (DOORSObject) and drag the Link (DOORSInnerLink) attribute into the Container element.
    3. In the Select Context window, select the first item and click OK.
    4. Select the Container element and in the Properties view, expand Metadata. In the name field, enter Link Container.
    5. In the Properties view, expand Data, select Filter and then click the Setting field value Configuration icon.
    6. In the Native Filter tab of the Filter Editor window, edit the filter for the Module/Object/Link query by entering Link direction in, and then click OK.
    7. From the Palette view, drag the Paragraph element into the Link Container element.
    8. From the Data Source Schemas view, expand Object (DOORSObject) > Link (DOORSInnerLink).
    9. Drag the Linked Object (DOORSLinkObject) attribute into the Paragraph element. A Text element is created automatically in the Paragraph element.
    10. Click OK.
    11. Select the Paragraph element and in the Properties view, expand Metadata. In the name field, enter Linked Objects Para.
    12. From the Data Source Schemas view, expand Object (DOORSObject) and Linked Object (DOORSLinkObject), and then drag the Object Text (string) query into the Paragraph element.
      Adding Rational DOORS link
  15. Save your template.
  16. Compare your template to the one included in your installation files: %RPE_HOME%\source\DOORS\examples\Tutorial_DOORS.dta.

3. Generating the document output

Switch to the Launcher perspective. If the perspective icon is not visible under the toolbar, click the button located in the upper left part of the screen, below the toolbar.

Note: When the keep document specification synchronized preference is selected, the document specification is synchronized with at every load, close, and save operation. If the preference is not selected, you must manually synchronize the document specification.
To configure the data source:
  1. In the Document Specification window, expand Templates > Data Sources.
  2. Right-click the data sourceand select Configure Data Source. In the Rational DOORS Database Source Selection wizard, click Next.
  3. Specify the connection details:
    • To use a running instance of Rational DOORS, select Use running DOORS instance and click Next.
    • To run Rational DOORS in the background, select Run a new background DOORS process and specify the user name, password, database, and path to doors.exe; and then click Next.
  4. In the Select a view from the Rational DOORS database window, navigate to the structure and select the appropriate module, version, and view. After you select a view, Finish enables.
  5. Click Finish.
  6. After you configure the data source, generate the document by clicking Publish > Generate Document or by clicking the Generate Document icon Generate Document icon in the toolbar.

Feedback