Using Special Containers in Rational Publishing Engine

Rational Publishing Engine provides a special Container. Why is this special ?
This is special because it can be inserted directly in a Table, directly in a Row or directly in a List and it can have  Row elements, Cell element and List-detail elements as children. This will allow us to create template structures like in the following Figure:

Figure 1. Special Container in Table

Figure 2. Special Container in List

So the next question is why are these special Containers useful?
For example, there are some situations in which we want a Row to be inserted or not in output based on a condition of which result is calculated at runtime.
Suppose that in a Row, we have one Cell presenting an attribute value. If this value is empty, we don’t want that the empty Row to be displayed in the output document. In this situation we need a condition that will be true only if the value of this attribute will not be empty.
Let’s suppose that we have a Generic XML data source. We have a Table in which we have one Row with a Cell. We set the query Project/Requirements/PRRequirement to the Row. This means that we will have one Row for each PRRequirement.
In the Cell we extract the Assigned To attribute.

Figure 3. Query set to Row

In case that the attribute will have empty value, the result will be an empty Row in the output document. To avoid this situation, we insert a Container in the Table and we move the Row in the newly inserted Container. We move the query to the Container, because we want to be able to insert the proper condition for the Row.

Figure 4. Query moved to Container

We set the following condition to the row “ AssignedTo != “” “. Now, in the output document we will not have empty rows.

Figure 5. Condition for Row

For similar situations in the Tables, we can insert a Container in a Row, and the Cell will be inserted in the Container to avoid having empty cells in the output document.
We can use also this mechanism with Lists. In this situation we will have a Container inserted in the List and in the Container we will insert the List-detail element.

Leave a Reply