You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ed...@apache.org on 2003/09/17 20:54:33 UTC
cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/publication SiteTreeNodeImpl.java SiteTreeNode.java
edith 2003/09/17 11:54:33
Modified: src/java/org/apache/lenya/cms/publication
SiteTreeNodeImpl.java SiteTreeNode.java
Log:
method getNextSiblings added
Revision Changes Path
1.17 +25 -2 cocoon-lenya/src/java/org/apache/lenya/cms/publication/SiteTreeNodeImpl.java
Index: SiteTreeNodeImpl.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/publication/SiteTreeNodeImpl.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- SiteTreeNodeImpl.java 12 Sep 2003 17:36:06 -0000 1.16
+++ SiteTreeNodeImpl.java 17 Sep 2003 18:54:33 -0000 1.17
@@ -370,6 +370,29 @@
new SiteTreeNode[childElements.size()]);
}
+ /**
+ * (non-Javadoc)
+ * @see org.apache.lenya.cms.publication.SiteTreeNode#getChildren()
+ */
+ public SiteTreeNode[] getNextSiblings() {
+ List siblingElements = new ArrayList();
+
+ NamespaceHelper helper =
+ new NamespaceHelper(
+ DefaultSiteTree.NAMESPACE_URI,
+ "",
+ node.getOwnerDocument());
+ Element[] elements =
+ helper.getNextSiblings((Element)node, SiteTreeNodeImpl.NODE_NAME);
+
+ for (int i = 0; i < elements.length; i++) {
+ SiteTreeNode newNode = new SiteTreeNodeImpl(elements[i]);
+ siblingElements.add(newNode);
+ }
+
+ return (SiteTreeNode[])siblingElements.toArray(
+ new SiteTreeNode[siblingElements.size()]);
+ }
/**
* (non-Javadoc)
* @see org.apache.lenya.cms.publication.SiteTreeNode#accept(org.apache.lenya.cms.publication.SiteTreeNodeVisitor)
1.11 +9 -3 cocoon-lenya/src/java/org/apache/lenya/cms/publication/SiteTreeNode.java
Index: SiteTreeNode.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/publication/SiteTreeNode.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- SiteTreeNode.java 12 Sep 2003 17:35:02 -0000 1.10
+++ SiteTreeNode.java 17 Sep 2003 18:54:33 -0000 1.11
@@ -152,6 +152,12 @@
*/
SiteTreeNode[] removeChildren();
+ /**
+ * Get the sitetreenodes, which are the siblings following this node
+ *
+ * @return the children.
+ */
+ SiteTreeNode[] getNextSiblings();
/**
* Call the visit method of the visitor, that mean
* the operation that shall be perfoemed on this node
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org