org.outerj.daisy.navigation
Interface NavigationManager


public interface NavigationManager


Method Summary
 void generateNavigationTree(org.xml.sax.ContentHandler contentHandler, NavigationParams navigationParams, org.outerj.daisy.repository.VariantKey activeDocument, boolean handleErrors)
          Generates a navigation tree as XML.
 void generatePreviewNavigationTree(org.xml.sax.ContentHandler contentHandler, java.lang.String navigationTreeXml, long branchId, long languageId)
          Generates a navigation tree based on the XML given in the navigationTreeXml parameter.
 NavigationLookupResult lookup(java.lang.String navigationPath, org.outerj.daisy.repository.VariantKey navigationDoc)
          Resolves a path (of the form id/id/...) against a navigation tree, giving a certain result.
 java.lang.String reverseLookup(org.outerj.daisy.repository.VariantKey document, org.outerj.daisy.repository.VariantKey navigationDoc)
          Searches a possible path in the navigation tree for the given document, or null if none exists.
 

Method Detail

generateNavigationTree

public void generateNavigationTree(org.xml.sax.ContentHandler contentHandler,
                                   NavigationParams navigationParams,
                                   org.outerj.daisy.repository.VariantKey activeDocument,
                                   boolean handleErrors)
                            throws org.outerj.daisy.repository.RepositoryException,
                                   org.xml.sax.SAXException
Generates a navigation tree as XML.

If the document specified in the NavigationParams as 'activeDocument' cannot be found, a 'closed' tree will be produced (i.e. a tree generated to node depth level 1) if contextualized is true. If contextualized is false, a full tree will be genereated.

The same holds if the the 'activeDocument', or one of the nodes on the path leading to that document, is not readable by the current user and role.

Parameters:
contentHandler - resulting XML will be pushed on this ContentHandler
activeDocument - the document that should be marked as 'selected' (null for none)
handleErrors - if true, the navigation tree generation output will first be buffered so that in case an error occurs, some information about this error can be streamed instead of the normal navigation tree outpus
Throws:
NavigationException - in case some error occurs
org.xml.sax.SAXException - never thrown by us, but unavoidable when pushing things to a ContentHandler.
org.outerj.daisy.repository.RepositoryException

generatePreviewNavigationTree

public void generatePreviewNavigationTree(org.xml.sax.ContentHandler contentHandler,
                                          java.lang.String navigationTreeXml,
                                          long branchId,
                                          long languageId)
                                   throws org.outerj.daisy.repository.RepositoryException,
                                          org.xml.sax.SAXException
Generates a navigation tree based on the XML given in the navigationTreeXml parameter. This allows to generate navigation trees from an XML description not stored in the repository.

The branch and language parameters should be the branch and language that are or will be used on the site where this navigation tree is published (and thus the branch and language under which the navigation tree would normally be stored in the repository). They are used as default branch and language there where one is needed (eg. document and import nodes).

Throws:
org.outerj.daisy.repository.RepositoryException
org.xml.sax.SAXException

lookup

public NavigationLookupResult lookup(java.lang.String navigationPath,
                                     org.outerj.daisy.repository.VariantKey navigationDoc)
                              throws org.outerj.daisy.repository.RepositoryException
Resolves a path (of the form id/id/...) against a navigation tree, giving a certain result. See NavigationLookupResult.

Throws:
org.outerj.daisy.repository.RepositoryException

reverseLookup

public java.lang.String reverseLookup(org.outerj.daisy.repository.VariantKey document,
                                      org.outerj.daisy.repository.VariantKey navigationDoc)
                               throws org.outerj.daisy.repository.RepositoryException
Searches a possible path in the navigation tree for the given document, or null if none exists.

Throws:
org.outerj.daisy.repository.RepositoryException


Copyright © -2005 . All Rights Reserved.