You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2003/02/26 10:11:18 UTC
cvs commit: xml-cocoon2 build.xml build.properties
cziegeler 2003/02/26 01:11:18
Modified: src/java/org/apache/cocoon Constants.java
. build.xml build.properties
Added: src/java/org/apache/cocoon cocoon.properties
Log:
Moving some properties into a separate property file. This avoids filtering our java code.
Revision Changes Path
1.21 +74 -48 xml-cocoon2/src/java/org/apache/cocoon/Constants.java
Index: Constants.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/Constants.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- Constants.java 22 Feb 2003 11:25:20 -0000 1.20
+++ Constants.java 26 Feb 2003 09:11:18 -0000 1.21
@@ -50,6 +50,10 @@
*/
package org.apache.cocoon;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
/**
* The <code>Constants</code> use throughout the core of the Cocoon engine.
*
@@ -57,167 +61,189 @@
* @author <a href="mailto:proyal@managingpartners.com">Peter Royal</a>
* @version CVS $Id$
*/
-public interface Constants {
+public final class Constants {
+ /** Our properties are now here: */
+ private static final String PROPS_FILE = "org/apache/cocoon/cocoon.properties";
+
+ static final Properties properties;
+
+ /**
+ * Load the cocoon properties
+ */
+ static {
+ properties = new Properties();
+ try {
+ final InputStream is = Constants.class.getClassLoader().getResourceAsStream(PROPS_FILE);
+ if ( null == is ) {
+ throw new RuntimeException("Cocoon cannot find required properties from " + PROPS_FILE);
+ }
+ properties.load(is);
+ } catch (IOException ioe) {
+ throw new RuntimeException("Cocoon cannot load required properties from " + PROPS_FILE);
+ }
+
+ }
+
/** The name of this project. */
- String NAME = "@name@";
+ public static final String NAME = properties.getProperty("name");
/** The version of this build. */
- String VERSION = "@version@";
+ public static final String VERSION = properties.getProperty("version");
/** The full name of this project. */
- String COMPLETE_NAME = NAME + " " + VERSION;
+ public static final String COMPLETE_NAME = NAME + " " + VERSION;
/** The version of the configuration schema */
- String CONF_VERSION = "2.1";
+ public static final String CONF_VERSION = "2.1";
/** The year of the build */
- String YEAR = "@year@";
+ public static final String YEAR = properties.getProperty("year");
/**
* The request parameter name to reload the configuration.
*
* FIXME(GP): Isn't this Servlet specific?
*/
- String RELOAD_PARAM = "cocoon-reload";
+ public static final String RELOAD_PARAM = "cocoon-reload";
/**
* The request parameter name to add a line of the request duration.
*
* FIXME(GP): Isn't this Servlet specific?
*/
- String SHOWTIME_PARAM = "cocoon-showtime";
+ public static final String SHOWTIME_PARAM = "cocoon-showtime";
/**
* The request parameter name to request a specific view of a resource.
*
* FIXME(GP): Isn't this Servlet specific?
*/
- String VIEW_PARAM = "cocoon-view";
+ public static final String VIEW_PARAM = "cocoon-view";
/**
* The request parameter name to trigger a specific action.
*
* FIXME(GP): Isn't this Servlet specific?
*/
- String ACTION_PARAM = "cocoon-action";
+ public static final String ACTION_PARAM = "cocoon-action";
/**
* The request parameter prefix to trigger a specific action.
*
* FIXME(GP): Isn't this Servlet specific?
*/
- String ACTION_PARAM_PREFIX = "cocoon-action-";
+ public static final String ACTION_PARAM_PREFIX = "cocoon-action-";
/**
* The directory to use as context root.
*
* FIXME(GP): Isn't this CLI specific?
*/
- String DEFAULT_CONTEXT_DIR = "./webapp";
+ public static final String DEFAULT_CONTEXT_DIR = "./webapp";
/**
* The diretory to use to use for the generated output.
*
* FIXME(GP): Isn't this CLI specific?
*/
- String DEFAULT_DEST_DIR = "./site";
+ public static final String DEFAULT_DEST_DIR = "./site";
/**
* The diretory to use for generated files.
*
* FIXME(GP): Isn't this CLI specific?
*/
- String DEFAULT_WORK_DIR = "./work";
+ public static final String DEFAULT_WORK_DIR = "./work";
/**
* How a default configuration file is named.
*
* FIXME(GP): Isn't this CLI specific?
*/
- String DEFAULT_CONF_FILE = "cocoon.xconf";
+ public static final String DEFAULT_CONF_FILE = "cocoon.xconf";
/** The name of the property holding the class for a XML parser */
- String PARSER_PROPERTY = "org.apache.excalibur.xml.sax.SAXParser";
+ public static final String PARSER_PROPERTY = "org.apache.excalibur.xml.sax.SAXParser";
/** The name of the class for the default XML parser to use */
- String DEFAULT_PARSER = "org.apache.excalibur.xml.impl.JaxpParser";
+ public static final String DEFAULT_PARSER = "org.apache.excalibur.xml.impl.JaxpParser";
/** The name of the property holding the class for a XML parser
* @deprecated This will be removed in future release */
- String DEPRECATED_PARSER_PROPERTY = "org.apache.cocoon.components.parser.Parser";
+ public static final String DEPRECATED_PARSER_PROPERTY = "org.apache.cocoon.components.parser.Parser";
/** The namespace for the XSP core logicsheet. */
- String XSP_URI = "http://apache.org/xsp";
+ public static final String XSP_URI = "http://apache.org/xsp";
/**
* The namespace prefix for the request logicsheet.
*
* FIXME(GP): Would logicsheets belong to the core?
*/
- String XSP_REQUEST_PREFIX = "xsp-request";
+ public static final String XSP_REQUEST_PREFIX = "xsp-request";
/**
* The namespace for the request logicsheet.
*
* FIXME(GP): Would logicsheets belong to the core?
*/
- String XSP_REQUEST_URI = XSP_URI + "/request/2.0";
+ public static final String XSP_REQUEST_URI = XSP_URI + "/request/2.0";
/**
* The namespace prefix for the response logicsheet.
*
* FIXME(GP): Would logicsheets belong to the core?
*/
- String XSP_RESPONSE_PREFIX = "xsp-response";
+ public static final String XSP_RESPONSE_PREFIX = "xsp-response";
/**
* The namespace for the response logicsheet.
*
* FIXME(GP): Would logicsheets belong to the core?
*/
- String XSP_RESPONSE_URI = XSP_URI + "/response/2.0";
+ public static final String XSP_RESPONSE_URI = XSP_URI + "/response/2.0";
/**
* The namespace prefix for the cookie logicsheet.
*
* FIXME(GP): Would logicsheets belong to the core?
*/
- String XSP_COOKIE_PREFIX = "xsp-cookie";
+ public static final String XSP_COOKIE_PREFIX = "xsp-cookie";
/**
* The namespace for the cookie logicsheet.
*
* FIXME(GP): Would logicsheets belong to the core?
*/
- String XSP_COOKIE_URI = XSP_URI + "/cookie/2.0";
+ public static final String XSP_COOKIE_URI = XSP_URI + "/cookie/2.0";
/**
* Don't know exactly what this is for. (I can guess it's for the FormValidator)
*
* FIXME(GP): Isn't this component specific?
*/
- String XSP_FORMVALIDATOR_PATH = "org.apache.cocoon.acting.FormValidatorAction.results";
+ public static final String XSP_FORMVALIDATOR_PATH = "org.apache.cocoon.acting.FormValidatorAction.results";
/** The URI for xml namespaces */
- String XML_NAMESPACE_URI = "http://www.w3.org/XML/1998/namespace";
+ public static final String XML_NAMESPACE_URI = "http://www.w3.org/XML/1998/namespace";
/**
* Mime-type for the link view
*
* FIXME(GP): Isn't this Environment specific?
*/
- String LINK_CONTENT_TYPE = "application/x-cocoon-links";
+ public static final String LINK_CONTENT_TYPE = "application/x-cocoon-links";
/**
* Name of the request value for the link view
*
* FIXME(GP): Isn't this Environment specific?
*/
- String LINK_VIEW = "links";
+ public static final String LINK_VIEW = "links";
/** Don't know exactly what this is for (and it is not used in the code base) */
- String LINK_CRAWLING_ROLE = "static";
+ public static final String LINK_CRAWLING_ROLE = "static";
/**
* The name of a <code>Request</code> object in the so called objectModel <code>Map</code>.
@@ -226,7 +252,7 @@
* FIXME(GP): Shouldn't this definition here be removed?
* @deprecated Use the {@link org.apache.cocoon.environment.ObjectModelHelper#getRequest(java.util.Map))} instead.
*/
- String REQUEST_OBJECT = org.apache.cocoon.environment.ObjectModelHelper.REQUEST_OBJECT;
+ public static final String REQUEST_OBJECT = org.apache.cocoon.environment.ObjectModelHelper.REQUEST_OBJECT;
/**
* The name of a <code>Response</code> object in the so called objectModel <code>Map</code>.
@@ -235,7 +261,7 @@
* FIXME(GP): Shouldn't this definition here be removed?
* @deprecated Use the {@link org.apache.cocoon.environment.ObjectModelHelper#getResponse(java.util.Map)} instead.
*/
- String RESPONSE_OBJECT = org.apache.cocoon.environment.ObjectModelHelper.RESPONSE_OBJECT;
+ public static final String RESPONSE_OBJECT = org.apache.cocoon.environment.ObjectModelHelper.RESPONSE_OBJECT;
/**
*The name of a <code>Context</code> object in the so called objectModel <code>Map</code>.
@@ -244,7 +270,7 @@
* FIXME(GP): Shouldn't this definition here be removed?
* @deprecated Use the {@link org.apache.cocoon.environment.ObjectModelHelper#getContext(java.util.Map)} instead.
*/
- String CONTEXT_OBJECT = org.apache.cocoon.environment.ObjectModelHelper.CONTEXT_OBJECT;
+ public static final String CONTEXT_OBJECT = org.apache.cocoon.environment.ObjectModelHelper.CONTEXT_OBJECT;
/**
* Key of the Map of index translation table.
@@ -255,61 +281,61 @@
* <p>
* TODO(VG): Move this declaration to ObjectModelHelper
*/
- String LINK_OBJECT = "link";
+ public static final String LINK_OBJECT = "link";
/**
* The name of a <code>NotifyingObject</code> in the so called objectModel <code>Map</code>.
*/
- String NOTIFYING_OBJECT = "notifying-object";
+ public static final String NOTIFYING_OBJECT = "notifying-object";
/**
* Describe variable <code>INDEX_URI</code> here.
*
* FIXME(GP): It seems to be (CLI) Environment specific!
*/
- String INDEX_URI = "index";
+ public static final String INDEX_URI = "index";
/** The namespace URI for the Error/Exception XML */
- String ERROR_NAMESPACE_URI = "http://apache.org/cocoon/error/" + CONF_VERSION;
+ public static final String ERROR_NAMESPACE_URI = "http://apache.org/cocoon/error/" + CONF_VERSION;
/** The namespace prefix for the Error/Exception XML */
- String ERROR_NAMESPACE_PREFIX = "error";
+ public static final String ERROR_NAMESPACE_PREFIX = "error";
/** Application <code>Context</code> Key for the environmental Context */
- String CONTEXT_ENVIRONMENT_CONTEXT = "environment-context";
+ public static final String CONTEXT_ENVIRONMENT_CONTEXT = "environment-context";
/** Application <code>Context</code> Key for the global classloader */
- String CONTEXT_CLASS_LOADER = "class-loader";
+ public static final String CONTEXT_CLASS_LOADER = "class-loader";
/** Application <code>Context</code> Key for the work directory path */
- String CONTEXT_WORK_DIR = "work-directory";
+ public static final String CONTEXT_WORK_DIR = "work-directory";
/** Application <code>Context</code> Key for the upload directory path */
- String CONTEXT_UPLOAD_DIR = "upload-directory";
+ public static final String CONTEXT_UPLOAD_DIR = "upload-directory";
- /** Application <code>Context</code> Key for the cache directory path */
+ public static final /** Application <code>Context</code> Key for the cache directory path */
String CONTEXT_CACHE_DIR = "cache-directory";
/** Application <code>Context</code> Key for the current classpath */
- String CONTEXT_CLASSPATH = "classpath";
+ public static final String CONTEXT_CLASSPATH = "classpath";
/**
* Application <code>Context</code> Key for the URL to the configuration file
* (usually named cocoon.xconf)
*/
- String CONTEXT_CONFIG_URL = "config-url";
+ public static final String CONTEXT_CONFIG_URL = "config-url";
/**
* @deprecated used only by deprecated SessionStateSelector
*/
- String SESSION_STATE_ATTRIBUTE = "org.apache.cocoon.SessionState";
+ public static final String SESSION_STATE_ATTRIBUTE = "org.apache.cocoon.SessionState";
/**
* Should descriptors be reloaded?
*
* FIXME(GP): Isn't this Action specific only?
*/
- boolean DESCRIPTOR_RELOADABLE_DEFAULT = true;
+ public static final boolean DESCRIPTOR_RELOADABLE_DEFAULT = true;
}
1.1 xml-cocoon2/src/java/org/apache/cocoon/cocoon.properties
Index: cocoon.properties
===================================================================
# ------ System Properties -----------------------------------------------------
# WARNING: you shouldn't need to modify anything below here since there is a
# very high change of breaking the build system. Do it only if you know what
# you're doing.
version=2.1-dev
released.version=2.0.4
year=1999-2003
name=cocoon
Name=Cocoon
fullname=Apache ${Name}
1.333 +4 -8 xml-cocoon2/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/build.xml,v
retrieving revision 1.332
retrieving revision 1.333
diff -u -r1.332 -r1.333
--- build.xml 25 Feb 2003 14:15:10 -0000 1.332
+++ build.xml 26 Feb 2003 09:11:18 -0000 1.333
@@ -41,6 +41,8 @@
<property file="${user.home}/cocoon.build.properties"/>
<property file="local.build.properties"/>
+ <!-- Get the (constant) cocoon properties -->
+ <property file="src/java/org/apache/cocoon/cocoon.properties"/>
<!-- Get the build properties from an external file -->
<property file="build.properties"/>
@@ -155,19 +157,13 @@
<!-- compiles the core -->
<target name="compile-core" depends="prepare-core">
- <!-- copy those source files that needed filtering -->
- <!--copy todir="${build.src}" filtering="on">
- <fileset dir="${java}">
- <include name="**/Constants.java"/>
- </fileset>
- </copy-->
-
<!-- copy those files that need to be in the classpath -->
<copy todir="${build.dest}">
<fileset dir="${java}">
<include name="**/*.xsl"/>
<include name="**/*.roles"/>
<include name="**/*.xml"/>
+ <include name="**/*.properties"/>
<include name="**/*.js"/>
</fileset>
</copy>
1.8 +0 -7 xml-cocoon2/build.properties
Index: build.properties
===================================================================
RCS file: /home/cvs/xml-cocoon2/build.properties,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- build.properties 26 Feb 2003 08:04:11 -0000 1.7
+++ build.properties 26 Feb 2003 09:11:18 -0000 1.8
@@ -79,13 +79,6 @@
# very high change of breaking the build system. Do it only if you know what
# you're doing.
-version=2.1-dev
-released.version=2.0.4
-year=1999-2003
-name=cocoon
-Name=Cocoon
-fullname=Apache ${Name}
-
packages=org.apache
# Directory Layout