lenya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/ant InitWorkflowHistoryTask.java
Date Wed, 13 Aug 2003 17:21:57 GMT
egli        2003/08/13 10:21:57

  Modified:    src/java/org/apache/lenya/cms/ant
                        InitWorkflowHistoryTask.java
  Log:
  The init workflow task now also accepts the langaueg as a
  parameter. So it can initialize different workflows for the
  same document with different languages.
  
  Revision  Changes    Path
  1.6       +40 -8     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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- InitWorkflowHistoryTask.java	5 Aug 2003 18:17:28 -0000	1.5
  +++ InitWorkflowHistoryTask.java	13 Aug 2003 17:21:57 -0000	1.6
  @@ -71,23 +71,39 @@
    *
    */
   public class InitWorkflowHistoryTask extends PublicationTask {
  +    private String documentId;
  +    private String documentType;
  +    private String language;
  +
       /**
        * @see org.apache.tools.ant.Task#execute()
        */
       public void execute() throws BuildException {
           // FIXME: URL as parameter
  -        String url = "/" + getPublication().getId() + "/" + Publication.AUTHORING_AREA
+
  -            getDocumentId() + ".html";
  +        String url =
  +            "/"
  +                + getPublication().getId()
  +                + "/"
  +                + Publication.AUTHORING_AREA
  +                + getDocumentId()
  +                + "_"
  +                + getLanguage()
  +                + ".html";
           Document document;
   
           try {
  -            document = DefaultDocumentBuilder.getInstance().buildDocument(getPublication(),
url);
  +            document =
  +                DefaultDocumentBuilder.getInstance().buildDocument(
  +                    getPublication(),
  +                    url);
           } catch (DocumentBuildException e) {
               throw new BuildException(e);
           }
   
           try {
  -            DocumentType type = DocumentTypeBuilder.buildDocumentType(getDocumentType(),
  +            DocumentType type =
  +                DocumentTypeBuilder.buildDocumentType(
  +                    getDocumentType(),
                       getPublication());
               WorkflowFactory.initHistory(document, type.getWorkflowFileName());
           } catch (Exception e) {
  @@ -95,9 +111,6 @@
           }
       }
   
  -    private String documentId;
  -    private String documentType;
  -
       /**
        * Get the document-id.
        * 
  @@ -139,4 +152,23 @@
           assertString(aDocumentType);
           documentType = aDocumentType;
       }
  +    
  +    /**
  +     * Get the language.
  +     *  
  +     * @return the language
  +     */
  +    public String getLanguage() {
  +        return language;
  +    }
  +
  +    /**
  +     * Set the language.
  +     * 
  +     * @param string the language
  +     */
  +    public void setLanguage(String string) {
  +        language = string;
  +    }
  +
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org


Mime
View raw message