Daisy allows to create hierarchical navigation trees for your site. Some of the features and possibilities:
The Daisy Wiki has an advanced GUI for editing the navigation trees, so that users are not confronted with the raw XML. It is of course possible to switch to a source view. Editing a navigation tree is done in the same way as any other document is edited.
It is possible to create readable URLs (i.e. URLs containing readable names instead of numbers) by basing the URL space on the navigation tree and assigning meaningful node IDs to nodes in the navigation tree. See the document about URL management.
The 'root' navigation document of a site is accessible through the [Edit navigation] link below the navigation tree, which is visible is you are logged on as a non-guest-role user. You can also get an overview of all navigation documents using this query:
select id, branch, language, name where documentType = 'Navigation'
The simplest possible navigation tree description is the empty one:
<d:navigationTree xmlns:d="http://outerx.org/daisy/1.0#navigationspec"> </d:navigationTree>
Adding document nodes to it is easy:
<d:navigationTree xmlns:d="http://outerx.org/daisy/1.0#navigationspec">
<d:doc id="26"/>
<d:doc id="32">
<d:doc id="15"/>
</d:doc>
</d:navigationTree>
As shown, the nodes can be nested.
By default , the navigation tree will display the name of the document as the label of a node. However, sometimes you might want to change that, for example if the name is too long. Also, when editing the navigation tree description as a source document, it will quickly become difficult to figure out what node stands for what. Therefore, you can add an attribute called "label" to the d:doc elements:
<d:navigationTree xmlns:d="http://outerx.org/daisy/1.0#navigationspec">
<d:doc id="26" label="Introduction"/>
<d:doc id="32" label="Hot Stuff">
<d:doc id="15" label="Fire"/>
</d:doc>
</d:navigationTree>
By default the ID of a document node is the document ID, but you can assign a custom ID by specifying it in an attribute called nodeId. The custom ID should not start with a digit and not contain whitespace.
To link to a document on another branch or in another language, add a branch and/or language attribute on the d:doc element. The value of the attribute can be a branch/language name or ID. By default, documents are assumed to be on the same branch and in the same language as the navigation tree document itself.
To insert a link to an external location (a non-Daisy document), use the link element:
<d:navigationTree xmlns:d="http://outerx.org/daisy/1.0#navigationspec">
<d:doc id="26" label="Introduction"/>
<d:doc id="32" label="Hot Stuff">
<d:doc id="15" label="Fire"/>
</d:doc>
<d:link url="http://outerthought.org" label="Outerthought"/>
</d:navigationTree>
The attributes url and label are both required. The link element supports an optional id attribute.
If you want to group a number of items below a common title, use the group element. The group element can optionally have an attribute called id to specify a custom id for the node (otherwise, the id is automatically generated, something like g1, g2, etc).
<d:navigationTree xmlns:d="http://outerx.org/daisy/1.0#navigationspec">
<d:group label="Some title">
<d:doc id="26" label="Introduction"/>
<d:doc id="32" label="Hot Stuff">
<d:doc id="15" label="Fire"/>
</d:doc>
</d:group>
<d:link url="http://outerthought.org" label="Outerthought"/>
</d:navigationTree>
To import another navigation tree, use the import element:
<d:navigationTree xmlns:d="http://outerx.org/daisy/1.0#navigationspec">
<d:group label="Some title">
<d:doc id="26" label="Introduction"/>
<d:doc id="32" label="Hot Stuff">
<d:doc id="15" label="Fire"/>
</d:doc>
<d:import docId="81"/>
</d:group>
<d:link url="http://outerthought.org" label="Outerthought"/>
</d:navigationTree>
The docId attribute on the d:import element is of course the id of the navigation document to be imported.
It is possible to dynamically insert nodes by including a query, for example:
<d:navigationTree xmlns:d="http://outerx.org/daisy/1.0#navigationspec">
<d:doc id="26" label="Introduction"/>
<d:doc id="32" label="Hot Stuff">
<d:doc id="15" label="Fire"/>
<d:query q="select name where $somefield='hot' order by name"/>
</d:doc>
</d:navigationTree>
It only makes sense to select one value using the query, that value will be used as the node label.
Since the query is embedded in an XML file, don't forget that you might need to escape certain characters, eg < should be entered as <
The query element can have an optional attribute called filterVariants with value true or false. If true, the query results will be automatically limitted to the branch and language of the navigation document.
If you want to automatically limit the result of queries in the navigation tree to documents contained by one ore more collections, you can add a collections element as first child of the navigationTree element:
<d:navigationTree xmlns:d="http://outerx.org/daisy/1.0#navigationspec">
<d:collections>
<d:collection name="MyCollection"/>
</d:collections>
<d:doc id="26" label="Introduction"/>
<d:doc id="32" label="Hot Stuff">
<d:doc id="15" label="Fire"/>
<d:query q="select name where $somefield='hot' order by name"/>
</d:doc>
</d:navigationTree>
The doc, group, query, link and import nodes can be combined and nested as you desire, with the exception that query and import can't have child elements.
Any other elements besides the ones mentioned here are prohibited, as is text in between the nodes.
The Navigation Manager is implemented as an extension component running inside the repository server. It has its own HTTP+XML interface and remote Java API.