cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r491257 - in /cocoon/trunk/core: cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configura...
Date Sat, 30 Dec 2006 17:31:52 GMT
Author: cziegeler
Date: Sat Dec 30 09:31:49 2006
New Revision: 491257

URL: http://svn.apache.org/viewvc?view=rev&rev=491257
Log:
Move spring configuration stuff for child context to configurator.

Added:
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildSettingsBeanFactoryPostProcessor.java
      - copied, changed from r491219, cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/ChildSettingsBeanFactoryPostProcessor.java
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildSettingsElementParser.java
  (with props)
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildXmlWebApplicationContext.java
      - copied, changed from r491219, cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/ChildXmlWebApplicationContext.java
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SitemapNamespaceHandler.java
      - copied, changed from r491219, cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/SitemapNamespaceHandler.java
Removed:
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/ChildSettingsBeanFactoryPostProcessor.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/ChildXmlWebApplicationContext.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/Constants.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/SitemapElementParser.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/SitemapNamespaceHandler.java
Modified:
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ConfiguratorNamespaceHandler.java
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/Constants.java
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.xsd
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java

Copied: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildSettingsBeanFactoryPostProcessor.java
(from r491219, cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/ChildSettingsBeanFactoryPostProcessor.java)
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildSettingsBeanFactoryPostProcessor.java?view=diff&rev=491257&p1=cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/ChildSettingsBeanFactoryPostProcessor.java&r1=491219&p2=cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildSettingsBeanFactoryPostProcessor.java&r2=491257
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/ChildSettingsBeanFactoryPostProcessor.java
(original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildSettingsBeanFactoryPostProcessor.java
Sat Dec 30 09:31:49 2006
@@ -16,7 +16,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.cocoon.core.container.spring;
+package org.apache.cocoon.spring.configurator.impl;
 
 import java.util.Iterator;
 import java.util.List;
@@ -27,7 +27,6 @@
 import org.apache.cocoon.configuration.PropertyProvider;
 import org.apache.cocoon.configuration.Settings;
 import org.apache.cocoon.spring.configurator.ResourceUtils;
-import org.apache.cocoon.spring.configurator.impl.AbstractSettingsBeanFactoryPostProcessor;
 import org.springframework.beans.factory.BeanFactory;
 import org.springframework.beans.factory.HierarchicalBeanFactory;
 import org.springframework.core.io.Resource;
@@ -35,7 +34,7 @@
 /**
  * This is a bean factory post processor which sets up a child settings object.
  *
- * @since 2.2
+ * @since 1.0
  * @version $Id$
  */
 public class ChildSettingsBeanFactoryPostProcessor

Added: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildSettingsElementParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildSettingsElementParser.java?view=auto&rev=491257
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildSettingsElementParser.java
(added)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildSettingsElementParser.java
Sat Dec 30 09:31:49 2006
@@ -0,0 +1,136 @@
+/*
+ * 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.spring.configurator.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.cocoon.configuration.Settings;
+import org.springframework.beans.factory.BeanDefinitionStoreException;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.support.RootBeanDefinition;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.w3c.dom.Element;
+
+/**
+ * Add a bean definition for the settings object of a child context to the bean factory
+ * and process all includes of spring configurations.
+ *
+ * @see SitemapNamespaceHandler
+ * @see ChildSettingsBeanFactoryPostProcessor
+ * @version $Id$
+ * @since 1.0
+ */
+public class ChildSettingsElementParser extends AbstractElementParser {
+
+    protected List getPropertyIncludes(Element childSettingsElement)
+    throws Exception {
+        List propertyDirs = null;
+        if ( childSettingsElement != null ) {
+            final Element[] propertyDirConfigs = this.getChildElements(childSettingsElement,
"include-properties");
+            if ( propertyDirConfigs != null && propertyDirConfigs.length > 0 )
{
+                propertyDirs = new ArrayList();
+                for(int i=0; i < propertyDirConfigs.length; i++) {
+                    propertyDirs.add(this.getAttributeValue(propertyDirConfigs[i], "dir",
null));
+                }
+            }
+        }
+        return propertyDirs;        
+    }
+
+    /**
+     * Get additional properties.
+     */
+    protected Properties getAdditionalProperties(Element childSettingsElement)
+    throws Exception {
+        Properties variables = null;
+        final Element[] properties = this.getChildElements(childSettingsElement, "property");
+        if ( properties != null && properties.length > 0 ) {
+            variables = new Properties();
+            for(int i=0; i<properties.length; i++) {
+                variables.setProperty(this.getAttributeValue(properties[i], "name", null),
+                                      this.getAttributeValue(properties[i], "value", null));
+            }
+        }
+        return variables;
+    }
+
+    /**
+     * @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) {
+        final String runningMode = RunningModeHelper.determineRunningMode( this.getAttributeValue(element,
SettingsElementParser.RUNNING_MODE_ATTR, null) );
+        final String location = element.getAttribute("location");
+        try {
+            final boolean useDefaultIncludes = Boolean.valueOf(this.getAttributeValue(element,
"useDefaultIncludes", "true")).booleanValue();
+
+            // register a PropertyPlaceholderConfigurer
+            if ( useDefaultIncludes ) {
+                this.registerPropertyOverrideConfigurer(parserContext, Collections.singletonList(Constants.DEFAULT_CHILD_SPRING_CONFIGURATION_LOCATION));
+            }
+            
+            RootBeanDefinition def =  this.createBeanDefinition(ChildSettingsBeanFactoryPostProcessor.class.getName(),
+                    "init",
+                    false);
+            def.getPropertyValues().addPropertyValue("location", location);
+            def.getPropertyValues().addPropertyValue("useDefaultIncludes", Boolean.valueOf(useDefaultIncludes));
+
+            final Properties additionalProps = this.getAdditionalProperties(element);
+            if ( additionalProps != null ) {
+                def.getPropertyValues().addPropertyValue("additionalProperties", additionalProps);
               
+            }
+
+            final List includes = this.getPropertyIncludes(element);
+            if ( includes != null ) {
+                def.getPropertyValues().addPropertyValue("directories", includes);
+            }
+
+            if ( useDefaultIncludes ) {
+                this.handleBeanInclude(parserContext, null, Constants.DEFAULT_CHILD_SPRING_CONFIGURATION_LOCATION,
"*.xml", true);
+                this.handleBeanInclude(parserContext, null, Constants.DEFAULT_CHILD_SPRING_CONFIGURATION_LOCATION
+ "/" + runningMode, "*.xml", true);
+            }
+            // search for includes
+            if ( element.hasChildNodes() ) {
+                final Element[] includeElements = this.getChildElements(element, "include-beans");
+                if ( includeElements != null ) {
+                    for(int i = 0 ; i < includeElements.length; i++ ) {
+                        final String src = this.getAttributeValue(includeElements[i], "src",
null);
+                        final String dir = this.getAttributeValue(includeElements[i], "dir",
null);
+                        final String pattern = this.getAttributeValue(includeElements[i],
"pattern", "*.xml");
+                        final boolean optional = Boolean.valueOf(this.getAttributeValue(includeElements[i],
"optional", "false")).booleanValue();
+
+                        this.handleBeanInclude(parserContext, src, dir, pattern, optional);
+
+                        // TODO do we really need both src/dir attributes? The
+                        // quiet precedence of 'src' over 'dir' attribute is at
+                        // least unclear.
+                        if (src == null && dir != null)
+                            this.handleBeanInclude(parserContext, null, dir + "/" + runningMode,
pattern, optional);
+                    }
+                }
+            }
+            this.register(def, Settings.ROLE, parserContext.getRegistry());
+        } catch (Exception e) {
+            throw new BeanDefinitionStoreException("Unable to process sitemap at '" + location
+ "'.",e);
+        }
+        return null;
+    }
+}

Propchange: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildSettingsElementParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildSettingsElementParser.java
------------------------------------------------------------------------------
    svn:keywords = Id

Copied: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildXmlWebApplicationContext.java
(from r491219, cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/ChildXmlWebApplicationContext.java)
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildXmlWebApplicationContext.java?view=diff&rev=491257&p1=cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/ChildXmlWebApplicationContext.java&r1=491219&p2=cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildXmlWebApplicationContext.java&r2=491257
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/ChildXmlWebApplicationContext.java
(original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ChildXmlWebApplicationContext.java
Sat Dec 30 09:31:49 2006
@@ -16,7 +16,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.cocoon.core.container.spring;
+package org.apache.cocoon.spring.configurator.impl;
 
 import java.io.IOException;
 import java.net.MalformedURLException;
@@ -35,7 +35,7 @@
  * Own implementation of a {@link XmlWebApplicationContext} which is configured with
  * a base url specifying the root directory for this web application context.
  *
- * @since 2.2
+ * @since 1.0
  * @version $Id$
  */
 public class ChildXmlWebApplicationContext extends XmlWebApplicationContext {

Modified: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ConfiguratorNamespaceHandler.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ConfiguratorNamespaceHandler.java?view=diff&rev=491257&r1=491256&r2=491257
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ConfiguratorNamespaceHandler.java
(original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ConfiguratorNamespaceHandler.java
Sat Dec 30 09:31:49 2006
@@ -28,6 +28,7 @@
  *              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}).
+ * "child-settings" : This sets up a sub context.
  *
  * @version $Id$
  * @since 1.0
@@ -39,5 +40,6 @@
      */
     public void init() {
         registerBeanDefinitionParser("settings", new SettingsElementParser());
+        registerBeanDefinitionParser("child-settings", new ChildSettingsElementParser());
     }
 }

Modified: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/Constants.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/Constants.java?view=diff&rev=491257&r1=491256&r2=491257
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/Constants.java
(original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/Constants.java
Sat Dec 30 09:31:49 2006
@@ -48,4 +48,15 @@
      * The location of global property files (*.properties) for the settings.
      */
     public static final String GLOBAL_PROPERTIES_LOCATION = "/WEB-INF/cocoon/properties";
+
+    /**
+     * The default location of spring related child configuration files.
+     * TODO Move this to the sitemap handler
+     */
+    public static final String DEFAULT_CHILD_SPRING_CONFIGURATION_LOCATION = "config/spring";
+    /**
+     * The default location of spring related child configuration files.
+     * TODO Move this to the sitemap handler
+     */
+    public static final String DEFAULT_CHILD_PROPERTIES_LOCATION = "config/properties";
 }

Copied: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SitemapNamespaceHandler.java
(from r491219, cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/SitemapNamespaceHandler.java)
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SitemapNamespaceHandler.java?view=diff&rev=491257&p1=cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/SitemapNamespaceHandler.java&r1=491219&p2=cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SitemapNamespaceHandler.java&r2=491257
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/SitemapNamespaceHandler.java
(original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SitemapNamespaceHandler.java
Sat Dec 30 09:31:49 2006
@@ -16,7 +16,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.cocoon.core.container.spring;
+package org.apache.cocoon.spring.configurator.impl;
 
 import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
 
@@ -35,6 +35,6 @@
      * @see org.springframework.beans.factory.xml.NamespaceHandler#init()
      */
     public void init() {
-        registerBeanDefinitionParser("sitemap", new SitemapElementParser());
+        registerBeanDefinitionParser("sitemap", new ChildSettingsElementParser());
     }
 }

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=491257&r1=491256&r2=491257
==============================================================================
--- 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
Sat Dec 30 09:31:49 2006
@@ -18,13 +18,50 @@
 <!-- @version $Id$ -->
 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             targetNamespace="http://cocoon.apache.org/schema/configurator"
-            xmlns:tns="http://cocoon.apache.org/schema/configurator">
+            xmlns:tns="http://cocoon.apache.org/schema/configurator"
+            xmlns="http://cocoon.apache.org/schema/configurator">
 
-    <xsd:element name="settings" type="tns:settingsType"/>
-
-    <xsd:complexType name="settingsType">
+    <xsd:element name="settings">
+      <xsd:complexType>
     	<xsd:attribute name="processorClassName" type="xsd:string" use="optional"></xsd:attribute>
     	<xsd:attribute name="runningMode" type="xsd:string" use="optional"></xsd:attribute>
     	<xsd:attribute name="location" type="xsd:string" use="optional"></xsd:attribute>
-    </xsd:complexType>
+      </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="child-settings">
+      <xsd:complexType>
+    	<xsd:sequence>
+    	    <xsd:element ref="include-beans" minOccurs="0" maxOccurs="unbounded"/>
+    	    <xsd:element ref="include-properties" minOccurs="0" maxOccurs="unbounded"/>
+    	    <xsd:element ref="property" minOccurs="0" maxOccurs="unbounded"/>
+    	</xsd:sequence>
+    	<xsd:attribute name="location" type="xsd:string" use="required"/>
+    	<xsd:attribute name="runningMode" type="xsd:string" use="optional"/>
+    	<xsd:attribute name="useDefaultIncludes" type="xsd:boolean"	use="optional"/>
+      </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="include-beans">
+      <xsd:complexType>
+    	<xsd:attribute name="src" type="xsd:string" use="optional"/>
+    	<xsd:attribute name="dir" type="xsd:string" use="optional"/>
+    	<xsd:attribute name="pattern" type="xsd:string" use="optional"/>
+    	<xsd:attribute name="optional" type="xsd:boolean" use="optional"/>
+      </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="include-properties">
+      <xsd:complexType>
+    	<xsd:attribute name="dir" type="xsd:string" use="required"/>
+      </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="property">
+      <xsd:complexType>
+    	<xsd:attribute name="name" type="xsd:string" use="required"/>
+    	<xsd:attribute name="value" type="xsd:string" use="required"/>
+      </xsd:complexType>
+    </xsd:element>
+
 </xsd:schema>

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java?view=diff&rev=491257&r1=491256&r2=491257
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java
Sat Dec 30 09:31:49 2006
@@ -31,11 +31,11 @@
 import org.apache.avalon.framework.configuration.DefaultConfiguration;
 import org.apache.cocoon.classloader.reloading.Monitor;
 import org.apache.cocoon.configuration.Settings;
-import org.apache.cocoon.core.container.spring.ChildXmlWebApplicationContext;
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.processing.ProcessInfoProvider;
 import org.apache.cocoon.spring.configurator.WebAppContextUtils;
+import org.apache.cocoon.spring.configurator.impl.ChildXmlWebApplicationContext;
 import org.apache.cocoon.util.Deprecation;
 import org.springframework.web.context.WebApplicationContext;
 import org.springframework.web.context.support.WebApplicationContextUtils;
@@ -63,8 +63,8 @@
                                              Properties props) {
         final StringBuffer buffer = new StringBuffer();
         addHeader(buffer);
-        // Child setting for sitemap
-        buffer.append("  <sitemap:sitemap");
+        // Child settings for sitemap
+        buffer.append("  <configurator:child-settings");
         addAttribute(buffer, "location", sitemapLocation);
         addAttribute(buffer, "runningMode", runningMode);
         addAttribute(buffer, "useDefaultIncludes", String.valueOf(useDefaultIncludes));
@@ -73,7 +73,7 @@
             final Iterator i = beanIncludes.iterator();
             while ( i.hasNext() ) {
                 final IncludeInfo info = (IncludeInfo)i.next();
-                buffer.append("    <sitemap:include-beans");
+                buffer.append("    <configurator:include-beans");
                 addAttribute(buffer, "src", info.src);
                 addAttribute(buffer, "dir", info.dir);
                 addAttribute(buffer, "pattern", info.pattern);
@@ -85,7 +85,7 @@
             final Iterator i = propertyIncludes.iterator();
             while ( i.hasNext() ) {
                 final IncludeInfo info = (IncludeInfo)i.next();
-                buffer.append("    <sitemap:include-properties");
+                buffer.append("    <configurator:include-properties");
                 addAttribute(buffer, "dir", info.dir);
                 buffer.append("/>\n");
             }
@@ -94,13 +94,13 @@
             final Iterator kI = props.keySet().iterator();
             while ( kI.hasNext() ) {
                 final String key = (String)kI.next();
-                buffer.append("    <sitemap:property");
+                buffer.append("    <configurator:property");
                 addAttribute(buffer, "name", key.toString());
                 addAttribute(buffer, "value", props.getProperty(key));
                 buffer.append("/>\n");
             }
         }
-        buffer.append("  </sitemap:sitemap>\n");
+        buffer.append("  </configurator:child-settings>\n");
         // Avalon
         buffer.append("  <avalon:sitemap");
         addAttribute(buffer, "location", sitemapLocation);
@@ -117,11 +117,11 @@
         buffer.append("<beans xmlns=\"http://www.springframework.org/schema/beans\"");
         buffer.append(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
         buffer.append(" xmlns:util=\"http://www.springframework.org/schema/util\"");
-        buffer.append(" xmlns:sitemap=\"http://cocoon.apache.org/schema/sitemap\"");
+        buffer.append(" xmlns:configurator=\"http://cocoon.apache.org/schema/configurator\"");
         buffer.append(" xmlns:avalon=\"http://cocoon.apache.org/schema/avalon\"");
         buffer.append(" xsi:schemaLocation=\"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd");
         buffer.append(" http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd");
-        buffer.append(" http://cocoon.apache.org/schema/sitemap http://cocoon.apache.org/schema/sitemap/cocoon-sitemap-1.0.xsd");
+        buffer.append(" http://cocoon.apache.org/schema/configurator http://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.xsd");
         buffer.append(" http://cocoon.apache.org/schema/avalon http://cocoon.apache.org/schema/avalon/cocoon-avalon-1.0.xsd\">\n");
     }
 



Mime
View raw message