cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkossakow...@apache.org
Subject svn commit: r677626 - in /cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main: java/org/apache/cocoon/spring/configurator/ java/org/apache/cocoon/spring/configurator/impl/ resources/org/apache/cocoon/spring/configurator/sc...
Date Thu, 17 Jul 2008 16:06:11 GMT
Author: gkossakowski
Date: Thu Jul 17 09:06:10 2008
New Revision: 677626

URL: http://svn.apache.org/viewvc?rev=677626&view=rev
Log:
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 defintions and property files.

The resource filter itself is a simple class implementing one method of ResourceFilter interface.

Added a new schema that covers new configuration element for a filter setup.

Added:
    cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceFilter.java
    cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.1.0.xsd
Modified:
    cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java
    cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsBeanFactoryPostProcessor.java
    cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsElementParser.java
    cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ExtendedPropertyOverrideConfigurer.java
    cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsBeanFactoryPostProcessor.java
    cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsElementParser.java

Added: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceFilter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceFilter.java?rev=677626&view=auto
==============================================================================
--- cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceFilter.java
(added)
+++ cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceFilter.java
Thu Jul 17 09:06:10 2008
@@ -0,0 +1,47 @@
+/*
+ * 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;
+
+import java.util.Set;
+
+import org.springframework.core.io.Resource;
+
+/**
+ * <p>This is an interface for custom implementations of filtering of resources being

+ * processed by Spring Configurator.</p>
+ * 
+ * <p>If you want to make some decisions on which resources you want to include at
the runtime
+ * then you should implement this interface and configure it following way:</p>
+ * <pre>
+ *   <configurator:settings>
+ *     ..
+ *     <configurator:filter class="org.package.SomeClass"/>
+ *   </configurator:settings>
+ * </pre>
+ * 
+ * <p>The implementations of this interface should be stateless</p>
+ *
+ */
+public interface ResourceFilter {
+    
+    /**
+     * @param resources The set of {@link Resource Spring resources}
+     * @return
+     */
+    Set filter(Set resources);
+    
+}

Modified: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java?rev=677626&r1=677625&r2=677626&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java
(original)
+++ cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java
Thu Jul 17 09:06:10 2008
@@ -19,9 +19,12 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Comparator;
+import java.util.HashSet;
 import java.util.Properties;
+import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.springframework.core.io.Resource;
@@ -76,11 +79,13 @@
      * @param propertiesPath The directory path.
      * @param properties The properties object where all the read properties are applied
to.
      * @param resourceLoader The resource loader to load the property files.
+     * @param resourceFilter The resource filter used to filter read property files, if null
no filtering is being applied.
      * @param logger Optional logger for debugging.
      */
     public static void readProperties(String         propertiesPath,
                                       Properties     properties,
                                       ResourceLoader resourceLoader,
+                                      ResourceFilter resourceFilter,
                                       Log            logger) {
         if (logger != null && logger.isDebugEnabled()) {
             logger.debug("Reading properties from directory: " + propertiesPath);
@@ -106,6 +111,7 @@
         if (load) {
             try {
                 resources = resolver.getResources(propertiesPath + "/*.properties");
+                resources = filterResources(resources, resourceFilter);
                 if (logger != null && logger.isDebugEnabled())
                     logger.debug("Found " + resources.length + " matching resources in "
+
                                  propertiesPath + "/*.properties");
@@ -219,4 +225,18 @@
             return null;
         }
     }
+    
+    /**
+     * @param resources The array of resources need to be filtered
+     * @param filter The instance of the filter itself
+     * @return the array of resources that has been filtered
+     */
+    public static Resource[] filterResources(Resource[] resources, ResourceFilter filter)
{
+        if (filter == null)
+            return resources;
+        
+        Set resourcesSet = new HashSet(Arrays.asList(resources));
+        Set filteredResources = filter.filter(resourcesSet);
+        return (Resource[])(new ArrayList(filteredResources)).toArray(new Resource[0]);
+    }
 }

Modified: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsBeanFactoryPostProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsBeanFactoryPostProcessor.java?rev=677626&r1=677625&r2=677626&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsBeanFactoryPostProcessor.java
(original)
+++ cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsBeanFactoryPostProcessor.java
Thu Jul 17 09:06:10 2008
@@ -28,6 +28,7 @@
 import org.apache.cocoon.configuration.PropertyHelper;
 import org.apache.cocoon.configuration.PropertyProvider;
 import org.apache.cocoon.configuration.Settings;
+import org.apache.cocoon.spring.configurator.ResourceFilter;
 import org.apache.cocoon.spring.configurator.ResourceUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -71,6 +72,8 @@
     protected BeanFactory beanFactory;
 
     protected ResourceLoader resourceLoader;
+    
+    protected ResourceFilter resourceFilter;
 
     /**
      * Additional properties.
@@ -103,6 +106,10 @@
     public void setResourceLoader(ResourceLoader loader) {
         this.resourceLoader = loader;
     }
+    
+    public void setResourceFilter(ResourceFilter resourceFilter) {
+        this.resourceFilter = resourceFilter;
+    }
 
     public void setDirectories(List directories) {
         this.directories = directories;
@@ -224,9 +231,9 @@
             while (i.hasNext()) {
                 final String directory = (String) i.next();
                 // now read all properties from the properties directory
-                ResourceUtils.readProperties(directory, properties, getResourceLoader(),
this.logger);
+                ResourceUtils.readProperties(directory, properties, getResourceLoader(),
this.resourceFilter, this.logger);
                 // read all properties from the mode dependent directory
-                ResourceUtils.readProperties(directory + '/' + mode, properties, getResourceLoader(),
this.logger);
+                ResourceUtils.readProperties(directory + '/' + mode, properties, getResourceLoader(),
this.resourceFilter, this.logger);
             }
         }
 

Modified: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsElementParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsElementParser.java?rev=677626&r1=677625&r2=677626&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsElementParser.java
(original)
+++ cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsElementParser.java
Thu Jul 17 09:06:10 2008
@@ -23,6 +23,7 @@
 import java.util.List;
 import java.util.Properties;
 
+import org.apache.cocoon.spring.configurator.ResourceFilter;
 import org.apache.cocoon.spring.configurator.ResourceUtils;
 import org.springframework.beans.factory.BeanDefinitionStoreException;
 import org.springframework.beans.factory.config.BeanDefinition;
@@ -55,8 +56,10 @@
                                                                    ParserContext parserContext,
                                                                    String        runningMode);
 
+    private ResourceFilter resourceFilter;
+    
     /**
-     * Get additonal includes of property directories.
+     * Get additional includes of property directories.
      */
     protected List getPropertyIncludes(Element childSettingsElement) {
         List propertyDirs = null;
@@ -119,6 +122,12 @@
      */
     public BeanDefinition parse(Element element, ParserContext parserContext) {
         final String runningMode = this.getRunningMode(element);
+        
+        try {
+            this.resourceFilter = getResourceFilter(element);
+        } catch (Exception e) {
+            throw new BeanDefinitionStoreException("Unable to read filter configuration",
e);
+        }
 
         // create factory for settings object
         this.createSettingsBeanFactoryPostProcessor(element, parserContext, runningMode);
@@ -182,6 +191,7 @@
         if ( load ) {
             try {
                 Resource[] resources = resolver.getResources(path + "/*.xml");
+                resources = ResourceUtils.filterResources(resources, getResourceFilter());
                 Arrays.sort(resources, ResourceUtils.getResourceComparator());
                 for (int i = 0; i < resources.length; i++) {
                     this.handleImport(parserContext, resources[i].getURL().toExternalForm());
@@ -211,7 +221,27 @@
         beanDef.getPropertyValues().addPropertyValue("locations", locations);
         beanDef.getPropertyValues().addPropertyValue("resourceLoader",
                 parserContext.getReaderContext().getReader().getResourceLoader());
+        beanDef.getPropertyValues().addPropertyValue("resourceFilter", getResourceFilter());
         beanDef.getPropertyValues().addPropertyValue("beanNameSeparator", "/");
         this.register(beanDef, ExtendedPropertyOverrideConfigurer.class.getName(), parserContext.getRegistry());
     }
+    
+    
+    protected ResourceFilter getResourceFilter(Element e) throws Exception {
+        Element[] filters = this.getChildElements(e, "filter");
+        
+        if (filters.length == 0)
+            return null;
+        else if (filters.length > 1)
+            throw new RuntimeException("Only one filter definition is allowed and you configured
" + filters.length + " filters.");
+        
+        String filterClassName = filters[0].getAttribute("class");
+        if (filterClassName.length() == 0)
+            throw new RuntimeException("Missing 'class' attribute.");
+        return (ResourceFilter)java.lang.Class.forName(filterClassName).newInstance();
+    }
+    
+    protected final ResourceFilter getResourceFilter() {
+        return this.resourceFilter;
+    }
 }

Modified: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ExtendedPropertyOverrideConfigurer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ExtendedPropertyOverrideConfigurer.java?rev=677626&r1=677625&r2=677626&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ExtendedPropertyOverrideConfigurer.java
(original)
+++ cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ExtendedPropertyOverrideConfigurer.java
Thu Jul 17 09:06:10 2008
@@ -29,6 +29,8 @@
 import org.springframework.core.io.DefaultResourceLoader;
 import org.springframework.core.io.ResourceLoader;
 
+import org.apache.cocoon.spring.configurator.ResourceFilter;
+
 /**
  * Our version of the property override configurer which reads properties from
  * the Cocoon spring configuration directory. A property should have the
@@ -51,6 +53,8 @@
      * context.
      */
     protected ResourceLoader resourceLoader = new DefaultResourceLoader();
+    
+    protected ResourceFilter resourceFilter;
 
     /**
      * The settings object.
@@ -90,6 +94,15 @@
     public void setResourceLoader(final ResourceLoader loader) {
         this.resourceLoader = loader;
     }
+    
+    /**
+     * Set the {@link ResourceFilter resource filter}
+     * 
+     * @param resourceFilter
+     */
+    public void setResourceFilter(ResourceFilter resourceFilter) {
+        this.resourceFilter = resourceFilter;
+    }
 
     /**
      * Read all property files from the specified location and apply the
@@ -108,9 +121,9 @@
             final Iterator i = this.locations.iterator();
             while ( i.hasNext() ) {
                 final String location = (String)i.next();
-                ResourceUtils.readProperties(location, mergedProps, this.resourceLoader,
this.logger);
+                ResourceUtils.readProperties(location, mergedProps, this.resourceLoader,
resourceFilter, this.logger);
                 // read properties from running-mode dependent directory
-                ResourceUtils.readProperties(location + '/' + mode, mergedProps, this.resourceLoader,
this.logger);
+                ResourceUtils.readProperties(location + '/' + mode, mergedProps, this.resourceLoader,
resourceFilter, this.logger);
             }
         }
 

Modified: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsBeanFactoryPostProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsBeanFactoryPostProcessor.java?rev=677626&r1=677625&r2=677626&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsBeanFactoryPostProcessor.java
(original)
+++ cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsBeanFactoryPostProcessor.java
Thu Jul 17 09:06:10 2008
@@ -170,19 +170,19 @@
         if (this.readFromClasspath) {
             // now read all properties from classpath directory
             ResourceUtils.readProperties(Constants.CLASSPATH_PROPERTIES_LOCATION,
-                                         properties, getResourceLoader(), this.logger);
+                                         properties, getResourceLoader(), this.resourceFilter,
this.logger);
             // read all properties from the mode dependent directory
             ResourceUtils.readProperties(Constants.CLASSPATH_PROPERTIES_LOCATION +
-                                         "/" + mode, properties, getResourceLoader(), this.logger);
+                                         "/" + mode, properties, getResourceLoader(), this.resourceFilter,
this.logger);
         }
 
         if (this.readFromGlobalLocation) {
             // now read all properties from the properties directory
             ResourceUtils.readProperties(Constants.GLOBAL_PROPERTIES_LOCATION,
-                                         properties, getResourceLoader(), this.logger);
+                                         properties, getResourceLoader(), this.resourceFilter,
this.logger);
             // read all properties from the mode dependent directory
             ResourceUtils.readProperties(Constants.GLOBAL_PROPERTIES_LOCATION +
-                                         "/" + mode, properties, getResourceLoader(), this.logger);
+                                         "/" + mode, properties, getResourceLoader(), this.resourceFilter,
this.logger);
         }
 
         // set default work directory value
@@ -241,10 +241,10 @@
                 if (additionalFile.isDirectory()) {
                     // read from directory
                     ResourceUtils.readProperties(additionalFile.getAbsolutePath(),
-                                                 properties, getResourceLoader(), this.logger);
+                                                 properties, getResourceLoader(), this.resourceFilter,
this.logger);
                     // read all properties from the mode dependent directory
                     ResourceUtils.readProperties(additionalFile.getAbsolutePath() + File.separatorChar
+ mode,
-                                                 properties, getResourceLoader(), this.logger);
+                                                 properties, getResourceLoader(), this.resourceFilter,
this.logger);
                 } else {
                     // read the file
                     try {

Modified: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsElementParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsElementParser.java?rev=677626&r1=677625&r2=677626&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsElementParser.java
(original)
+++ cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsElementParser.java
Thu Jul 17 09:06:10 2008
@@ -22,6 +22,7 @@
 import javax.servlet.ServletContext;
 
 import org.apache.cocoon.configuration.Settings;
+import org.apache.cocoon.spring.configurator.ResourceFilter;
 import org.springframework.beans.factory.support.RootBeanDefinition;
 import org.springframework.beans.factory.xml.ParserContext;
 import org.w3c.dom.Element;
@@ -53,6 +54,12 @@
         // create bean definition for settings object
         final RootBeanDefinition beanDef = this.createBeanDefinition(SettingsBeanFactoryPostProcessor.class.getName(),
                 "init", false);
+        
+        //pass resource filter
+        final ResourceFilter resourceFilter = getResourceFilter();
+        if (resourceFilter != null) {
+            beanDef.getPropertyValues().addPropertyValue("resourceFilter", resourceFilter);
+        }
         // add additional properties
         final Properties additionalProps = this.getAdditionalProperties(element);
         if (additionalProps != null) {

Added: cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.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-1.1.0.xsd?rev=677626&view=auto
==============================================================================
--- cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.1.0.xsd
(added)
+++ cocoon/trunk/subprojects/cocoon-configuration/cocoon-spring-configurator/src/main/resources/org/apache/cocoon/spring/configurator/schema/cocoon-configurator-1.1.0.xsd
Thu Jul 17 09:06:10 2008
@@ -0,0 +1,100 @@
+<?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>
+</xsd:schema>



Mime
View raw message