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 2007/02/20 12:24:12 UTC

svn commit: r509512 - in /cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src: changes/ main/java/org/apache/cocoon/spring/configurator/impl/ main/resources/META-INF/ main/resources/org/apache/cocoon/spring/configurator/schema/

Author: cziegeler
Date: Tue Feb 20 03:24:10 2007
New Revision: 509512

URL: http://svn.apache.org/viewvc?view=rev&rev=509512
Log:
Add dynamic bean map that collects all configured beans of a given type.

Added:
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMap.java   (with props)
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMapElementParser.java   (with props)
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.1.xsd   (with props)
Modified:
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/changes/changes.xml
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractElementParser.java
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsBeanFactoryPostProcessor.java
    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/resources/META-INF/spring.schemas

Modified: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/changes/changes.xml?view=diff&rev=509512&r1=509511&r2=509512
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/changes/changes.xml (original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/changes/changes.xml Tue Feb 20 03:24:10 2007
@@ -24,6 +24,12 @@
     +-->
 <document>
   <body>
+    <release version="1.0.1-M1" date="2007-00-00" description="unreleased">  
+     <action dev="cziegeler" type="add">
+       Add a bean map that collects all beans from the Spring context
+       conforming to a specified type.
+     </action>
+    </release>
     <release version="1.0.0-M1" date="2007-00-00" description="unreleased">  
      <action dev="cziegeler" type="add">
         Improved the DefaultBlockResourcesHolder to act like a PropertyPlaceholderConfigurer.

Modified: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractElementParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractElementParser.java?view=diff&rev=509512&r1=509511&r2=509512
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractElementParser.java (original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractElementParser.java Tue Feb 20 03:24:10 2007
@@ -17,6 +17,8 @@
 package org.apache.cocoon.spring.configurator.impl;
 
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 import org.apache.cocoon.configuration.Settings;
 import org.apache.commons.logging.Log;
@@ -28,6 +30,8 @@
 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.BeanDefinitionParserDelegate;
+import org.springframework.util.StringUtils;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -102,6 +106,37 @@
         } else {
             holder = new BeanDefinitionHolder(beanDef, beanName);
         }
+        BeanDefinitionReaderUtils.registerBeanDefinition(holder, registry);
+    }
+
+    /**
+     * Register a global bean definition.
+     * The provided xml element is searched for an id and/or name attribute to register
+     * the bean. This implementation works the same as the default spring implementation.
+     *
+     * @param beanDef The bean definition.
+     * @param element The xml element defining the bean.
+     * @param registry The registry.
+     */
+    protected void register(BeanDefinition beanDef, Element element, BeanDefinitionRegistry registry) {
+        String id = element.getAttribute(BeanDefinitionParserDelegate.ID_ATTRIBUTE);
+        String nameAttr = element.getAttribute(BeanDefinitionParserDelegate.NAME_ATTRIBUTE);
+
+        final List aliases = new ArrayList();
+        if (StringUtils.hasLength(nameAttr)) {
+            String[] nameArr = StringUtils.tokenizeToStringArray(nameAttr, BeanDefinitionParserDelegate.BEAN_NAME_DELIMITERS);
+            aliases.addAll(Arrays.asList(nameArr));
+        }
+
+        String beanName = id;
+        if (!StringUtils.hasText(beanName) && !aliases.isEmpty()) {
+            beanName = (String) aliases.remove(0);
+            if (this.logger.isDebugEnabled()) {
+                this.logger.debug("No XML 'id' specified - using '" + beanName +
+                            "' as bean name and " + aliases + " as aliases");
+            }
+        }
+        final BeanDefinitionHolder holder = new BeanDefinitionHolder(beanDef, beanName, StringUtils.toStringArray(aliases));
         BeanDefinitionReaderUtils.registerBeanDefinition(holder, registry);
     }
 

Modified: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsBeanFactoryPostProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsBeanFactoryPostProcessor.java?view=diff&rev=509512&r1=509511&r2=509512
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsBeanFactoryPostProcessor.java (original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsBeanFactoryPostProcessor.java Tue Feb 20 03:24:10 2007
@@ -38,7 +38,6 @@
 import org.springframework.beans.factory.HierarchicalBeanFactory;
 import org.springframework.beans.factory.config.BeanDefinition;
 import org.springframework.beans.factory.config.BeanDefinitionVisitor;
-import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
 import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
 import org.springframework.context.ResourceLoaderAware;
@@ -59,7 +58,7 @@
  */
 public abstract class AbstractSettingsBeanFactoryPostProcessor
     extends PropertyPlaceholderConfigurer
-    implements ServletContextAware, BeanFactoryPostProcessor, ResourceLoaderAware, FactoryBean {
+    implements ServletContextAware, ResourceLoaderAware, FactoryBean {
 
     /** Logger (we use the same logging mechanism as Spring!) */
     protected final Log logger = LogFactory.getLog(getClass());

Added: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMap.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMap.java?view=auto&rev=509512
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMap.java (added)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMap.java Tue Feb 20 03:24:10 2007
@@ -0,0 +1,257 @@
+/*
+ * 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.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanDefinitionStoreException;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.BeanFactoryAware;
+import org.springframework.beans.factory.HierarchicalBeanFactory;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.ListableBeanFactory;
+
+/**
+ * This is a map implementation collecting all beans of a specific type (class)
+ * from a spring bean factory.
+ * The beans are available through their configured bean id.
+ *
+ * @version $Id$
+ * @since 1.0.1
+ */
+public class BeanMap
+    implements Map, BeanFactoryAware, InitializingBean {
+
+    /** The real map. */
+    protected Map beanMap = new HashMap();
+
+    /** The bean names. */
+    protected Set beanNames = new HashSet();
+
+    /** Is the map initialized? */
+    protected boolean initialized = false;
+
+    /** The bean factory. */
+    protected ListableBeanFactory beanFactory;
+
+    /** The class for all beans in this map. */
+    protected Class beanClass;
+
+    protected boolean stripPrefix = true;
+    protected boolean checkParent = true;
+
+    protected void load() {
+        final String prefix1 = this.beanClass.getName() + '.';
+        final String prefix2 = this.beanClass.getName() + '/';
+        final Iterator i = this.beanNames.iterator();
+        while ( i.hasNext() ) {
+            final String beanName = (String)i.next();
+            String key = beanName;
+            if ( this.stripPrefix && (beanName.startsWith(prefix1) || beanName.startsWith(prefix2)) ) {
+                key = key.substring(prefix1.length());
+            }
+            this.beanMap.put(key, this.beanFactory.getBean(beanName));
+        }
+    }
+
+    protected void checkInit() {
+        if ( !this.initialized ) {
+            synchronized (this) {
+                if ( !this.initialized ) {
+                    this.initialized = true;
+                    this.load();
+                }
+            }
+        }
+    }
+
+    /**
+     * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
+     */
+    public void afterPropertiesSet() throws Exception {
+        this.beanNames.clear();
+        this.getBeanNames(this.beanFactory, this.beanNames);
+    }
+
+    /** 
+     * Initialize this bean.
+     */
+    protected void getBeanNames(ListableBeanFactory factory, Set names) {
+        // check parent first
+        if ( this.checkParent ) {
+            if ( factory instanceof HierarchicalBeanFactory ) {
+                if ( ((HierarchicalBeanFactory)factory).getParentBeanFactory() != null ) {
+                    this.getBeanNames((ListableBeanFactory)((HierarchicalBeanFactory)factory).getParentBeanFactory(), names);
+                }
+            }
+        }
+        // get all bean names for our class
+        final String[] beanNames = factory.getBeanNamesForType(this.beanClass);
+        for (int i = 0; i < beanNames.length; i++) {
+            names.add(beanNames[i]);
+        }
+    }
+
+    /**
+     * @see org.springframework.beans.factory.BeanFactoryAware#setBeanFactory(org.springframework.beans.factory.BeanFactory)
+     */
+    public void setBeanFactory(BeanFactory factory) throws BeansException {
+        if ( !(factory instanceof ListableBeanFactory) ) {
+            throw new BeanDefinitionStoreException("BeanFactory must be listable.");
+        }
+        this.beanFactory = (ListableBeanFactory)factory;
+    }
+
+    public void setStripPrefix(boolean stripPrefix) {
+        this.stripPrefix = stripPrefix;
+    }
+
+    public void setCheckParent(boolean checkParent) {
+        this.checkParent = checkParent;
+    }
+
+    public void setType(Class typeClass) {
+        this.beanClass = typeClass;
+    }
+
+    /**
+     * @see java.util.Map#clear()
+     */
+    public void clear() {
+        // no need to call checkInit as we clear the map!
+        this.initialized = true;
+        this.beanMap.clear();
+    }
+
+    /**
+     * @see java.util.Map#containsKey(java.lang.Object)
+     */
+    public boolean containsKey(Object key) {
+        this.checkInit();
+        return this.beanMap.containsKey(key);
+    }
+
+    /**
+     * @see java.util.Map#containsValue(java.lang.Object)
+     */
+    public boolean containsValue(Object value) {
+        this.checkInit();
+        return this.beanMap.containsValue(value);
+    }
+
+    /**
+     * @see java.util.Map#entrySet()
+     */
+    public Set entrySet() {
+        this.checkInit();
+        return this.beanMap.entrySet();
+    }
+
+    /**
+     * @see java.util.Map#get(java.lang.Object)
+     */
+    public Object get(Object key) {
+        this.checkInit();
+        return this.beanMap.get(key);
+    }
+
+    /**
+     * @see java.util.Map#isEmpty()
+     */
+    public boolean isEmpty() {
+        this.checkInit();
+        return this.beanMap.isEmpty();
+    }
+
+    /**
+     * @see java.util.Map#keySet()
+     */
+    public Set keySet() {
+        this.checkInit();
+        return this.beanMap.keySet();
+    }
+
+    /**
+     * @see java.util.Map#put(java.lang.Object, java.lang.Object)
+     */
+    public Object put(Object key, Object value) {
+        this.checkInit();
+        return this.beanMap.put(key, value);
+    }
+
+    /**
+     * @see java.util.Map#putAll(java.util.Map)
+     */
+    public void putAll(Map t) {
+        this.checkInit();
+        this.beanMap.putAll(t);
+    }
+
+    /**
+     * @see java.util.Map#remove(java.lang.Object)
+     */
+    public Object remove(Object key) {
+        this.checkInit();
+        return this.beanMap.remove(key);
+    }
+
+    /**
+     * @see java.util.Map#size()
+     */
+    public int size() {
+        this.checkInit();
+        return this.beanMap.size();
+    }
+
+    /**
+     * @see java.util.Map#values()
+     */
+    public Collection values() {
+        this.checkInit();
+        return this.beanMap.values();
+    }
+
+    /**
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals(Object obj) {
+        this.checkInit();
+        return this.beanMap.equals(obj);
+    }
+
+    /**
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode() {
+        this.checkInit();
+        return this.beanMap.hashCode();
+    }
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString() {
+        this.checkInit();
+        return this.beanMap.toString();
+    }
+}

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

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

Added: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMapElementParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMapElementParser.java?view=auto&rev=509512
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMapElementParser.java (added)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMapElementParser.java Tue Feb 20 03:24:10 2007
@@ -0,0 +1,57 @@
+/*
+ * 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 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.util.ClassUtils;
+import org.w3c.dom.Element;
+
+/**
+ * The parser for the bean-map element.
+ *
+ * @version $Id$
+ * @since 1.0.1
+ */
+public class BeanMapElementParser extends AbstractElementParser {
+
+    /**
+     * @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) {
+        // create a new bean definition for the aspect chain
+        RootBeanDefinition beanDef = this.createBeanDefinition(BeanMap.class, null, false);
+        final String type = this.getAttributeValue(element, "type", null);
+        final Class typeClass;
+        try {
+            typeClass = ClassUtils.forName(type);
+        } catch (ClassNotFoundException e) {
+            throw new BeanDefinitionStoreException("Unable to load aspect class: " + type, e);
+        }
+        beanDef.getPropertyValues().addPropertyValue("type", typeClass);
+        beanDef.getPropertyValues().addPropertyValue("checkParent", this.getAttributeValue(element, "check-parent", "true"));
+        beanDef.getPropertyValues().addPropertyValue("stripPrefix", this.getAttributeValue(element, "strip-prefix", "true"));
+
+        // register bean if it's a global definition
+        if ( !parserContext.isNested() ) {
+            this.register(beanDef, element, parserContext.getRegistry());
+        }
+        return beanDef;
+    }
+}

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

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

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=509512&r1=509511&r2=509512
==============================================================================
--- 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 Tue Feb 20 03:24:10 2007
@@ -27,6 +27,7 @@
  *              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.
+ * "bean-map" : Creates a bean map.
  *
  * @version $Id$
  * @since 1.0
@@ -39,5 +40,6 @@
     public void init() {
         registerBeanDefinitionParser("settings", new SettingsElementParser());
         registerBeanDefinitionParser("child-settings", new ChildSettingsElementParser());
+        registerBeanDefinitionParser("bean-map", new BeanMapElementParser());
     }
 }

Modified: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/resources/META-INF/spring.schemas
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/resources/META-INF/spring.schemas?view=diff&rev=509512&r1=509511&r2=509512
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/resources/META-INF/spring.schemas (original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/resources/META-INF/spring.schemas Tue Feb 20 03:24:10 2007
@@ -14,3 +14,4 @@
 #  limitations under the License.
 #
 http\://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.xsd=org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.xsd
+http\://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.1.xsd=org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.1.xsd

Added: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.1.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.1.xsd?view=auto&rev=509512
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.1.xsd (added)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.1.xsd Tue Feb 20 03:24:10 2007
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<!-- @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="http://cocoon.apache.org/schema/configurator">
+
+    <xsd:element name="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="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>
+
+    <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="name" type="xsd:string" use="required"/>
+      </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="include-beans">
+      <xsd:complexType>
+    	<xsd:attribute name="dir" type="xsd:string" 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>
+
+    <!-- Since 1.0.1: -->
+    <xsd:element name="bean-map">
+      <xsd:complexType>
+        <xsd:attribute name="name" type="xsd:string" use="optional"/>
+        <xsd:attribute name="id" type="xsd:ID" use="optional"/>
+    	<xsd:attribute name="type" type="xsd:string" use="required"/>
+    	<xsd:attribute name="check-parent" type="xsd:boolean" use="optional" default="true"/>
+    	<xsd:attribute name="strip-prefix" type="xsd:boolean" use="optional" default="true"/>
+      </xsd:complexType>
+    </xsd:element>
+</xsd:schema>
\ No newline at end of file

Propchange: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.1.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.0.1.xsd
------------------------------------------------------------------------------
    svn:keywords = Id