org.apache.lenya.cms.site.tree
Class SiteTreeNodeImpl

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.lenya.cms.site.tree.SiteTreeNodeImpl
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled, org.apache.lenya.cms.site.SiteNode, SiteTreeNode

public class SiteTreeNodeImpl
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements SiteTreeNode

Concrete implementation of the SiteTreeNode interface.

Version:
$Id: SiteTreeNodeImpl.java 155316 2005-02-25 10:53:29Z andreas $
See Also:
SiteTreeNode

Field Summary
static java.lang.String HREF_ATTRIBUTE_NAME
          HREF_ATTRIBUTE_NAME The href attribute
static java.lang.String ID_ATTRIBUTE_NAME
          ID_ATTRIBUTE_NAME The id attribute
static java.lang.String LABEL_NAME
          LABEL_NAME The label name
static java.lang.String LANGUAGE_ATTRIBUTE_NAME
          LANGUAGE_ATTRIBUTE_NAME The language attribute
static java.lang.String LINK_ATTRIBUTE_NAME
          LINK_ATTRIBUTE_NAME The link attribute
static java.lang.String NODE_NAME
          NODE_NAME The node name
static java.lang.String SUFFIX_ATTRIBUTE_NAME
          SUFFIX_ATTRIBUTE_NAME The suffix attribute
static java.lang.String UUID_ATTRIBUTE_NAME
          UUID_ATTRIBUTE_NAME The uuid attribute
static java.lang.String VISIBLEINNAV_ATTRIBUTE_NAME
          ISIBLEINNAV_ATTRIBUTE_NAMEThe visibleinnav attribute
 
Constructor Summary
protected SiteTreeNodeImpl(org.apache.lenya.cms.publication.DocumentFactory factory, DefaultSiteTree tree, org.w3c.dom.Element node, org.apache.avalon.framework.logger.Logger logger)
          Creates a new SiteTreeNodeImpl object.
 
Method Summary
 void accept(SiteTreeNodeVisitor visitor)
           
protected  void acceptReverseSubtree(SiteTreeNodeVisitor visitor)
           
 void acceptSubtree(SiteTreeNodeVisitor visitor)
           
 void addLabel(java.lang.String language, java.lang.String label)
           
 void delete()
           
protected  void deleteIfEmpty()
           
 boolean equals(java.lang.Object obj)
           
 org.apache.lenya.cms.site.SiteNode[] getChildren()
           
 SiteTreeNode[] getChildren(java.lang.String language)
           
 java.lang.String getHref()
           
protected  java.lang.String getKey()
           
 java.lang.String[] getLanguages()
           
 org.apache.lenya.cms.site.Link getLink(java.lang.String language)
           
protected  SiteTreeLink getLinkInternal(java.lang.String language)
           
protected  SiteTreeLink[] getLinks()
           
 java.lang.String getName()
           
protected  org.apache.lenya.xml.NamespaceHelper getNamespaceHelper()
          Returns the namespace helper of the sitetree XML document.
 java.lang.String getNextSiblingDocumentId()
           
 SiteTreeNode[] getNextSiblings()
          Get the sitetreenodes, which are the siblings following this node
 java.lang.String getNodeAttribute(java.lang.String attributeName)
           
 org.apache.lenya.cms.site.SiteNode getParent()
           
 SiteTreeNode getParent(java.lang.String language)
           
 java.lang.String getPath()
           
 SiteTreeNode[] getPrecedingSiblings()
          Get the sitetreenodes, which are the siblings preceding this node
 org.apache.lenya.cms.site.SiteStructure getStructure()
           
 java.lang.String getSuffix()
           
protected  DefaultSiteTree getTree()
           
 java.lang.String getUuid()
           
 int hashCode()
           
 boolean hasLink()
           
 boolean hasLink(java.lang.String language)
           
 boolean isTopLevel()
           
 boolean isVisible()
           
 java.util.List postOrder()
           
 java.util.List preOrder()
           
 SiteTreeNode[] removeChildren()
           
 void removeLabel(java.lang.String language)
           
protected  void save()
           
 void setNodeAttribute(java.lang.String attributeName, java.lang.String attributeValue)
           
 void setUUID(java.lang.String uuid)
           
 void setVisible(boolean visibleInNav)
           
 java.lang.String toString()
           
 boolean visibleInNav()
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ID_ATTRIBUTE_NAME

public static final java.lang.String ID_ATTRIBUTE_NAME
ID_ATTRIBUTE_NAME The id attribute

See Also:
Constant Field Values

UUID_ATTRIBUTE_NAME

public static final java.lang.String UUID_ATTRIBUTE_NAME
UUID_ATTRIBUTE_NAME The uuid attribute

See Also:
Constant Field Values

VISIBLEINNAV_ATTRIBUTE_NAME

public static final java.lang.String VISIBLEINNAV_ATTRIBUTE_NAME
ISIBLEINNAV_ATTRIBUTE_NAMEThe visibleinnav attribute

See Also:
Constant Field Values

HREF_ATTRIBUTE_NAME

public static final java.lang.String HREF_ATTRIBUTE_NAME
HREF_ATTRIBUTE_NAME The href attribute

See Also:
Constant Field Values

SUFFIX_ATTRIBUTE_NAME

public static final java.lang.String SUFFIX_ATTRIBUTE_NAME
SUFFIX_ATTRIBUTE_NAME The suffix attribute

See Also:
Constant Field Values

LINK_ATTRIBUTE_NAME

public static final java.lang.String LINK_ATTRIBUTE_NAME
LINK_ATTRIBUTE_NAME The link attribute

See Also:
Constant Field Values

LANGUAGE_ATTRIBUTE_NAME

public static final java.lang.String LANGUAGE_ATTRIBUTE_NAME
LANGUAGE_ATTRIBUTE_NAME The language attribute

See Also:
Constant Field Values

NODE_NAME

public static final java.lang.String NODE_NAME
NODE_NAME The node name

See Also:
Constant Field Values

LABEL_NAME

public static final java.lang.String LABEL_NAME
LABEL_NAME The label name

See Also:
Constant Field Values
Constructor Detail

SiteTreeNodeImpl

protected SiteTreeNodeImpl(org.apache.lenya.cms.publication.DocumentFactory factory,
                           DefaultSiteTree tree,
                           org.w3c.dom.Element node,
                           org.apache.avalon.framework.logger.Logger logger)
Creates a new SiteTreeNodeImpl object.

Parameters:
factory - The document factory.
tree - The tree.
node - The node.
logger - The logger.
_node - the node which is to be wrapped by this SiteTreeNode
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface org.apache.lenya.cms.site.SiteNode

getUuid

public java.lang.String getUuid()
Specified by:
getUuid in interface org.apache.lenya.cms.site.SiteNode

getPath

public java.lang.String getPath()
Specified by:
getPath in interface org.apache.lenya.cms.site.SiteNode

getLinks

protected SiteTreeLink[] getLinks()

addLabel

public void addLabel(java.lang.String language,
                     java.lang.String label)
              throws org.apache.lenya.cms.site.SiteException
Throws:
org.apache.lenya.cms.site.SiteException

removeLabel

public void removeLabel(java.lang.String language)

deleteIfEmpty

protected void deleteIfEmpty()
                      throws org.apache.lenya.cms.site.SiteException
Throws:
org.apache.lenya.cms.site.SiteException

visibleInNav

public boolean visibleInNav()
See Also:
org.apache.lenya.cms.site.tree.SiteTreeNode#visibleInNav()

getHref

public java.lang.String getHref()
Specified by:
getHref in interface org.apache.lenya.cms.site.SiteNode
See Also:
SiteNode.getHref()

getSuffix

public java.lang.String getSuffix()
Specified by:
getSuffix in interface org.apache.lenya.cms.site.SiteNode
See Also:
SiteNode.getSuffix()

hasLink

public boolean hasLink()
Specified by:
hasLink in interface org.apache.lenya.cms.site.SiteNode
See Also:
SiteNode.hasLink()

getChildren

public org.apache.lenya.cms.site.SiteNode[] getChildren()
Specified by:
getChildren in interface org.apache.lenya.cms.site.SiteNode
See Also:
SiteNode.getChildren()

removeChildren

public SiteTreeNode[] removeChildren()
See Also:
org.apache.lenya.cms.site.tree.SiteTreeNode#removeChildren()

getNextSiblings

public SiteTreeNode[] getNextSiblings()
Description copied from interface: SiteTreeNode
Get the sitetreenodes, which are the siblings following this node

Specified by:
getNextSiblings in interface SiteTreeNode
Returns:
the children.
See Also:
SiteTreeNode.getNextSiblings()

getPrecedingSiblings

public SiteTreeNode[] getPrecedingSiblings()
Description copied from interface: SiteTreeNode
Get the sitetreenodes, which are the siblings preceding this node

Specified by:
getPrecedingSiblings in interface SiteTreeNode
Returns:
the children.
See Also:
SiteTreeNode.getPrecedingSiblings()

getNextSiblingDocumentId

public java.lang.String getNextSiblingDocumentId()
See Also:
org.apache.lenya.cms.site.tree.SiteTreeNode#getNextSiblingDocumentId()

accept

public void accept(SiteTreeNodeVisitor visitor)
            throws org.apache.lenya.cms.publication.DocumentException
Throws:
org.apache.lenya.cms.publication.DocumentException
See Also:
org.apache.lenya.cms.site.tree.SiteTreeNode#accept(org.apache.lenya.cms.site.tree.SiteTreeNodeVisitor)

acceptSubtree

public void acceptSubtree(SiteTreeNodeVisitor visitor)
                   throws org.apache.lenya.cms.publication.DocumentException
Throws:
org.apache.lenya.cms.publication.DocumentException
See Also:
org.apache.lenya.cms.site.tree.SiteTreeNode#acceptSubtree(org.apache.lenya.cms.site.tree.SiteTreeNodeVisitor)

acceptReverseSubtree

protected void acceptReverseSubtree(SiteTreeNodeVisitor visitor)
                             throws org.apache.lenya.cms.publication.DocumentException
Throws:
org.apache.lenya.cms.publication.DocumentException

postOrder

public java.util.List postOrder()
See Also:
org.apache.lenya.cms.site.tree.SiteTreeNode#postOrder()

setNodeAttribute

public void setNodeAttribute(java.lang.String attributeName,
                             java.lang.String attributeValue)
See Also:
org.apache.lenya.cms.site.tree.SiteTreeNode#setNodeAttribute(String, String)

getChildren

public SiteTreeNode[] getChildren(java.lang.String language)
See Also:
org.apache.lenya.cms.site.tree.SiteTreeNode#getChildren(java.lang.String)

getParent

public org.apache.lenya.cms.site.SiteNode getParent()
                                             throws org.apache.lenya.cms.site.SiteException
Specified by:
getParent in interface org.apache.lenya.cms.site.SiteNode
Throws:
org.apache.lenya.cms.site.SiteException
See Also:
SiteNode.getParent()

getNamespaceHelper

protected org.apache.lenya.xml.NamespaceHelper getNamespaceHelper()
Returns the namespace helper of the sitetree XML document.

Returns:
A namespace helper.

getParent

public SiteTreeNode getParent(java.lang.String language)
See Also:
org.apache.lenya.cms.site.tree.SiteTreeNode#getParent(java.lang.String)

preOrder

public java.util.List preOrder()
See Also:
org.apache.lenya.cms.site.tree.SiteTreeNode#preOrder()

getNodeAttribute

public java.lang.String getNodeAttribute(java.lang.String attributeName)

setUUID

public void setUUID(java.lang.String uuid)

getStructure

public org.apache.lenya.cms.site.SiteStructure getStructure()
Specified by:
getStructure in interface org.apache.lenya.cms.site.SiteNode

getTree

protected DefaultSiteTree getTree()

getLanguages

public java.lang.String[] getLanguages()
Specified by:
getLanguages in interface org.apache.lenya.cms.site.SiteNode

getLink

public org.apache.lenya.cms.site.Link getLink(java.lang.String language)
                                       throws org.apache.lenya.cms.site.SiteException
Specified by:
getLink in interface org.apache.lenya.cms.site.SiteNode
Throws:
org.apache.lenya.cms.site.SiteException

getLinkInternal

protected SiteTreeLink getLinkInternal(java.lang.String language)

hasLink

public boolean hasLink(java.lang.String language)
Specified by:
hasLink in interface org.apache.lenya.cms.site.SiteNode

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getKey

protected java.lang.String getKey()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isVisible

public boolean isVisible()
Specified by:
isVisible in interface org.apache.lenya.cms.site.SiteNode

setVisible

public void setVisible(boolean visibleInNav)
Specified by:
setVisible in interface org.apache.lenya.cms.site.SiteNode

delete

public void delete()
Specified by:
delete in interface org.apache.lenya.cms.site.SiteNode

isTopLevel

public boolean isTopLevel()
Specified by:
isTopLevel in interface org.apache.lenya.cms.site.SiteNode

save

protected void save()


Copyright $ Apache Software Foundation. All Rights Reserved.