org.apache.lenya.cms.publication
Interface SiteTree

All Known Implementing Classes:
DefaultSiteTree

public interface SiteTree


Field Summary
static java.lang.String NAMESPACE_URI
           
 
Method Summary
 void addLabel(java.lang.String documentId, Label label)
          Add a label to an existing node
 void addNode(SiteTreeNode node)
          Add a node.
 void addNode(SiteTreeNode node, java.lang.String refDocumentId)
          Add a node.
 void addNode(java.lang.String documentid, Label[] labels, boolean visibleInNav, java.lang.String href, java.lang.String suffix, boolean link)
          Add a node.
 void addNode(java.lang.String documentid, Label[] labels, boolean visibleInNav, java.lang.String href, java.lang.String suffix, boolean link, java.lang.String refDocumentId)
          Insert a node before a given node Compute the parent id and the id of the node from the document-id
 void addNode(java.lang.String parentid, java.lang.String id, Label[] labels, boolean visibleInNav)
          Add a node.
 void addNode(java.lang.String parentid, java.lang.String id, Label[] labels, boolean visibleInNav, java.lang.String href, java.lang.String suffix, boolean link)
          Add a node.
 void addNode(java.lang.String parentid, java.lang.String id, Label[] labels, boolean visibleInNav, java.lang.String href, java.lang.String suffix, boolean link, java.lang.String refDocumentId)
          Insert a node before a given node
 void copy(SiteTreeNode src, SiteTreeNode dst, java.lang.String newId, java.lang.String followingSibling)
          Copy a node with all its child node.
 void deleteNode(java.lang.String documentId)
          Removes the node corresponding to the given document-id from the tree.
 SiteTreeNode getNode(java.lang.String documentId)
          Return the Node for a given document-id.
 SiteTreeNode[] getTopNodes()
          Return the top level nodes in the sitetree.
 void importSubtree(SiteTreeNode subtreeRoot, SiteTreeNode newParent, java.lang.String newid, java.lang.String refDocumentId)
          Deprecated. Use copy, move instead.
 void move(SiteTreeNode src, SiteTreeNode dst, java.lang.String newId, java.lang.String followingSibling)
          Move a node with all its child node.
 void moveDown(java.lang.String documentid)
          Move down the node amongst its siblings.
 void moveUp(java.lang.String documentid)
          Move up the node amongst its siblings.
 void removeLabel(java.lang.String documentId, Label label)
          Remove a label from a node
 SiteTreeNode removeNode(java.lang.String documentId)
          Deprecated. Use deleteNode() instead
 void save()
          Save the SiteTree.
 void setLabel(java.lang.String documentId, Label label)
          Sets a label of an existing node.
 

Field Detail

NAMESPACE_URI

static final java.lang.String NAMESPACE_URI
See Also:
Constant Field Values
Method Detail

addNode

void addNode(java.lang.String parentid,
             java.lang.String id,
             Label[] labels,
             boolean visibleInNav)
             throws SiteTreeException
Add a node.

Parameters:
parentid - where the node is to be added
id - e.g. "concepts"
labels - the labels of the node that is to be added
Throws:
SiteTreeException - if the addition failed

addNode

void addNode(java.lang.String parentid,
             java.lang.String id,
             Label[] labels,
             boolean visibleInNav,
             java.lang.String href,
             java.lang.String suffix,
             boolean link)
             throws SiteTreeException
Add a node.

Parameters:
parentid - the node where the new node is to be inserted
id - the node id
labels - the labels
visibleInNav - the visibility of a node in the navigation. It is meant to hide specific nodes within the "public" navigation whereas the node is visible within the info/site area.
href - the href of the new node (internal and external references)
suffix - the suffix of the new node
link - Visibility of link respectively href. It is meant to support "grouping" nodes in the navigation which do not relate to a document (internal) or external link (www).
Throws:
SiteTreeException - if the addition failed

addNode

void addNode(java.lang.String parentid,
             java.lang.String id,
             Label[] labels,
             boolean visibleInNav,
             java.lang.String href,
             java.lang.String suffix,
             boolean link,
             java.lang.String refDocumentId)
             throws SiteTreeException
Insert a node before a given node

Parameters:
parentid - the node where the new node is to be inserted
id - the node id
labels - the labels
visibleInNav - the visibility of a node in the navigation
href - the href of the new node
suffix - the suffix of the new node
link - the link
refDocumentId - document-id of the node, before which the new node will be inserted.
Throws:
SiteTreeException - if the addition failed

addNode

void addNode(java.lang.String documentid,
             Label[] labels,
             boolean visibleInNav,
             java.lang.String href,
             java.lang.String suffix,
             boolean link)
             throws SiteTreeException
Add a node. Compute the parent id and the id of the node from the document-id

Parameters:
documentid - the document-id of the new node. From this the parent-id and the id are computed
labels - the labels
href - the href
suffix - the suffix
link - the link
Throws:
SiteTreeException - if the addition failed

addNode

void addNode(java.lang.String documentid,
             Label[] labels,
             boolean visibleInNav,
             java.lang.String href,
             java.lang.String suffix,
             boolean link,
             java.lang.String refDocumentId)
             throws SiteTreeException
Insert a node before a given node Compute the parent id and the id of the node from the document-id

Parameters:
documentid - the document-id of the new node. From this the parent-id and the id are computed
labels - the labels
href - the href
suffix - the suffix
link - the link
refDocumentId - document-id of the node, before which the new node will be inserted.
Throws:
SiteTreeException - if the addition failed

addNode

void addNode(SiteTreeNode node)
             throws SiteTreeException
Add a node. This method is typically used when publishing, i.e. when copying a node from the authoring tree to the live tree. The existing node already has a parent node (in the authoring tree). The node that is added will be a copy of the original node and will be inserted at the same parentid as the original node.

Parameters:
node - the SiteTreeNode that is to be added
Throws:
SiteTreeException - if the addition failed

addNode

void addNode(SiteTreeNode node,
             java.lang.String refDocumentId)
             throws SiteTreeException
Add a node. This method is typically used when publishing, i.e. when copying a node from the authoring tree to the live tree. The existing node already has a parent node (in the authoring tree). The node that is added will be a copy of the original node and will be inserted at the same parentid as the original node.

Parameters:
node - the SiteTreeNode that is to be added
refDocumentId - document-id of the node, before which the new node will be inserted.
Throws:
SiteTreeException - if the addition failed

addLabel

void addLabel(java.lang.String documentId,
              Label label)
Add a label to an existing node

Parameters:
documentId - the document-id to which the label is to be added.
label - the label to add

setLabel

void setLabel(java.lang.String documentId,
              Label label)
Sets a label of an existing node. If the label does not exist, it is added. Otherwise, the existing label is replaced.

Parameters:
documentId - the document-id to which the label is to be added.
label - the label to add

removeLabel

void removeLabel(java.lang.String documentId,
                 Label label)
Remove a label from a node

Parameters:
documentId - the document-id from which the label is to be removed.
label - the label to remove

removeNode

SiteTreeNode removeNode(java.lang.String documentId)
Deprecated. Use deleteNode() instead

Removes the node corresponding to the given document-id from the tree, and returns it.

Parameters:
documentId - the document-id of the node that is to be removed
Returns:
the removed node

deleteNode

void deleteNode(java.lang.String documentId)
                throws SiteTreeException
Removes the node corresponding to the given document-id from the tree.

Parameters:
documentId - the document-id of the node that is to be removed
Throws:
SiteTreeException

getNode

SiteTreeNode getNode(java.lang.String documentId)
Return the Node for a given document-id.

Parameters:
documentId - the document-id of the node that is requested
Returns:
a SiteTreeNode if there is a node for the given document-id, null otherwise.

getTopNodes

SiteTreeNode[] getTopNodes()
Return the top level nodes in the sitetree.

Returns:
the top nodes in the sitetree, or empty array if there are none

moveUp

void moveUp(java.lang.String documentid)
            throws SiteTreeException
Move up the node amongst its siblings.

Parameters:
documentid - The document id of the node.
Throws:
SiteTreeException - if the moving failed.

moveDown

void moveDown(java.lang.String documentid)
              throws SiteTreeException
Move down the node amongst its siblings.

Parameters:
documentid - The document id of the node.
Throws:
SiteTreeException - if the moving failed.

copy

void copy(SiteTreeNode src,
          SiteTreeNode dst,
          java.lang.String newId,
          java.lang.String followingSibling)
          throws SiteTreeException
Copy a node with all its child node.

Parameters:
src - Node to copy.
dst - Parent node where node will be inserted.
newId - The new id of the inserted node (in case when the node id exists already).
followingSibling - The sibling node that should follow this node (ordering), if null the node will be inserted at the end.
Throws:
SiteTreeException

move

void move(SiteTreeNode src,
          SiteTreeNode dst,
          java.lang.String newId,
          java.lang.String followingSibling)
          throws SiteTreeException
Move a node with all its child node.

Parameters:
src - Node to move.
dst - Parent node where node will be inserted.
newId - The new id of the inserted node (in case when the node id exists already).
followingSibling - The sibling node that should follow the moved node (ordering), if null the node will be inserted at the end.
Throws:
SiteTreeException

importSubtree

void importSubtree(SiteTreeNode subtreeRoot,
                   SiteTreeNode newParent,
                   java.lang.String newid,
                   java.lang.String refDocumentId)
                   throws SiteTreeException
Deprecated. Use copy, move instead.

Imports a subtree (from this or from another tree) at a certain position.

Parameters:
subtreeRoot - The root of the subtree to import.
newParent - The node where the subtree shall be inserted.
newid - The new id of the inserted subtreeRoot node (to not overwrite
refDocumentId - The document-id corresponding to the reference node, before which the subtree should be inserted. If null, the subtree is inserted at the end. in case there is already a node with the same id in the tree).
Throws:
SiteTreeException - when an error occurs.

save

void save()
          throws SiteTreeException
Save the SiteTree.

Throws:
SiteTreeException - if the saving failed


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.