KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xdoclet > modules > macromedia > jrun > web > JRunWebXmlSubTask


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

5 package xdoclet.modules.macromedia.jrun.web;
6
7 import xdoclet.XmlSubTask;
8
9 /**
10  * Generates jrun-web.xml deployment descriptor.
11  *
12  * @author Dan Schaffer (dschaffer@macromedia.com)
13  * @created February 7, 2002
14  * @ant.element display-name="JRun" name="jrunwebxml" parent="xdoclet.modules.web.WebDocletTask"
15  * @version $Revision: 1.8 $
16  * @xdoclet.merge-file file="session-config.xml" relates-to="jrun-web.xml" description="An XML document containing the
17  * optional session-config element."
18  * @xdoclet.merge-file file="virtual-mapping.xml" relates-to="jrun-web.xml" description="An XML unparsed entity
19  * containing the virtual-mapping elements."
20  */

21 public class JRunWebXmlSubTask extends XmlSubTask
22 {
23     private final static String JavaDoc JRUN_WEB_PUBLICID = "-//Macromedia, Inc.//DTD jrun-web 4.0//EN";
24
25     private final static String JavaDoc JRUN_WEB_SYSTEMID = "http://www.macromedia.com/dtds/jrun-web.dtd";
26
27     private final static String JavaDoc JRUN_WEB_DTD_FILE_NAME = "resources/jrun-web.dtd";
28
29     /**
30      * The default template file - jrun_web_xml.j.
31      */

32     private static String JavaDoc DEFAULT_TEMPLATE_FILE = "resources/jrun_web_xml.xdt";
33
34     /**
35      * The generated file name - jrun-web.xml.
36      */

37     private static String JavaDoc GENERATED_FILE_NAME = "jrun-web.xml";
38
39     /**
40      * The Security Domain, defaults to "" because it is not included if not set in the build.xml.
41      */

42     protected String JavaDoc contextRoot = "";
43
44     protected String JavaDoc reload = "";
45
46     protected String JavaDoc compile = "";
47
48     protected String JavaDoc loadSystemClassesFirst = "";
49
50     /**
51      * Describe what the JRunWebXmlSubTask constructor does
52      */

53     public JRunWebXmlSubTask()
54     {
55         setTemplateURL(getClass().getResource(DEFAULT_TEMPLATE_FILE));
56         setDestinationFile(GENERATED_FILE_NAME);
57         setPublicId(JRUN_WEB_PUBLICID);
58         setSystemId(JRUN_WEB_SYSTEMID);
59         setDtdURL(getClass().getResource(JRUN_WEB_DTD_FILE_NAME));
60     }
61
62     /**
63      * Return the Context Root of the web application. This is where the webApp will be installed in the browser (e.g.
64      * http://localhost:8100/contextRoot
65      *
66      * @return The Context Root
67      */

68     public String JavaDoc getContextRoot()
69     {
70         return contextRoot;
71     }
72
73     /**
74      * Return the Reload setting. Determines whether to automatically reload servlets, helper classes, jsp helper
75      * classes.
76      *
77      * @return reload setting either true or false
78      */

79     public String JavaDoc getReload()
80     {
81         return reload;
82     }
83
84     /**
85      * Return the Compile setting. Determines whether to automatically compile servlets
86      *
87      * @return compile setting either true or false
88      */

89     public String JavaDoc getCompile()
90     {
91         return compile;
92     }
93
94     /**
95      * Return the Load-System-Classes-First setting. Determines whether to load system classpath first or app server
96      * classpath.
97      *
98      * @return loadSystemClassesFirst setting
99      */

100     public String JavaDoc getLoadSystemClassesFirst()
101     {
102         return loadSystemClassesFirst;
103     }
104
105     /**
106      * Set the Context Root..
107      *
108      * @param contextRoot the new context root
109      */

110     public void setContextRoot(String JavaDoc contextRoot)
111     {
112         this.contextRoot = contextRoot;
113     }
114
115     /**
116      * Set the Reload setting to either true or false.
117      *
118      * @param reload new reload value
119      */

120     public void setReload(String JavaDoc reload)
121     {
122         if (reload.equalsIgnoreCase("true")) {
123             this.reload = "true";
124         }
125         else {
126             this.reload = "false";
127         }
128     }
129
130     /**
131      * Set the Compile setting to either true or false.
132      *
133      * @param compile new compile value
134      */

135     public void setCompile(String JavaDoc compile)
136     {
137         if (compile.equalsIgnoreCase("true")) {
138             this.compile = "true";
139         }
140         else {
141             this.compile = "false";
142         }
143     }
144
145     /**
146      * Set the LoadSystemClassesFirst setting to either true or false.
147      *
148      * @param loadSystemClassesFirst new setting
149      */

150     public void setLoadSystemClassesFirst(String JavaDoc loadSystemClassesFirst)
151     {
152         if (loadSystemClassesFirst.equalsIgnoreCase("true")) {
153             this.loadSystemClassesFirst = "true";
154         }
155         else {
156             this.loadSystemClassesFirst = "false";
157         }
158     }
159 }
160
Popular Tags