cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lgaw...@apache.org
Subject svn commit: r471167 - in /cocoon/trunk/core/cocoon-core/src/main: java/org/apache/cocoon/core/container/spring/ java/org/apache/cocoon/core/container/spring/avalon/ resources/org/apache/cocoon/
Date Sat, 04 Nov 2006 11:44:38 GMT
Author: lgawron
Date: Sat Nov  4 03:44:37 2006
New Revision: 471167

URL: http://svn.apache.org/viewvc?view=rev&rev=471167
Log:
do not load files from context://WEB-INF/cocoon/{spring|avalon|properties}
If you do not like your configuration files placed in jars plase use any classpath location
eg. WEB-INF/classes/META-INF/cocoon/{spring|avalon|properties}

this means cocoon stops giving any special meaning to context://WEB-INF/cocoon/ directory.

Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AbstractElementParser.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonPropertyOverrideConfigurer.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/Constants.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsBeanFactoryPostProcessor.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsElementParser.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SitemapElementParser.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonBeanPostProcessor.java
    cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AbstractElementParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AbstractElementParser.java?view=diff&rev=471167&r1=471166&r2=471167
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AbstractElementParser.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AbstractElementParser.java
Sat Nov  4 03:44:37 2006
@@ -271,15 +271,13 @@
      * @param springConfigLocation
      */
     protected void registerPropertyOverrideConfigurer(final ParserContext parserContext,
-                                                      final String        location,
-                                                      final boolean       scanClassPath)
{
+                                                      final String        location) {
         final RootBeanDefinition beanDef = this.createBeanDefinition(CocoonPropertyOverrideConfigurer.class.getName(),
                 null, true);
         beanDef.getPropertyValues().addPropertyValue("location", location);
         beanDef.getPropertyValues().addPropertyValue("resourceLoader",
                 parserContext.getReaderContext().getReader().getResourceLoader());
         beanDef.getPropertyValues().addPropertyValue("beanNameSeparator", "/");
-        beanDef.getPropertyValues().addPropertyValue("scanClassPath", Boolean.valueOf(scanClassPath));
         this.register(beanDef, CocoonPropertyOverrideConfigurer.class.getName(), parserContext.getRegistry());
     }
 

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonPropertyOverrideConfigurer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonPropertyOverrideConfigurer.java?view=diff&rev=471167&r1=471166&r2=471167
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonPropertyOverrideConfigurer.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonPropertyOverrideConfigurer.java
Sat Nov  4 03:44:37 2006
@@ -107,10 +107,10 @@
         final String mode = (this.settings != null ? this.settings.getRunningMode() : SettingsDefaults.DEFAULT_RUNNING_MODE);
         final Properties mergedProps = new Properties();
 
-        if ( this.scanClassPath ) {
-            ResourceUtils.readProperties("classpath*:META-INF/cocoon/spring", mergedProps,
this.resourceLoader,
-                    this.logger);
-            ResourceUtils.readProperties("classpath*:META-INF/cocoon/spring/" + mode, mergedProps,
+        if (this.scanClassPath) {
+            ResourceUtils.readProperties(Constants.DEFAULT_BEAN_OVERRIDE_PROPERTIES_LOCATION,
mergedProps,
+                    this.resourceLoader, this.logger);
+            ResourceUtils.readProperties(Constants.DEFAULT_BEAN_OVERRIDE_PROPERTIES_LOCATION
+ "/" + mode, mergedProps,
                     this.resourceLoader, this.logger);
         }
 

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/Constants.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/Constants.java?view=diff&rev=471167&r1=471166&r2=471167
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/Constants.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/Constants.java
Sat Nov  4 03:44:37 2006
@@ -20,16 +20,15 @@
 
 /**
  * Some constants for the spring integration.
+ * 
  * @version $Id$
  */
 public class Constants {
-
     /** The default location of spring related configuration files. */
-    public static final String DEFAULT_SPRING_CONFIGURATION_LOCATION = "/WEB-INF/cocoon/spring";
+    public static final String DEFAULT_SPRING_CONFIGURATION_LOCATION = "classpath*:META-INF/cocoon/spring";
+    public static final String DEFAULT_PROPERTIES_LOCATION = "classpath*:META-INF/cocoon/properties";
+    public static final String DEFAULT_BEAN_OVERRIDE_PROPERTIES_LOCATION = "classpath*:META-INF/cocoon/spring";
 
     /** The default location of spring related per sitemap configuration files. */
     public static final String DEFAULT_SPRING_SITEMAP_CONFIGURATION_FILES = "config/spring";
-
-    /** The default location of spring related configuration files inside a block. */
-    public static final String DEFAULT_SPRING_BLOCK_CONFIGURATION_LOCATION = "classpath*:META-INF/cocoon/spring";
 }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsBeanFactoryPostProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsBeanFactoryPostProcessor.java?view=diff&rev=471167&r1=471166&r2=471167
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsBeanFactoryPostProcessor.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsBeanFactoryPostProcessor.java
Sat Nov  4 03:44:37 2006
@@ -186,14 +186,11 @@
         final Properties properties = new Properties();
 
         // now read all properties from the properties directory
-        ResourceUtils.readProperties("classpath*:META-INF/cocoon/properties", properties,
this.getResourceLoader(), this.logger);
+        ResourceUtils.readProperties(org.apache.cocoon.core.container.spring.Constants.DEFAULT_PROPERTIES_LOCATION,
+                properties, this.getResourceLoader(), this.logger);
         // read all properties from the mode dependent directory
-        ResourceUtils.readProperties("classpath*:META-INF/cocoon/properties/" + mode, properties,
this.getResourceLoader(), this.logger);
-
-        // now read all properties from the properties directory
-        ResourceUtils.readProperties("/WEB-INF/cocoon/properties", properties, this.getResourceLoader(),
this.logger);
-        // read all properties from the mode dependent directory
-        ResourceUtils.readProperties("/WEB-INF/cocoon/properties/" + mode, properties, this.getResourceLoader(),
this.logger);
+        ResourceUtils.readProperties(org.apache.cocoon.core.container.spring.Constants.DEFAULT_PROPERTIES_LOCATION
+                + "/" + mode, properties, this.getResourceLoader(), this.logger);
 
         // fill from the servlet context
         if ( s.getWorkDirectory() == null ) {

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsElementParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsElementParser.java?view=diff&rev=471167&r1=471166&r2=471167
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsElementParser.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SettingsElementParser.java
Sat Nov  4 03:44:37 2006
@@ -68,7 +68,7 @@
         this.register(beanDef, Settings.ROLE, parserContext.getRegistry());
 
         // register a PropertyPlaceholderConfigurer
-        this.registerPropertyOverrideConfigurer(parserContext, springConfigLocation, true);
+        this.registerPropertyOverrideConfigurer(parserContext, springConfigLocation);
 
         // add the servlet context as a bean
         this.addComponent(ServletContextFactoryBean.class.getName(), ServletContext.class.getName(),
null, false,
@@ -76,16 +76,9 @@
 
         // handle includes
         try {
-            this.handleBeanInclude(parserContext, null, Constants.DEFAULT_SPRING_BLOCK_CONFIGURATION_LOCATION,
"*.xml", true);
+            this.handleBeanInclude(parserContext, null, Constants.DEFAULT_SPRING_CONFIGURATION_LOCATION,
"*.xml", true);
         } catch (Exception e) {
-            throw new BeanDefinitionStoreException("Unable to read spring configurations
from " + Constants.DEFAULT_SPRING_BLOCK_CONFIGURATION_LOCATION, e);
-        }
-
-        try {
-            this.handleBeanInclude(parserContext, null, springConfigLocation, "*.xml", true);
-        } catch (Exception e) {
-            throw new BeanDefinitionStoreException("Unable to read spring configurations
from " + springConfigLocation,
-                    e);
+            throw new BeanDefinitionStoreException("Unable to read spring configurations
from " + Constants.DEFAULT_SPRING_CONFIGURATION_LOCATION, e);
         }
         return null;
     }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SitemapElementParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SitemapElementParser.java?view=diff&rev=471167&r1=471166&r2=471167
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SitemapElementParser.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SitemapElementParser.java
Sat Nov  4 03:44:37 2006
@@ -127,7 +127,7 @@
 
             // register a PropertyPlaceholderConfigurer
             if ( useDefaultIncludes ) {
-                this.registerPropertyOverrideConfigurer(parserContext, Constants.DEFAULT_SPRING_SITEMAP_CONFIGURATION_FILES,
false);
+                this.registerPropertyOverrideConfigurer(parserContext, Constants.DEFAULT_SPRING_SITEMAP_CONFIGURATION_FILES);
             }
             
             RootBeanDefinition def =  this.createBeanDefinition(SubSettingsBeanFactoryPostProcessor.class.getName(),

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonBeanPostProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonBeanPostProcessor.java?view=diff&rev=471167&r1=471166&r2=471167
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonBeanPostProcessor.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonBeanPostProcessor.java
Sat Nov  4 03:44:37 2006
@@ -66,7 +66,6 @@
     protected Settings settings = new MutableSettings("test");
     protected ResourceLoader resourceLoader = new DefaultResourceLoader();
 
-    // TODO should we also load from WEB-INF/cocoon/avalon?
     protected String location = "classpath*:META-INF/cocoon/avalon";
 
     public void setSettings(Settings settings) {

Modified: cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf?view=diff&rev=471167&r1=471166&r2=471167
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf (original)
+++ cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf Sat Nov
 4 03:44:37 2006
@@ -30,14 +30,7 @@
   <include src="resource://org/apache/cocoon/cocoon.roles"/>
 
   <!--+
-      | Include all configuration files (for core and blocks) from within the jars.
+      | Include all configuration files (for core and blocks) from within the classpath.
       +-->
   <include dir="classpath*:META-INF/cocoon/avalon" pattern="*.xconf"/>
-
-  <!--+
-      | Include all configuration files ending with ".xconf"
-      | from the xconf directory.
-      +-->
-  <include dir="context://WEB-INF/cocoon/avalon" pattern="*.xconf"/>
-
 </cocoon>



Mime
View raw message