org.outerj.daisy.navigation.impl
Class DocumentNode

java.lang.Object
  extended by org.outerj.daisy.navigation.impl.AbstractParentNode
      extended by org.outerj.daisy.navigation.impl.DocumentNode
All Implemented Interfaces:
DocumentRepresentingNode, Node

public class DocumentNode
extends AbstractParentNode
implements DocumentRepresentingNode


Field Summary
 
Fields inherited from class org.outerj.daisy.navigation.impl.AbstractParentNode
children
 
Fields inherited from interface org.outerj.daisy.navigation.impl.Node
NAVIGATION_NS
 
Constructor Summary
DocumentNode(org.outerj.daisy.repository.VariantKey variantKey, java.lang.String nodeId, java.lang.String label, NodeVisibility nodeVisibility, CommonNavigationManager.Context context, long navigationBranchId, long navigationLanguageId, org.outerj.daisy.navigation.NavigationVersionMode versionMode)
           
 
Method Summary
 boolean checkId(java.lang.String id, long branchId, long languageId)
          Returns true if the id of this node equals the specified id.
 void generateXml(org.xml.sax.ContentHandler contentHandler, int depth, java.lang.String path, long userId, long[] roleIds)
          Generates a full, non-contextualized navigation tree up to the specified depth.
 void generateXml(org.xml.sax.ContentHandler contentHandler, Node[] activeNodePath, int pos, boolean includeOnlyActivePath, java.lang.String path, long userId, long[] roleIds)
           
 org.outerj.daisy.repository.Document getDocument()
           
 java.lang.String getId()
          Returns the id of this node, only works when Node.isIdentifiable() returns true, otherwise throws an UnsupportedOperationException.
 org.outerj.daisy.repository.VariantKey getVariantKey()
           
 boolean isExpandable()
          Returns true for expandable nodes, these are nodes which themselves are not a part of the generated navigation tree, but are replaced by one or more other nodes.
 boolean isIdentifiable()
          Returns true if this node has an ID and will generate a corresponding node in the output tree.
 boolean isVisible(long userId, long[] roleIds, Node[] activeNodePath, int activeNodePathPos)
          Returns true if this node or any of its chilren would produce a visible node in the generated navigation tree.
 void populateNodeLookupMap(java.util.Map map, java.lang.String path)
          Nodes representing documents should add themselves to the map, using as key a VariantKey object and as value a String object representing the navigation tree path.
 java.util.List searchDocument(org.outerj.daisy.repository.VariantKey key)
           
 
Methods inherited from class org.outerj.daisy.navigation.impl.AbstractParentNode
add, generateXml, generateXml, getExpandedChildList, searchPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentNode

public DocumentNode(org.outerj.daisy.repository.VariantKey variantKey,
                    java.lang.String nodeId,
                    java.lang.String label,
                    NodeVisibility nodeVisibility,
                    CommonNavigationManager.Context context,
                    long navigationBranchId,
                    long navigationLanguageId,
                    org.outerj.daisy.navigation.NavigationVersionMode versionMode)
             throws org.outerj.daisy.repository.RepositoryException
Parameters:
label - can be null, in which case the name of the document will serve as label
Throws:
org.outerj.daisy.repository.RepositoryException
Method Detail

checkId

public boolean checkId(java.lang.String id,
                       long branchId,
                       long languageId)
Description copied from interface: Node
Returns true if the id of this node equals the specified id.

Specified by:
checkId in interface Node

isExpandable

public boolean isExpandable()
Description copied from interface: Node
Returns true for expandable nodes, these are nodes which themselves are not a part of the generated navigation tree, but are replaced by one or more other nodes.

Specified by:
isExpandable in interface Node

searchDocument

public java.util.List searchDocument(org.outerj.daisy.repository.VariantKey key)
                              throws org.outerj.daisy.repository.RepositoryException
Specified by:
searchDocument in interface Node
Overrides:
searchDocument in class AbstractParentNode
Throws:
org.outerj.daisy.repository.RepositoryException

populateNodeLookupMap

public void populateNodeLookupMap(java.util.Map map,
                                  java.lang.String path)
                           throws org.outerj.daisy.repository.RepositoryException
Description copied from interface: Node
Nodes representing documents should add themselves to the map, using as key a VariantKey object and as value a String object representing the navigation tree path. A node should not add itself to the map if there is already another mapping for its document ID in the map.

Specified by:
populateNodeLookupMap in interface Node
Overrides:
populateNodeLookupMap in class AbstractParentNode
Throws:
org.outerj.daisy.repository.RepositoryException

generateXml

public void generateXml(org.xml.sax.ContentHandler contentHandler,
                        int depth,
                        java.lang.String path,
                        long userId,
                        long[] roleIds)
                 throws org.outerj.daisy.repository.RepositoryException,
                        org.xml.sax.SAXException
Description copied from interface: Node
Generates a full, non-contextualized navigation tree up to the specified depth. Specify a depth of -1 to get the full tree.

Specified by:
generateXml in interface Node
Overrides:
generateXml in class AbstractParentNode
Throws:
org.outerj.daisy.repository.RepositoryException
org.xml.sax.SAXException

generateXml

public void generateXml(org.xml.sax.ContentHandler contentHandler,
                        Node[] activeNodePath,
                        int pos,
                        boolean includeOnlyActivePath,
                        java.lang.String path,
                        long userId,
                        long[] roleIds)
                 throws org.outerj.daisy.repository.RepositoryException,
                        org.xml.sax.SAXException
Specified by:
generateXml in interface Node
Overrides:
generateXml in class AbstractParentNode
Throws:
org.outerj.daisy.repository.RepositoryException
org.xml.sax.SAXException

isVisible

public boolean isVisible(long userId,
                         long[] roleIds,
                         Node[] activeNodePath,
                         int activeNodePathPos)
                  throws org.outerj.daisy.repository.RepositoryException
Description copied from interface: Node
Returns true if this node or any of its chilren would produce a visible node in the generated navigation tree.

Specified by:
isVisible in interface Node
activeNodePath - this parameter can be null (if there is not active node path)
Throws:
org.outerj.daisy.repository.RepositoryException

isIdentifiable

public boolean isIdentifiable()
Description copied from interface: Node
Returns true if this node has an ID and will generate a corresponding node in the output tree.

Specified by:
isIdentifiable in interface Node

getDocument

public org.outerj.daisy.repository.Document getDocument()
                                                 throws org.outerj.daisy.repository.RepositoryException
Throws:
org.outerj.daisy.repository.RepositoryException

getVariantKey

public org.outerj.daisy.repository.VariantKey getVariantKey()
Specified by:
getVariantKey in interface DocumentRepresentingNode

getId

public java.lang.String getId()
Description copied from interface: Node
Returns the id of this node, only works when Node.isIdentifiable() returns true, otherwise throws an UnsupportedOperationException.

Specified by:
getId in interface Node
Overrides:
getId in class AbstractParentNode


Copyright © -2012 . All Rights Reserved.