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 2006/08/27 13:03:36 UTC

svn commit: r437365 - in /cocoon/trunk/core/cocoon-core/src/main: java/org/apache/cocoon/components/treeprocessor/sitemap/ java/org/apache/cocoon/core/container/spring/ resources/org/apache/cocoon/core/container/spring/

Author: cziegeler
Date: Sun Aug 27 04:03:35 2006
New Revision: 437365

URL: http://svn.apache.org/viewvc?rev=437365&view=rev
Log:
Allow own implementations for customizing settings
Start new implementation for per sitemap factories

Added:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SubSettingsBeanFactoryPostProcessor.java   (with props)
Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonNamespaceHandler.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/resources/org/apache/cocoon/core/container/spring/cocoon.xsd

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java?rev=437365&r1=437364&r2=437365&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java Sun Aug 27 04:03:35 2006
@@ -15,8 +15,6 @@
  */
 package org.apache.cocoon.components.treeprocessor.sitemap;
 
-import java.io.IOException;
-import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonNamespaceHandler.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonNamespaceHandler.java?rev=437365&r1=437364&r2=437365&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonNamespaceHandler.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonNamespaceHandler.java Sun Aug 27 04:03:35 2006
@@ -24,6 +24,8 @@
  * (in the namespace "http://org.apache.cocoon/core"):
  * "settings" : This sets up the Cocoon Settings object (by reading the property
  *              files located under /WEB-INF/cocoon/properties.
+ *              By specifying the attribute "processorClassName" an own implementation
+ *              can be used (this should be a subclass of the {@link SettingsBeanFactoryPostProcessor}).
  *
  * @version $Id$
  * @since 2.2

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?rev=437365&r1=437364&r2=437365&view=diff
==============================================================================
--- 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 Sun Aug 27 04:03:35 2006
@@ -78,20 +78,35 @@
         this.servletContext = sContext;
     }
 
+    /**
+     * Initialize this processor.
+     * Setup the settings object.
+     * @throws Exception
+     */
     public void init()
     throws Exception {
         this.settings = this.createSettings();
-        this.initSettingsFiles();
 
+        this.doInit();
+
+        this.initSettingsFiles();
         // settings can't be changed anymore
         this.settings.makeReadOnly();
 
         this.dumpSystemProperties();
+        this.dumpSettings();
         this.forceLoad();
         this.logger.info("Apache Cocoon " + Constants.VERSION + " is up and ready.");
     }
 
     /**
+     * This method can be overwritten by subclasses to further initialize the settings
+     */
+    protected void doInit() {
+        // nothing to do here
+    }
+
+    /**
      * Init work, upload and cache directory
      * @param settings 
      * @param log 
@@ -165,18 +180,18 @@
      *    Default values for the core and each block - the order in which the files are read is not guaranteed.
      * 2) context://WEB-INF/cocoon/properties/[RUNNING_MODE]/*.properties
      *    Default values for the running mode - the order in which the files are read is not guaranteed.
-     * 4) Working directory from servlet context (if not already set)
-     * 5) Optional property file which is stored under ".cocoon/settings.properties" in the user
+     * 3) Working directory from servlet context (if not already set)
+     * 4) Optional property file which is stored under ".cocoon/settings.properties" in the user
      *    directory.
-     * 6) Additional property file specified by the "org.apache.cocoon.settings" property.
-     * 7) System properties
+     * 5) Additional property file specified by the "org.apache.cocoon.settings" property.
+     * 6) System properties
      *
      * This means that system properties (provided on startup of the web application) override all
      * others etc.
      *
      * @return A new Settings object
      */
-    public MutableSettings createSettings() {
+    protected MutableSettings createSettings() {
         // get the running mode
         final String mode = getSystemProperty(Settings.PROPERTY_RUNNING_MODE, SettingsDefaults.DEFAULT_RUNNING_MODE);
         
@@ -189,7 +204,7 @@
         }
         */
         
-        servletContext.log("Running in mode: " + mode);
+        this.servletContext.log("Running in mode: " + mode);
 
         // create an empty settings objects
         final MutableSettings s = new MutableSettings(mode);
@@ -253,9 +268,9 @@
     /**
      * Read all property files from the given directory and apply them to the settings.
      */
-    public void readProperties(String          directoryName,
-                               Settings        s,
-                               Properties      properties) {
+    protected void readProperties(String          directoryName,
+                                  Settings        s,
+                                  Properties      properties) {
         final String pattern = directoryName + "/*.properties";
         PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(new ServletContextResourceLoader(this.servletContext));
         Resource[] resources = null;
@@ -271,7 +286,7 @@
                 propertyUris.add(resources[i]);
             }
             // sort
-            Collections.sort(propertyUris, getResourceComparator());
+            Collections.sort(propertyUris, this.getResourceComparator());
             // now process
             final Iterator i = propertyUris.iterator();
             while ( i.hasNext() ) {
@@ -292,7 +307,7 @@
     /**
      * Return a resource comparator
      */
-    public static Comparator getResourceComparator() {
+    protected Comparator getResourceComparator() {
         return new ResourceComparator();
     }
 
@@ -371,6 +386,17 @@
             } catch (SecurityException se) {
                 // Ignore Exceptions.
             }
+        }
+    }
+
+    /**
+     * Dump the settings object
+     */
+    protected void dumpSettings() {
+        if ( this.logger.isDebugEnabled() ) {
+            this.logger.debug("===== Settings Start =====");
+            this.logger.debug(this.settings.toString());
+            this.logger.debug("===== Settings End =====");
         }
     }
 

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?rev=437365&r1=437364&r2=437365&view=diff
==============================================================================
--- 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 Sun Aug 27 04:03:35 2006
@@ -23,7 +23,6 @@
 import org.springframework.beans.factory.config.BeanDefinition;
 import org.springframework.beans.factory.config.BeanDefinitionHolder;
 import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
-import org.springframework.beans.factory.support.BeanDefinitionRegistry;
 import org.springframework.beans.factory.support.RootBeanDefinition;
 import org.springframework.beans.factory.xml.BeanDefinitionParser;
 import org.springframework.beans.factory.xml.ParserContext;
@@ -31,6 +30,7 @@
 
 /**
  * Add a bean definition for the settings object to the bean factory.
+ *
  * @see CocoonNamespaceHandler
  * @see SettingsBeanFactoryPostProcessor
  * @version $Id$
@@ -41,30 +41,27 @@
     /** Logger (we use the same logging mechanism as Spring!) */
     protected final Log logger = LogFactory.getLog(getClass());
 
+    /** The name of the configuration attribute to use a different processor class. */
+    public static final String PROCESSOR_CLASS_NAME_ATTR = "processorClassName";
+
     /**
      * @see org.springframework.beans.factory.xml.BeanDefinitionParser#parse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext)
      */
     public BeanDefinition parse(Element element, ParserContext parserContext) {
         this.logger.info("Initializing Apache Cocoon " + Constants.VERSION);
-        this.addComponent(SettingsBeanFactoryPostProcessor.class,
-                          Settings.ROLE,
-                          "init",
-                          parserContext.getRegistry());
-        return null;
-    }
-
-    protected void addComponent(Class  componentClass,
-                                String role,
-                                String initMethod,
-                                BeanDefinitionRegistry registry) {
-        RootBeanDefinition beanDef = new RootBeanDefinition();
-        beanDef.setBeanClass(componentClass);      
-        beanDef.setSingleton(true);
-        if ( initMethod != null ) {
-            beanDef.setInitMethodName(initMethod);
+        String componentClassName = SettingsBeanFactoryPostProcessor.class.getName();
+        if ( element.getAttribute(PROCESSOR_CLASS_NAME_ATTR) != null ) {
+            componentClassName = element.getAttribute(PROCESSOR_CLASS_NAME_ATTR);
         }
+        final RootBeanDefinition beanDef = new RootBeanDefinition();
+        beanDef.setBeanClassName(componentClassName);      
+        beanDef.setSingleton(true);
+        beanDef.setLazyInit(false);
+        beanDef.setInitMethodName("init");
         
-        BeanDefinitionHolder holder = new BeanDefinitionHolder(beanDef, role);
-        BeanDefinitionReaderUtils.registerBeanDefinition(holder, registry);
+        final BeanDefinitionHolder holder = new BeanDefinitionHolder(beanDef, Settings.ROLE);
+        BeanDefinitionReaderUtils.registerBeanDefinition(holder, parserContext.getRegistry());
+
+        return null;
     }
 }

Added: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SubSettingsBeanFactoryPostProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SubSettingsBeanFactoryPostProcessor.java?rev=437365&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SubSettingsBeanFactoryPostProcessor.java (added)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SubSettingsBeanFactoryPostProcessor.java Sun Aug 27 04:03:35 2006
@@ -0,0 +1,184 @@
+/* 
+ * Copyright 2006 The Apache Software Foundation
+ * 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.
+ */
+package org.apache.cocoon.core.container.spring;
+
+import java.util.Properties;
+
+import javax.servlet.ServletContext;
+
+import org.apache.cocoon.configuration.Settings;
+import org.apache.cocoon.configuration.impl.MutableSettings;
+import org.apache.cocoon.configuration.impl.PropertyHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.FactoryBean;
+import org.springframework.beans.factory.HierarchicalBeanFactory;
+import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
+import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
+import org.springframework.web.context.ServletContextAware;
+
+/**
+ * This is a bean factory post processor which sets up a child settings object.
+ *
+ * @since 2.2
+ * @version $Id$
+ */
+public class SubSettingsBeanFactoryPostProcessor
+    extends PropertyPlaceholderConfigurer
+    implements ServletContextAware, BeanFactoryPostProcessor, FactoryBean {
+
+    /** Logger (we use the same logging mechanism as Spring!) */
+    protected final Log logger = LogFactory.getLog(getClass());
+
+    protected ServletContext servletContext;
+
+    protected MutableSettings settings;
+
+    protected BeanFactory beanFactory;
+
+    /**
+     * @see org.springframework.web.context.ServletContextAware#setServletContext(javax.servlet.ServletContext)
+     */
+    public void setServletContext(ServletContext sContext) {
+        this.servletContext = sContext;
+    }
+
+    /**
+     * @see org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#setBeanFactory(org.springframework.beans.factory.BeanFactory)
+     */
+    public void setBeanFactory(BeanFactory factory) {
+        super.setBeanFactory(factory);
+        this.beanFactory = factory;
+    }
+
+    /**
+     * Initialize this processor.
+     * Setup the settings object.
+     * @throws Exception
+     */
+    public void init()
+    throws Exception {
+        this.settings = this.createSettings();
+
+        this.doInit();
+
+        // settings can't be changed anymore
+        this.settings.makeReadOnly();
+
+    }
+
+    protected MutableSettings createSettings() {
+        MutableSettings s;
+        Settings parentSettings = null;
+        final Properties globalSitemapVariables = null;
+        if ( this.beanFactory != null && this.beanFactory instanceof HierarchicalBeanFactory
+             && ((HierarchicalBeanFactory)this.beanFactory).getParentBeanFactory() != null ) {
+            parentSettings = (Settings)((HierarchicalBeanFactory)this.beanFactory).getParentBeanFactory().getBean(Settings.ROLE);
+        }
+//        if ( componentConfig != null ) {
+//            final String propertyDir = componentConfig.getAttribute("property-dir", null);
+//            s = this.createSettings(parentSettings, propertyDir, useDefaultIncludes, factory.getCurrentBeanFactory(itsContext), globalSitemapVariables);
+//        } else if ( globalSitemapVariables != null ) {
+            s = new MutableSettings(parentSettings);
+            PropertyHelper.replaceAll(globalSitemapVariables, parentSettings);
+            s.configure(globalSitemapVariables);
+//        }
+        // if no config we just add an empty settings
+        if ( s == null ) {
+            s = new MutableSettings(parentSettings);
+        }
+        return s;
+    }
+
+    /**
+     * Get the settings for Cocoon.
+     * This method reads several property files and merges the result. If there
+     * is more than one definition for a property, the last one wins.
+     * The property files are read in the following order:
+     * 1) PROPERTYDIR/*.properties
+     *    Default values for the core and each block - the order in which the files are read is not guaranteed.
+     * 2) PROPERTYDIR/[RUNNING_MODE]/*.properties
+     *    Default values for the running mode - the order in which the files are read is not guaranteed.
+     * 3) Property providers (ToBeDocumented)
+     *
+     * @return A new Settings object
+     */
+    protected MutableSettings createSettings(Settings    parent,
+                                             String      directory,
+                                             boolean     useDefaultIncludes,
+                                             BeanFactory parentBeanFactory,
+                                             Properties  globalSitemapVariables) {
+        // get the running mode
+        final String mode = parent.getRunningMode();
+        // get properties
+        final Properties properties = new Properties();
+
+        // create an empty settings objects
+        final MutableSettings s = new MutableSettings(parent);
+
+        // read properties from default includes
+        if ( useDefaultIncludes ) {
+//            SettingsHelper.readProperties(SitemapLanguage.DEFAULT_CONFIG_PROPERTIES, s, properties);
+            // read all properties from the mode dependent directory
+//            SettingsHelper.readProperties(SitemapLanguage.DEFAULT_CONFIG_PROPERTIES + '/' + mode, s, properties);    
+        }
+
+        if ( directory != null ) {
+            // now read all properties from the properties directory
+ //           SettingsHelper.readProperties(directory, s, properties);
+            // read all properties from the mode dependent directory
+ //           SettingsHelper.readProperties(directory + '/' + mode, s, properties);
+        }
+
+        if ( globalSitemapVariables != null ) {
+            properties.putAll(globalSitemapVariables);
+        }
+        PropertyHelper.replaceAll(properties, parent);
+        s.configure(properties);
+
+        return s;
+    }
+
+    /**
+     * This method can be overwritten by subclasses to further initialize the settings
+     */
+    protected void doInit() {
+        // nothing to do here
+    }
+
+    /**
+     * @see org.springframework.beans.factory.FactoryBean#getObject()
+     */
+    public Object getObject() throws Exception {
+        return this.settings;
+    }
+
+    /**
+     * @see org.springframework.beans.factory.FactoryBean#getObjectType()
+     */
+    public Class getObjectType() {
+        return Settings.class;
+    }
+
+    /**
+     * @see org.springframework.beans.factory.FactoryBean#isSingleton()
+     */
+    public boolean isSingleton() {
+        return true;
+    }
+}

Propchange: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SubSettingsBeanFactoryPostProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SubSettingsBeanFactoryPostProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/core/container/spring/cocoon.xsd
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/core/container/spring/cocoon.xsd?rev=437365&r1=437364&r2=437365&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/core/container/spring/cocoon.xsd (original)
+++ cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/core/container/spring/cocoon.xsd Sun Aug 27 04:03:35 2006
@@ -20,5 +20,7 @@
 
     <xsd:element name="settings" type="tns:settingsType"/>
 
-    <xsd:complexType name="settingsType"/>
+    <xsd:complexType name="settingsType">
+    	<xsd:attribute name="processorClassName" type="xsd:string" use="optional"></xsd:attribute>
+    </xsd:complexType>
 </xsd:schema>



Re: svn commit: r437365 - in /cocoon/trunk/core/cocoon-core/src/main: java/org/apache/cocoon/components/treeprocessor/sitemap/ java/org/apache/cocoon/core/container/spring/ resources/org/apache/cocoon/core/container/spring/

Posted by Carsten Ziegeler <cz...@apache.org>.
Leszek Gawron wrote:
> Carsten Ziegeler wrote:
> One more question: why does the root context gets singletons 
> pre-instantiated two times? One time at container start and second time 
> after first request. I can post revelant log entries if you like.
> 
Yes, please do.

Carsten

-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: svn commit: r437365 - in /cocoon/trunk/core/cocoon-core/src/main: java/org/apache/cocoon/components/treeprocessor/sitemap/ java/org/apache/cocoon/core/container/spring/ resources/org/apache/cocoon/core/container/spring/

Posted by Leszek Gawron <lg...@mobilebox.pl>.
Carsten Ziegeler wrote:
> Leszek Gawron wrote:
>> It would be even better if the main component wouldn't have the 
>> processor passed to. Instead we could make it BeanFactoryAware and allow 
>> it to find all beans implementing PropertyProvider in context.
> I implemented it slightly different now :) The implementation now
> searches for one bean
> defined in the application context under the bean name
> PropertyProvider.ROLE.
> 
> At this point, we can't search for all implementations of this interface
> in the application context as this would force Spring to instantiate
> FactoryBeans. And then property replacements for FactoryBeans would not
> work anymore as they would be applied later.
One more question: why does the root context gets singletons 
pre-instantiated two times? One time at container start and second time 
after first request. I can post revelant log entries if you like.

-- 
Leszek Gawron, IT Manager                          MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Re: svn commit: r437365 - in /cocoon/trunk/core/cocoon-core/src/main: java/org/apache/cocoon/components/treeprocessor/sitemap/ java/org/apache/cocoon/core/container/spring/ resources/org/apache/cocoon/core/container/spring/

Posted by Carsten Ziegeler <cz...@apache.org>.
Leszek Gawron wrote:
> 
> It would be even better if the main component wouldn't have the 
> processor passed to. Instead we could make it BeanFactoryAware and allow 
> it to find all beans implementing PropertyProvider in context.
I implemented it slightly different now :) The implementation now
searches for one bean
defined in the application context under the bean name
PropertyProvider.ROLE.

At this point, we can't search for all implementations of this interface
in the application context as this would force Spring to instantiate
FactoryBeans. And then property replacements for FactoryBeans would not
work anymore as they would be applied later.

Carsten
-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: svn commit: r437365 - in /cocoon/trunk/core/cocoon-core/src/main: java/org/apache/cocoon/components/treeprocessor/sitemap/ java/org/apache/cocoon/core/container/spring/ resources/org/apache/cocoon/core/container/spring/

Posted by Leszek Gawron <lg...@mobilebox.pl>.
Carsten Ziegeler wrote:
> Leszek Gawron wrote:
>> Wouldn't it be better if instead of processorClassName it was a bean 
>> reference? There is no way to do any configuration if only class name is 
>> passed.
>>
> Yes, a bean would be better, but I'm not sure if this works. I will try
> this out during the week and then change the code.
> 
>> I am still pushing for the ability to test developments blocks in 
>> isolation which would require something like:
>>
>> <cocoon:properties additionalProcessor="localProcessor"/>
>>
>> <bean id="localProcessor" class="sth">
>> 	<property name="propertyPath"
>>            value="src/main/resources/META-INF/properties"/>
>> </bean>
>>
> We already have an interface for this:
> org.apache.cocoon.configuration.PropertyProvider.
Yes but it was totally hidden from configuration point. There was only 
one property provider and it was already used for reading properties 
from web.xml.

It would be even better if the main component wouldn't have the 
processor passed to. Instead we could make it BeanFactoryAware and allow 
it to find all beans implementing PropertyProvider in context.

-- 
Leszek Gawron, IT Manager                          MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Re: svn commit: r437365 - in /cocoon/trunk/core/cocoon-core/src/main: java/org/apache/cocoon/components/treeprocessor/sitemap/ java/org/apache/cocoon/core/container/spring/ resources/org/apache/cocoon/core/container/spring/

Posted by Carsten Ziegeler <cz...@apache.org>.
Leszek Gawron wrote:
> Wouldn't it be better if instead of processorClassName it was a bean 
> reference? There is no way to do any configuration if only class name is 
> passed.
> 
Yes, a bean would be better, but I'm not sure if this works. I will try
this out during the week and then change the code.

> I am still pushing for the ability to test developments blocks in 
> isolation which would require something like:
> 
> <cocoon:properties additionalProcessor="localProcessor"/>
> 
> <bean id="localProcessor" class="sth">
> 	<property name="propertyPath"
>            value="src/main/resources/META-INF/properties"/>
> </bean>
> 
We already have an interface for this:
org.apache.cocoon.configuration.PropertyProvider.

Carsten

-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: svn commit: r437365 - in /cocoon/trunk/core/cocoon-core/src/main: java/org/apache/cocoon/components/treeprocessor/sitemap/ java/org/apache/cocoon/core/container/spring/ resources/org/apache/cocoon/core/container/spring/

Posted by Leszek Gawron <lg...@mobilebox.pl>.
cziegeler@apache.org wrote:
> Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonNamespaceHandler.java
> URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonNamespaceHandler.java?rev=437365&r1=437364&r2=437365&view=diff
> ==============================================================================
> --- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonNamespaceHandler.java (original)
> +++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/CocoonNamespaceHandler.java Sun Aug 27 04:03:35 2006
> @@ -24,6 +24,8 @@
>   * (in the namespace "http://org.apache.cocoon/core"):
>   * "settings" : This sets up the Cocoon Settings object (by reading the property
>   *              files located under /WEB-INF/cocoon/properties.
> + *              By specifying the attribute "processorClassName" an own implementation
> + *              can be used (this should be a subclass of the {@link SettingsBeanFactoryPostProcessor}).
Wouldn't it be better if instead of processorClassName it was a bean 
reference? There is no way to do any configuration if only class name is 
passed.

I am still pushing for the ability to test developments blocks in 
isolation which would require something like:

<cocoon:properties additionalProcessor="localProcessor"/>

<bean id="localProcessor" class="sth">
	<property name="propertyPath"
           value="src/main/resources/META-INF/properties"/>
</bean>

-- 
Leszek Gawron, IT Manager                          MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65