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/08/12 12:06:42 UTC
cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/ant DeleteNodeTask.java
egli 2003/08/12 03:06:41
Modified: src/java/org/apache/lenya/cms/ant DeleteNodeTask.java
Log:
Removed the deprecated usage of the DefaultSiteTree constructor.
Revision Changes Path
1.2 +17 -16 cocoon-lenya/src/java/org/apache/lenya/cms/ant/DeleteNodeTask.java
Index: DeleteNodeTask.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/ant/DeleteNodeTask.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DeleteNodeTask.java 22 Jul 2003 13:56:19 -0000 1.1
+++ DeleteNodeTask.java 12 Aug 2003 10:06:41 -0000 1.2
@@ -60,15 +60,14 @@
import org.apache.lenya.cms.publication.SiteTreeNode;
import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
/**
* Ant task to delete a node of a tree.
* @author edith
*/
-public class DeleteNodeTask extends Task {
- private String absolutetreepath;
+public class DeleteNodeTask extends PublicationTask {
+ private String area;
private String documentid;
/**
@@ -79,19 +78,21 @@
}
/**
- * @return absolutetreepath The absolute path of the tree.
+ * Get the area.
+ *
+ * @return the area.
*/
- protected String getAbsolutetreepath() {
- return absolutetreepath;
+ public String getArea() {
+ return area;
}
/**
- * Set the value of the absolute path of the tree
+ * Set the area.
*
- * @param string The absolute path of the tree.
+ * @param area the area
*/
- public void setAbsolutetreepath(String string) {
- absolutetreepath = string;
+ public void setArea(String area) {
+ this.area = area;
}
/**
@@ -115,16 +116,16 @@
* Delete a node of a tree.
*
* @param documentid The id of the document corresponding to the node to delete.
- * @param absolutetreepath The absolute path of the tree
+ * @param area the areaof the tree
*
* @throws SiteTreeException if an error occurs
*/
- public void deleteNode(String documentid, String absolutetreepath)
+ public void deleteNode(String documentid, String area)
throws SiteTreeException {
DefaultSiteTree tree = null;
try {
- tree = new DefaultSiteTree(absolutetreepath);
+ tree = getPublication().getSiteTree(area);
SiteTreeNode node = tree.removeNode(documentid);
if (node == null) {
throw new SiteTreeException("Node " + node + " couldn't be removed");
@@ -140,8 +141,8 @@
public void execute() throws BuildException {
try {
log("document-id corresponding to the node: " + getDocumentid());
- log("Absolute Tree Path: " + getAbsolutetreepath());
- deleteNode(getDocumentid(), getAbsolutetreepath());
+ log("area: " + getArea());
+ deleteNode(getDocumentid(), getArea());
} catch (Exception e) {
throw new BuildException(e);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org