|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lenya.cms.publication.DefaultSiteTree
public class DefaultSiteTree
Default Sitetree implementation
Field Summary | |
---|---|
static java.lang.String |
SITE_TREE_FILENAME
|
Fields inherited from interface org.apache.lenya.cms.publication.SiteTree |
---|
NAMESPACE_URI |
Constructor Summary | |
---|---|
|
DefaultSiteTree(java.io.File treefile)
Deprecated. this constructor will be private in the future |
protected |
DefaultSiteTree(java.io.File pubDir,
java.lang.String area)
Create a DefaultSiteTree |
|
DefaultSiteTree(java.lang.String treefilename)
Deprecated. use the DefaultSiteTree(File pubDir, String area) constructor instead. |
Method Summary | |
---|---|
void |
addLabel(java.lang.String documentId,
Label label)
(non-Javadoc) |
void |
addNode(SiteTreeNode node)
(non-Javadoc) |
void |
addNode(SiteTreeNode node,
java.lang.String refDocumentId)
(non-Javadoc) |
void |
addNode(java.lang.String documentid,
Label[] labels,
boolean visibleInNav,
java.lang.String href,
java.lang.String suffix,
boolean link)
(non-Javadoc) |
void |
addNode(java.lang.String documentId,
Label[] labels,
boolean visibleInNav,
java.lang.String href,
java.lang.String suffix,
boolean link,
java.lang.String refDocumentId)
(non-Javadoc) |
void |
addNode(java.lang.String parentid,
java.lang.String id,
Label[] labels)
(non-Javadoc) |
void |
addNode(java.lang.String parentid,
java.lang.String id,
Label[] labels,
boolean visibleInNav)
(non-Javadoc) |
void |
addNode(java.lang.String parentid,
java.lang.String id,
Label[] labels,
boolean visibleInNav,
java.lang.String href,
java.lang.String suffix,
boolean link)
(non-Javadoc) |
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)
(non-Javadoc) |
protected void |
checkModified()
Checks if the tree file has been modified externally and reloads the site tree. |
void |
copy(SiteTreeNode src,
SiteTreeNode dst,
java.lang.String newId,
java.lang.String followingSibling)
Copy a node with all its child node. |
org.w3c.dom.Document |
createDocument()
Create a new DefaultSiteTree xml document. |
void |
deleteNode(java.lang.String documentId)
Removes the node corresponding to the given document-id from the tree. |
protected org.w3c.dom.Node |
findNode(org.w3c.dom.Node node,
java.util.List ids)
Find a node in a subtree. |
long |
getLastModified()
Get the last time a modification occured to this object. |
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 newParent,
SiteTreeNode subtreeRoot,
java.lang.String newid,
java.lang.String refDocumentId)
(non-Javadoc) |
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)
(non-Javadoc) |
SiteTreeNode |
removeNode(java.lang.String documentId)
(non-Javadoc) |
void |
save()
(non-Javadoc) |
void |
setLabel(java.lang.String documentId,
Label label)
Sets a label of an existing node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SITE_TREE_FILENAME
Constructor Detail |
---|
protected DefaultSiteTree(java.io.File pubDir, java.lang.String area) throws SiteTreeException
pubDir
- the publication directoryarea
- the area
SiteTreeException
- if an error occurspublic DefaultSiteTree(java.lang.String treefilename) throws SiteTreeException
treefilename
- file name of the tree
SiteTreeException
- if an error occurspublic DefaultSiteTree(java.io.File treefile) throws SiteTreeException
treefile
- the file containing the tree
SiteTreeException
- if an error occursMethod Detail |
---|
protected void checkModified()
SiteTreeException
- when something went wrong.public org.w3c.dom.Document createDocument() throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationException
- if an error occursprotected org.w3c.dom.Node findNode(org.w3c.dom.Node node, java.util.List ids)
node
- where to start the searchids
- list of node ids
public void addNode(SiteTreeNode node, java.lang.String refDocumentId) throws SiteTreeException
addNode
in interface SiteTree
node
- the SiteTreeNode
that is to be addedrefDocumentId
- document-id of the node, before which the new node will be inserted.
SiteTreeException
- if the addition failedSiteTree.addNode(org.apache.lenya.cms.publication.SiteTreeNode, java.lang.String)
public void addNode(java.lang.String parentid, java.lang.String id, Label[] labels, boolean visibleInNav) throws SiteTreeException
addNode
in interface SiteTree
parentid
- where the node is to be addedid
- e.g. "concepts"labels
- the labels of the node that is to be added
SiteTreeException
- if the addition failedorg.apache.lenya.cms.publication.SiteTree#addNode(java.lang.String, java.lang.String, org.apache.lenya.cms.publication.Label[])
public void addNode(java.lang.String parentid, java.lang.String id, Label[] labels) throws SiteTreeException
SiteTreeException
SiteTree.addNode(java.lang.String, java.lang.String, org.apache.lenya.cms.publication.Label[], boolean)
public void addNode(SiteTreeNode node) throws SiteTreeException
addNode
in interface SiteTree
node
- the SiteTreeNode
that is to be added
SiteTreeException
- if the addition failedSiteTree.addNode(org.apache.lenya.cms.publication.SiteTreeNode)
public 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
addNode
in interface SiteTree
documentId
- the document-id of the new node.
From this the parent-id and the id are computedlabels
- the labelshref
- the hrefsuffix
- the suffixlink
- the linkrefDocumentId
- document-id of the node, before which the new node will be inserted.
SiteTreeException
- if the addition failedorg.apache.lenya.cms.publication.SiteTree#addNode(java.lang.String, org.apache.lenya.cms.publication.Label[], java.lang.String, java.lang.String, boolean, java.lang.String)
public void addNode(java.lang.String documentid, Label[] labels, boolean visibleInNav, java.lang.String href, java.lang.String suffix, boolean link) throws SiteTreeException
addNode
in interface SiteTree
documentid
- the document-id of the new node.
From this the parent-id and the id are computedlabels
- the labelshref
- the hrefsuffix
- the suffixlink
- the link
SiteTreeException
- if the addition failedorg.apache.lenya.cms.publication.SiteTree#addNode(java.lang.String, org.apache.lenya.cms.publication.Label[], java.lang.String, java.lang.String, boolean)
public 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
addNode
in interface SiteTree
parentid
- the node where the new node is to be insertedid
- the node idlabels
- the labelsvisibleInNav
- 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 nodelink
- 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).
SiteTreeException
- if the addition failedorg.apache.lenya.cms.publication.SiteTree#addNode(java.lang.String, java.lang.String, org.apache.lenya.cms.publication.Label[], java.lang.String, java.lang.String, boolean)
public 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
addNode
in interface SiteTree
parentid
- the node where the new node is to be insertedid
- the node idlabels
- the labelsvisibleInNav
- the visibility of a node in the navigationhref
- the href of the new nodesuffix
- the suffix of the new nodelink
- the linkrefDocumentId
- document-id of the node, before which the new node will be inserted.
SiteTreeException
- if the addition failedorg.apache.lenya.cms.publication.SiteTree#addNode(java.lang.String, java.lang.String, org.apache.lenya.cms.publication.Label[], java.lang.String, java.lang.String, boolean)
public void addLabel(java.lang.String documentId, Label label)
addLabel
in interface SiteTree
documentId
- the document-id to which the label is to be added.label
- the label to addSiteTree.addLabel(java.lang.String, org.apache.lenya.cms.publication.Label)
public void removeLabel(java.lang.String documentId, Label label)
removeLabel
in interface SiteTree
documentId
- the document-id from which the label is to be removed.label
- the label to removeSiteTree.removeLabel(java.lang.String, org.apache.lenya.cms.publication.Label)
public SiteTreeNode removeNode(java.lang.String documentId)
removeNode
in interface SiteTree
documentId
- the document-id of the node that is to be removed
SiteTree.removeNode(java.lang.String)
public void deleteNode(java.lang.String documentId) throws SiteTreeException
SiteTree
deleteNode
in interface SiteTree
documentId
- the document-id of the node that is to be removed
SiteTreeException
public SiteTreeNode getNode(java.lang.String documentId)
SiteTree
getNode
in interface SiteTree
documentId
- the document-id of the node that is requested
SiteTreeNode
if there is a node for the given
document-id, null otherwise.SiteTree.getNode(java.lang.String)
public SiteTreeNode[] getTopNodes()
SiteTree
getTopNodes
in interface SiteTree
SiteTree.getTopNodes()
public void moveUp(java.lang.String documentid) throws SiteTreeException
moveUp
in interface SiteTree
documentid
- The document id for the node.
SiteTreeException
- if the moving failed.public void moveDown(java.lang.String documentid) throws SiteTreeException
moveDown
in interface SiteTree
documentid
- The document id for the node.
SiteTreeException
- if the moving failed.public void importSubtree(SiteTreeNode newParent, SiteTreeNode subtreeRoot, java.lang.String newid, java.lang.String refDocumentId) throws SiteTreeException
importSubtree
in interface SiteTree
newParent
- The root of the subtree to import.subtreeRoot
- The node where the subtree shall be inserted.newid
- The new id of the inserted subtreeRoot node (to not overwriterefDocumentId
- 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).
SiteTreeException
- when an error occurs.org.apache.lenya.cms.publication.SiteTree#importSubtree(org.apache.lenya.cms.publication.SiteTreeNode, org.apache.lenya.cms.publication.SiteTreeNode, java.lang.String)
public void save() throws SiteTreeException
save
in interface SiteTree
SiteTreeException
- if the saving failedSiteTree.save()
public void setLabel(java.lang.String documentId, Label label)
SiteTree
setLabel
in interface SiteTree
documentId
- the document-id to which the label is to be added.label
- the label to addSiteTree.setLabel(java.lang.String, org.apache.lenya.cms.publication.Label)
public void copy(SiteTreeNode src, SiteTreeNode dst, java.lang.String newId, java.lang.String followingSibling) throws SiteTreeException
SiteTree
copy
in interface SiteTree
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.
SiteTreeException
SiteTree.copy(org.apache.lenya.cms.publication.SiteTreeNode, org.apache.lenya.cms.publication.SiteTreeNode, java.lang.String, java.lang.String)
public void move(SiteTreeNode src, SiteTreeNode dst, java.lang.String newId, java.lang.String followingSibling) throws SiteTreeException
SiteTree
move
in interface SiteTree
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.
SiteTreeException
SiteTree.move(org.apache.lenya.cms.publication.SiteTreeNode, org.apache.lenya.cms.publication.SiteTreeNode, java.lang.String, java.lang.String)
public long getLastModified()
LastModified
getLastModified
in interface LastModified
LastModified.getLastModified()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |