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/09/09 20:09:02 UTC

svn commit: r441837 - in /cocoon/trunk: core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/ core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ core/cocoon-core/src/main/java/org/apache/cocoon/core/...

Author: cziegeler
Date: Sat Sep  9 11:09:01 2006
New Revision: 441837

URL: http://svn.apache.org/viewvc?view=rev&rev=441837
Log:
Refactoring: separate between spring and avalon stuff

Added:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SitemapElementParser.java
      - copied, changed from r441648, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PropertiesElementParser.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/xml/dom/DomHelper.java   (with props)
Removed:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PropertiesElementParser.java
Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeBuilder.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
    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/AbstractElementParser.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/SettingsElementParser.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SubSettingsBeanFactoryPostProcessor.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationReader.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java
    cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/core/container/spring/cocoon.xsd
    cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/resources/org/apache/cocoon/maven/deployer/monolithic/WEB-INF/cocoon/cocoon.xconf

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeBuilder.java?view=diff&rev=441837&r1=441836&r2=441837
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeBuilder.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeBuilder.java Sat Sep  9 11:09:01 2006
@@ -59,7 +59,7 @@
     /**
      * Build a processing tree from a <code>Configuration</code> object holding the sitemap program.
      */
-    ProcessingNode build(Configuration config) throws Exception;
+    ProcessingNode build(Configuration config, String location) throws Exception;
 
     /**
      * Return the list of <code>ProcessingNodes</code> part of this tree that are

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java?view=diff&rev=441837&r1=441836&r2=441837
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java Sat Sep  9 11:09:01 2006
@@ -381,7 +381,7 @@
             try {
                 treeBuilder.setProcessor(newProcessor);
 
-                ProcessingNode root = treeBuilder.build(sitemapProgram);
+                ProcessingNode root = treeBuilder.build(sitemapProgram, this.source.getURI());
                 newProcessor.setProcessorData(
                         treeBuilder.getContainer(),
                         root,

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?view=diff&rev=441837&r1=441836&r2=441837
==============================================================================
--- 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 Sat Sep  9 11:09:01 2006
@@ -44,7 +44,6 @@
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.cocoon.Constants;
 import org.apache.cocoon.ProcessingUtil;
-import org.apache.cocoon.components.ContextHelper;
 import org.apache.cocoon.components.LifecycleHelper;
 import org.apache.cocoon.components.source.SourceUtil;
 import org.apache.cocoon.components.treeprocessor.AbstractProcessingNode;
@@ -63,7 +62,6 @@
 import org.apache.cocoon.core.container.spring.Container;
 import org.apache.cocoon.core.container.spring.avalon.AvalonUtils;
 import org.apache.cocoon.core.container.spring.avalon.SitemapHelper;
-import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.generation.Generator;
 import org.apache.cocoon.serialization.Serializer;
 import org.apache.cocoon.sitemap.EnterSitemapEventListener;
@@ -335,14 +333,11 @@
     /**
      * Build a processing tree from a <code>Configuration</code>.
      */
-    public ProcessingNode build(Configuration tree) throws Exception {
-        // get the request
-        final Request request = ContextHelper.getRequest(this.context);
+    public ProcessingNode build(Configuration tree, String location) throws Exception {
         this.itsContainer = SitemapHelper.createContainer(
-                                               tree, 
-                                               (ServletContext)this.context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT), 
-                                               this.processor.getSourceResolver(), 
-                                               request);
+                                               tree,
+                                               location,
+                                               (ServletContext)this.context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT));
         final Context itsContext = (Context)this.itsContainer.getBeanFactory().getBean(ProcessingUtil.CONTEXT_ROLE);
         // The namespace used in the whole sitemap is the one of the root
         // element

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=441837&r1=441836&r2=441837
==============================================================================
--- 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 Sep  9 11:09:01 2006
@@ -16,6 +16,9 @@
  */
 package org.apache.cocoon.core.container.spring;
 
+import java.io.IOException;
+import java.util.Arrays;
+
 import org.apache.cocoon.configuration.Settings;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -26,6 +29,10 @@
 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;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.ResourceLoader;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
 
 /**
  * This is a base class for all bean definition parser used in Cocoon.
@@ -156,5 +163,65 @@
         final RootBeanDefinition beanDef = this.createBeanDefinition(componentClass, initMethod, requiresSettings);
 
         this.register(beanDef, beanName, registry);
+    }
+
+    /**
+     * Handle include for spring bean configurations.
+     * @throws ConfigurationException
+     */
+    protected void handleBeanInclude(ParserContext parserContext,
+                                     String         src,
+                                     String         dir,
+                                     String         pattern,
+                                     boolean optional)
+    throws Exception {
+        final ResourceLoader resourceLoader = parserContext.getReaderContext().getReader().getResourceLoader();
+        PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(resourceLoader);
+        final String includeURI = src;
+        String directoryURI = null;
+        if (includeURI == null) {
+            // check for directories
+            directoryURI = dir;
+        }
+        if (includeURI == null && directoryURI == null) {
+            throw new Exception("Include statement must either have a 'src' or 'dir' attribute.");
+        }
+
+        if (includeURI != null) {
+            Resource rsrc = null;
+            try {
+                rsrc = resourceLoader.getResource(includeURI);
+
+                this.handleImport(parserContext, rsrc.getURL().toExternalForm());
+            } catch (Exception e) {
+                throw new Exception("Cannot load '" + includeURI + "'.", e);
+            }
+
+        } else {
+            // test if directory exists
+            Resource dirResource = resourceLoader.getResource(directoryURI);
+            if ( dirResource.exists() ) {
+                try {
+                    Resource[] resources = resolver.getResources(directoryURI + '/' + pattern);
+                    if ( resources != null ) {
+                        Arrays.sort(resources, AbstractSettingsBeanFactoryPostProcessor.getResourceComparator());
+                        for(int i=0; i < resources.length; i++) {
+                            this.handleImport(parserContext, resources[i].getURL().toExternalForm());
+                        }
+                    }
+                } catch (IOException ioe) {
+                    throw new Exception("Unable to read configurations from " + directoryURI);
+                }
+            } else {
+                if ( !optional ) {
+                    throw new Exception("Directory '" + directoryURI + "' does not exist.");
+                }
+            }
+        }
+    }
+
+    protected void handleImport(ParserContext parserContext, String uri) {
+        final ResourceLoader resourceLoader = parserContext.getReaderContext().getReader().getResourceLoader();
+        parserContext.getDelegate().getReaderContext().getReader().loadBeanDefinitions(resourceLoader.getResource(uri));        
     }
 }

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?view=diff&rev=441837&r1=441836&r2=441837
==============================================================================
--- 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 Sat Sep  9 11:09:01 2006
@@ -37,6 +37,6 @@
      */
     public void init() {
         registerBeanDefinitionParser("settings", new SettingsElementParser());
-        registerBeanDefinitionParser("properties", new PropertiesElementParser());
+        registerBeanDefinitionParser("sitemap", new SitemapElementParser());
     }
 }

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=441837&r1=441836&r2=441837
==============================================================================
--- 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 Sep  9 11:09:01 2006
@@ -17,6 +17,7 @@
 package org.apache.cocoon.core.container.spring;
 
 import org.apache.cocoon.configuration.Settings;
+import org.springframework.beans.factory.BeanDefinitionStoreException;
 import org.springframework.beans.factory.config.BeanDefinition;
 import org.springframework.beans.factory.xml.ParserContext;
 import org.w3c.dom.Element;
@@ -38,6 +39,11 @@
      * @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) {
+        try {
+            this.handleBeanInclude(parserContext, null, "/WEB-INF/cocoon/spring", "*.xml", true);
+        } catch (Exception e) {
+            throw new BeanDefinitionStoreException("Unable to read spring configurations.",e);
+        }
         String componentClassName = SettingsBeanFactoryPostProcessor.class.getName();
         String value = element.getAttribute(PROCESSOR_CLASS_NAME_ATTR);
         if ( value != null && value.trim().length() > 0 ) {

Copied: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SitemapElementParser.java (from r441648, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PropertiesElementParser.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=441837&p1=cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PropertiesElementParser.java&r1=441648&p2=cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SitemapElementParser.java&r2=441837
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/PropertiesElementParser.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SitemapElementParser.java Sat Sep  9 11:09:01 2006
@@ -16,32 +16,150 @@
  */
 package org.apache.cocoon.core.container.spring;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
 import org.apache.cocoon.configuration.Settings;
+import org.apache.cocoon.util.Deprecation;
+import org.apache.cocoon.xml.dom.DomHelper;
+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.springframework.core.io.Resource;
+import org.springframework.core.io.ResourceLoader;
+import org.w3c.dom.Document;
 import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
 
 /**
- * Add a bean definition for the settings object of a child context to the bean factory.
+ * Add a bean definition for the settings object of a child context to the bean factory
+ * and process all includes of spring configurations.
  *
  * @see CocoonNamespaceHandler
  * @see SubSettingsBeanFactoryPostProcessor
  * @version $Id$
  * @since 2.2
  */
-public class PropertiesElementParser extends AbstractElementParser {
+public class SitemapElementParser extends AbstractElementParser {
+
+    private static final String DEFAULT_CONFIG_SPRING = "config/spring";
+
+    protected Element readSitemap(String location, ResourceLoader resourceLoader)
+    throws Exception {
+        // read the sitemap
+        final Resource sitemapResource = resourceLoader.getResource(location);
+        final InputSource is = new InputSource(sitemapResource.getInputStream());
+        is.setSystemId(sitemapResource.getURL().toExternalForm());
+        final Document doc = DomHelper.parse(is);
+        final Element rootElement = doc.getDocumentElement();
+        return rootElement;
+    }
+
+    protected Element getComponentsElement(Element rootElement) {
+        final Element componentsElement = DomHelper.getChildElement(rootElement, rootElement.getNamespaceURI(), "components");
+        return componentsElement;
+    }
+
+    protected boolean isUseDefaultIncludes(Element componentsElement) {
+        if ( componentsElement != null ) {
+            return DomHelper.getAttributeAsBoolean(componentsElement, "use-default-includes", true);
+        }
+        return true;
+    }
+
+    protected List getPropertyIncludes(Element componentsElement)
+    throws Exception {
+        List propertyDirs = null;
+        if ( componentsElement != null ) {
+            final Element[] propertyDirConfigs = DomHelper.getChildElements(componentsElement, componentsElement.getNamespaceURI(), "include-properties");
+            if ( propertyDirConfigs != null && propertyDirConfigs.length > 0 ) {
+                propertyDirs = new ArrayList();
+                for(int i=0; i < propertyDirConfigs.length; i++) {
+                    propertyDirs.add(DomHelper.getAttribute(propertyDirConfigs[i], "dir"));
+                }
+            }
+        }
+        return propertyDirs;        
+    }
+
+    /**
+     * compatibility with 2.1.x - check for global variables in sitemap
+     * TODO - This will be removed in later versions!
+     */
+    protected Properties getGlobalSitemapVariables(Element rootElement)
+    throws Exception {
+        Properties variables = null;
+        final Element pipelines = DomHelper.getChildElement(rootElement, rootElement.getNamespaceURI(), "pipelines");
+        if ( pipelines != null ) {
+            final Element configs = DomHelper.getChildElement(pipelines, pipelines.getNamespaceURI(), "component-configurations");
+            if ( configs != null ) {
+                Deprecation.logger.warn("The 'component-configurations' section in the sitemap is deprecated. Please check for alternatives.");
+                variables = new Properties();
+                // now check for global variables - if any other element occurs: throw exception
+                Element[] children = DomHelper.getChildElements(configs, configs.getNamespaceURI());
+                for(int i=0; i<children.length; i++) {
+                    if ( "global-variables".equals(children[i].getLocalName()) ) {
+                        Element[] variableElements = DomHelper.getChildElements(children[i], children[i].getNamespaceURI());
+                        for(int v=0; v<variableElements.length; v++) {
+                            variables.setProperty(variableElements[v].getLocalName(), DomHelper.getElementText(variableElements[v]));
+                        }
+                    } else {
+                        throw new Exception("Component configurations in the sitemap are not allowed for component: " + children[i].getLocalName());
+                    }
+                }
+            }
+        }
+        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 location = element.getAttribute("location");
+        final ResourceLoader resourceLoader = parserContext.getReaderContext().getReader().getResourceLoader();
         RootBeanDefinition def =  this.createBeanDefinition(SubSettingsBeanFactoryPostProcessor.class.getName(),
                 "init",
                 false);
-        def.getPropertyValues().addPropertyValue("sitemapUri", element.getAttribute("sitemapUri"));
-        def.getPropertyValues().addPropertyValue("useDefaultIncludes", element.getAttribute("useDefaultIncludes"));
+        def.getPropertyValues().addPropertyValue("location", location);
+        try {
+            final Element rootElement = this.readSitemap(location, resourceLoader);
+            final Element componentsElement = this.getComponentsElement(rootElement);
+            final boolean useDefaultIncludes = this.isUseDefaultIncludes(componentsElement);
+            def.getPropertyValues().addPropertyValue("useDefaultIncludes", Boolean.valueOf(useDefaultIncludes));
+
+            final Properties globalSitemapVariables = this.getGlobalSitemapVariables(rootElement);
+            if ( globalSitemapVariables != null ) {
+                def.getPropertyValues().addPropertyValue("globalSitemapVariables", globalSitemapVariables);                
+            }
+
+            final List includes = this.getPropertyIncludes(componentsElement);
+            if ( includes != null ) {
+                def.getPropertyValues().addPropertyValue("directories", includes);
+            }
+
+            if ( useDefaultIncludes ) {
+                this.handleBeanInclude(parserContext, null, DEFAULT_CONFIG_SPRING, "*.xml", true);
+            }
+            // search for includes
+            if ( componentsElement != null ) {
+                final Element[] includeElements = DomHelper.getChildElements(componentsElement, componentsElement.getNamespaceURI(), "include-beans");
+                if ( includeElements != null ) {
+                    for(int i = 0 ; i < includeElements.length; i++ ) {
+                        final String src = DomHelper.getAttribute(includeElements[i], "src", null);
+                        final String dir = DomHelper.getAttribute(includeElements[i], "dir", null);
+                        final String pattern = DomHelper.getAttribute(includeElements[i], "pattern", "*.xml");
+                        final boolean optional = DomHelper.getAttributeAsBoolean(includeElements[i], "optional", false);
+                        this.handleBeanInclude(parserContext, src, dir, pattern, optional);
+                    }
+                }
+            }
+        } catch (Exception e) {
+            throw new BeanDefinitionStoreException("Unable to process sitemap at '" + location + "'.",e);
+        }
         this.register(def, Settings.ROLE, parserContext.getRegistry());
-        return def;
+        return null;
     }
 }

Modified: 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?view=diff&rev=441837&r1=441836&r2=441837
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SubSettingsBeanFactoryPostProcessor.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/SubSettingsBeanFactoryPostProcessor.java Sat Sep  9 11:09:01 2006
@@ -39,7 +39,7 @@
 
     private static final String DEFAULT_CONFIG_PROPERTIES = "config/properties";
 
-    protected String sitemapUri;
+    protected String location;
 
     protected List directories;
 
@@ -48,7 +48,7 @@
     protected Properties globalSitemapVariables;    
 
     /**
-     * Initialize this processor.
+     * Initialize this settings.
      * Setup the settings object.
      * @throws Exception
      */
@@ -62,6 +62,10 @@
         this.settings.makeReadOnly();
     }
 
+    public void setLocation(String sitemapUri) {
+        this.location = sitemapUri;
+    }
+
     public void setDirectories(List directories) {
         this.directories = directories;
     }
@@ -70,10 +74,6 @@
         this.globalSitemapVariables = globalSitemapVariables;
     }
 
-    public void setSitemapUri(String sitemapUri) {
-        this.sitemapUri = sitemapUri;
-    }
-
     public void setUseDefaultIncludes(boolean useDefaultIncludes) {
         this.useDefaultIncludes = useDefaultIncludes;
     }
@@ -103,13 +103,13 @@
         final MutableSettings s = new MutableSettings(parent);
 
         // read properties from default includes
-        if ( useDefaultIncludes ) {
+        if ( this.useDefaultIncludes ) {
             this.readProperties(DEFAULT_CONFIG_PROPERTIES, properties);
             // read all properties from the mode dependent directory
             this.readProperties(DEFAULT_CONFIG_PROPERTIES + '/' + mode, properties);    
         }
 
-        if ( directories != null ) {
+        if ( this.directories != null ) {
             final Iterator i = directories.iterator();
             while ( i.hasNext() ) {
                 final String directory = (String)i.next();
@@ -123,7 +123,7 @@
         // Next look for a custom property provider in the parent bean factory
         if (parentBeanFactory.containsBean(PropertyProvider.ROLE) ) {
             try {
-                final Resource r = this.resourceLoader.getResource(this.sitemapUri);
+                final Resource r = this.resourceLoader.getResource(this.location);
                 final PropertyProvider provider = (PropertyProvider)parentBeanFactory.getBean(PropertyProvider.ROLE);
                 final Properties providedProperties = provider.getProperties(s, mode, r.getURL().toExternalForm());
                 if ( providedProperties != null ) {

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationReader.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationReader.java?view=diff&rev=441837&r1=441836&r2=441837
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationReader.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationReader.java Sat Sep  9 11:09:01 2006
@@ -298,7 +298,11 @@
             if ("include".equals(componentName)) {
                 this.handleInclude(contextURI, loadedURIs, componentConfig);
             } else if ( "include-beans".equals(componentName) ) {
-                this.handleBeanInclude(contextURI, componentConfig);
+                // we ignore include-beans if this is a child context as this has already been
+                // processed by the sitemap element
+                if ( this.isRootContext ) {
+                    this.handleBeanInclude(contextURI, componentConfig);
+                }
                 // we ignore include-properties if this is a child context
             } else if ( this.isRootContext || !"include-properties".equals(componentName) ) {
                 // Component declaration, add it to list

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java?view=diff&rev=441837&r1=441836&r2=441837
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapHelper.java Sat Sep  9 11:09:01 2006
@@ -16,11 +16,7 @@
  */
 package org.apache.cocoon.core.container.spring.avalon;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
+import java.io.File;
 
 import javax.servlet.ServletContext;
 
@@ -32,17 +28,18 @@
 import org.apache.cocoon.core.container.spring.CocoonRequestAttributes;
 import org.apache.cocoon.core.container.spring.CocoonWebApplicationContext;
 import org.apache.cocoon.core.container.spring.Container;
+import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Request;
-import org.apache.cocoon.util.Deprecation;
-import org.apache.excalibur.source.Source;
+import org.apache.cocoon.processing.ProcessInfoProvider;
 import org.apache.excalibur.source.SourceResolver;
 import org.springframework.beans.factory.BeanFactory;
 import org.springframework.web.context.WebApplicationContext;
 import org.springframework.web.context.scope.RequestAttributes;
+import org.springframework.web.context.support.WebApplicationContextUtils;
 
 
 /**
- * FIXME - This class can only handle the case if the sitemap is named "sitemap.xmap"!!!
+ *
  * @version $Id$
  * @since 2.2
  */
@@ -54,48 +51,18 @@
 
     private static final String DEFAULT_CONFIG_XCONF  = "config/xconf";
 
-    private static final String DEFAULT_CONFIG_SPRING = "config/spring";
-
     protected static String createDefinition(String     uriPrefix,
-                                             boolean    useDefaultIncludes,
-                                             List       includes,
-                                             Properties globalVariables,
-                                             String     sitemapUri) {
+                                             String     sitemapLocation) {
         final StringBuffer buffer = new StringBuffer();
         addHeader(buffer);
         // Settings
-        buffer.append("  <cocoon:properties useDefaultIncludes=\"");
-        buffer.append(useDefaultIncludes);
-        buffer.append("\" sitemapUri=\"");
-        buffer.append(sitemapUri);
-        buffer.append("\">\n");
-        if ( includes != null && includes.size() > 0 ) {
-            buffer.append("    <property name=\"directories\">\n      <list>\n");
-            final Iterator i = includes.iterator();
-            while ( i.hasNext() ) {
-                final String current = (String)i.next();
-                buffer.append("        <value>");
-                buffer.append(current);
-                buffer.append("</value>\n");
-            }
-            buffer.append("      </list>\n    </property>");            
-        }
-        if ( globalVariables != null && globalVariables.size() > 0 ) {
-            buffer.append("    <property name=\"globalSitemapVariables\">\n      <props>\n");
-            final Iterator i = globalVariables.entrySet().iterator();
-            while ( i.hasNext() ) {
-                final Map.Entry current = (Map.Entry)i.next();
-                buffer.append("        <prop key=\"");
-                buffer.append(current.getKey().toString());
-                buffer.append("\">");
-                buffer.append(current.getValue().toString());
-                buffer.append("</prop>\n");
-            }
-            buffer.append("      </props>\n    </property>\n");
-        }
-        buffer.append("  </cocoon:properties>\n");
+        buffer.append("  <cocoon:sitemap location=\"");
+        buffer.append(sitemapLocation);
+        buffer.append("\"/>\n");
         // Avalon
-        buffer.append("  <avalon:sitemap location=\"sitemap.xmap\" uriPrefix=\"");
+        buffer.append("  <avalon:sitemap location=\"");
+        buffer.append(sitemapLocation);
+        buffer.append("\" uriPrefix=\"");
         buffer.append(uriPrefix);
         buffer.append("\"/>\n");
         addFooter(buffer);
@@ -106,22 +73,6 @@
         return config.getChild("components").getAttributeAsBoolean("use-default-includes", true);
     }
 
-    protected static List getPropertyIncludes(Configuration config)
-    throws ConfigurationException {
-        List propertyDirs = null;
-        final Configuration componentConfig = config.getChild("components", false);
-        if ( componentConfig != null ) {
-            Configuration[] propertyDirConfigs = componentConfig.getChildren("include-properties");
-            if ( propertyDirConfigs.length > 0 ) {
-                propertyDirs = new ArrayList();
-                for(int i=0; i < propertyDirConfigs.length; i++) {
-                    propertyDirs.add(propertyDirConfigs[i].getAttribute("dir"));
-                }
-            }
-        }
-        return propertyDirs;        
-    }
-
     public static Configuration createSitemapConfiguration(Configuration config)
     throws ConfigurationException {
         Configuration componentConfig = config.getChild("components", false);
@@ -164,15 +115,6 @@
                 includeElement.setAttribute("pattern", "*.xconf");
                 includeElement.setAttribute("optional", "true");
                 c.addChild(includeElement);
-
-                includeElement = new DefaultConfiguration("include-beans", 
-                                                          c.getLocation(),
-                                                          c.getNamespace(),
-                                                          "");
-                includeElement.setAttribute("dir", DEFAULT_CONFIG_SPRING);
-                includeElement.setAttribute("pattern", "*.xml");
-                includeElement.setAttribute("optional", "true");
-                c.addChild(includeElement);
             }
             componentConfig = c;
         }
@@ -195,44 +137,21 @@
         buffer.append("</beans>\n");
     }
 
-    /**
-     * compatibility with 2.1.x - check for global variables in sitemap
-     * TODO - This will be removed in later versions!
-     */
-    protected static Properties getGlobalSitemapVariables(Configuration tree)
-    throws ConfigurationException {
-        // compatibility with 2.1.x - check for global variables in sitemap
-        // TODO - This will be removed in later versions!
-        Properties globalSitemapVariables = null;
-        if ( tree.getChild("pipelines").getChild("component-configurations", false) != null ) {
-            Deprecation.logger.warn("The 'component-configurations' section in the sitemap is deprecated. Please check for alternatives.");
-            globalSitemapVariables = new Properties();
-            // now check for global variables - if any other element occurs: throw exception
-            Configuration[] children = tree.getChild("pipelines").getChild("component-configurations").getChildren();
-            for(int i=0; i<children.length; i++) {
-                if ( "global-variables".equals(children[i].getName()) ) {
-                    Configuration[] variables = children[i].getChildren();
-                    for(int v=0; v<variables.length; v++) {
-                        globalSitemapVariables.setProperty(variables[v].getName(), variables[v].getValue());
-                    }
-               } else {
-                    throw new ConfigurationException("Component configurations in the sitemap are not allowed for component: " + children[i].getName());
-                }
-            }
-        }
-        return globalSitemapVariables;
-    }
-
     public static Container createContainer(Configuration  config,
-                                            ServletContext servletContext,
-                                            SourceResolver sitemapResolver,
-                                            Request        request)
+                                            String         sitemapLocation,
+                                            ServletContext servletContext)
     throws Exception {
+        // let's get the root container first
+        final WebApplicationContext rootContext = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
+        final ProcessInfoProvider infoProvider = (ProcessInfoProvider) rootContext.getBean(ProcessInfoProvider.ROLE);
+        final Request request = ObjectModelHelper.getRequest(infoProvider.getObjectModel());
+        final SourceResolver sitemapResolver = (SourceResolver)rootContext.getBean(SourceResolver.ROLE);
         // let's determine our context url
-        Source s = sitemapResolver.resolveURI("a");
-        String contextUrl = s.getURI();
-        sitemapResolver.release(s);
-        contextUrl = contextUrl.substring(0, contextUrl.length() - 1);
+        int pos = sitemapLocation.lastIndexOf('/');
+        if ( sitemapLocation.lastIndexOf(File.separatorChar) > pos ) {
+            pos = sitemapLocation.lastIndexOf(File.separatorChar);
+        }
+        final String contextUrl = sitemapLocation.substring(0, pos + 1);
 
         final RequestAttributes attr = new CocoonRequestAttributes(request);
         final Container container = Container.getCurrentContainer(servletContext, attr);
@@ -245,13 +164,8 @@
         // get classloader
         final ClassLoader classloader = createClassLoader(parentContext, config, servletContext, sitemapResolver);
         // create root bean definition
-        final boolean useDefaultIncludes = isUsingDefaultIncludes(config);
-        final List propIncludes = getPropertyIncludes(config);
         final String definition = createDefinition(request.getSitemapURIPrefix(),
-                                                   useDefaultIncludes,
-                                                   propIncludes,
-                                                   getGlobalSitemapVariables(config),
-                                                   "sitemap.xmap");
+                                                   sitemapLocation.substring(pos+1));
         PARENT_CONTEXT.set(parentContext);
         try {
             final CocoonWebApplicationContext context = new CocoonWebApplicationContext(classloader,

Added: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/xml/dom/DomHelper.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/xml/dom/DomHelper.java?view=auto&rev=441837
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/xml/dom/DomHelper.java (added)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/xml/dom/DomHelper.java Sat Sep  9 11:09:01 2006
@@ -0,0 +1,363 @@
+/*
+ * Copyright 1999-2005 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.xml.dom;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.apache.cocoon.util.location.Location;
+import org.apache.cocoon.util.location.LocationAttributes;
+import org.apache.cocoon.xml.SaxBuffer;
+import org.apache.commons.lang.BooleanUtils;
+import org.apache.excalibur.xml.sax.XMLizable;
+import org.w3c.dom.Attr;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.XMLReader;
+
+/**
+ * Helper class to create and retrieve information from DOM-trees. It provides
+ * some functionality comparable to what's found in Avalon's Configuration
+ * objects. These lasts one could however not be used by Cocoon Forms because they
+ * don't provide an accurate model of an XML file (no mixed content,
+ * no namespaced attributes, no namespace declarations, ...).
+ *
+ * <p>This class depends specifically on the Xerces DOM implementation to be
+ * able to provide information about the location of elements in their source
+ * XML file. See the {@link #getLocation(Element)} method.
+ * @version $Id$
+ */
+public class DomHelper {
+
+    protected static final SAXParserFactory saxFactory = SAXParserFactory.newInstance();
+    static {
+        saxFactory.setNamespaceAware(true);
+        saxFactory.setValidating(false);
+    }
+
+    public static final String XMLNS_URI = XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
+
+    /**
+     * Creates a W3C Document that remembers the location of each element in
+     * the source file. The location of element nodes can then be retrieved
+     * using the {@link #getLocation(Element)} method.
+     *
+     * @param inputSource the inputSource to read the document from
+     */
+    public static Document parse(InputSource inputSource)
+    throws SAXException, SAXNotSupportedException, IOException {
+        try {
+            final XMLReader parser = saxFactory.newSAXParser().getXMLReader();
+            final DOMBuilder builder = new DOMBuilder();
+            
+            // Enhance the sax stream with location information
+            final ContentHandler locationHandler = new LocationAttributes.Pipe(builder);
+            parser.setContentHandler(locationHandler);
+    
+            parser.parse(inputSource);
+            
+            return builder.getDocument();
+        } catch (ParserConfigurationException pce) {
+            throw new SAXException(pce);
+        }
+    }
+
+    public static Location getLocationObject(Element element) {
+        return LocationAttributes.getLocation(element);
+    }
+
+    /**
+     * Retrieves the location of an element node in the source file from which
+     * the Document was created. This will only work for Document's created
+     * with the method {@link #parse(InputSource, ServiceManager)} of this class.
+     */
+    public static String getLocation(Element element) {
+        return LocationAttributes.getLocationString(element);
+    }
+    
+    public static String getSystemIdLocation(Element element) {
+        return LocationAttributes.getURI(element);
+    }
+    
+    public static int getLineLocation(Element element) {
+        return LocationAttributes.getLine(element);
+    }
+
+    public static int getColumnLocation(Element element) {
+        return LocationAttributes.getColumn(element);
+    }
+
+    /**
+     * Returns all Element children of an Element that belong to the given
+     * namespace.
+     */
+    public static Element[] getChildElements(Element element, String namespace) {
+        ArrayList elements = new ArrayList();
+        NodeList nodeList = element.getChildNodes();
+        for (int i = 0; i < nodeList.getLength(); i++) {
+            Node node = nodeList.item(i);
+            if (node instanceof Element
+                    && namespace.equals(node.getNamespaceURI()))
+                elements.add(node);
+        }
+        return (Element[])elements.toArray(new Element[elements.size()]);
+    }
+
+    /**
+     * Returns all Element children of an Element that belong to the given
+     * namespace and have the given local name.
+     */
+    public static Element[] getChildElements(Element element,
+            String namespace, String localName) {
+        ArrayList elements = new ArrayList();
+        NodeList nodeList = element.getChildNodes();
+        for (int i = 0; i < nodeList.getLength(); i++) {
+            Node node = nodeList.item(i);
+            if (node instanceof Element
+                    && namespace.equals(node.getNamespaceURI()) 
+                    && localName.equals(node.getLocalName())) {
+                elements.add(node);
+            }
+        }
+        return (Element[])elements.toArray(new Element[elements.size()]);
+    }
+
+    /**
+     * Returns the first child element with the given namespace and localName,
+     * or null if there is no such element.
+     */
+    public static Element getChildElement(Element element, String namespace, 
+            String localName) {
+        Element node = null;
+        try {
+            node = getChildElement(element, namespace, localName, false);
+        } catch (Exception e) {
+            node = null;
+        }
+        return node;
+    }
+
+    /**
+     * Returns the first child element with the given namespace and localName,
+     * or null if there is no such element and required flag is unset or
+     * throws an Exception if the "required" flag is set.
+     */
+    public static Element getChildElement(Element element, String namespace, 
+            String localName, boolean required) throws Exception {
+        NodeList nodeList = element.getChildNodes();
+        for (int i = 0; i < nodeList.getLength(); i++) {
+            Node node = nodeList.item(i);
+            if (node instanceof Element
+                    && namespace.equals(node.getNamespaceURI()) 
+                    && localName.equals(node.getLocalName())) {
+                return (Element)node;
+            }
+        }
+        if (required) {
+            throw new Exception("Missing element \"" + localName +
+                    "\" as child of element \"" + element.getTagName() + 
+                    "\" at " + DomHelper.getLocation(element));
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Returns the value of an element's attribute, but throws an exception
+     * if the element has no such attribute.
+     */
+    public static String getAttribute(Element element, String attributeName)
+            throws Exception {
+        String attrValue = element.getAttribute(attributeName);
+        if (attrValue.length() == 0) {
+            throw new Exception("Missing attribute \"" + attributeName + 
+                    "\" on element \"" + element.getTagName() + 
+                    "\" at " + getLocation(element));
+        }
+        return attrValue;
+    }
+
+    /**
+     * Returns the value of an element's attribute, or a default value if the 
+     * element has no such attribute.
+     */
+    public static String getAttribute(Element element, String attributeName, 
+            String defaultValue) {
+        String attrValue = element.getAttribute(attributeName);
+        if (attrValue.length() == 0) {
+            return defaultValue;
+        }
+        return attrValue;
+    }
+
+    public static int getAttributeAsInteger(Element element, 
+            String attributeName) throws Exception {
+        String attrValue = getAttribute(element, attributeName);
+        try {
+            return Integer.parseInt(attrValue);
+        } catch (NumberFormatException e) {
+            throw new Exception("Cannot parse the value \"" + attrValue + 
+                    "\" as an integer in the attribute \"" + attributeName + 
+                    "\" on the element \"" + element.getTagName() + 
+                    "\" at " + getLocation(element));
+        }
+    }
+
+    public static int getAttributeAsInteger(Element element, 
+            String attributeName, int defaultValue) throws Exception {
+        String attrValue = element.getAttribute(attributeName);
+        if (attrValue.length() == 0) {
+            return defaultValue;
+        } else {
+            try {
+                return Integer.parseInt(attrValue);
+            } catch (NumberFormatException e) {
+                throw new Exception("Cannot parse the value \"" + attrValue + 
+                        "\" as an integer in the attribute \"" + 
+                        attributeName + "\" on the element \"" +
+                        element.getTagName() + "\" at " +
+                        getLocation(element));
+            }
+        }
+    }
+
+    public static boolean getAttributeAsBoolean(Element element, 
+                String attributeName, boolean defaultValue) {
+        String attrValue = element.getAttribute(attributeName);
+        Boolean result;
+        try {
+            result = BooleanUtils.toBooleanObject(attrValue, "true", "false", null);
+        } catch (IllegalArgumentException iae) {
+            result = null;
+        }
+        if (result != null) {
+            return result.booleanValue();
+        }
+        try {
+            result = BooleanUtils.toBooleanObject(attrValue, "yes", "no", null);
+        } catch (IllegalArgumentException iae) {
+            result = null;
+        }
+        if (result != null) {
+            return result.booleanValue();
+        }
+        return defaultValue;    
+    }
+
+    public static String getElementText(Element element) {
+        StringBuffer value = new StringBuffer();
+        NodeList nodeList = element.getChildNodes();
+        for (int i = 0; i < nodeList.getLength(); i++) {
+            Node node = nodeList.item(i);
+            if (node instanceof Text || node instanceof CDATASection) {
+                value.append(node.getNodeValue());
+            }
+        }
+        return value.toString();
+    }
+
+    /**
+     * Returns the content of the given Element as an object implementing the
+     * XMLizable interface. Practically speaking, the implementation uses the
+     * {@link SaxBuffer} class. The XMLizable object will be a standalone blurb
+     * of SAX events, not producing start/endDocument calls and containing all
+     * necessary namespace declarations.
+     */
+    public static XMLizable compileElementContent(Element element) {
+        // Remove location information
+        LocationAttributes.remove(element, true);
+
+        SaxBuffer saxBuffer = new SaxBuffer();
+        DOMStreamer domStreamer = new DOMStreamer();
+        domStreamer.setContentHandler(saxBuffer);
+
+        NodeList childNodes = element.getChildNodes();
+        for (int i = 0; i < childNodes.getLength(); i++) {
+            try {
+                domStreamer.stream(childNodes.item(i));
+            } catch (SAXException e) {
+                // It's unlikely that an exception will occur here,
+                // so use a runtime exception
+                throw new RuntimeException(
+                        "Error in DomHelper.compileElementContent: " + 
+                        e.toString());
+            }
+        }
+        return saxBuffer;
+    }
+
+    public static Map getLocalNSDeclarations(Element elm) {
+        return addLocalNSDeclarations(elm, null);
+    }
+    
+    private static Map addLocalNSDeclarations(Element elm, Map nsDeclarations) {
+        NamedNodeMap atts = elm.getAttributes();
+        int attsSize = atts.getLength();
+
+        for (int i = 0; i < attsSize; i++)
+        {
+            Attr attr = (Attr)atts.item(i);
+            if (XMLNS_URI.equals(attr.getNamespaceURI()))
+            {
+                String nsUri = attr.getValue();
+                String pfx = attr.getLocalName();
+                if (nsDeclarations == null)
+                    nsDeclarations = new HashMap();
+                nsDeclarations.put(nsUri, pfx);
+            }
+        }        
+        return nsDeclarations;    }
+    
+    public static Map getInheritedNSDeclarations(Element elm) {
+        List ancestorsAndSelf = new LinkedList();
+        Element current = elm;
+        while (current != null) {
+            ancestorsAndSelf.add(current);
+            Node parent = current.getParentNode();
+            if (parent.getNodeType() == Node.ELEMENT_NODE)
+                current = (Element)parent;
+            else 
+                current = null;
+        }
+        
+        Map nsDeclarations = null;
+        ListIterator iter = ancestorsAndSelf.listIterator(ancestorsAndSelf.size());
+        while (iter.hasPrevious()) {
+            Element element = (Element) iter.previous();
+            nsDeclarations = addLocalNSDeclarations(element, nsDeclarations);
+        }
+        
+        return nsDeclarations;
+    }
+}

Propchange: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/xml/dom/DomHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/xml/dom/DomHelper.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?view=diff&rev=441837&r1=441836&r2=441837
==============================================================================
--- 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 Sat Sep  9 11:09:01 2006
@@ -24,13 +24,8 @@
     	<xsd:attribute name="processorClassName" type="xsd:string" use="optional"></xsd:attribute>
     </xsd:complexType>
 
-    <xsd:element name="properties" type="tns:propertiesType"/>
-    <xsd:complexType name="propertiesType">
-     <xsd:complexContent>
-       <xsd:extension base="xsd:anyType">
-         <xsd:attribute name="useDefaultIncludes" type="xsd:string" use="optional"></xsd:attribute>
-         <xsd:attribute name="sitemapUri" type="xsd:string" use="required"></xsd:attribute>
-       </xsd:extension>
-      </xsd:complexContent>
+    <xsd:element name="sitemap" type="tns:sitemapType"/>
+    <xsd:complexType name="sitemapType">
+         <xsd:attribute name="location" type="xsd:string" use="required"></xsd:attribute>
     </xsd:complexType>
 </xsd:schema>

Modified: cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/resources/org/apache/cocoon/maven/deployer/monolithic/WEB-INF/cocoon/cocoon.xconf
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/resources/org/apache/cocoon/maven/deployer/monolithic/WEB-INF/cocoon/cocoon.xconf?view=diff&rev=441837&r1=441836&r2=441837
==============================================================================
--- cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/resources/org/apache/cocoon/maven/deployer/monolithic/WEB-INF/cocoon/cocoon.xconf (original)
+++ cocoon/trunk/tools/cocoon-block-deployer/cocoon-deployer-plugin/src/main/resources/org/apache/cocoon/maven/deployer/monolithic/WEB-INF/cocoon/cocoon.xconf Sat Sep  9 11:09:01 2006
@@ -34,12 +34,6 @@
       +-->
   <include dir="context://WEB-INF/cocoon/sitemap-additions" pattern="*.xmap"/>
   
-  <!--+
-      | Include Spring beans definition files ending with ".xml" from
-      | the spring directory.
-      +-->
-  <include-beans dir="context://WEB-INF/cocoon/spring" pattern="*.xml"/>
-
   $devblocks:{ devblock |
     $if(devblock.springConfPath)$
     <include-beans dir="$devblock.springConfPath$" pattern="*.xml"/>