From 0b87ac3d185f767fb76da982b6fa7e3611d8482e Mon Sep 17 00:00:00 2001 From: Poetz Reinhard Date: Mon, 19 Mar 2007 23:50:01 +0000 Subject: [PATCH] remove test tag git-svn-id: https://svn.apache.org/repos/asf/cocoon/tags/cocoon-configuration@520183 13f79535-47bb-0310-9956-ffa450edef68 --- .../pom.xml | 124 ----- .../src/changes/changes.xml | 33 -- .../cocoon/configuration/MutableSettings.java | 503 ------------------ .../cocoon/configuration/PropertyHelper.java | 166 ------ .../configuration/PropertyProvider.java | 48 -- .../apache/cocoon/configuration/Settings.java | 176 ------ .../configuration/SettingsDefaults.java | 49 -- .../src/main/resources/META-INF/LICENSE.txt | 201 ------- .../src/main/resources/META-INF/NOTICE.txt | 5 - 9 files changed, 1305 deletions(-) delete mode 100644 cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/pom.xml delete mode 100644 cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/changes/changes.xml delete mode 100644 cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/MutableSettings.java delete mode 100644 cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/PropertyHelper.java delete mode 100644 cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/PropertyProvider.java delete mode 100644 cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/Settings.java delete mode 100644 cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/SettingsDefaults.java delete mode 100644 cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/resources/META-INF/LICENSE.txt delete mode 100644 cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/resources/META-INF/NOTICE.txt diff --git a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/pom.xml b/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/pom.xml deleted file mode 100644 index af8b1248d9c..00000000000 --- a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/pom.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - 4.0.0 - jar - - - cocoon-core-modules - org.apache.cocoon - 3 - - - cocoon-configuration-api - 1.0.0-gpg-test-release - Cocoon Configuration API - - The Cocoon Configuration API is a library providing beans for various configuration issues. - It describes a mechanism for handling properties in an standardized way. - - http://cocoon.apache.org/${docs.m.configuration-api.relPath} - - - - website - ${docs.deploymentBaseUrl}/${docs.m.configuration-api.relPath} - - - - - Cocoon Configuration API - ${docs.m.configuration-api.version} - - - - - - maven-release-plugin - - https://svn.apache.org/repos/asf/cocoon/tags/cocoon-configuration/${project.artifactId} - - - - - - - - - central - Maven central repository - http://repo1.maven.org/maven2 - - true - - never - - - false - - - - - - - release - - - - maven-gpg-plugin - 1.0-alpha-3 - - - sign-artifacts - verify - - sign - - - - - - - - - - - - scm:svn:https://svn.apache.org/repos/asf/cocoon/tags/cocoon-configuration/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release - scm:svn:https://svn.apache.org/repos/asf/cocoon/tags/cocoon-configuration/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release - https://svn.apache.org/repos/asf/cocoon/tags/cocoon-configuration/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release - - diff --git a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/changes/changes.xml b/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/changes/changes.xml deleted file mode 100644 index d3a037e2b6a..00000000000 --- a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/changes/changes.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - Initial creation. - - - - diff --git a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/MutableSettings.java b/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/MutableSettings.java deleted file mode 100644 index 59dfd37883d..00000000000 --- a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/MutableSettings.java +++ /dev/null @@ -1,503 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.cocoon.configuration; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -/** - * This is an implementation of the {@link Settings} object. - * The value can either be set using the various setter methods - * or through properties ({@link #configure(Properties)}. - * - * The object can be set to read-only using {@link #makeReadOnly()}. From that - * on the object is immutable and can't be changed anymore. - * - * @version $Id$ - * @since 1.0 - */ -public class MutableSettings implements Settings { - - /** Are we still mutable? */ - protected boolean readOnly = false; - - /** Prefix for properties. */ - protected static final String KEYPREFIX = "org.apache.cocoon."; - - /** The properties used to configure Cocoon. */ - protected final Properties properties = new Properties(); - - /** - * Allow reinstantiating (reloading) of the cocoon instance. If this is - * set to "yes" or "true", a new cocoon instance can be created using - * the request parameter "cocoon-reload". It also enables that Cocoon is - * reloaded when cocoon.xconf changes. Default is no for security reasons. - */ - protected boolean reloadingEnabled; - - /** - * This parameter is used to list classes that should be loaded at - * initialization time of the servlet. For example, JDBC Drivers used need to - * be named here. Additional entries may be inserted here during build - * depending on your build properties. - */ - protected final List loadClasses = new ArrayList(); - - /** - * This parameter allows to specify where Cocoon should create its page - * and other objects cache. The path specified can be either absolute or - * relative to the context path of the servlet. On windows platform, - * absolute directory must start with volume: C:\Path\To\Cache\Directory. - */ - protected String cacheDirectory; - - /** - * This parameter allows to specify where Cocoon should put it's - * working files. The path specified is either absolute or relative - * to the context path of the Cocoon servlet. On windows platform, - * absolute directory must start with volume: C:\Path\To\Work\Directory. - */ - protected String workDirectory; - - /** - * Set form encoding. This will be the character set used to decode request - * parameters. If not set the ISO-8859-1 encoding will be assumed. - */ - protected String formEncoding; - - /** - * Delay between reload checks for the configuration. - */ - protected long configurationReloadDelay; - - /** The time the cocoon instance was created. */ - protected long creationTime; - - /** - * The container encoding. - * @see Settings#KEY_CONTAINER_ENCODING - */ - protected String containerEncoding; - - /** The optional parent settings object. */ - protected Settings parent; - - /** Running mode. */ - protected final String runningMode; - - /** - * Create a new settings object. - */ - public MutableSettings(String mode) { - // set default values - this.reloadingEnabled = SettingsDefaults.RELOADING_ENABLED_DEFAULT; - this.configurationReloadDelay = SettingsDefaults.DEFAULT_CONFIGURATION_RELOAD_DELAY; - this.containerEncoding = SettingsDefaults.DEFAULT_CONTAINER_ENCODING; - this.runningMode = mode; - } - - /** - * Create a new child settings object. - * @param parent The parent settings object. - */ - public MutableSettings(Settings parent) { - if ( parent == null ) { - throw new IllegalArgumentException("Parent is not allowed to be null."); - } - this.parent = parent; - this.runningMode = parent.getRunningMode(); - } - - /** - * Fill from a properties object - */ - public void configure(Properties props) { - this.checkWriteable(); - if ( props != null ) { - final Iterator i = props.entrySet().iterator(); - while ( i.hasNext() ) { - final Map.Entry current = (Map.Entry)i.next(); - String key = current.getKey().toString(); - if ( key.startsWith(KEYPREFIX) ) { - final String value = current.getValue().toString(); - - if ( key.equals(KEY_RELOAD_DELAY) ) { - this.setConfigurationReloadDelay(Long.valueOf(value).longValue()); - } else if ( key.equals(KEY_RELOADING) ) { - this.setReloadingEnabled(Boolean.valueOf(value).booleanValue()); - } else if ( key.equals(KEY_CACHE_DIRECTORY) ) { - this.setCacheDirectory(value); - } else if ( key.equals(KEY_WORK_DIRECTORY) ) { - this.setWorkDirectory(value); - } else if ( key.equals(KEY_FORM_ENCODING) ) { - this.setFormEncoding(value); - } else if ( key.startsWith(KEY_LOAD_CLASSES) ) { - this.addToLoadClasses(value); - } else if ( key.startsWith(KEY_CONTAINER_ENCODING ) ) { - this.setContainerEncoding(value); - } - } - } - this.properties.putAll(props); - } - } - - /** - * @see org.apache.cocoon.configuration.Settings#isReloadingEnabled(java.lang.String) - */ - public boolean isReloadingEnabled(String type) { - if ( type == null ) { - if ( parent != null ) { - return parent.isReloadingEnabled(type); - } - return this.reloadingEnabled; - } - String o = this.getProperty(KEY_RELOADING + '.' + type); - if ( o != null ) { - return Boolean.valueOf(o).booleanValue(); - } - if ( this.parent != null ) { - return this.parent.isReloadingEnabled(type); - } - return this.reloadingEnabled; - } - - /** - * @see org.apache.cocoon.configuration.Settings#getCacheDirectory() - */ - public String getCacheDirectory() { - if ( this.parent != null ) { - return this.parent.getCacheDirectory(); - } - return this.cacheDirectory; - } - - /** - * @see org.apache.cocoon.configuration.Settings#getFormEncoding() - */ - public String getFormEncoding() { - if ( this.parent != null ) { - return this.parent.getFormEncoding(); - } - return this.formEncoding; - } - - /** - * @see org.apache.cocoon.configuration.Settings#getContainerEncoding() - */ - public String getContainerEncoding() { - if ( this.parent != null ) { - return this.parent.getContainerEncoding(); - } - return this.containerEncoding; - } - - /** - * Set the container encoding. - * @param value The new encoding value. - */ - public void setContainerEncoding(String value) { - this.checkSubSetting(); - this.containerEncoding = value; - } - - /** - * @see org.apache.cocoon.configuration.Settings#getLoadClasses() - */ - public List getLoadClasses() { - // we don't ask the parent here as the classes of the parent - // have already been loaded - return this.loadClasses; - } - - /** - * @see org.apache.cocoon.configuration.Settings#getWorkDirectory() - */ - public String getWorkDirectory() { - if ( this.parent != null ) { - return this.parent.getWorkDirectory(); - } - return this.workDirectory; - } - - /** - * @see org.apache.cocoon.configuration.Settings#getReloadDelay(java.lang.String) - */ - public long getReloadDelay(String type) { - if ( type == null ) { - if ( parent != null ) { - return parent.getReloadDelay(type); - } - return this.configurationReloadDelay; - } - String o = this.getProperty(KEY_RELOAD_DELAY + '.' + type); - if ( o != null ) { - return Long.valueOf(o).longValue(); - } - if ( this.parent != null ) { - return this.parent.getReloadDelay(type); - } - return this.configurationReloadDelay; - } - - /** - * @see org.apache.cocoon.configuration.Settings#getProperty(java.lang.String) - */ - public String getProperty(String name) { - return this.getProperty(name, null); - } - - /** - * @see org.apache.cocoon.configuration.Settings#getProperty(java.lang.String, java.lang.String) - */ - public String getProperty(String key, String defaultValue) { - if ( key == null ) { - return defaultValue; - } - String value = null; - if ( key.startsWith(KEYPREFIX) ) { - if ( key.equals(KEY_RELOAD_DELAY) ) { - value = String.valueOf(this.getReloadDelay(null)); - } else if ( key.equals(KEY_RELOADING) ) { - value = String.valueOf(this.isReloadingEnabled(null)); - } else if ( key.equals(KEY_CACHE_DIRECTORY) ) { - value = this.getCacheDirectory(); - } else if ( key.equals(KEY_WORK_DIRECTORY) ) { - value = this.getWorkDirectory(); - } else if ( key.equals(KEY_FORM_ENCODING) ) { - value = this.getFormEncoding(); - } else if ( key.equals(KEY_LOAD_CLASSES) ) { - value = this.toString(this.getLoadClasses()); - } else if ( key.equals(KEY_CONTAINER_ENCODING) ) { - value = this.containerEncoding; - } - } - - if ( value == null ) { - value = this.properties.getProperty(key); - } - - if ( value == null ) { - if ( this.parent != null ) { - value = this.parent.getProperty(key, defaultValue); - } else { - value = defaultValue; - } - } - return value; - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - return "Settings:\n" + - "Running mode : " + this.getRunningMode()+ '\n' + - KEY_RELOAD_DELAY + " : " + this.getReloadDelay(null) + '\n' + - KEY_RELOADING + " : " + this.isReloadingEnabled(null) + '\n' + - KEY_LOAD_CLASSES + " : " + this.toString(this.getLoadClasses()) + '\n' + - KEY_CACHE_DIRECTORY + " : " + this.getCacheDirectory() + '\n' + - KEY_WORK_DIRECTORY + " : " + this.getWorkDirectory() + '\n' + - KEY_FORM_ENCODING + " : " + this.getFormEncoding() + '\n' + - KEY_CONTAINER_ENCODING + " : " + this.getContainerEncoding() + '\n'; - } - - /** - * Helper method to make a string out of a list of objects. - */ - protected String toString(List a) { - final StringBuffer buffer = new StringBuffer(); - final Iterator i = a.iterator(); - boolean first = true; - while ( i.hasNext() ) { - if ( first ) { - first = false; - } else { - buffer.append(", "); - } - buffer.append(i.next()); - } - return buffer.toString(); - } - - /** - * @param allowReload The allowReload to set. - */ - public void setReloadingEnabled(boolean allowReload) { - this.checkWriteable(); - this.checkSubSetting(); - this.reloadingEnabled = allowReload; - } - - /** - * @param cacheDirectory The cacheDirectory to set. - */ - public void setCacheDirectory(String cacheDirectory) { - this.checkWriteable(); - this.checkSubSetting(); - this.cacheDirectory = cacheDirectory; - } - - /** - * @param formEncoding The formEncoding to set. - */ - public void setFormEncoding(String formEncoding) { - this.checkWriteable(); - this.checkSubSetting(); - this.formEncoding = formEncoding; - } - - /** - * @param className The loadClasses to set. - */ - public void addToLoadClasses(String className) { - this.checkWriteable(); - this.loadClasses.add(className); - } - - /** - * @param workDirectory The workDirectory to set. - */ - public void setWorkDirectory(String workDirectory) { - this.checkWriteable(); - this.checkSubSetting(); - this.workDirectory = workDirectory; - } - - /** - * @param configurationReloadDelay The configurationReloadDelay to set. - */ - public void setConfigurationReloadDelay(long configurationReloadDelay) { - this.checkWriteable(); - this.checkSubSetting(); - this.configurationReloadDelay = configurationReloadDelay; - } - - /** - * Mark this object as read-only. - */ - public void makeReadOnly() { - this.readOnly = false; - } - - /** - * check if this configuration is writeable. - * - * @throws IllegalStateException if this setting is read-only - */ - protected final void checkWriteable() - throws IllegalStateException { - if( this.readOnly ) { - throw new IllegalStateException - ( "Settings is read only and can not be modified anymore." ); - } - } - - /** - * check if this configuration is tried to be set for a sub settings - * object. - * - * @throws IllegalStateException if this setting is a sub setting - */ - protected final void checkSubSetting() - throws IllegalStateException { - if( this.parent != null ) { - throw new IllegalStateException - ( "This value can only be changed for the root settings object." ); - } - } - - /** - * @see org.apache.cocoon.configuration.Settings#getCreationTime() - */ - public long getCreationTime() { - if ( this.parent != null ) { - return this.parent.getCreationTime(); - } - return this.creationTime; - } - - /** - * Set the creation time of the current cocoon instance. - */ - public void setCreationTime(long value) { - // we don't check for writable here as this value is set after the whole - // container is setup - this.checkSubSetting(); - this.creationTime = value; - } - - /** - * @see org.apache.cocoon.configuration.Settings#getPropertyNames(java.lang.String) - */ - public List getPropertyNames(String keyPrefix) { - final List props = new ArrayList(); - final Iterator kI = this.properties.keySet().iterator(); - while ( kI.hasNext() ) { - final String name = (String)kI.next(); - if ( name.startsWith(keyPrefix) && !props.contains(name) ) { - props.add(name); - } - } - if ( this.parent != null ) { - final List parentList = this.parent.getPropertyNames(keyPrefix); - final Iterator i = parentList.iterator(); - while ( i.hasNext() ) { - final String name = (String)i.next(); - if ( !props.contains(name) ) { - props.add(name); - } - } - } - return props; - } - - /** - * @see org.apache.cocoon.configuration.Settings#getPropertyNames() - */ - public List getPropertyNames() { - final List props = new ArrayList(); - final Iterator kI = this.properties.keySet().iterator(); - while ( kI.hasNext() ) { - final String name = (String)kI.next(); - if (!props.contains(name) ) { - props.add(name); - } - } - if ( this.parent != null ) { - final List parentList = this.parent.getPropertyNames(); - final Iterator i = parentList.iterator(); - while ( i.hasNext() ) { - final String name = (String)i.next(); - if ( !props.contains(name) ) { - props.add(name); - } - } - } - return props; - } - - /** - * @see org.apache.cocoon.configuration.Settings#getRunningMode() - */ - public String getRunningMode() { - return this.runningMode; - } -} diff --git a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/PropertyHelper.java b/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/PropertyHelper.java deleted file mode 100644 index 799fd92d1b6..00000000000 --- a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/PropertyHelper.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.cocoon.configuration; - -import java.util.Iterator; -import java.util.Properties; - - -/** - * Helper class for replacing property references with the value of the - * property. - * - * @version $Id$ - * @since 1.0 - */ -public class PropertyHelper { - - /** - * Replace all property references in the string with the current value - * and return it. - */ - public static String replace(String value, Settings settings) { - return replace(value, null, settings); - } - - /** - * Replace all property references in the string with the current value - * and return it. - */ - public static String replace(String value, Properties properties, Settings settings) { - // quick test for null or no references - if ( value == null || value.indexOf("${") == -1 ) { - return value; - } - final StringBuffer buffer = new StringBuffer(); - int prev = 0; - int pos; - - // search for the next instance of $ from the 'prev' position - while ((pos = value.indexOf("$", prev)) >= 0) { - - // if there was any text before this, add it - if (pos > prev) { - buffer.append(value.substring(prev, pos)); - } - - // if we are at the end of the string, end - if (pos == (value.length() - 1)) { - buffer.append("$"); - prev = pos + 1; - } else if (value.charAt(pos + 1) != '{') { - // peek ahead to see if the next char is a property or not - // not a property: insert the char as a literal - buffer.append(value.substring(pos, pos + 2)); - prev = pos + 2; - - } else { - // start token found, check for end token - int endName = value.indexOf('}', pos); - if (endName == -1) { - // no end token found, just append the rest - buffer.append(value.substring(pos)); - prev = value.length(); - } else { - final String propertyName = value.substring(pos + 2, endName); - String propertyValue = getProperty(propertyName, properties, settings); - // compatibility fallback - if the value is null, just readd token - if (propertyValue == null) { - buffer.append("${"); - buffer.append(propertyName); - buffer.append('}'); - } else { - buffer.append(propertyValue); - } - prev = endName + 1; - } - } - } - // no more tokens found - // append the rest - if (prev < value.length()) { - buffer.append(value.substring(prev)); - } - return buffer.toString(); - } - - /** - * Return the value of the property. - * If a properties object is provided, this is searched first for a value. - * If no value is found and a settings object is provided, the settings object - * is searched for a value. If still no value is found, the system properties - * are searched. - * The key might contain a default value separated by a ':'! If no value is found - * and such a default value is provided, the default value is returned. - * - * @param key The key for the property. - * @param properties A set of properties. - * @param settings A settings object. - * @return Return the value or null. - * @since 1.0.1 - */ - public static String getProperty(String key, Properties properties, Settings settings) { - final int pos = key.indexOf(':'); - final String name; - final String defaultValue; - if ( pos != -1 ) { - name = key.substring(0, pos); - defaultValue = key.substring(pos+1); - } else { - name = key; - defaultValue = null; - } - String value = null; - if ( properties != null ) { - value = properties.getProperty(name); - } - if ( value == null && settings != null ) { - value = settings.getProperty(name); - } - if ( value == null ) { - try { - value = System.getProperty(name); - } catch (SecurityException ex) { - // ignore this - } - } - if ( value == null ) { - value = defaultValue; - } - return value; - } - - /** - * Replace all references in the values contained in the properties. - * If the reference is not found in the properties it is searched in - * the settings. - * @param props - * @param settings - */ - public static void replaceAll(Properties props, Settings settings) { - final Iterator kI = props.keySet().iterator(); - while ( kI.hasNext() ) { - final String key = (String)kI.next(); - // get value - String value = props.getProperty(key); - // replace - value = replace(value, props, settings); - // and put back - props.put(key, value); - } - } -} diff --git a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/PropertyProvider.java b/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/PropertyProvider.java deleted file mode 100644 index 63d8ec72815..00000000000 --- a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/PropertyProvider.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.cocoon.configuration; - -import java.util.Properties; - -/** - * This is an interface for custom components delivering properties to - * configure Cocoon. - * This component must be setup as a Spring bean in the root application - * context using {@link #ROLE} as the bean identifier. - * The registered provider is asked once on startup for a set of properties. - * - * @version $Id$ - * @since 1.0 - */ -public interface PropertyProvider { - - /** - * The bean must be registered with this name. - */ - String ROLE = PropertyProvider.class.getName(); - - /** - * Provide the properties. - * - * @param settings The already loaded settings. - * @param runningMode The current running mode. - * @param path A path specifying the application context the settings are applied to. - * A path of null indicates the root application context. - * @return The additional properties. - */ - Properties getProperties(Settings settings, String runningMode, String path); -} diff --git a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/Settings.java b/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/Settings.java deleted file mode 100644 index f6893a8cc38..00000000000 --- a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/Settings.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.cocoon.configuration; - -import java.util.List; - -/** - * This object holds the global configuration of Cocoon. - * - * @version $Id$ - * @since 1.0 - */ -public interface Settings { - - /** The role to lookup this bean. */ - String ROLE = Settings.class.getName(); - - /** Name of the property specifying a custom user properties file. */ - String PROPERTY_USER_SETTINGS = "org.apache.cocoon.settings"; - - /** - * This parameter is used to list classes that should be loaded at - * initialization time of the servlet. For example, JDBC Drivers used need to - * be named here. Additional entries may be inserted here during build - * depending on your build properties. - */ - String KEY_LOAD_CLASSES = "org.apache.cocoon.classloader.load.classes"; - - /** - * This parameter allows to specify where Cocoon should create its page - * and other objects cache. The path specified can be either absolute or - * relative to the context path of the servlet. On windows platform, - * absolute directory must start with volume: C:\Path\To\Cache\Directory. - */ - String KEY_CACHE_DIRECTORY = "org.apache.cocoon.cache.directory"; - - /** - * This parameter allows to specify where Cocoon should put it's - * working files. The path specified is either absolute or relative - * to the context path of the Cocoon servlet. On windows platform, - * absolute directory must start with volume: C:\Path\To\Work\Directory. - */ - String KEY_WORK_DIRECTORY = "org.apache.cocoon.work.directory"; - - /** - * Set form encoding. This will be the character set used to decode request - * parameters. If not set the ISO-8859-1 encoding will be assumed. - */ - String KEY_FORM_ENCODING = "org.apache.cocoon.formencoding"; - - /** - * Set encoding used by the container. If not set the ISO-8859-1 encoding - * will be assumed. - * Since the servlet specification requires that the ISO-8859-1 encoding - * is used (by default), you should never change this value unless - * you have a buggy servlet container. - */ - String KEY_CONTAINER_ENCODING = "org.apache.cocoon.containerencoding"; - - /** - * Allow reinstantiating (reloading) of the cocoon instance. If this is - * set to "yes" or "true", a new cocoon instance can be created using - * the request parameter "cocoon-reload". It also enables that Cocoon is - * reloaded when cocoon.xconf changes. Default is no for security reasons. - */ - String KEY_RELOADING = "org.apache.cocoon.reloading"; - - /** - * Delay between reload checks for the configuration. - */ - String KEY_RELOAD_DELAY = "org.apache.cocoon.reload-delay"; - - /** - * Get the value of a property. - * @param key The name of the property. - * @return The value of the property or null. - */ - String getProperty(String key); - - /** - * Get the value of a property. - * @param key The name of the property. - * @param defaultValue The value returned if the property is not available. - * @return The value of the property or if the property cannot - * be found the default value. - */ - String getProperty(String key, String defaultValue); - - /** - * Return all available property names starting with the prefix. - * @param keyPrefix The prefix each property name must have. - * @return A list of property names (including the prefix) or - * an empty list. - */ - List getPropertyNames(String keyPrefix); - - /** - * Return all available property names. - * @return A list of all property names or an empty list. - */ - List getPropertyNames(); - - /** - * @return Returns the loadClasses. - * @see #KEY_LOAD_CLASSES - */ - List getLoadClasses(); - - /** - * @return Returns the workDirectory. - * @see #KEY_WORK_DIRECTORY - */ - String getWorkDirectory(); - - /** - * @return Returns the formEncoding. - * @see #KEY_FORM_ENCODING - */ - String getFormEncoding(); - - /** - * @return Returns the container encoding - * @see #KEY_CONTAINER_ENCODING - */ - String getContainerEncoding(); - - /** - * @return Returns the cacheDirectory. - * @see #KEY_CACHE_DIRECTORY - */ - String getCacheDirectory(); - - /** - * The creation time of the current settings instance. - * @return The creation time. - */ - long getCreationTime(); - - /** - * This method can be used by components to query if they are - * configured to check for reloading. - * @param type The type of the component that wants to check for reload. - * @return Returns if reloading is enabled for this component. - * @see #KEY_RELOADING - */ - boolean isReloadingEnabled(String type); - - /** - * This method can be used by components to get the configured - * delay period inbetween checks. - * @param type The type of the component that wants to check for reload. - * @return Returns the delay inbetween checks in milliseconds. - * @see #KEY_RELOAD_DELAY - */ - long getReloadDelay(String type); - - /** - * Return the current running mode. - * @return The current running mode. - */ - String getRunningMode(); -} diff --git a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/SettingsDefaults.java b/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/SettingsDefaults.java deleted file mode 100644 index 5d667c3a997..00000000000 --- a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/java/org/apache/cocoon/configuration/SettingsDefaults.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.cocoon.configuration; - -/** - * This object defines the default values for the {@link Settings}. - * - * @version $Id$ - * @since 1.0 - */ -public abstract class SettingsDefaults { - - /** - * The default running mode. - * @see Settings#getRunningMode() - */ - public static final String DEFAULT_RUNNING_MODE = "prod"; - - /** - * Default value for {@link Settings#isReloadingEnabled(String)} parameter (false). - */ - public static final boolean RELOADING_ENABLED_DEFAULT = false; - - /** - * Default reload delay for configurations in milliseconds. - * @see Settings#getReloadDelay(String) - */ - public static final long DEFAULT_CONFIGURATION_RELOAD_DELAY = 1000; - - /** - * The default encoding for the web container. - * @see Settings#getContainerEncoding() - */ - public static final String DEFAULT_CONTAINER_ENCODING = "ISO-8859-1"; -} diff --git a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/resources/META-INF/LICENSE.txt b/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/resources/META-INF/LICENSE.txt deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/resources/META-INF/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/resources/META-INF/NOTICE.txt b/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/resources/META-INF/NOTICE.txt deleted file mode 100644 index 672aaa382ed..00000000000 --- a/cocoon-configuration-api/cocoon-configuration-api-1.0.0-gpg-test-release/src/main/resources/META-INF/NOTICE.txt +++ /dev/null @@ -1,5 +0,0 @@ -Apache Cocoon -Copyright 1999-2006 The Apache Software Foundation. - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/).