You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2003/06/30 10:45:31 UTC
cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/ant InitWorkflowHistoryTask.java
andreas 2003/06/30 01:45:31
Modified: src/java/org/apache/lenya/cms/ant
InitWorkflowHistoryTask.java
Log:
using DefaultDocumentBuilder instead of DefaultDocument ctor
Revision Changes Path
1.2 +23 -5 cocoon-lenya/src/java/org/apache/lenya/cms/ant/InitWorkflowHistoryTask.java
Index: InitWorkflowHistoryTask.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/ant/InitWorkflowHistoryTask.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- InitWorkflowHistoryTask.java 6 Jun 2003 13:28:13 -0000 1.1
+++ InitWorkflowHistoryTask.java 30 Jun 2003 08:45:31 -0000 1.2
@@ -44,9 +44,12 @@
package org.apache.lenya.cms.ant;
import org.apache.lenya.cms.publication.DefaultDocument;
+import org.apache.lenya.cms.publication.DefaultDocumentBuilder;
import org.apache.lenya.cms.publication.Document;
+import org.apache.lenya.cms.publication.DocumentBuildException;
import org.apache.lenya.cms.publication.DocumentType;
import org.apache.lenya.cms.publication.DocumentTypeBuilder;
+import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.workflow.WorkflowFactory;
import org.apache.tools.ant.BuildException;
@@ -56,16 +59,31 @@
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
-public class InitWorkflowHistoryTask
- extends PublicationTask {
+public class InitWorkflowHistoryTask extends PublicationTask {
- /* (non-Javadoc)
+ /**
* @see org.apache.tools.ant.Task#execute()
*/
public void execute() throws BuildException {
- Document document = new DefaultDocument(getPublication(), getDocumentId());
+
+ // FIXME: URL as parameter
+
+ String url =
+ "/"
+ + getPublication().getId()
+ + "/"
+ + Publication.AUTHORING_AREA
+ + getDocumentId()
+ + ".html";
+ Document document;
+ try {
+ document = DefaultDocumentBuilder.getInstance().buildDocument(getPublication(), url);
+ } catch (DocumentBuildException e) {
+ throw new BuildException(e);
+ }
try {
- DocumentType type = DocumentTypeBuilder.buildDocumentType(getDocumentType(), getPublication());
+ DocumentType type =
+ DocumentTypeBuilder.buildDocumentType(getDocumentType(), getPublication());
WorkflowFactory.initHistory(document, type.getWorkflowFileName());
} 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