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/06 15:31:56 UTC

cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/publication DocumentType.java

andreas     2003/06/06 06:31:56

  Modified:    src/java/org/apache/lenya/cms/publication DocumentType.java
  Log:
  added workflow and creator handling
  
  Revision  Changes    Path
  1.5       +56 -2     cocoon-lenya/src/java/org/apache/lenya/cms/publication/DocumentType.java
  
  Index: DocumentType.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/publication/DocumentType.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DocumentType.java	28 May 2003 14:45:34 -0000	1.4
  +++ DocumentType.java	6 Jun 2003 13:31:56 -0000	1.5
  @@ -6,6 +6,8 @@
   
   package org.apache.lenya.cms.publication;
   
  +import org.apache.lenya.cms.authoring.ParentChildCreatorInterface;
  +
   /**
    * A document type.
    *
  @@ -16,8 +18,8 @@
   	public static final String NAMESPACE = "http://www.lenya.org/2003/doctype";
   	public static final String DEFAULT_PREFIX = "dt";
       
  -    /** Creates a new instance of DocumentTypeImpl */
  -    public DocumentType(String name) {
  +    /** Creates a new instance of DocumentType */
  +    protected DocumentType(String name) {
           assert name != null;
       	this.name = name;
       }
  @@ -31,5 +33,57 @@
   	public String getName() {
   		return name;
   	}
  +    
  +    private ParentChildCreatorInterface creator = null;
  +    
  +    /**
  +     * @return
  +     */
  +    public ParentChildCreatorInterface getCreator() {
  +        return creator;
  +    }
  +
  +    /**
  +     * @param string
  +     */
  +    protected void setCreator(ParentChildCreatorInterface creator) {
  +        assert creator != null;
  +        this.creator = creator;
  +    }
  +    
  +    private String workflowFile = null;
  +    
  +    /**
  +     * Returns if this document type has a workflow definition.
  +     * @return A boolean value.
  +     */
  +    public boolean hasWorkflow() {
  +        return workflowFile != null;
  +    }
  +    
  +    /**
  +     * @return
  +     */
  +    public String getWorkflowFileName() throws DocumentTypeBuildException {
  +        if (!hasWorkflow()) {
  +            throw new DocumentTypeBuildException("The document type '" + getName() + "' has no workflow!");
  +        }
  +        return workflowFile;
  +    }
  +
  +    /**
  +     * @param string
  +     */
  +    public void setWorkflowFileName(String string) {
  +        assert string != null;
  +        workflowFile = string;
  +    }
  +
  +    /* (non-Javadoc)
  +     * @see java.lang.Object#toString()
  +     */
  +    public String toString() {
  +        return getName();
  +    }
   
   }
  
  
  

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