KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xdoclet > modules > caucho > ResinWebXmlSubTask


1 /*
2  * Copyright (c) 2001, 2002 The XDoclet team
3  * All rights reserved.
4  */

5 package xdoclet.modules.caucho;
6
7 import xdoclet.modules.web.WebXmlSubTask;
8
9 /**
10  * Subtask for generation of web.xml with resin extensions.
11  *
12  * @author Yoritaka Sakakura (yori@teardrop.org)
13  * @created June 5, 2002
14  * @see <a HREF="http://caucho.com/products/resin/ref/app-config.xtp">Web Application Configuration</a>
15  * @ant.element name="resin-web-xml" parent="xdoclet.modules.web.WebDocletTask" display-name="Resin"
16  * @xdoclet.merge-file file="web-settings.xml" relates-to="resin-web.xml" description="The standard merge file from
17  * WebDocletTask's deploymentdescriptor subtask. If present, used instead of generating from config parameters."
18  * @xdoclet.merge-file file="filters.xml" relates-to="resin-web.xml" description="The standard merge file from
19  * WebDocletTask's deploymentdescriptor subtask. Also included in Resin's descriptor if the useStandardMergeFiles
20  * config parameter is true."
21  * @xdoclet.merge-file file="filter-mappings.xml" relates-to="resin-web.xml" description="The standard merge file from
22  * WebDocletTask's deploymentdescriptor subtask. Also included in Resin's descriptor if the useStandardMergeFiles
23  * config parameter is true."
24  * @xdoclet.merge-file file="servlets.xml" relates-to="resin-web.xml" description="The standard merge file from
25  * WebDocletTask's deploymentdescriptor subtask. Also included in Resin's descriptor if the useStandardMergeFiles
26  * config parameter is true."
27  * @xdoclet.merge-file file="servlet-mappings.xml" relates-to="resin-web.xml" description="The standard merge file
28  * from WebDocletTask's deploymentdescriptor subtask. Also included in Resin's descriptor if the
29  * useStandardMergeFiles config parameter is true."
30  * @xdoclet.merge-file file="mime-mappings.xml" relates-to="resin-web.xml" description="The standard merge file from
31  * WebDocletTask's deploymentdescriptor subtask. Also included in Resin's descriptor if the useStandardMergeFiles
32  * config parameter is true."
33  * @xdoclet.merge-file file="taglibs.xml" relates-to="resin-web.xml" description="The standard merge file from
34  * WebDocletTask's deploymentdescriptor subtask. Also included in Resin's descriptor if the useStandardMergeFiles
35  * config parameter is true."
36  * @xdoclet.merge-file file="web-resource-env-refs.xml" relates-to="resin-web.xml" description="The standard merge
37  * file from WebDocletTask's deploymentdescriptor subtask. Also included in Resin's descriptor if the
38  * useStandardMergeFiles config parameter is true."
39  * @xdoclet.merge-file file="ejb-resourcerefs.xml" relates-to="resin-web.xml" description="The standard merge file
40  * from WebDocletTask's deploymentdescriptor subtask. Also included in Resin's descriptor if the
41  * useStandardMergeFiles config parameter is true."
42  * @xdoclet.merge-file file="web-security.xml" relates-to="resin-web.xml" description="The standard merge file from
43  * WebDocletTask's deploymentdescriptor subtask. Also included in Resin's descriptor if the useStandardMergeFiles
44  * config parameter is true."
45  * @xdoclet.merge-file file="web-sec-roles.xml" relates-to="resin-web.xml" description="The standard merge file from
46  * WebDocletTask's deploymentdescriptor subtask. Also included in Resin's descriptor if the useStandardMergeFiles
47  * config parameter is true."
48  * @xdoclet.merge-file file="web-env-entries.xml" relates-to="resin-web.xml" description="The standard merge file from
49  * WebDocletTask's deploymentdescriptor subtask. Also included in Resin's descriptor if the useStandardMergeFiles
50  * config parameter is true."
51  * @xdoclet.merge-file file="web-ejbrefs.xml" relates-to="resin-web.xml" description="The standard merge file from
52  * WebDocletTask's deploymentdescriptor subtask. Also included in Resin's descriptor if the useStandardMergeFiles
53  * config parameter is true."
54  * @xdoclet.merge-file file="resinweb-custom.xml" relates-to="resin-web.xml" description="Optional top-level merge
55  * path resinweb-custom.xml for resin-only configuration."
56  * @xdoclet.merge-file file="web-sec-rolerefs-{0}.xml" relates-to="resin-web.xml" description="An XML unparsed entity
57  * containing security-role-ref elements for a bean, to use instead of generating from web.security-role-ref tags."
58  * @xdoclet.merge-file file="web-ejbrefs-{0}.xml" relates-to="resin-web.xml" description="An XML unparsed entity
59  * containing ejb-ref elements for a bean, to use instead of generating from web.ejb-ref tags."
60  * @xdoclet.merge-file file="web-env-entries-{0}.xml" relates-to="resin-web.xml" description="An XML unparsed entity
61  * containing env-entry elements for a bean, to use instead of generating from web.env-entry tags."
62  * @xdoclet.merge-file file="ejb-resourcerefs-{0}.xml" relates-to="resin-web.xml" description="An XML unparsed entity
63  * containing resource-ref elements for a bean, to use instead of generating from web.resource-ref tags."
64  * @xdoclet.merge-file file="resin-jndi-link-{0}.xml" relates-to="resin-web.xml" description="An XML unparsed entity
65  * containing jndi-link elements for a bean, to use instead of generating from resin.jndi-link tags."
66  */

67 public class ResinWebXmlSubTask extends WebXmlSubTask
68 {
69     private static String JavaDoc DEFAULT_TEMPLATE_FILE = "resources/resin-web-xml.xdt";
70     private static String JavaDoc DEST_FILE_NAME = "resin-web.xml";
71
72     private String JavaDoc appDir = "";
73     private String JavaDoc classUpdateInterval = "";
74     private String JavaDoc configUpdateInterval = "";
75     private String JavaDoc directoryServlet = "";
76     private String JavaDoc encoding = "";
77     private String JavaDoc id = "";
78     private String JavaDoc lazyInit = "";
79     private String JavaDoc secure = "";
80     private String JavaDoc tempDir = "";
81     private String JavaDoc urlRegexp = "";
82     private String JavaDoc workDir = "";
83
84     private String JavaDoc generateSourceComments = "true";
85     private String JavaDoc searchForConfigElements = "true";
86     private String JavaDoc useStandardMergeFiles = "true";
87
88
89     public ResinWebXmlSubTask()
90     {
91         setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE));
92         setDestinationFile(DEST_FILE_NAME);
93         setPublicId(null);
94         setSystemId(null);
95         setSchema(null);
96         setDtdURL(null);
97         setValidateXML(false);
98     }
99
100
101     /**
102      * web-app/app-dir
103      *
104      * @return
105      */

106     public String JavaDoc getAppDir()
107     {
108         return appDir;
109     }
110
111     /**
112      * web-app/character-encoding
113      *
114      * @return
115      */

116     public String JavaDoc getCharEncoding()
117     {
118         return encoding;
119     }
120
121     /**
122      * web-app/class-update-interval
123      *
124      * @return
125      */

126     public String JavaDoc getClassUpdateInterval()
127     {
128         return classUpdateInterval;
129     }
130
131     /**
132      * web-app/config-update-interval
133      *
134      * @return
135      */

136     public String JavaDoc getConfigUpdateInterval()
137     {
138         return configUpdateInterval;
139     }
140
141     /**
142      * web-app/directory-servlet
143      *
144      * @return
145      */

146     public String JavaDoc getDirectoryServlet()
147     {
148         return directoryServlet;
149     }
150
151     /**
152      * Whether or not to include an xml comment for each xdoclet-generated element pointing back to the originating
153      * class/method; default true.
154      *
155      * @return
156      */

157     public String JavaDoc getGenerateSourceComments()
158     {
159         return generateSourceComments;
160     }
161
162     /**
163      * web-app/id
164      *
165      * @return
166      */

167     public String JavaDoc getId()
168     {
169         return id;
170     }
171
172     /**
173      * web-app/lazy-init
174      *
175      * @return
176      */

177     public String JavaDoc getLazyInit()
178     {
179         return lazyInit;
180     }
181
182     /**
183      * Whether or not iterate over all classes in search for configuration other than filters, filter-mappings,
184      * listeners, servlets, and servlet-mappings; default true.
185      *
186      * @return
187      */

188     public String JavaDoc getSearchForConfigElements()
189     {
190         return searchForConfigElements;
191     }
192
193     /**
194      * web-app/secure
195      *
196      * @return
197      */

198     public String JavaDoc getSecure()
199     {
200         return secure;
201     }
202
203     /**
204      * web-app/temp-dir
205      *
206      * @return
207      */

208     public String JavaDoc getTempDir()
209     {
210         return tempDir;
211     }
212
213     /**
214      * web-app/url-regexp
215      *
216      * @return
217      */

218     public String JavaDoc getUrlRegexp()
219     {
220         return urlRegexp;
221     }
222
223     /**
224      * Whether or not to use the top-level merge points defined in the standard web_xml.j; default true.
225      *
226      * @return
227      */

228     public String JavaDoc getUseStandardMergeFiles()
229     {
230         return useStandardMergeFiles;
231     }
232
233     /**
234      * web-app/work-dir
235      *
236      * @return
237      */

238     public String JavaDoc getWorkDir()
239     {
240         return workDir;
241     }
242
243     public void setAppDir(String JavaDoc appDir)
244     {
245         this.appDir = appDir;
246     }
247
248     public void setCharEncoding(String JavaDoc encoding)
249     {
250         this.encoding = encoding;
251     }
252
253     public void setClassUpdateInterval(String JavaDoc classUpdateInterval)
254     {
255         this.classUpdateInterval = classUpdateInterval;
256     }
257
258     public void setConfigUpdateInterval(String JavaDoc configUpdateInterval)
259     {
260         this.configUpdateInterval = configUpdateInterval;
261     }
262
263     public void setDirectoryServlet(String JavaDoc directoryServlet)
264     {
265         this.directoryServlet = directoryServlet;
266     }
267
268     public void setGenerateSourceComments(String JavaDoc generate)
269     {
270         this.generateSourceComments = generate;
271     }
272
273     public void setId(String JavaDoc id)
274     {
275         this.id = id;
276     }
277
278     public void setLazyInit(String JavaDoc lazyInit)
279     {
280         this.lazyInit = lazyInit;
281     }
282
283     public void setSearchForConfigElements(String JavaDoc searchForConfigElements)
284     {
285         this.searchForConfigElements = searchForConfigElements;
286     }
287
288     public void setSecure(String JavaDoc secure)
289     {
290         this.secure = secure;
291     }
292
293     public void setTempDir(String JavaDoc tempDir)
294     {
295         this.tempDir = tempDir;
296     }
297
298     public void setUrlRegexp(String JavaDoc regexp)
299     {
300         this.urlRegexp = regexp;
301     }
302
303     public void setUseStandardMergeFiles(String JavaDoc useStandardMergeFiles)
304     {
305         this.useStandardMergeFiles = useStandardMergeFiles;
306     }
307
308     public void setWorkDir(String JavaDoc workDir)
309     {
310         this.workDir = workDir;
311     }
312 }
313
Popular Tags