The sample template, Tutorial_Tau.dta,
is in the Rational® Publishing Engine installation
in the Tau Examples folder. The template contains a configured Rational Tau data
source and elements that you can use to generate an output document.
You can find the sample template, Tutorial_Tau.dta,
in %RPE_HOME%\source\Tau\examples.
Basic setup
Create a document template,
add the packages, and for each package list the classes and the diagrams
that are contained in that package. For each class, a table is added
that lists the class's attribute names and types. If the "TAU
instalation Path\bin" is not installed to the path in the system variable,
the following error displays "Cannot Initialize JAVA API" Error
on document generation.
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 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 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 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 data source schema
Templates operate
with data schemas and not with actual data sources. You can add new
data source schema to the currently open template.
To add a
data source:
- You can add new schemas in three ways.
- In Document Studio, click .
- In the Outline view, click .
- In the Schema 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, Tau).
- In the Schema file field, type or click Browse to
select the path for the schema file. 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, Tau 1.

- In the Summary window, review the information
and click Finish.
3. Defining template contents
To define
a template contents:
- Define a query for the top-level packages and cast under the model.root element:
- Click the root(Any Type) element from the Data
Source Schema view and click
.
- In the Select Type window, select Package and
then click OK.
Note: You cannot build queries of type Any Type. A cast
needs to be defined before using the query. Schema elements that can
have more than one type do not have a type assigned to them. In such
cases, you can define which type to use through the Cast
to type feature.
- Add the container element from the Palette view
in the template, and drag the newly added Package element from the Data
Source Schema view to the container element.
- Name the container Root Packages for easier referencing.
- Create a paragraph in the container element and add the Name attribute.

- Add the static text heading diagrams for the list of diagrams:
- Add the Paragraph element from the Palette view
to the container element.
- Add the Text element from the Palette view
to the paragraph.
- Double-click the text and set the value for the diagrams.
- Create a new container in the Root Packages container and add
the package diagram element to it.
Note: To add a specific diagram
type, add a cast to that diagram type below the diagram(Diagram) node
and use the cast type instead of the generic diagram type.
- To add a specific diagram:
- Add an image element from the Palette view
into the container.
- Right-click on image element and select Set Value.
- In the Set Value for Image Element window,
expand $2 - model.root(Package).diagram, and select _image.
The selected attribute is added in the Select data item field.
- Click OK.
- Add a Paragraph element below the Image element
by dragging the element from the Palette view.
- Add the Diagram caption element to the paragraph by dragging the
element from the Palette view. Optionally, add
a figure caption field so that you can build a Table of Figures.
Tip: You can also add diagram name to the figure caption.

- To display the figure caption with the diagram name:
- In the Properties view, expand specific,
and then click
.
- In the Set Field Label Value window, expand
$2- model.root(Package).diagram, and select Name.
The selected attribute is added in the Select data item field.
- Click OK.
- List the classes from each package:
- Save the document.
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 the edited template 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 source and then click Configure
Data Source.
- In the Select a Tau Project File window,
select a Tau project. For example, CMdesign.ttp.
- Click Open.
- Once you have configured the data source, generate the document
by clicking Publish > Generate Document or
by clicking
icon.
After you generate the document, the output contains the name
of the top-level packages in the model, the diagrams, and the classes
in each package.