< Previous | Next >

Lesson 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 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 after the Text 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 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_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.

      Adding Table of Contents and Image

  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, select the General tab.
    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.

      Adding property value

    5. Then click Next.
    6. Review the summary and click Finish.
    7. 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
      • 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. Select the Container element and in the Properties view, select the General tab. In the name field, enter Link Container.
    4. In the Properties view, expand Data, and for the Filter property, click Setting field value.
    5. 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.
    6. From the Palette view, drag the Paragraph element into the Link Container element.
    7. From the Data Source Schemas view, expand Object (DOORSObject) and drag the Linked Object (DOORSLinkObject) attribute into the Paragraph element.
    8. Click OK.
    9. Select the Paragraph element and in the Properties view, select the General. In the name field, enter Linked Objects Para.
    10. 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.

Lesson checkpoint

You have added elements to a template.
< Previous | Next >

Feedback