KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > cms > ant > DocumentCreatorTask


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17
18 /* $Id: DocumentCreatorTask.java 109758 2004-12-04 02:23:27Z antonio $ */
19
20 package org.apache.lenya.cms.ant;
21
22 import java.io.File JavaDoc;
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 JavaDoc parentId;
30     private String JavaDoc childId;
31     private String JavaDoc childName;
32     private String JavaDoc childType;
33     private String JavaDoc documentType;
34     private String JavaDoc area;
35     private String JavaDoc authoringPath;
36     private String JavaDoc language;
37     private boolean visibleInNav;
38
39     /**
40      * (non-Javadoc)
41      * @see org.apache.tools.ant.Task#execute()
42      */

43     public void execute() throws BuildException {
44         DocumentCreator creator = new DocumentCreator();
45
46         try {
47             creator.create(
48                 getPublication(),
49                 new File JavaDoc(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     /**
64      * Get the child type
65      *
66      * @return the child type
67      */

68     public String JavaDoc getChildType() {
69         assertString(childType);
70
71         return childType;
72     }
73
74     /**
75      * Get the document type
76      *
77      * @return the document type
78      */

79     public String JavaDoc getDocumentType() {
80         assertString(documentType);
81
82         return documentType;
83     }
84
85     /**
86      * Get the parent id
87      *
88      * @return the parent id
89      */

90     public String JavaDoc getParentId() {
91         assertString(parentId);
92
93         return parentId;
94     }
95
96     /**
97      * Set the child type
98      *
99      * @param string the child type
100      */

101     public void setChildType(String JavaDoc string) {
102         assertString(string);
103         childType = string;
104     }
105
106     /**
107      * Set the document type
108      *
109      * @param string the document type
110      */

111     public void setDocumentType(String JavaDoc string) {
112         assertString(string);
113         documentType = string;
114     }
115
116     /**
117      * Set the parent id
118      *
119      * @param string the parent id
120      */

121     public void setParentId(String JavaDoc string) {
122         assertString(string);
123         parentId = string;
124     }
125
126     /**
127      * Get the child id
128      *
129      * @return the child id
130      */

131     public String JavaDoc getChildId() {
132         assertString(childId);
133
134         return childId;
135     }
136
137     /**
138      * Get the child name
139      *
140      * @return the child name
141      */

142     public String JavaDoc getChildName() {
143         assertString(childName);
144
145         return childName;
146     }
147
148     /**
149      * Set the child id
150      *
151      * @param string the child id
152      */

153     public void setChildId(String JavaDoc string) {
154         assertString(string);
155         childId = string;
156     }
157
158     /**
159      * Set the child name
160      *
161      * @param string the child name
162      */

163     public void setChildName(String JavaDoc string) {
164         assertString(string);
165         childName = string;
166     }
167
168     /**
169      * Get the authoring path
170      *
171      * @return the authoring path
172      */

173     public String JavaDoc getAuthoringPath() {
174         assertString(authoringPath);
175
176         return authoringPath;
177     }
178
179     /**
180      * Set the authoring path
181      *
182      * @param string the authoring path
183      */

184     public void setAuthoringPath(String JavaDoc string) {
185         assertString(string);
186         authoringPath = string;
187     }
188
189     /**
190      * Get the language
191      *
192      * @return the language
193      */

194     public String JavaDoc getLanguage() {
195         return language;
196     }
197
198     /**
199      * Set the language
200      *
201      * @param language the language
202      */

203     public void setLanguage(String JavaDoc language) {
204         this.language = language;
205     }
206
207     /**
208      * Get the area.
209      *
210      * @return the area
211      */

212     public String JavaDoc getArea() {
213         return area;
214     }
215
216     /**
217      * Set the area.
218      *
219      * @param area the area
220      */

221     public void setArea(String JavaDoc area) {
222         this.area = area;
223     }
224     
225     /**
226      * Set the visiblity of a node
227      *
228      * @param boolean visibleInNav
229      */

230     public void setVisibleInNav(boolean visible) {
231         visibleInNav = visible;
232     }
233     
234     /**
235      * Get the visiblity of a node
236      *
237      * @param boolean visibleinnav
238      */

239     public boolean getVisibleInNav() {
240         return visibleInNav;
241     }
242
243
244 }
245
Popular Tags