You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by eg...@apache.org on 2003/07/08 11:29:43 UTC
cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/publication DefaultSiteTree.java SiteTree.java
egli 2003/07/08 02:29:43
Modified: src/java/org/apache/lenya/cms/publication
DefaultSiteTree.java SiteTree.java
Log:
Added methods to allow adding and removing labels to
existing nodes. This is needed for handling of
multilingual documents.
Revision Changes Path
1.20 +24 -2 cocoon-lenya/src/java/org/apache/lenya/cms/publication/DefaultSiteTree.java
Index: DefaultSiteTree.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/publication/DefaultSiteTree.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- DefaultSiteTree.java 4 Jul 2003 11:45:55 -0000 1.19
+++ DefaultSiteTree.java 8 Jul 2003 09:29:43 -0000 1.20
@@ -266,7 +266,29 @@
log.debug("Tree has been modified: " + document.getDocumentElement());
}
- /** (non-Javadoc)
+ /**
+ * (non-Javadoc)
+ * @see org.apache.lenya.cms.publication.SiteTree#addLabel(java.lang.String, org.apache.lenya.cms.publication.Label)
+ */
+ public void addLabel(String documentId, Label label) {
+ SiteTreeNode node = getNode(documentId);
+ if (node != null) {
+ node.addLabel(label);
+ }
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see org.apache.lenya.cms.publication.SiteTree#removeLabel(java.lang.String, org.apache.lenya.cms.publication.Label)
+ */
+ public void removeLabel(String documentId, Label label) {
+ SiteTreeNode node = getNode(documentId);
+ if (node != null) {
+ node.removeLabel(label);
+ }
+ }
+
+ /** (non-Javadoc)
* @see org.apache.lenya.cms.publication.SiteTree#removeNode(java.lang.String)
*/
public SiteTreeNode removeNode(String documentId) {
1.12 +21 -5 cocoon-lenya/src/java/org/apache/lenya/cms/publication/SiteTree.java
Index: SiteTree.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/publication/SiteTree.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- SiteTree.java 4 Jul 2003 14:07:39 -0000 1.11
+++ SiteTree.java 8 Jul 2003 09:29:43 -0000 1.12
@@ -119,8 +119,24 @@
* @throws SiteTreeException if the addition failed
*/
void addNode(SiteTreeNode node) throws SiteTreeException;
-
- /**
+
+ /**
+ * Add a label to an existing node
+ *
+ * @param documentId the document-id to which the label is to be added.
+ * @param label the label to add
+ */
+ void addLabel(String documentId, Label label);
+
+ /**
+ * Remove a label from a node
+ *
+ * @param documentId the document-id from which the label is to be removed.
+ * @param label the label to remove
+ */
+ void removeLabel(String documentId, Label label);
+
+ /**
* Removes the node corresponding to the given document-id
* from the tree, and returns it.
*
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org