cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r754972 - in /cocoon/trunk/subprojects/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/
Date Mon, 16 Mar 2009 18:20:54 GMT
Author: reinhard
Date: Mon Mar 16 18:20:54 2009
New Revision: 754972

URL: http://svn.apache.org/viewvc?rev=754972&view=rev
Log:
Add a WildcardBeanMap that extends BeanMap but checks for a wildcard expression instead of
the bean type.

Added:
    cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/WildcardBeanMap.java
  (with props)
    cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/WildcardBeanMapElementParser.java
  (with props)
    cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-2.1.0.xsd
  (with props)
Modified:
    cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/changes/changes.xml
    cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMap.java
    cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ConfiguratorNamespaceHandler.java
    cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/resources/META-INF/spring.schemas

Modified: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/changes/changes.xml?rev=754972&r1=754971&r2=754972&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/changes/changes.xml
(original)
+++ cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/changes/changes.xml
Mon Mar 16 18:20:54 2009
@@ -24,9 +24,14 @@
   -->
 <document>
   <body>
-    <release version="2.0.1" date="2009-??-??" description="unreleased">
+    <release version="2.1.0" date="2009-??-??" description="unreleased">
       <action dev="reinhard" type="add">
-        Support the definition of a user properties file as servlet context init parameter
(org.apache.cocoon.settings).
+        Add a WildcardBeanMap that extends BeanMap but checks for a wildcard expression
+        instead of the bean type.
+      </action>   
+      <action dev="reinhard" type="add">
+        Support the definition of a user properties file as servlet context init parameter

+        (org.apache.cocoon.settings).
       </action>   
     </release>  
     <release version="2.0.0" date="2008-08-09" description="released">
@@ -38,12 +43,15 @@
       </action>
       <action dev="gkossakowski" type="add">
         Introduced resource filter feature as explained here: http://article.gmane.org/gmane.text.xml.cocoon.devel/78158
-        The resource filtering is used for *all* resources being processed by Spring Configurator
including beans definitions and property files.
+        The resource filtering is used for *all* resources being processed by 
+        Spring Configurator including beans definitions and property files.
         
-        The resource filter itself is a simple class implementing one method of ResourceFilter
interface.
+        The resource filter itself is a simple class implementing one method of 
+        ResourceFilter interface.
       </action>
       <action dev="lgawron" type="fix">
-        Fix configurator:bean-map throwing ClassCastException when key-property="propertyName"
did not resolve to a String property.
+        Fix configurator:bean-map throwing ClassCastException when 
+        key-property="propertyName" did not resolve to a String property.
       </action>
     </release>
 

Modified: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMap.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMap.java?rev=754972&r1=754971&r2=754972&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMap.java
(original)
+++ cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMap.java
Mon Mar 16 18:20:54 2009
@@ -20,7 +20,6 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -50,10 +49,10 @@
  * @version $Id$
  * @since 1.0.1
  */
-public class BeanMap implements Map, BeanFactoryAware {
+public class BeanMap implements Map<Object, Object>, BeanFactoryAware {
 
     /** The real map. */
-    protected final Map beanMap = new HashMap();
+    protected final Map<Object, Object> beanMap = new HashMap<Object, Object>();
 
     /** Is the map initialized? */
     protected boolean initialized = false;
@@ -62,7 +61,7 @@
     protected ListableBeanFactory beanFactory;
 
     /** The class for all beans in this map. */
-    protected Class beanClass;
+    protected Class<?> beanClass;
 
     /** Do we strip the prefix from the bean name? */
     protected boolean stripPrefix = true;
@@ -71,35 +70,24 @@
     protected boolean checkParent = true;
 
     /** Do we check for properties? */
-    protected List hasProperties = new ArrayList();
+    protected List<String> hasProperties = new ArrayList<String>();
 
     /** Which property should we use to key the map? */
     protected String keyProperty;
 
     /**
-     * Get all the bean's from the bean factory and put them into a map using
-     * their id.
+     * Get all the beans from the bean factory and put them into a map using their id.
      *
-     * @param beanNames
-     *            The bean names to load.
+     * @param beanNames The bean names to load.
      */
-    protected void load(Set beanNames) {
-        final String prefix1 = this.beanClass.getName() + '.';
-        final String prefix2 = this.beanClass.getName() + '/';
-        final Iterator i = beanNames.iterator();
-        while (i.hasNext()) {
-            final String beanName = (String) i.next();
-            Object key = beanName;
-            if (this.stripPrefix && (beanName.startsWith(prefix1) || beanName.startsWith(prefix2)))
{
-                key = beanName.substring(prefix1.length());
-            }
+    protected void load(Set<String> beanNames) {
+        for (String beanName : beanNames) {
+            Object key = this.stripPrefix(beanName);
             if (this.hasProperties.size() > 0) {
                 final Object bean = this.beanFactory.getBean(beanName);
                 final BeanWrapperImpl wrapper = new BeanWrapperImpl(bean);
                 boolean isOk = true;
-                final Iterator iter = this.hasProperties.iterator();
-                while (iter.hasNext()) {
-                    final String propName = (String) iter.next();
+                for (String propName : this.hasProperties) {
                     if (!wrapper.isReadableProperty(propName)) {
                         isOk = false;
                     }
@@ -123,6 +111,18 @@
         }
     }
 
+    protected Object stripPrefix(final String beanName) {
+        final String prefix1 = this.beanClass.getName() + '.';
+        final String prefix2 = this.beanClass.getName() + '/';
+
+        Object key = beanName;
+        if (this.stripPrefix && (beanName.startsWith(prefix1) || beanName.startsWith(prefix2)))
{
+            key = beanName.substring(prefix1.length());
+        }
+
+        return key;
+    }
+
     /**
      * Check if the bean is already initialized. If not, the bean's are searched
      * in the bean factory.
@@ -135,7 +135,7 @@
                     // spring
                     // it will just contain an empty map
                     if (this.beanFactory != null) {
-                        final Set beanNames = new HashSet();
+                        final Set<String> beanNames = new HashSet<String>();
                         this.getBeanNames(this.beanFactory, beanNames);
                         this.load(beanNames);
                     }
@@ -153,7 +153,7 @@
      * @param beanNames
      *            The set containing the resulting bean names.
      */
-    protected void getBeanNames(ListableBeanFactory factory, Set beanNames) {
+    protected void getBeanNames(ListableBeanFactory factory, Set<String> beanNames)
{
         // check parent first
         if (this.checkParent) {
             if (factory instanceof HierarchicalBeanFactory) {
@@ -164,12 +164,16 @@
             }
         }
         // get all bean names for our class
-        final String[] names = factory.getBeanNamesForType(this.beanClass);
+        final String[] names = this.lookupBeans(factory);
         for (int i = 0; i < names.length; i++) {
             beanNames.add(names[i]);
         }
     }
 
+    protected String[] lookupBeans(ListableBeanFactory factory) {
+        return factory.getBeanNamesForType(this.beanClass);
+    }
+
     /**
      * @see org.springframework.beans.factory.BeanFactoryAware#setBeanFactory(org.springframework.beans.factory.BeanFactory)
      */
@@ -190,7 +194,7 @@
 
     public void setHasProperties(String pHasProperties) {
         final StringTokenizer tokenizer = new StringTokenizer(pHasProperties, " \t\n\r\f,");
-        final List propNames = new ArrayList();
+        final List<String> propNames = new ArrayList<String>();
         while (tokenizer.hasMoreTokens()) {
             propNames.add(tokenizer.nextToken());
         }
@@ -201,7 +205,7 @@
         this.keyProperty = pKeyProperty;
     }
 
-    public void setType(Class typeClass) {
+    public void setType(Class<?> typeClass) {
         this.beanClass = typeClass;
     }
 
@@ -233,7 +237,7 @@
     /**
      * @see java.util.Map#entrySet()
      */
-    public Set entrySet() {
+    public Set<Entry<Object, Object>> entrySet() {
         this.checkInit();
         return this.beanMap.entrySet();
     }
@@ -257,7 +261,7 @@
     /**
      * @see java.util.Map#keySet()
      */
-    public Set keySet() {
+    public Set<Object> keySet() {
         this.checkInit();
         return this.beanMap.keySet();
     }
@@ -273,7 +277,7 @@
     /**
      * @see java.util.Map#putAll(java.util.Map)
      */
-    public void putAll(Map t) {
+    public void putAll(Map<?, ?> t) {
         this.checkInit();
         this.beanMap.putAll(t);
     }
@@ -297,7 +301,7 @@
     /**
      * @see java.util.Map#values()
      */
-    public Collection values() {
+    public Collection<Object> values() {
         this.checkInit();
         return this.beanMap.values();
     }
@@ -305,6 +309,7 @@
     /**
      * @see java.lang.Object#equals(java.lang.Object)
      */
+    @Override
     public boolean equals(Object obj) {
         this.checkInit();
         return this.beanMap.equals(obj);
@@ -313,6 +318,7 @@
     /**
      * @see java.lang.Object#hashCode()
      */
+    @Override
     public int hashCode() {
         this.checkInit();
         return this.beanMap.hashCode();
@@ -321,6 +327,7 @@
     /**
      * @see java.lang.Object#toString()
      */
+    @Override
     public String toString() {
         this.checkInit();
         return this.beanMap.toString();

Modified: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ConfiguratorNamespaceHandler.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ConfiguratorNamespaceHandler.java?rev=754972&r1=754971&r2=754972&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ConfiguratorNamespaceHandler.java
(original)
+++ cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ConfiguratorNamespaceHandler.java
Mon Mar 16 18:20:54 2009
@@ -19,15 +19,17 @@
 import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
 
 /**
- * Spring namespace handler for the cocoon core namespace.
- * Currently this namespace defines the following elements
- * (in the namespace "http://cocoon.apache.org/schema/configurator"):
- * "settings" : This sets up the Cocoon Settings object (by reading the property
- *              files located under /WEB-INF/cocoon/properties.
- *              By specifying the attribute "processorClassName" an own implementation
- *              can be used (this should be a subclass of the {@link SettingsBeanFactoryPostProcessor}).
- * "child-settings" : This sets up a sub context.
- * "bean-map" : Creates a bean map.
+ * Spring namespace handler for the cocoon core namespace. Currently this namespace defines
the
+ * following elements (in the namespace "http://cocoon.apache.org/schema/configurator"):
+ * <ul>
+ * <li>"settings": This sets up the Cocoon Settings object (by reading the property
files located
+ * under /WEB-INF/cocoon/properties. By specifying the attribute "processorClassName" an
own
+ * implementation can be used (this should be a subclass of the
+ * {@link SettingsBeanFactoryPostProcessor}).</li>
+ * <li>"child-settings" : This sets up a sub context.</li>
+ * <li>"bean-map" : Creates a bean map. "wildcard-bean-map" : Creates a bean map by
matching the
+ * bean name against a wildcard expression.</li>
+ * </ul>
  *
  * @version $Id$
  * @since 1.0
@@ -38,8 +40,9 @@
      * @see org.springframework.beans.factory.xml.NamespaceHandler#init()
      */
     public void init() {
-        registerBeanDefinitionParser("settings", new SettingsElementParser());
-        registerBeanDefinitionParser("child-settings", new ChildSettingsElementParser());
-        registerBeanDefinitionParser("bean-map", new BeanMapElementParser());
+        this.registerBeanDefinitionParser("settings", new SettingsElementParser());
+        this.registerBeanDefinitionParser("child-settings", new ChildSettingsElementParser());
+        this.registerBeanDefinitionParser("bean-map", new BeanMapElementParser());
+        this.registerBeanDefinitionParser("wildcard-bean-map", new WildcardBeanMapElementParser());
     }
 }

Added: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/WildcardBeanMap.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/WildcardBeanMap.java?rev=754972&view=auto
==============================================================================
--- cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/WildcardBeanMap.java
(added)
+++ cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/WildcardBeanMap.java
Mon Mar 16 18:20:54 2009
@@ -0,0 +1,69 @@
+/*
+ * 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.List;
+
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.ListableBeanFactory;
+import org.springframework.util.PatternMatchUtils;
+
+/**
+ * Similar to the {@link BeanMap} it collects beans from a {@link BeanFactory}. But instead
of
+ * checking the type of the bean, its bean name is matched against a wildcard expression
(e.g.
+ * <code>some.beans.*</code>).
+ *
+ * @see BeanMap
+ */
+public class WildcardBeanMap extends BeanMap {
+
+    protected String wildcard;
+
+    public String getWildcard() {
+        return this.wildcard;
+    }
+
+    public void setWildcard(String wildcard) {
+        this.wildcard = wildcard;
+    }
+
+    /**
+     * Find all beans that match the wildcard expression. Expression resolving is done based
on the
+     * default Spring wildcard pattern matching
+     * {@link PatternMatchUtils#simpleMatch(String, String)}.
+     *
+     * @see org.apache.cocoon.spring.configurator.impl.BeanMap#lookupBeans(org.springframework.beans.factory.ListableBeanFactory)
+     */
+    @Override
+    protected String[] lookupBeans(ListableBeanFactory factory) {
+        List<String> filteredBeanNames = new ArrayList<String>();
+
+        for (String beanName : factory.getBeanNamesForType(null)) {
+            if (PatternMatchUtils.simpleMatch(this.wildcard, beanName)) {
+                filteredBeanNames.add(beanName);
+            }
+        }
+
+        return filteredBeanNames.toArray(new String[0]);
+    }
+
+    @Override
+    protected Object stripPrefix(String beanName) {
+        return beanName;
+    }
+}

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

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

Propchange: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/WildcardBeanMap.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/WildcardBeanMapElementParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/WildcardBeanMapElementParser.java?rev=754972&view=auto
==============================================================================
--- cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/WildcardBeanMapElementParser.java
(added)
+++ cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/WildcardBeanMapElementParser.java
Mon Mar 16 18:20:54 2009
@@ -0,0 +1,56 @@
+/*
+ * 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.config.BeanDefinition;
+import org.springframework.beans.factory.support.RootBeanDefinition;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.w3c.dom.Element;
+
+/**
+ * The parser for the wildcard-bean-map element.
+ *
+ * @version $Id$
+ * @since 1.0.1
+ */
+public class WildcardBeanMapElementParser extends BeanMapElementParser {
+
+    /**
+     * {@inheritDoc}
+     *
+     * @see org.apache.cocoon.spring.configurator.impl.BeanMapElementParser#parse(org.w3c.dom.Element,
+     *      org.springframework.beans.factory.xml.ParserContext)
+     */
+    @Override
+    public BeanDefinition parse(Element element, ParserContext parserContext) {
+        // create a new bean definition for the aspect chain
+        RootBeanDefinition beanDef = this.createBeanDefinition(WildcardBeanMap.class, null,
false);
+        beanDef.getPropertyValues().addPropertyValue("wildcard", this.getAttributeValue(element,
"wildcard", null));
+        beanDef.getPropertyValues().addPropertyValue("checkParent",
+                this.getAttributeValue(element, "check-parent", "true"));
+        beanDef.getPropertyValues().addPropertyValue("hasProperties",
+                this.getAttributeValue(element, "has-properties", ""));
+        beanDef.getPropertyValues()
+                .addPropertyValue("keyProperty", this.getAttributeValue(element, "key-property",
""));
+
+        // register bean if it's a global definition
+        if (!parserContext.isNested()) {
+            this.register(beanDef, element, parserContext.getRegistry());
+        }
+        return beanDef;
+    }
+}

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

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

Propchange: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/WildcardBeanMapElementParser.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/resources/META-INF/spring.schemas
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/resources/META-INF/spring.schemas?rev=754972&r1=754971&r2=754972&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/resources/META-INF/spring.schemas
(original)
+++ cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/resources/META-INF/spring.schemas
Mon Mar 16 18:20:54 2009
@@ -15,3 +15,5 @@
 #
 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
+http\://cocoon.apache.org/schema/configurator/cocoon-configurator-2.0.0.xsd=org/apache/cocoon/spring/configurator/schema/cocoon-configurator-2.0.0.xsd
+http\://cocoon.apache.org/schema/configurator/cocoon-configurator-2.1.0.xsd=org/apache/cocoon/spring/configurator/schema/cocoon-configurator-2.1.0.xsd
\ No newline at end of file

Added: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-2.1.0.xsd
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-2.1.0.xsd?rev=754972&view=auto
==============================================================================
--- cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-2.1.0.xsd
(added)
+++ cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-2.1.0.xsd
Mon Mar 16 18:20:54 2009
@@ -0,0 +1,116 @@
+<?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.
+-->
+<!-- $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="filter" minOccurs="0" maxOccurs="1"/>
+        <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="filter">
+    <xsd:complexType>
+      <xsd:attribute name="class" 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="id" type="xsd:ID" use="optional"/>
+      <xsd:attribute name="name" type="xsd:string" 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:attribute name="has-properties" type="xsd:string" use="optional" default="">
+        <xsd:annotation>
+          <xsd:documentation>beans should have all these properties (comma separated
list)</xsd:documentation>
+        </xsd:annotation>
+      </xsd:attribute>
+      <xsd:attribute name="key-property" type="xsd:string" use="optional" default="">
+        <xsd:annotation>
+          <xsd:documentation>use value of this bean property to key the map instead
of bean id</xsd:documentation>
+        </xsd:annotation>
+      </xsd:attribute>
+    </xsd:complexType>
+  </xsd:element>
+  
+  
+  <!-- Since 2.0.1 -->
+  <xsd:element name="wildcard-bean-map">
+    <xsd:complexType>
+      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
+      <xsd:attribute name="name" type="xsd:string" use="optional"/>
+      <xsd:attribute name="wildcard" type="xsd:string" use="required"/>
+      <xsd:attribute name="check-parent" type="xsd:boolean" use="optional" default="true"/>
+      <xsd:attribute name="has-properties" type="xsd:string" use="optional" default="">
+        <xsd:annotation>
+          <xsd:documentation>beans should have all these properties (comma separated
list)</xsd:documentation>
+        </xsd:annotation>
+      </xsd:attribute>
+      <xsd:attribute name="key-property" type="xsd:string" use="optional" default="">
+        <xsd:annotation>
+          <xsd:documentation>use value of this bean property to key the map instead
of bean id</xsd:documentation>
+        </xsd:annotation>
+      </xsd:attribute>
+    </xsd:complexType>
+  </xsd:element>  
+</xsd:schema>

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

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

Propchange: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-2.1.0.xsd
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message