1 17 18 19 20 package org.apache.lenya.cms.publication; 21 22 import org.apache.lenya.cms.authoring.ParentChildCreatorInterface; 23 24 25 28 public class DocumentType { 29 public static final String NAMESPACE = "http://apache.org/cocoon/lenya/doctypes/1.0"; 30 public static final String DEFAULT_PREFIX = "dt"; 31 32 37 protected DocumentType(String name) { 38 assert name != null; 39 this.name = name; 40 } 41 42 private String name; 43 44 48 public String getName() { 49 return name; 50 } 51 52 private ParentChildCreatorInterface creator = null; 53 54 59 public ParentChildCreatorInterface getCreator() { 60 return creator; 61 } 62 63 68 protected void setCreator(ParentChildCreatorInterface creator) { 69 assert creator != null; 70 this.creator = creator; 71 } 72 73 private String workflowFile = null; 74 75 80 public boolean hasWorkflow() { 81 return workflowFile != null; 82 } 83 84 91 public String getWorkflowFileName() throws DocumentTypeBuildException { 92 if (!hasWorkflow()) { 93 throw new DocumentTypeBuildException("The document type '" + getName() + 94 "' has no workflow!"); 95 } 96 97 return workflowFile; 98 } 99 100 105 public void setWorkflowFileName(String string) { 106 assert string != null; 107 workflowFile = string; 108 } 109 110 113 public String toString() { 114 return getName(); 115 } 116 } 117 | Popular Tags |