Java Doc for NavigationManager.java in  » Content-Management-System » daisy » org » outerj » daisy » navigation » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » daisy » org.outerj.daisy.navigation 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.outerj.daisy.navigation.NavigationManager

All known Subclasses:   org.outerj.daisy.navigation.impl.NavigationManagerImpl,  org.outerj.daisy.navigation.clientimpl.RemoteNavigationManager,
NavigationManager
public interface NavigationManager (Code)
The NavigationManager generates hierarchical navigation trees from an XML navigation tree specification. The navigation tree specification is read from a Daisy repository document (from the content of the "NavigationData" part) and can contain a literal enumeration of documents but also queries.

The navigation trees support quite some features, we refer to the Daisy documentation for more information on this.

This is an optional repository extension component.

The NavigationManager is obtained from the org.outerj.daisy.repository.Repository Repository as follows:

 NavigationManager navManager = (NavigationManager)repository.getExtension("NavigationManager");
 

In the remote repository API, the NavigationManager extension can be registered as follows:

 RemoteRepositoryManager repositoryManager = ...;
 repositoryManager.registerExtension("NavigationManager",
 new Packages.org.outerj.daisy.navigation.clientimpl.RemoteNavigationManagerProvider());
 




Method Summary
public  voidgenerateNavigationTree(ContentHandler contentHandler, NavigationParams navigationParams, VariantKey activeDocument, boolean handleErrors)
     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.

public  voidgeneratePreviewNavigationTree(ContentHandler contentHandler, String navigationTreeXml, long branchId, long languageId, Locale locale)
     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).

public  voidgeneratePreviewNavigationTree(ContentHandler contentHandler, String navigationTreeXml, long branchId, long languageId)
     Same as the other generatePreviewNavigationTree method, but without Locale parameter (defaults to Locale.US), for backwards compatibility.
public  NavigationLookupResultlookup(String navigationPath, long requestedBranchId, long requestedLanguageId, LookupAlternative[] lookupAlternatives)
     Resolves a path (of the form id/id/...) against a (series of) navigation tree(s), giving a certain result.
public  StringreverseLookup(VariantKey document, VariantKey navigationDoc, NavigationVersionMode versionMode)
     Searches a possible path in the navigation tree for the given document, or null if none exists.
public  StringreverseLookup(VariantKey document, VariantKey navigationDoc)
     Same as the other reverseLookup method, but defaults to the live version mode.



Method Detail
generateNavigationTree
public void generateNavigationTree(ContentHandler contentHandler, NavigationParams navigationParams, VariantKey activeDocument, boolean handleErrors) throws RepositoryException, SAXException(Code)
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
Parameters:
  activeDocument - the document that should be marked as 'selected' (null for none)
Parameters:
  handleErrors - if true, the navigation tree generation output will first be buffered so thatin case an error occurs, some information about this error can be streamedinstead of the normal navigation tree outpus
throws:
  NavigationException - in case some error occurs
throws:
  SAXException - never thrown by us, but unavoidable when pushing things to a ContentHandler.




generatePreviewNavigationTree
public void generatePreviewNavigationTree(ContentHandler contentHandler, String navigationTreeXml, long branchId, long languageId, Locale locale) throws RepositoryException, SAXException(Code)
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).




generatePreviewNavigationTree
public void generatePreviewNavigationTree(ContentHandler contentHandler, String navigationTreeXml, long branchId, long languageId) throws RepositoryException, SAXException(Code)
Same as the other generatePreviewNavigationTree method, but without Locale parameter (defaults to Locale.US), for backwards compatibility.



lookup
public NavigationLookupResult lookup(String navigationPath, long requestedBranchId, long requestedLanguageId, LookupAlternative[] lookupAlternatives) throws RepositoryException(Code)
Resolves a path (of the form id/id/...) against a (series of) navigation tree(s), giving a certain result. See NavigationLookupResult .

This method is best understood with the structure of the Daisy Wiki, where each 'site' is associated with a collection and a navigation tree, and the branch and language of the navigation tree document correspond to the 'default' branch and language for that site.

The algortihm followed is described below.

Is the navigationPath found in the navigation tree of the first lookup alternative?

  • 1. If yes, what is the type of node it addresses?
    • 1-a. If it is a group node, set the result to a redirect to the first (depth-first) document child descendant of the group node. If the group node does not have any such children, set the result to 'path not found'.
    • 1-b. If it is a document node, check if the branch and language of the navtree node match the requested branch and language (if not -1)
      • 1-b-i. If they match, set the result to 'match'.
      • 1-b-ii. If no, search among the lookup alternatives.
  • 2. If no, then does the path end on a numeric ID?
    • 2-a. If no, set the result to 'path not found'.
    • 2-b. If yes, follow the following algorithm:
      • Determine the branch and language (is either the requested branch and language, or those of the navtree of the first lookup alternative)
      • Retrieve the collections the document belongs to. If this fails for whathever reason (usually permissions or existence), just set the result to 'match'. When the front end will then try to display the document, it will run into this error and show it to the user.
      • Run over the lookup alternatives:
        • If the collection, navtree-branch and navtree-language of a lookup alternative match those of the document:
          • If this is the first match, remember it as "firstMatch"
          • If found in the navtree of this lookup alternative, set the result to a redirect to this lookup alternative and navigation path. Done.
        • If we ran over all the lookup alternatives and none matched:
          • If 'firstMatch' is set and is different from first lookup alternative, set result to redirect to the lookup alternative
          • Otherwise set result to 'match' (as if it was found at whatever location that was requested).

      Parameters:
        requestedBranchId - if the branch of the document differs the one in the navtree node, this argumentspecifies the branch ID, otherwise supply -1.
      Parameters:
        requestedLanguageId - dito as for requestedBranchId
      Parameters:
        lookupAlternatives - should at least contain one entry



reverseLookup
public String reverseLookup(VariantKey document, VariantKey navigationDoc, NavigationVersionMode versionMode) throws RepositoryException(Code)
Searches a possible path in the navigation tree for the given document, or null if none exists.



reverseLookup
public String reverseLookup(VariantKey document, VariantKey navigationDoc) throws RepositoryException(Code)
Same as the other reverseLookup method, but defaults to the live version mode.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.