Changing the Sorting During Navigation
Sort ordering is defined in the IS, PS, and PH Type property XML files under the element NodeOrderingMapping. You can set several sort ordering configurations, one of which can be used during run time.
The sorting mechanism does the following two things:
Sorts selected children of a node based on XPATH rules defined in the Type definition (the order is defined during TAL, not runtime).
If a child node has several values, it selects one of the values based on parameters passed at runtime.
This is used in the language fallback mechanism, where only one TITLE is returned for a child node based on the fallback settings.
The ordering is built globally for all values in all languages. It is based on the assumption that there is a global ordering algorithm for all titles. Only at runtime is the correct title selected for each node.
The definition of ordering provides a lot of freedom in how you define it. In the definition, you can determine the following things:
The node that will be returned by the ordering (in the table of contents example, it is the NODE element)
The node or nodes that will be used for sorting (in the table of contents example it is the linenumber and TITLE/Desc element)
A string value that will be used for selecting the correct node when there are multiple values (in the table of contents example it is the language of the title)
Following is an example of how the definition is coded in the Type:
In this example:
The ordering name is folderdoc.
The returned nodes are sorted in the following order:
If line numbers exist, display the nodes based on the line number
Next display folders and then display documents
The folders and documents are displayed in alphabetic order
The string value for selecting the correct value for each node is the value of the xml:lang attribute on the <DESC> element if it exists, some default if not, or the value of the AuthoredDocLang attribute belonging to the <NODE> element (lines eight through twenty-three).
You can define as many orderings as you like in the Type property. You can also map each one of them to any content type you want at any level providing you can express the mapping rules in XSL.
However, for IS and PS the Java SDK uses three predefined orderings:
doc – used for extracting only document children
folder – used for extracting only folder children
folderdoc – used for extracting both document and folder children
Was this helpful?