KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > Constants


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 package org.apache.cocoon;
17
18 import java.io.IOException JavaDoc;
19 import java.io.InputStream JavaDoc;
20 import java.util.Properties JavaDoc;
21
22 /**
23  * The <code>Constants</code> use throughout the core of the Cocoon engine.
24  *
25  * @author <a HREF="mailto:stefano@apache.org">Stefano Mazzocchi</a>
26  * @author <a HREF="mailto:proyal@managingpartners.com">Peter Royal</a>
27  * @version CVS $Id: Constants.java 37206 2004-08-30 14:52:42Z cziegeler $
28  */

29 public final class Constants {
30
31     /** Our properties are now here: */
32     private static final String JavaDoc PROPS_FILE = "org/apache/cocoon/cocoon.properties";
33
34     static final Properties JavaDoc properties;
35
36     /**
37      * Load the cocoon properties
38      */

39     static {
40         properties = new Properties JavaDoc();
41         try {
42             final InputStream JavaDoc is = Constants.class.getClassLoader().getResourceAsStream(PROPS_FILE);
43             if ( null == is ) {
44                 throw new RuntimeException JavaDoc("Cocoon cannot find required properties from " + PROPS_FILE);
45             }
46             properties.load(is);
47         } catch (IOException JavaDoc ioe) {
48             throw new RuntimeException JavaDoc("Cocoon cannot load required properties from " + PROPS_FILE);
49         }
50
51     }
52
53     /** The name of this project. */
54     public static final String JavaDoc NAME = properties.getProperty("name");
55
56     /** The version of this build. */
57     public static final String JavaDoc VERSION = properties.getProperty("version");
58
59     /** The full name of this project. */
60     public static final String JavaDoc COMPLETE_NAME = properties.getProperty("fullname") + " " + VERSION;
61
62     /** The version of the configuration schema */
63     public static final String JavaDoc CONF_VERSION = "2.1";
64
65     /** The year of the build */
66     public static final String JavaDoc YEAR = properties.getProperty("year");
67
68     /**
69      * The request parameter name to reload the configuration.
70      *
71      * FIXME(GP): Isn't this Servlet specific?
72      */

73     public static final String JavaDoc RELOAD_PARAM = "cocoon-reload";
74
75     /**
76      * The request parameter name to add a line of the request duration.
77      *
78      * FIXME(GP): Isn't this Servlet specific?
79      */

80     public static final String JavaDoc SHOWTIME_PARAM = "cocoon-showtime";
81
82     /**
83      * The request parameter name to request a specific view of a resource.
84      *
85      * FIXME(GP): Isn't this Servlet specific?
86      */

87     public static final String JavaDoc VIEW_PARAM = "cocoon-view";
88
89     /**
90      * The request parameter name to trigger a specific action.
91      *
92      * FIXME(GP): Isn't this Servlet specific?
93      */

94     public static final String JavaDoc ACTION_PARAM = "cocoon-action";
95
96     /**
97      * The request parameter prefix to trigger a specific action.
98      *
99      * FIXME(GP): Isn't this Servlet specific?
100      */

101     public static final String JavaDoc ACTION_PARAM_PREFIX = "cocoon-action-";
102
103     /** The name of the property holding the class for a XML parser */
104     public static final String JavaDoc PARSER_PROPERTY = "org.apache.excalibur.xml.sax.SAXParser";
105
106     /** The name of the class for the default XML parser to use */
107     public static final String JavaDoc DEFAULT_PARSER = "org.apache.excalibur.xml.impl.JaxpParser";
108
109     /** The name of the property holding the class for a XML parser
110      * @deprecated This will be removed in future release */

111     public static final String JavaDoc DEPRECATED_PARSER_PROPERTY = "org.apache.cocoon.components.parser.Parser";
112
113     /** The namespace for the XSP core logicsheet. */
114     public static final String JavaDoc XSP_URI = "http://apache.org/xsp";
115
116     /**
117      * The namespace prefix for the request logicsheet.
118      *
119      * FIXME(GP): Would logicsheets belong to the core?
120      */

121     public static final String JavaDoc XSP_REQUEST_PREFIX = "xsp-request";
122
123     /**
124      * The namespace for the request logicsheet.
125      *
126      * FIXME(GP): Would logicsheets belong to the core?
127      */

128     public static final String JavaDoc XSP_REQUEST_URI = XSP_URI + "/request/2.0";
129
130     /**
131      * The namespace prefix for the response logicsheet.
132      *
133      * FIXME(GP): Would logicsheets belong to the core?
134      */

135     public static final String JavaDoc XSP_RESPONSE_PREFIX = "xsp-response";
136
137     /**
138      * The namespace for the response logicsheet.
139      *
140      * FIXME(GP): Would logicsheets belong to the core?
141      */

142     public static final String JavaDoc XSP_RESPONSE_URI = XSP_URI + "/response/2.0";
143
144     /**
145      * The namespace prefix for the cookie logicsheet.
146      *
147      * FIXME(GP): Would logicsheets belong to the core?
148      */

149     public static final String JavaDoc XSP_COOKIE_PREFIX = "xsp-cookie";
150
151     /**
152      * The namespace for the cookie logicsheet.
153      *
154      * FIXME(GP): Would logicsheets belong to the core?
155      */

156     public static final String JavaDoc XSP_COOKIE_URI = XSP_URI + "/cookie/2.0";
157
158     /**
159      * Don't know exactly what this is for. (I can guess it's for the FormValidator)
160      *
161      * FIXME(GP): Isn't this component specific?
162      */

163     public static final String JavaDoc XSP_FORMVALIDATOR_PATH = "org.apache.cocoon.acting.FormValidatorAction.results";
164
165     /** The URI for xml namespaces */
166     public static final String JavaDoc XML_NAMESPACE_URI = "http://www.w3.org/XML/1998/namespace";
167
168     /**
169      * Mime-type for the link view
170      *
171      * FIXME(GP): Isn't this Environment specific?
172      */

173     public static final String JavaDoc LINK_CONTENT_TYPE = "application/x-cocoon-links";
174
175     /**
176      * Name of the request value for the link view
177      *
178      * FIXME(GP): Isn't this Environment specific?
179      */

180     public static final String JavaDoc LINK_VIEW = "links";
181
182     /** Don't know exactly what this is for (and it is not used in the code base) */
183     public static final String JavaDoc LINK_CRAWLING_ROLE = "static";
184
185     /**
186      * Key of the Map of index translation table.
187      * <p>Presence of this Map in the ObjectModel indicates to the Sitemap that link
188      * translation mode has been requested by the environment. Sitemap adds LinkTranslator
189      * transformer to the pipeline, which replaces all the links in the input document with
190      * the links from this translation table.
191      * <p>
192      * TODO(VG): Move this declaration to ObjectModelHelper
193      * comment found at ObjectModelHelper(JH):
194      * LINK_OBJECT should also be moved to CommandLineEnvironment
195      */

196     public static final String JavaDoc LINK_OBJECT = "link";
197
198     /**
199      * Key of the List for collecting links.
200      * <p>Presence of this Map in the ObjectModel indicates to the Sitemap that link
201      * gathering mode has been requested by the environment. Sitemap adds LinkGatherer
202      * transformer to the pipeline, which gathers the links in the input document into
203      * this List.
204      * <p>
205      */

206     public static final String JavaDoc LINK_COLLECTION_OBJECT = "link-collection";
207
208     /**
209      * The name of a <code>NotifyingObject</code> in the so called objectModel <code>Map</code>.
210      */

211     public static final String JavaDoc NOTIFYING_OBJECT = "notifying-object";
212
213     /**
214      * The default URI to be used when a URI requested refers to
215      * a directory, e.g. http://localhost:8080/site/
216      */

217     public static final String JavaDoc INDEX_URI = "index";
218
219     /**
220      * The directory to use as context root.
221      */

222     public static final String JavaDoc DEFAULT_CONTEXT_DIR = "./webapp";
223
224     /**
225      * The diretory to use to use for the generated output.
226      */

227     public static final String JavaDoc DEFAULT_DEST_DIR = "./site";
228
229     /**
230      * The diretory to use for generated files.
231      */

232     public static final String JavaDoc DEFAULT_WORK_DIR = "./work";
233
234     /**
235      * How a default configuration file is named.
236      */

237     public static final String JavaDoc DEFAULT_CONF_FILE = "cocoon.xconf";
238
239     /** The namespace URI for the Error/Exception XML */
240     public static final String JavaDoc ERROR_NAMESPACE_URI = "http://apache.org/cocoon/error/2.1";
241
242     /** The namespace prefix for the Error/Exception XML */
243     public static final String JavaDoc ERROR_NAMESPACE_PREFIX = "error";
244
245     /** Application <code>Context</code> Key for the environmental Context */
246     public static final String JavaDoc CONTEXT_ENVIRONMENT_CONTEXT = "environment-context";
247
248     /** Application <code>Context</code> Key for the global classloader */
249     public static final String JavaDoc CONTEXT_CLASS_LOADER = "class-loader";
250
251     /** Application <code>Context</code> Key for the work directory path */
252     public static final String JavaDoc CONTEXT_WORK_DIR = "work-directory";
253
254     /** Application <code>Context</code> Key for the upload directory path */
255     public static final String JavaDoc CONTEXT_UPLOAD_DIR = "upload-directory";
256
257     /** Application <code>Context</code> Key for the cache directory path */
258     public static final String JavaDoc CONTEXT_CACHE_DIR = "cache-directory";
259
260     /** Application <code>Context</code> Key for the current classpath */
261     public static final String JavaDoc CONTEXT_CLASSPATH = "classpath";
262
263     /**
264      * Application <code>Context</code> Key for the URL to the configuration file
265      * (usually named cocoon.xconf)
266      */

267     public static final String JavaDoc CONTEXT_CONFIG_URL = "config-url";
268
269     /** Application <code>Context</code> Key for the default encoding */
270     public static final String JavaDoc CONTEXT_DEFAULT_ENCODING = "default-encoding";
271
272     
273     /**
274      * Should descriptors be reloaded?
275      *
276      * FIXME(GP): Isn't this Action specific only?
277      */

278     public static final boolean DESCRIPTOR_RELOADABLE_DEFAULT = true;
279     
280 }
281
282
283
284
285
286
287
288
289
290
291
292
293
Popular Tags