org.apache.lenya.cms.publication
Interface SiteTreeNode

All Known Implementing Classes:
SiteTreeNodeImpl

public interface SiteTreeNode

This interface is a wrapper around the more general w3c.Node which hides some details which are irrelevant for site tree nodes. It basically delegates everything to the Node.


Method Summary
 void accept(SiteTreeNodeVisitor visitor)
          Call the visit method of the visitor, that mean the operation that shall be perfoemed on this node (Visitor pattern)
 void acceptReverseSubtree(SiteTreeNodeVisitor visitor)
          Traverse in a reverse way the node ant its children and call the accept method.
 void acceptSubtree(SiteTreeNodeVisitor visitor)
          Traverse the node ant its children and call the accept method.
 void addLabel(Label label)
          Add a label to this node iff the node does not have this label already.
 void deleteChildren()
          Remove the children of this node.
 java.lang.String getAbsoluteId()
          Get the absolute id of this node.
 java.lang.String getAbsoluteParentId()
          Get the absolute parent-id of this node.
 SiteTreeNode[] getChildren()
          Get the sitetreenodes, which are children of this node
 SiteTreeNode[] getChildren(java.lang.String language)
          Get the sitetreenodes, which are children of this node and contain a label for the given language.
 java.lang.String getHref()
          Deprecated. use the href attribute of the label instead
 java.lang.String getId()
          Get the id of this node.
 Label getLabel(java.lang.String xmlLanguage)
          Get the label for a specific language.
 Label[] getLabels()
          Get all labels for this node (independent of their language attribute).
 java.lang.String getNextSiblingDocumentId()
           
 SiteTreeNode[] getNextSiblings()
          Get the sitetreenodes, which are the siblings following this node
 SiteTreeNode getParent()
          Returns the parent node of this node.
 SiteTreeNode getParent(java.lang.String language)
          Returns the parent node of this node or null if the parent has no label for the given language.
 java.lang.String getParentId()
          Get the parent-id of this node.
 java.lang.String getSuffix()
          Get the suffix of this node.
 boolean hasLink()
          Check whether this node has a link.
 java.util.List postOrder()
          Give a list of the children and this node in a post order way
 java.util.List preOrder()
          Give a list of the children and this node in a pre order way
 SiteTreeNode[] removeChildren()
          Deprecated. Use deleteChildren() instead
 void removeLabel(Label label)
          Remove a label from this node.
 void setLabel(Label label)
          Sets a label of an this node.
 void setNodeAttribute(java.lang.String attributeName, java.lang.String attributeValue)
          Sets an attribute of this node.
 boolean visibleInNav()
          Check whether this node is visible in the navigation
 

Method Detail

getParentId

java.lang.String getParentId()
Get the parent-id of this node.

Returns:
the parent-id.

getParent

SiteTreeNode getParent()
Returns the parent node of this node.

Returns:
A sitetree node.

getParent

SiteTreeNode getParent(java.lang.String language)
Returns the parent node of this node or null if the parent has no label for the given language.

Parameters:
language - A language string.
Returns:
A sitetree node.

getAbsoluteId

java.lang.String getAbsoluteId()
Get the absolute id of this node.

Returns:
the absolute id.

getAbsoluteParentId

java.lang.String getAbsoluteParentId()
Get the absolute parent-id of this node.

Returns:
the absolute parent-id.

getId

java.lang.String getId()
Get the id of this node.

Returns:
the node id.

getLabels

Label[] getLabels()
Get all labels for this node (independent of their language attribute).

Returns:
an Array of labels.

getLabel

Label getLabel(java.lang.String xmlLanguage)
Get the label for a specific language.

Parameters:
xmlLanguage - the language for which the label is requested.
Returns:
a Label if there is one for the given language, null otherwise.

addLabel

void addLabel(Label label)
Add a label to this node iff the node does not have this label already.

Parameters:
label - the label to be added.

removeLabel

void removeLabel(Label label)
Remove a label from this node.

Parameters:
label - the label to be removed.

visibleInNav

boolean visibleInNav()
Check whether this node is visible in the navigation

Returns:
true if this node is visible. The method should also return true if the attribute is not set. That means a node missing this attribute becomes visible by default.

getHref

java.lang.String getHref()
Deprecated. use the href attribute of the label instead

Get the href of this node.

Returns:
the href.

getSuffix

java.lang.String getSuffix()
Get the suffix of this node.

Returns:
the suffix.

hasLink

boolean hasLink()
Check whether this node has a link.

Returns:
true if this node has a link.

getChildren

SiteTreeNode[] getChildren()
Get the sitetreenodes, which are children of this node

Returns:
the children.

getChildren

SiteTreeNode[] getChildren(java.lang.String language)
Get the sitetreenodes, which are children of this node and contain a label for the given language.

Parameters:
language - A language string.
Returns:
the children.

removeChildren

SiteTreeNode[] removeChildren()
Deprecated. Use deleteChildren() instead

Remove the children of the node

Returns:
the removed node

deleteChildren

void deleteChildren()
                    throws SiteTreeException
Remove the children of this node.

Throws:
SiteTreeException

getNextSiblings

SiteTreeNode[] getNextSiblings()
Get the sitetreenodes, which are the siblings following this node

Returns:
the children.

getNextSiblingDocumentId

java.lang.String getNextSiblingDocumentId()
Returns:
string. The document-id corresponding to the next sibling node.

accept

void accept(SiteTreeNodeVisitor visitor)
            throws DocumentException
Call the visit method of the visitor, that mean the operation that shall be perfoemed on this node (Visitor pattern)

Parameters:
visitor - The visitor.
Throws:
DocumentException - if an error occurs

acceptSubtree

void acceptSubtree(SiteTreeNodeVisitor visitor)
                   throws DocumentException
Traverse the node ant its children and call the accept method.

Parameters:
visitor - The visitor.
Throws:
DocumentException - if an error occurs

acceptReverseSubtree

void acceptReverseSubtree(SiteTreeNodeVisitor visitor)
                          throws DocumentException
Traverse in a reverse way the node ant its children and call the accept method.

Parameters:
visitor - The visitor.
Throws:
DocumentException - if an error occurs

setLabel

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

Parameters:
label - the label to add

setNodeAttribute

void setNodeAttribute(java.lang.String attributeName,
                      java.lang.String attributeValue)
Sets an attribute of this node. If the attribute already exists its value will be overwritten

Parameters:
attributeName - name of the attribute
attributeValue - the value of the respective attribute

preOrder

java.util.List preOrder()
Give a list of the children and this node in a pre order way

Returns:
The list

postOrder

java.util.List postOrder()
Give a list of the children and this node in a post order way

Returns:
The list


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