Adding dynamic data elements in the template

You can include dynamic data source elements defined in the template at runtime. The Data Source Configuration element allows you to re-configure a data source. This is useful when you do not know the connection information while starting to design your document. For example, you if you linked artifacts from two products A and B, the data source information can be picked up from the B at runtime. By re-configuring a data source, you change the properties such as URI, user name, password, and any other data source-specific properties used by Rational® Publishing Engine when extracting data.

Before you begin

The Data Source Configuration element must be placed in the document template before the element containing queries for the configured data source.

About this task

Use the Data Source Configuration element to re-configure the data source. A data source configuration element must be connected to a data source schema that is used in the template. Depending on the data source configuration, the dynamic data source element includes properties similar to the properties in document specification. At the time of document generation, this element initializes or reinitialize the data source. It is recommended that you use the Data Source Configuration element to define only the properties that are not known at runtime. Using this element for all properties such as the user name, password, location of exe files makes the templates less portable.

Although the Data Source Configuration element properties are similar to the one defined for data source element in document specification, the properties from the document specification have static values while the properties from the Data Source Configuration element use values from another data source available in their context.

Procedure

To re-configure the datasource:

  1. In Document Studio, from the Palette view, drag the Data Source Configuration element onto the template.
  2. In the Properties view, expand Formatting > data.
  3. In the target data source property's Value column, enter the name of the data source schema. After a data source configuration is connected to a data source schema, its formatting properties are updated to reflect the runtime properties of the data source schema type.
  4. In the inherited data configuration, property's Value column, enter the name of a data source schema used in the template. Besides the target data source, a configuration element also contains inherited data source property. By default this property does not contain a value. You can change this value with the data source schema name that is used in the template. If this property is used, the target data source is configured using the settings taken from the inherited data source, along with the properties defined in the data source configuration.

    The properties from the inherited data source are used as long as a value is not specified for the target data source. For example, the URL of the inherited data source will be used for the target data source as long as the URL property is not filled for the target data source. The common use of the inherited data source property is to provide credentials only once for data sources.

  5. Expand dynamic configuration. In the URI property Value column, specify the data source URI. Remove any encoding from the URI if there is any. Rational Publishing Engine creates encoding and if the encoding is duplicated, the URI cannot resolve.
    Other properties can also be specified or they are taken from either the values provided in the Document Specification or the data source defined under the inherited data source property
    Note: The target data source and inherited data source can be the same data source. If inherited data source is left empty the target data source is used.

    Unless the data source configuration property is empty it takes precedence over the document specification property. Rational Publishing Engine combines the properties defined in the Data Source Configuration element with those defined in the Document Specification.

Example

The following example shows the inherited data configuration used in the template. The Data Source Configuration element defines the URI, baseline, and view while the document specification entry defines the Rational DOORS® database to use, user name, password and so on.
Note: Inherited data configuration: When a Dynamic Data Source Configuration element is reached, Rational Publishing Engine will use the properties of the “Inherited Data Source” as the basis and will override them with the values set in the Dynamic Data Source element. This allows a Dynamic Data Source element to specify only the dynamic properties ( usually the URI) and allow reuse of properties set by the user. (which is usually the user name and password).

A Data Source Configuration element connected to a data source

Inherited data configuration properties

Feedback