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:
- In the Document Studio, click and click Next in
the welcome page.
- Click Create a New Template and click Next.
- 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.
- 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:
- You can add new schemas in three ways.
- In Document Studio, click .
- In the Outline view, click .
- In the Data Source Schemas view, click
.
- In the Add Data Source wizard, click Next in
the welcome page.
- Select a New Data Source Schema:
- In the Schema type field, select the type
of the schema from the list. For example, DOORS.
- 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.
- In the Data Source ID field, type the name
for the data source. (for example, DOORS 1).

- 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.
- In the Document Studio, drag the Container element
from the Palette view, to a Content Editor area.
- Drag the Module.Object query from the Data
Source Schemas view to the container element.
- 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.

- If the Object Heading contains a value, assign a condition to
the display of the text element:
- Right-click on the Object Heading element and click . The Set
Condition for Current Element window opens.
- In the left pane, expand Attributes and
select the check box for the Object_Heading attribute.
- In the right pane, select the condition for the left
operand field as _element_level, from
the list.

- Add a Table of contents by dragging the element
from the Palette view to the content editor area.
- You can also add an image to the template:
- Drag the image element from the Palette view
to the content editor area.
- In the content editor area, right-click the image element and
click Image > Load Image.
- Select the image that you want to add and click OK.
The image is added to the template.

- Add a document title:
- Drag the paragraph with a text element from the Palette view,
to the content Editor area.
- Add a symbolic name such as Document Title Placeholder to the
paragraph.
- Add a variable to the document:
- In the Outline view, click .
- 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.
- Click OK.

- Drag the variable from the Outline view to
the text in the Document Title Placeholder paragraph.

- Save the template.
- Define a style in the template:
- In Document Studio, click.
- In the Style name field, type the style
name as RPE_Title and click Next. The Select
style properties window opens.
- 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
icon
to move them to the right pane, and then click Next.

- In the Set Property Value window, type the
value in the Property Value column for each
property, and then click Next.

- Review the summary and click Finish.
- Assign the created style to the Document Title Placeholder paragraph
by dragging the style from the Outline view to
the paragraph.

- Add a master page to the template:
- In the Document Studio, click or in the Outline view,
right-click on Master Pages and then click Insert
> New Master Page.
- Type the name of the master page in the Name field
(for example, MP Data).
- 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.
- Define a new external variable named HeaderData and
drag it to the text element.

- Click the Template Content tab, and assign the master page to
the container element by dragging it from the Outline view.

- Save the template.
- Adding DOORS links in the template:
- Drag the container element from the Palette view,
to the content editor area under the Module.Object container.
- 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.
- In the Properties view, expand Data,
select Filter and then click
.
- 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.
- 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.
- Add the Object Text attribute of the Linked
Object in the newly created element.

- 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:
- In the Document Specification window, expand .

- Right-click the Data Sources and select Configure
Data Source. In the DOORS Database Source Selection wizard,
click Next .
- 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.
- 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.
- Click Finish.
- After you have configured the data source, generate the document
by clicking Publish > Generate Document or
by clicking
icon.
Note: You can also enter these details manually in the Properties view.