Explore the sample Rational DOORS template

The sample template, Tutorial_DOORS.dta, is in the Rational® Publishing Engine installation in the DOORS Examples folder. The template contains a configured Rational DOORS® data source and elements that you can use to generate a Rational DOORS output document.

You can find the sample template, Tutorial_DOORS.dta, in %RPE_HOME%\source\DOORS\examples.

Basic setup

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.

1. Creating a document template

A document template defines what data is to be extracted from the data source (queries) and how to format all the information (formatting information). A template is built of static and dynamic content. The static content is defined by the data such as texts and images, that are provided when the template is designed. The dynamic content is represented by data obtained from the data sources at document generation time. A document template does not refer to concrete data sources.

The template's data's structure is defined with a schema. This 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 page.
  2. Click Create a New Template and click Next.
  3. Select Define Template Title Page option, and then click the check box next to the options to select the paragraph elements containing a Title, Subtitle, along with Table and Section fields to be included in the Template and then click Next.
  4. In the Summary window, review the information and click Finish.

2. Adding a data source schema

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

To add a data source schema:

  1. You can add new schemas in three ways.
    • In Document Studio, click Data > Add Data Source Schema.
    • In the Outline view, click Data Source Schemas > Insert > Data Source Schema.
    • In the Data Source Schemas view, click Add Data Source Schema icon.
  2. In the Add Data Source wizard, click Next in the welcome page.
  3. Select a New Data Source Schema:
    1. In the Schema type field, select the type of the schema from the list. For example, DOORS.
    2. In the Schema file field, type the full path for the schema file or click Browse to select it. You need to provide the full path to the schema. The schema can be on the local file system or on any URL accessible from the computer.
    3. In the Data Source ID field, type the name for the data source. (for example, DOORS 1). Add Data Source Schema Wizard
    4. In the Summary window, review the information and click Finish.

3. 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 a Content Editor area.
  2. Drag the Module.Object query from the Data Source Schemas view to the container element.
  3. Use either method to assign attributes to the text element:
    • Drag the Text element from the Palette view to a Content Editor area.
    • Drag the Object Heading attribute from the Data Source Schemas view to the text 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 left pane, expand Attributes and select the check box for the Object_Heading attribute.
    3. In the right pane, select the condition for the left operand field as _element_level, from the list. Assigning Condition
  5. Add a Table of contents by dragging the element from the Palette view to the content editor area.
  6. You can also add an image to the template:
    1. Drag the image element from the Palette view to the content editor area.
    2. In the content editor area, right-click the image element and click Image > Load Image.
    3. Select the image that you want to add and click OK. The image is added to the template. Adding Table of Contents and Image
  7. Add a document title:
    1. Drag the paragraph with a text element from the Palette view, to the content Editor area.
    2. Add a symbolic name such as Document Title Placeholder to the paragraph.
  8. Add a variable to the document:
    1. In the Outline view, click Variables > Insert > New Variable.
    2. In the New Variable window, type the Name of the variable as DocumentTitle, set its Default Value to DOORS Data, and set the Access as external.
    3. Click OK.

      Adding Variables

    4. Drag the variable from the Outline view to the text in the Document Title Placeholder paragraph. Assigning a variable to a paragraph
    5. Save the template.
  9. Define a style in the template:
    1. In Document Studio, clickStyle > New Style.
    2. In the Style name field, type the style name as RPE_Title and click Next. The Select style properties window opens.
    3. In the Select style properties window, from the left pane, select the property or group of properties that you want to apply to the template element (for example, text) and click Selecting a style icon to move them to the right pane, and then click Next. Adding style property
    4. In the Set Property Value window, type the value in the Property Value column for each property, and 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. Assigning a style to the paragraph
  10. Add a master page to the template:
    1. In the Document Studio, click Master Pages > New Master Page or in the Outline view, right-click on Master Pages and then click Insert > New Master Page.
    2. Type the name of the master page in the Name field (for example, MP Data).
    3. Add the page number field to the footer and a paragraph with a text to the header by dragging the elements from the Palette view onto the Content Editor area.
    4. Define a new external variable named HeaderData and drag it to the text element. Adding a master page
    5. Click the Template Content tab, and assign the master page to the container element by dragging it from the Outline view. Assigning a master page
    6. Save the template.
  11. Adding DOORS links in the template:
    1. Drag the container element from the Palette view, to the content editor area under the Module.Object container.
    2. Assign the query Module.Object.Link by dragging the element from the Data Source schema view to the container element. Name this container as Link Container for easier reference.
    3. In the Properties view, expand Data, select Filter and then click Setting field value.
    4. In the Filter Editor window, click native filter page, edit the filter for the Module.Object.Link query by defining the native filter as Link direction in , and then click OK.
    5. In the content editor area, add the paragraph element inside the Link Container and assign the Module.Object.Link.Linked Object query by dragging Linked Object (DOORSLinkObejct) attribute from the Data Source Schema view to the paragraph element.
    6. Add the Object Text attribute of the Linked Object in the newly created element. Adding DOORS link
  12. Save your template.

4. Generating the document

Switch to the Launcher perspective. If the perspective icon is not visible under the toolbar, click the button located in the top 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. Launcher perspective
  2. Right-click the Data Sources and select Configure Data Source. In the DOORS Database Source Selection wizard, click Next .
  3. Specify the connection details:
    • To use a running instance of DOORS, select Use running DOORS instance and click Next.
    • To run DOORS in the background, select Run a new background DOORS process and specify the Username, Password, Database and Path to doors.exe; and then click Next.
  4. In the Select a view from the DOORS database window, navigate to the structure and select the appropriate module, version, and view. Only when you have selected a view will the Finish button activate.
  5. Click Finish.
  6. After you have configured the data source, generate the document by clicking Publish > Generate Document or by clicking Generate Document icon icon.
Note: You can also enter these details manually in the Properties view.

Feedback