1 17 18 19 20 package org.apache.lenya.cms.ant; 21 22 import java.io.File ; 23 24 import org.apache.lenya.cms.authoring.CreatorException; 25 import org.apache.lenya.cms.authoring.DocumentCreator; 26 import org.apache.tools.ant.BuildException; 27 28 public class DocumentCreatorTask extends PublicationTask { 29 private String parentId; 30 private String childId; 31 private String childName; 32 private String childType; 33 private String documentType; 34 private String area; 35 private String authoringPath; 36 private String language; 37 private boolean visibleInNav; 38 39 43 public void execute() throws BuildException { 44 DocumentCreator creator = new DocumentCreator(); 45 46 try { 47 creator.create( 48 getPublication(), 49 new File (getPublication().getDirectory(), getAuthoringPath()), 50 getArea(), 51 getParentId(), 52 getChildId(), 53 getChildName(), 54 getChildType(), 55 documentType, 56 getLanguage(), 57 getVisibleInNav()); 58 } catch (CreatorException e) { 59 throw new BuildException(e); 60 } 61 } 62 63 68 public String getChildType() { 69 assertString(childType); 70 71 return childType; 72 } 73 74 79 public String getDocumentType() { 80 assertString(documentType); 81 82 return documentType; 83 } 84 85 90 public String getParentId() { 91 assertString(parentId); 92 93 return parentId; 94 } 95 96 101 public void setChildType(String string) { 102 assertString(string); 103 childType = string; 104 } 105 106 111 public void setDocumentType(String string) { 112 assertString(string); 113 documentType = string; 114 } 115 116 121 public void setParentId(String string) { 122 assertString(string); 123 parentId = string; 124 } 125 126 131 public String getChildId() { 132 assertString(childId); 133 134 return childId; 135 } 136 137 142 public String getChildName() { 143 assertString(childName); 144 145 return childName; 146 } 147 148 153 public void setChildId(String string) { 154 assertString(string); 155 childId = string; 156 } 157 158 163 public void setChildName(String string) { 164 assertString(string); 165 childName = string; 166 } 167 168 173 public String getAuthoringPath() { 174 assertString(authoringPath); 175 176 return authoringPath; 177 } 178 179 184 public void setAuthoringPath(String string) { 185 assertString(string); 186 authoringPath = string; 187 } 188 189 194 public String getLanguage() { 195 return language; 196 } 197 198 203 public void setLanguage(String language) { 204 this.language = language; 205 } 206 207 212 public String getArea() { 213 return area; 214 } 215 216 221 public void setArea(String area) { 222 this.area = area; 223 } 224 225 230 public void setVisibleInNav(boolean visible) { 231 visibleInNav = visible; 232 } 233 234 239 public boolean getVisibleInNav() { 240 return visibleInNav; 241 } 242 243 244 } 245 | Popular Tags |