Some of the template elements have the direction property. The value of this property can be set to ltr (left-to-right), rtl(right-to-left), contextual or empty (the default setting). If the value of this property is empty, the direction of the corresponding element is inherited or has a default for the current document value.
You can set the direction property from the Properties view in Document Studio.
The following bidi-specific properties of the runtime metadata are used to control layout of the generated document and base direction of its text contents.
Type | Value | Description |
---|---|---|
bidi | true, false (default) | Used as a trigger to switch on or off bidi-specific functionality. |
document direction | ltr, rtl | Defines the layout of the document. If both document direction and output locale metadata properties are empty, document direction is set to ltr.If document direction is empty, its actual runtime value depends on the value of output locale property. For bidi locales this is rtl. For other locales this is ltr. |
text direction | ltr, rtl, contextual,empty (default) | Defines the base text direction.empty means that the default text direction is the same as the document direction. |
In Launcher, you can set properties by the Properties view or by the Configure Metadata Properties window:
Bidi properties can be referenced from Rational® Publishing Engine templates using the internal variable _sessionInfo:
LocalDocumentGenerator docGen = new LocalDocumentGenerator(new RRDGEngineImpl());
String config = docGen.getConfigurationPath(configFolder.toURI());
DocumentSpecificationBuilder builder = new DocumentSpecificationBuilder();
RPEDocumentSpecification docSpec = builder.create(config);
RPEMetadata metadata = docSpec.getRuntime().getMetadata();
metadata.addProperty(new Property(RPEConfigConstants.PROPERTY_DOCUMENT_DIRECTION, new Value("","rtl"));
The direction of the element specifies alignment, layout and the base text direction of its contents.
Container ,Paragraph, Table ,Table Cell, List and List Item have their own direction property. If the value of this property is empty, the actual direction of the corresponding element is inherited from the closest ascendant, having a non-empty direction property. If it turns out that there is nothing to inherit, the direction of element is defined by the document direction property of the document.
If Container ,Paragraph, Table ,Table Cell, List or List Item have their own or inherited contextual direction property, the actual direction of these elements is determined by their text contents. However, if this is not possible (either the text is not placed into the current element directly or it contains neutral characters only), the actual direction is inherited from the closest ascendant, having a non-empty and non-contextual direction property. If it turns out that there is nothing to inherit, the direction of element is defined by the text direction property of the document.
If Container ,Paragraph, Table ,Table Cell, List or List Item have a Text element with a non-empty direction property as their first direct child, the actual direction of such elements is determined from the resolved direction of this Text element.
If Table or List have their own or inherited contextual direction property, the actual direction of these elements is inherited from the closest ascendant, having a non-empty and non-contextual direction property. If it turns out that there is nothing to inherit, the direction of the element is defined by the document direction property of the document.
If the direction of the Text element is not empty, the contents of this element (which can be only the part of the logical paragraph) appear in the generated document as an isolated segment of the text, formatted in accordance with this property. If the Text element has its own contextual direction property, the base direction of the corresponding text segment is determined from its contents. If the text segment contains only neutral characters, the base text direction is defined by the text direction property of the document.
The direction of Table Of Contents, Table Of Tables and Table Of Figures is defined by the document direction property of the document. It specifies their layout (for example, the relative positions of the section numbers, their names and page numbers) only. Text in the names of a section, for any direction of these elements, should look the same as it appears in the body of the document.
The direction of Table Caption and Figure Caption is defined by the document direction property of the document. It specifies their layout (for example, the relative positions of the labels and contents). The base text direction of each part of captions is defined by the text direction property of the document.
The direction of Footnote is defined by the document direction property of the document. It specifies the layout of the contents (for example, the relative positions of the footnote number, its contents and their alignment). The base text direction of the footnote's contents is defined by the text direction property of the document.
The direction of Comment is undefined. The base text direction of its contents is defined by the text direction property of the document.
The direction of Header and Footer is defined by the document direction property of the document.
The values of style direction and attribute dir found
in the block-level html elements such as P, DIV, H1-H6, LI, TD, as
well as in the TABLE, OL and UL, are recognized and converted into
the Rational Publishing Engine formatting
property direction. If both the style and attribute
are defined for the current html element, the value of dir is
used.
The contents of block-level html elements are handled as a sequence of text elements with different styles. You can use html SPAN elements with the style direction. These SPAN elements are handled as a text element having the style direction property. (However, these elements should not contain any additional markup inside. SPAN elements with additional markup are not supported and might cause unexpected results.)