cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r492166 - in /cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main: java/org/apache/cocoon/spring/configurator/impl/ resources/org/apache/cocoon/spring/configurator/schema/
Date Wed, 03 Jan 2007 14:48:24 GMT
Author: cziegeler
Date: Wed Jan  3 06:48:23 2007
New Revision: 492166

URL: http://svn.apache.org/viewvc?view=rev&rev=492166
Log:
Make extraction configurable

Modified:
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsElementParser.java
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/DefaultBlockResourcesHolder.java
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsElementParser.java
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.xsd

Modified: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsElementParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsElementParser.java?view=diff&rev=492166&r1=492165&r2=492166
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsElementParser.java
(original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsElementParser.java
Wed Jan  3 06:48:23 2007
@@ -134,7 +134,7 @@
         }
 
         // register additonal components
-        this.registerComponents(parserContext);
+        this.registerComponents(element, parserContext);
 
         // Get bean includes
         final List beanIncludes = this.getBeanIncludes(element);
@@ -157,7 +157,7 @@
     /**
      * This method can be used for subclasses to register additional components.
      */
-    protected void registerComponents(ParserContext parserContext) {
+    protected void registerComponents(Element settingsElement, ParserContext parserContext)
{
         // nothing to do here
     }
 

Modified: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/DefaultBlockResourcesHolder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/DefaultBlockResourcesHolder.java?view=diff&rev=492166&r1=492165&r2=492166
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/DefaultBlockResourcesHolder.java
(original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/DefaultBlockResourcesHolder.java
Wed Jan  3 06:48:23 2007
@@ -16,6 +16,7 @@
  */
 package org.apache.cocoon.spring.configurator.impl;
 
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -31,17 +32,33 @@
 public class DefaultBlockResourcesHolder
     implements BlockResourcesHolder {
 
+    /** The settings object. */
     protected Settings settings;
 
+    /** extractBlockResources. */
+    protected boolean extractBlockResources = true;
+
     protected Map blockContexts = new HashMap();
 
     public void setSettings(Settings settings) {
         this.settings = settings;
     }
 
+    public void setExtractBlockResources(boolean extractBlockResources) {
+        this.extractBlockResources = extractBlockResources;
+    }
+
+    /**
+     * Initialize this component.
+     * @throws Exception
+     */
     public void init()
     throws Exception {
-        this.blockContexts = DeploymentUtil.deployBlockArtifacts(this.settings.getWorkDirectory());
+        if ( this.extractBlockResources ) {
+            this.blockContexts = DeploymentUtil.deployBlockArtifacts(this.settings.getWorkDirectory());
+        } else {
+            this.blockContexts = Collections.EMPTY_MAP;
+        }
     }
 
     /**

Modified: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsElementParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsElementParser.java?view=diff&rev=492166&r1=492165&r2=492166
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsElementParser.java
(original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsElementParser.java
Wed Jan  3 06:48:23 2007
@@ -118,18 +118,20 @@
     }
 
     /**
-     * @see org.apache.cocoon.spring.configurator.impl.AbstractSettingsElementParser#registerComponents(org.springframework.beans.factory.xml.ParserContext)
+     * @see org.apache.cocoon.spring.configurator.impl.AbstractSettingsElementParser#registerComponents(org.w3c.dom.Element,
org.springframework.beans.factory.xml.ParserContext)
      */
-    protected void registerComponents(ParserContext parserContext) {
-        super.registerComponents(parserContext);
+    protected void registerComponents(Element settingsElement, ParserContext parserContext)
{
+        super.registerComponents(settingsElement, parserContext);
         // add the servlet context as a bean
         this.addComponent(ServletContextFactoryBean.class.getName(),
                           ServletContext.class.getName(),
                           null, false, parserContext.getRegistry());
 
         // deploy blocks and add a bean holding the information
-        this.addComponent(DefaultBlockResourcesHolder.class.getName(), 
-                          BlockResourcesHolder.class.getName(),
-                          "init", true, parserContext.getRegistry());
+        final Boolean extractBlockResources = Boolean.valueOf(this.getAttributeValue(settingsElement,
"extractBlockResources", "true"));
+        final RootBeanDefinition beanDef = this.createBeanDefinition(DefaultBlockResourcesHolder.class.getName(),
+                                                                     "init", true);
+        beanDef.getPropertyValues().addPropertyValue("extractBlockResources", extractBlockResources);
+        this.register(beanDef, BlockResourcesHolder.class.getName(), parserContext.getRegistry());
     }
 }

Modified: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.xsd
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.xsd?view=diff&rev=492166&r1=492165&r2=492166
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.xsd
(original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.xsd
Wed Jan  3 06:48:23 2007
@@ -31,6 +31,7 @@
     	<xsd:attribute name="runningMode" type="xsd:string" use="optional"/>
     	<xsd:attribute name="readFromClasspath" type="xsd:boolean" use="optional"/>
     	<xsd:attribute name="readFromGlobalLocation" type="xsd:boolean" use="optional"/>
+        <xsd:attribute name="extractBlockResources" type="xsd:boolean" use="optional"/>
       </xsd:complexType>
     </xsd:element>
 



Mime
View raw message