cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/modules/database PgsqlAutoIncrementModule.java
Date Sun, 17 Nov 2002 19:12:50 GMT
haul        2002/11/17 11:12:50

  Modified:    src/java/org/apache/cocoon/components/modules Tag:
                        cocoon_2_0_3_branch modules.xconf
               src/java/org/apache/cocoon/components/modules/output Tag:
                        cocoon_2_0_3_branch OutputModule.java
               src/java/org/apache/cocoon/components/modules/input Tag:
                        cocoon_2_0_3_branch AbstractInputModule.java
                        CollectionMetaModule.java DateInputModule.java
                        DefaultsMetaModule.java DigestMetaModule.java
                        HeaderAttributeModule.java InputModule.java
                        MapMetaModule.java NullInputModule.java
                        RandomNumberModule.java RequestAttributeModule.java
                        RequestParameterModule.java RequestURIModule.java
                        SessionAttributeModule.java
                        StringConstantModule.java XMLMetaModule.java
  Added:       src/java/org/apache/cocoon/components/modules/input Tag:
                        cocoon_2_0_3_branch AbstractJXPathModule.java
                        AbstractMetaModule.java ChainMetaModule.java
                        DateMetaInputModule.java IteratorHelper.java
                        JXPathMetaModule.java RequestContextPathModule.java
                        RequestModule.java SessionModule.java
               src/java/org/apache/cocoon/components/modules/database Tag:
                        cocoon_2_0_3_branch PgsqlAutoIncrementModule.java
  Removed:     src/java/org/apache/cocoon/components/modules/input Tag:
                        cocoon_2_0_3_branch EnumerationHelper.java
  Log:
    <action dev="CH" type="update">
     Changed SimpleFormTransformer to use InputModules.
    </action>
    <action dev="CH" type="update">
     Changed InputModules to return Iterator instead of Enumeration. New abstract
     "meta" module to make new meta modules easier. Stripped "meta" from defaults
     module. Added JXPathMetaModule. Added extension classes and packages to all
     modules that are based on JXPath.
    </action>
    <action dev="CH" type="update">
     Improved support for CLOB and BLOB columns in modular database actions.
    </action>
    <action dev="CH" type="add">
     New chaining InputModule that allows to use additional modules when an attribute is not
     present or null.
    </action>
    <action dev="CH" type="update">
     Changed defaults of InputModule names in many places to new names.
    </action>
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.1   +24 -18    xml-cocoon2/src/java/org/apache/cocoon/components/modules/modules.xconf
  
  Index: modules.xconf
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/modules.xconf,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  --- modules.xconf	9 Aug 2002 08:32:10 -0000	1.5
  +++ modules.xconf	17 Nov 2002 19:12:49 -0000	1.5.2.1
  @@ -4,31 +4,36 @@
      <!-- =============== Sitemap In/Out/Database Modules ==================== -->
      
      <input-modules>
  -	  <component-instance logger="core.modules.input" name="request"   	class="org.apache.cocoon.components.modules.input.RequestParameterModule"/>
  -	  <component-instance logger="core.modules.input" name="attribute" 	class="org.apache.cocoon.components.modules.input.RequestAttributeModule"/>
  -	  <component-instance logger="core.modules.input" name="URI"       	class="org.apache.cocoon.components.modules.input.RequestURIModule"/>
  -	  <component-instance logger="core.modules.input" name="header"    	class="org.apache.cocoon.components.modules.input.HeaderAttributeModule"/>
  -	  <component-instance logger="core.modules.input" name="session"   	class="org.apache.cocoon.components.modules.input.SessionAttributeModule"/>
  -	  <component-instance logger="core.modules.input" name="constant"  	class="org.apache.cocoon.components.modules.input.StringConstantModule"/>
  -	  <component-instance logger="core.modules.input" name="random"    	class="org.apache.cocoon.components.modules.input.RandomNumberModule"/>
  -      <component-instance logger="core.modules.input" name="digest"     class="org.apache.cocoon.components.modules.input.DigestMetaModule"/>
  -      <component-instance logger="core.modules.input" name="date"       class="org.apache.cocoon.components.modules.input.DateInputModule"/>
  -      <component-instance logger="core.modules.input" name="nullinput"  class="org.apache.cocoon.components.modules.input.NullInputModule"/>
  -      <component-instance logger="core.modules.input" name="collection" class="org.apache.cocoon.components.modules.input.CollectionMetaModule"/>
  -      <component-instance logger="core.modules.input" name="xmlmeta"    class="org.apache.cocoon.components.modules.input.XMLMetaModule"/>
  -      <component-instance logger="core.modules.input" name="mapmeta"    class="org.apache.cocoon.components.modules.input.MapMetaModule"/>
  -      <component-instance logger="core.modules.input" name="defaults"   class="org.apache.cocoon.components.modules.input.DefaultsMetaModule">
  -		 <input-module name="request"/>
  +      <component-instance logger="core.modules.input" name="request"       	class="org.apache.cocoon.components.modules.input.RequestModule"/>
  +      <component-instance logger="core.modules.input" name="session"       	class="org.apache.cocoon.components.modules.input.SessionModule"/>
  +      <component-instance logger="core.modules.input" name="request-param"   	class="org.apache.cocoon.components.modules.input.RequestParameterModule"/>
  +      <component-instance logger="core.modules.input" name="request-attr" 	class="org.apache.cocoon.components.modules.input.RequestAttributeModule"/>
  +      <component-instance logger="core.modules.input" name="request-header"    	class="org.apache.cocoon.components.modules.input.HeaderAttributeModule"/>
  +      <component-instance logger="core.modules.input" name="session-attr"   	class="org.apache.cocoon.components.modules.input.SessionAttributeModule"/>
  +      <component-instance logger="core.modules.input" name="constant"  		class="org.apache.cocoon.components.modules.input.StringConstantModule"/>
  +      <component-instance logger="core.modules.input" name="random"    		class="org.apache.cocoon.components.modules.input.RandomNumberModule"/>
  +      <component-instance logger="core.modules.input" name="digest"     	class="org.apache.cocoon.components.modules.input.DigestMetaModule"/>
  +      <component-instance logger="core.modules.input" name="date"       	class="org.apache.cocoon.components.modules.input.DateInputModule"/>
  +      <component-instance logger="core.modules.input" name="nullinput"  	class="org.apache.cocoon.components.modules.input.NullInputModule"/>
  +      <component-instance logger="core.modules.input" name="xmlmeta"    	class="org.apache.cocoon.components.modules.input.XMLMetaModule"/>
  +      <component-instance logger="core.modules.input" name="mapmeta"    	class="org.apache.cocoon.components.modules.input.MapMetaModule"/>
  +      <component-instance logger="core.modules.input" name="defaults"   	class="org.apache.cocoon.components.modules.input.DefaultsMetaModule">
   		 <values>
   			<skin>defaultSkin</skin>
   			<base-url>http://localhost:8080/cocoon</base-url>
   		 </values>
   	  </component-instance>
  +      <component-instance logger="core.modules.input" name="chain"   	class="org.apache.cocoon.components.modules.input.ChainMetaModule">
  +	     <input-module name="request-param"/>
  +	     <input-module name="request-attr"/>
  +	     <input-module name="session-attr"/>
  +	     <input-module name="defaults"/>
  +	  </component-instance>
      </input-modules>
   
      <output-modules>
  -      <component-instance logger="core.modules.output" name="attribute" class="org.apache.cocoon.components.modules.output.RequestAttributeOutputModule"/>
  -      <component-instance logger="core.modules.output" name="session"   class="org.apache.cocoon.components.modules.output.SessionAttributeOutputModule"/>
  +      <component-instance logger="core.modules.output" name="request-attr" class="org.apache.cocoon.components.modules.output.RequestAttributeOutputModule"/>
  +      <component-instance logger="core.modules.output" name="session-attr"   class="org.apache.cocoon.components.modules.output.SessionAttributeOutputModule"/>
      </output-modules>
   
      <autoincrement-modules>
  @@ -42,6 +47,7 @@
         <component-instance logger="core.modules.auto" name="auto" class="org.apache.cocoon.components.modules.database.ManualAutoIncrementModule"/>
         <component-instance logger="core.modules.auto" name="auto" class="org.apache.cocoon.components.modules.database.IfxSerialAutoIncrementModule"/>
         <component-instance logger="core.modules.auto" name="auto" class="org.apache.cocoon.components.modules.database.MysqlAutoIncrementModule"/>
  +      <component-instance logger="core.modules.auto" name="auto" class="org.apache.cocoon.components.modules.database.PsqlAutoIncrementModule"/>
   -->
      </autoincrement-modules>
  -</xconf>
  \ No newline at end of file
  +</xconf>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.4.1   +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/modules/output/OutputModule.java
  
  Index: OutputModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/output/OutputModule.java,v
  retrieving revision 1.4
  retrieving revision 1.4.4.1
  diff -u -r1.4 -r1.4.4.1
  --- OutputModule.java	2 Aug 2002 03:16:04 -0000	1.4
  +++ OutputModule.java	17 Nov 2002 19:12:49 -0000	1.4.4.1
  @@ -67,7 +67,7 @@
    */
   public interface OutputModule extends Component {
   
  -    String ROLE = "org.apache.cocoon.components.modules.output.OutputModule";
  +    String ROLE = OutputModule.class.getName();
   
       /**
        * communicate an attribute value to further processing logic.
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.4.1   +4 -4      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/AbstractInputModule.java
  
  Index: AbstractInputModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/AbstractInputModule.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- AbstractInputModule.java	31 Jul 2002 13:13:24 -0000	1.2
  +++ AbstractInputModule.java	17 Nov 2002 19:12:49 -0000	1.2.4.1
  @@ -60,9 +60,9 @@
   import org.apache.cocoon.util.HashMap;
   
   /**
  - * AbstractDatabaseModule gives you the infrastructure for easily
  - * deploying more InputModules.  In order to get at the
  - * Logger, use getLogger().
  + * AbstractInputModule gives you the infrastructure for easily
  + * deploying more InputModules.  In order to get at the Logger, use
  + * getLogger().
    *
    * @author <a href="mailto:haul@apache.org">Christian Haul</a>
    * @version CVS $Id$
  
  
  
  1.4.4.1   +58 -252   xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/Attic/CollectionMetaModule.java
  
  Index: CollectionMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/Attic/CollectionMetaModule.java,v
  retrieving revision 1.4
  retrieving revision 1.4.4.1
  diff -u -r1.4 -r1.4.4.1
  --- CollectionMetaModule.java	31 Jul 2002 13:13:24 -0000	1.4
  +++ CollectionMetaModule.java	17 Nov 2002 19:12:49 -0000	1.4.4.1
  @@ -50,28 +50,14 @@
   */
   package org.apache.cocoon.components.modules.input;
   
  -
  -import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.activity.Initializable;
  -import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.component.ComponentSelector;
  -import org.apache.avalon.framework.component.ComponentException;
  -import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.component.Composable;
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
  -import org.apache.avalon.framework.parameters.Parameters;
  -import org.apache.avalon.framework.thread.ThreadSafe;
   
  -import org.apache.cocoon.components.modules.input.InputModule;
   import org.apache.cocoon.util.JDBCTypeConversions;
   
  -import org.apache.cocoon.matching.AbstractWildcardMatcher;
  -
   import java.util.ArrayList;
   import java.util.Map;
  -import java.util.Enumeration;
  +import java.util.Iterator;
   import java.util.SortedSet;
   import java.util.TreeSet;
   
  @@ -95,37 +81,12 @@
    * @author <a href="mailto:haul@informatik.tu-darmstadt.de">Christian Haul</a>
    * @version CVS $Id$
    */
  -public class CollectionMetaModule extends AbstractLogEnabled
  -    implements InputModule, Configurable, Initializable, Composable, Disposable {
  -
  -    /** The component manager instance */
  -    protected ComponentManager manager;
  +public class CollectionMetaModule extends AbstractMetaModule {
   
       protected Configuration memberConf = null;
   
  -    private String defaultInput = "request"; // default to request parameters
  -    private Configuration inputConf = null;  // will become an empty configuration object
  -                                             // during configure() so why bother here...
  -    String INPUT_MODULE_ROLE = InputModule.ROLE;
  -    String INPUT_MODULE_SELECTOR = INPUT_MODULE_ROLE+"Selector";
  -
  -    private boolean initialized = false;
  -    private InputModule input = null;
  -    private ComponentSelector inputSelector = null;
  -
  -
  -
  -    /**
  -     * Set the current <code>ComponentManager</code> instance used by this
  -     * <code>Composable</code>.
  -     */
  -    public void compose(ComponentManager manager) throws ComponentException {
  -
  -        this.manager=manager;
  -    }
  -
  -
       
  +
       public void configure(Configuration config) throws ConfigurationException {
   
           this.memberConf = config.getChild("member");
  @@ -135,58 +96,11 @@
   
   
   
  -    public void initialize() {
  -
  -        try {
  -            // obtain input module
  -            this.inputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR); 
  -            if (this.defaultInput != null && 
  -                this.inputSelector != null && 
  -                this.inputSelector.hasComponent(this.defaultInput)
  -                ){
  -                this.input = (InputModule) this.inputSelector.select(this.defaultInput);
  -                if (!(this.input instanceof ThreadSafe && this.inputSelector instanceof ThreadSafe) ) {
  -                    this.inputSelector.release(this.input);
  -                    this.manager.release(this.inputSelector);
  -                    this.input = null;
  -                    this.inputSelector = null;
  -                }
  -                this.initialized = true;
  -            } else {
  -                if (getLogger().isErrorEnabled())
  -                    getLogger().error("A problem occurred setting up '" + this.defaultInput 
  -                                      + "': Selector is "+(this.inputSelector!=null?"not ":"")
  -                                      +"null, Component is "
  -                                      +(this.inputSelector!=null&&this.inputSelector.hasComponent(this.defaultInput)?"known":"unknown"));
  -            }
  -        } catch (Exception e) {
  -            if (getLogger().isWarnEnabled()) 
  -                getLogger().warn("A problem occurred setting up '" + this.defaultInput + "': " + e.getMessage());
  -        }
  -    }
  -
  -
  -
  -    public void dispose() {
  -
  -        if (!this.initialized) 
  -            if (getLogger().isErrorEnabled()) 
  -                getLogger().error("Uninitialized Component! FAILING");
  -        else 
  -            if (this.inputSelector != null) {
  -                if (this.input != null)
  -                    this.inputSelector.release(this.input);
  -                this.manager.release(this.inputSelector);
  -            }
  -    }
  -
  -
  -    
   
       public Object getAttribute( String name, Configuration modeConf, Map objectModel ) 
           throws ConfigurationException {
   
  -        if (!this.initialized) {
  +        if (!this.initialized.booleanValue()) {
               if (getLogger().isErrorEnabled()) 
                   getLogger().error("Uninitialized Component! FAILING");
               return null;
  @@ -226,86 +140,32 @@
   
           getLogger().debug("jType "+jType);
   
  -        // done reading configuration
  -        // setup modules and read values
  -        Object result = null;
  -        try {
  -            Object[] values = null;
  -            if (this.input != null && inputName == null) {
  -                // input module is thread safe
  -                // thus we still have a reference to it
  -                // and
  -                // no other module is configured dynamically
  -                values = input.getAttributeValues(pName,this.inputConf,objectModel);
  -            } else {
  -                // input was not thread safe
  -                // or
  -                // another module is configured dynamically
  -                // so acquire it again
  -                ComponentSelector iputSelector = null;
  -                InputModule iput = null;
  -                try {
  -                    // obtain input module
  -                    if (inputName == null) {
  -                        inputName   = this.defaultInput;
  -                        inputConfig = this.inputConf;
  -                    }
  -
  -                    iputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR); 
  -                    if (this.defaultInput != null 
  -                        && iputSelector != null 
  -                        && iputSelector.hasComponent(inputName)) {
  -                        
  -                        iput = (InputModule) iputSelector.select(inputName);
  -                    }
  -                    if (iput != null) {
  -                        values = iput.getAttributeValues(pName, inputConfig, objectModel);
  -                    }           
  -                } catch (Exception e) {
  -                    if (getLogger().isWarnEnabled()) 
  -                        getLogger().warn("A problem occurred acquiring a value from '" 
  -                                         + inputName + "' for '"+pName+"': " + e.getMessage());
  -                } finally {
  -                    // release components
  -                    if (iputSelector != null) {
  -                        if (iput != null)
  -                            iputSelector.release(iput);
  -                        this.manager.release(iputSelector);
  -                    }
  -                }
  +        Object[] values = getValues(pName, objectModel,
  +                                    this.input, this.defaultInput, this.inputConf,
  +                                    null, inputName, inputConfig);
  +        Object[] objects = null;
   
  -            }
  +        if (values != null) {
               
  -            // done reading values
  -            // start converting values and assemble array
  -
  -            if (values != null) {
  -                
  -                Object[] objects = new Object[values.length];
  -                    
  -                // FIXME: should put this into helper class
  -                for (int i = 0; i<values.length; i++) {
  -                    Object value = values[i];
  -                    objects[i] = JDBCTypeConversions.convert(value, jType);
  -                }
  -                return objects;
  +            objects = new Object[values.length];
  +            
  +            for (int i = 0; i<values.length; i++) {
  +                Object value = values[i];
  +                objects[i] = JDBCTypeConversions.convert(value, jType);
               }
  -        } catch (Exception e) {
  -            if (getLogger().isWarnEnabled()) 
  -                getLogger().warn("A problem occurred acquiring a value from '" + inputName 
  -                                 + "' for '"+pName+"': " + e.getMessage());
           }
  -        return null;        
  +
  +        return objects;
       }
   
   
   
   
   
  -    public Enumeration getAttributeNames( Configuration modeConf, Map objectModel ) 
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel ) 
           throws ConfigurationException {
   
  -        if (!this.initialized) {
  +        if (!this.initialized.booleanValue()) {
               if (getLogger().isErrorEnabled()) 
                   getLogger().error("Uninitialized Component! FAILING");
               return null;
  @@ -330,103 +190,49 @@
               }
           }
   
  -        // done reading configuration
  -        // setup modules and read attribute names
  -        Object result = null;
  -        try {
  -            Enumeration names = null;
  -            if (this.input != null && inputName == null) {
  -                // input module is thread safe
  -                // thus we still have a reference to it
  -                // and
  -                // no other module is configured dynamically
  -                names = input.getAttributeNames(this.inputConf,objectModel);
  -            } else {
  -                // input was not thread safe
  -                // or
  -                // another module is configured dynamically
  -                // so acquire it again
  -                ComponentSelector iputSelector = null;
  -                InputModule iput = null;
  -                try {
  -                    // obtain input module
  -                    if (inputName == null) {
  -                        inputName   = this.defaultInput;
  -                        inputConfig = this.inputConf;
  -                    }
   
  -                    iputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR); 
  -                    if (this.defaultInput != null 
  -                        && iputSelector != null 
  -                        && iputSelector.hasComponent(inputName)) {
  -                        
  -                        iput = (InputModule) iputSelector.select(inputName);
  -                    }
  -                    if (iput != null) {
  -                        names = iput.getAttributeNames(inputConfig, objectModel);
  -                    }           
  -                } catch (Exception e) {
  -                    if (getLogger().isWarnEnabled()) 
  -                        getLogger().warn("A problem occurred acquiring a names from '" + inputName + "': " + e.getMessage());
  -                } finally {
  -                    // release components
  -                    if (iputSelector != null) {
  -                        if (iput != null)
  -                            iputSelector.release(iput);
  -                        this.manager.release(iputSelector);
  -                    }
  -                }
  -
  -            }
  +        Iterator names = getNames(objectModel,
  +                                  this.input, this.defaultInput, this.inputConf,
  +                                  null, inputName, inputConfig);
  +
  +        if (names != null) {
  +            SortedSet matchset = new TreeSet();
  +            String pName = mConf.getAttribute("name");
  +            int index = pName.indexOf("*");
  +
  +            if (index>-1) {
  +                // parameter name contains '*'
  +                // find all strings that match this '*'
  +                // return them in an enumeration
   
  -            // done reading names
  -            // find attribute names matching configuration
  -            // and return an enumeration
  -
  -            if (names != null) {
  -                SortedSet matchset = new TreeSet();
  -                String pName = mConf.getAttribute("name");
  -                int index = pName.indexOf("*");
  -
  -                if (index>-1) {
  -                    // parameter name contains '*'
  -                    // find all strings that match this '*'
  -                    // return them in an enumeration
  -
  -                    String prefix = (index > 0 ? pName.substring(0,index) : null);
  -                    String suffix = (index < (pName.length() -1) ? pName.substring(index+1,pName.length()) : null);
  -
  -                    while (names.hasMoreElements()) {
  -                        String name = (String)names.nextElement();
  -                        if (name.startsWith(prefix) && name.endsWith(suffix)) {
  -                            String wildcard = name.substring(prefix.length());
  -                            wildcard = wildcard.substring(0,wildcard.length()-suffix.length());
  -                            matchset.add(wildcard);
  -                        }
  -                    }
  -                } else {
  -                    // parameter name without wildcard
  -                    // check that name is among available names
  -                    // and return it in that case
  -                    boolean done=false;
  -                    while (!done && names.hasMoreElements()) {
  -                        String name = (String)names.nextElement();
  -                        if (name.equals(pName)) {
  -                            matchset.add(pName);
  -                            done = true;
  -                        }
  +                String prefix = (index > 0 ? pName.substring(0,index) : null);
  +                String suffix = (index < (pName.length() -1) ? pName.substring(index+1,pName.length()) : null);
  +                
  +                while (names.hasNext()) {
  +                    String name = (String)names.next();
  +                    if (name.startsWith(prefix) && name.endsWith(suffix)) {
  +                        String wildcard = name.substring(prefix.length());
  +                        wildcard = wildcard.substring(0,wildcard.length()-suffix.length());
  +                        matchset.add(wildcard);
                       }
                   }
  -                return new EnumerationHelper(matchset.iterator());
               } else {
  -                return null;
  +                // parameter name without wildcard
  +                // check that name is among available names
  +                // and return it in that case
  +                boolean done=false;
  +                while (!done && names.hasNext()) {
  +                    String name = (String)names.next();
  +                    if (name.equals(pName)) {
  +                        matchset.add(pName);
  +                        done = true;
  +                    }
  +                }
               }
  -
  -        } catch (Exception e) {
  -            if (getLogger().isWarnEnabled()) 
  -                getLogger().warn("A problem occurred acquiring names from '" + inputName + "': " + e.getMessage());
  +            return matchset.iterator();
  +        } else {
  +            return null;
           }
  -        return null;        
       }
   
   
  @@ -435,10 +241,10 @@
       public Object[] getAttributeValues( String name, Configuration modeConf, Map objectModel ) 
           throws ConfigurationException {
   
  -        Enumeration names = this.getAttributeNames( modeConf, objectModel );
  +        Iterator names = this.getAttributeNames( modeConf, objectModel );
           ArrayList values = new ArrayList();
  -        while (names.hasMoreElements()) {
  -            values.add(this.getAttribute((String) names.nextElement(),modeConf,objectModel));
  +        while (names.hasNext()) {
  +            values.add(this.getAttribute((String) names.next(),modeConf,objectModel));
           }
   
           return values.toArray();
  
  
  
  1.3.4.1   +16 -8     xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DateInputModule.java
  
  Index: DateInputModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DateInputModule.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- DateInputModule.java	11 Aug 2002 18:17:15 -0000	1.3
  +++ DateInputModule.java	17 Nov 2002 19:12:49 -0000	1.3.4.1
  @@ -51,10 +51,10 @@
   
   package org.apache.cocoon.components.modules.input;
   
  -import java.util.Enumeration;
  +import java.util.Iterator;
   import java.util.List;
   import java.util.LinkedList;
  -import java.util.StringTokenizer;
  +import java.util.Vector;
   import java.util.Date;
   import java.util.Map;
   import java.text.SimpleDateFormat;
  @@ -66,7 +66,7 @@
   /**
    * DateInputModule returns current date, optionally formated as
    * string. Format given through attribute "format" of configuration
  - * root node.
  + * root node or nested &lt;format/&gt; tag on module declaration.
    *
    * @author <a href="mailto:haul@apache.org">Christian Haul</a>
    * @version CVS $Id$
  @@ -74,11 +74,19 @@
    */
   public class DateInputModule extends AbstractInputModule implements ThreadSafe {
   
  -    final static Enumeration returnNames = new StringTokenizer("stringConstant");
  +    final static Vector returnNames;
  +    static {
  +        Vector tmp = new Vector();
  +        tmp.add("currentDate");
  +        returnNames = tmp;
  +    }
   
       public Object getAttribute( String name, Configuration modeConf, Map objectModel ) throws ConfigurationException {
           
  -        String format = (modeConf != null? modeConf.getAttribute("format",null) : null);
  +        String format = (modeConf != null? 
  +                         modeConf.getAttribute("format", (String) this.settings.get("format",null)) 
  +                         : 
  +                         (String) this.settings.get("format",null));
   
           if (format==null) {
               return new Date();
  @@ -88,9 +96,9 @@
       }
   
   
  -    public Enumeration getAttributeNames( Configuration modeConf, Map objectModel ) throws ConfigurationException {
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel ) throws ConfigurationException {
   
  -        return DateInputModule.returnNames;
  +        return DateInputModule.returnNames.iterator();
       }
   
   
  
  
  
  1.3.4.1   +14 -197   xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DefaultsMetaModule.java
  
  Index: DefaultsMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DefaultsMetaModule.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- DefaultsMetaModule.java	9 Aug 2002 08:32:11 -0000	1.3
  +++ DefaultsMetaModule.java	17 Nov 2002 19:12:49 -0000	1.3.4.1
  @@ -51,36 +51,28 @@
   package org.apache.cocoon.components.modules.input;
   
   
  -import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.component.ComponentSelector;
  -import org.apache.avalon.framework.component.ComponentException;
  -import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.framework.thread.ThreadSafe;
   
   import org.apache.cocoon.components.modules.input.InputModule;
  -import org.apache.cocoon.util.JDBCTypeConversions;
  -
  -import org.apache.cocoon.matching.AbstractWildcardMatcher;
   
   import java.util.ArrayList;
   import java.util.Map;
   import java.util.HashMap;
  -import java.util.Enumeration;
  +import java.util.Iterator;
   import java.util.SortedSet;
   import java.util.TreeSet;
   
   /**
  - * Set a number of constants that may be overridden by output from
  - * another input module.
  + * Set a number of constants. To override the values with input from
  + * another module, combine this one with the ChainMetaModule and an
  + * arbitrary number of other modules. IOW this is no "meta" module
  + * anymore!
    *
  - * &lt;input-module&gt;some-other-module&lt;/input-module&gt;
    * &lt;values&gt;
    *  &lt;skin&gt;myskin&lt;/skin&gt;
    *  &lt;base&gt;baseurl&lt;/base&gt;
  @@ -90,38 +82,12 @@
    * @version CVS $Id$
    */
   public class DefaultsMetaModule extends AbstractLogEnabled
  -    implements InputModule, Configurable, Initializable, Composable, Disposable {
  -
  -    /** The component manager instance */
  -    protected ComponentManager manager;
  +    implements InputModule, Configurable, ThreadSafe {
   
  -    private String defaultInput = null;
  -    private Configuration inputConf = null;  // will become an empty configuration object
  -                                             // during configure() so why bother here...
  -    String INPUT_MODULE_ROLE = InputModule.ROLE;
  -    String INPUT_MODULE_SELECTOR = INPUT_MODULE_ROLE+"Selector";
  -
  -    private boolean initialized = false;
  -    private InputModule input = null;
  -    private ComponentSelector inputSelector = null;
       private Map constants = null;
  -
  -
  -    /**
  -     * Set the current <code>ComponentManager</code> instance used by this
  -     * <code>Composable</code>.
  -     */
  -    public void compose(ComponentManager manager) throws ComponentException {
  -
  -        this.manager=manager;
  -    }
  -
  -
       
       public void configure(Configuration config) throws ConfigurationException {
   
  -        this.inputConf = config.getChild("input-module");
  -        this.defaultInput = this.inputConf.getAttribute("name",this.defaultInput);
           this.constants = new HashMap();
           Configuration[] consts = config.getChild("values").getChildren();
           for (int i=0; i<consts.length; i++) {
  @@ -130,182 +96,33 @@
       }
   
   
  -
  -    public void initialize() {
  -
  -        try {
  -            // obtain input module
  -            this.inputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR); 
  -            if (this.defaultInput != null && 
  -                this.inputSelector != null && 
  -                this.inputSelector.hasComponent(this.defaultInput)
  -                ){
  -                this.input = (InputModule) this.inputSelector.select(this.defaultInput);
  -                if (!(this.input instanceof ThreadSafe && this.inputSelector instanceof ThreadSafe) ) {
  -                    this.inputSelector.release(this.input);
  -                    this.manager.release(this.inputSelector);
  -                    this.input = null;
  -                    this.inputSelector = null;
  -                }
  -                this.initialized = true;
  -            } else {
  -                if (this.defaultInput != null)
  -                    if (getLogger().isErrorEnabled())
  -                        getLogger().error("A problem occurred setting up '" + this.defaultInput 
  -                                          +"': Selector is "+(this.inputSelector!=null?"not ":"")
  -                                          +"null, Component is "
  -                                          +(this.inputSelector!=null&&this.inputSelector.hasComponent(this.defaultInput)?"known":"unknown"));
  -            }
  -        } catch (Exception e) {
  -            if (getLogger().isWarnEnabled()) 
  -                getLogger().warn("A problem occurred setting up '" + this.defaultInput + "': " + e.getMessage());
  -        }
  -    }
  -
  -
  -
  -    public void dispose() {
  -
  -        if (!this.initialized) 
  -            if (getLogger().isErrorEnabled()) 
  -                getLogger().error("Uninitialized Component! FAILING");
  -        else 
  -            if (this.inputSelector != null) {
  -                if (this.input != null)
  -                    this.inputSelector.release(this.input);
  -                this.manager.release(this.inputSelector);
  -            }
  -    }
  -
  -
  -    
  -
       public Object[] getAttributeValues( String name, Configuration modeConf, Map objectModel ) 
           throws ConfigurationException {
   
  -        if (!this.initialized) {
  -            if (getLogger().isErrorEnabled()) 
  -                getLogger().error("Uninitialized Component! FAILING");
  -            return null;
  -        }
  -        if (this.defaultInput == null) {
  -            if (getLogger().isWarnEnabled()) 
  -                getLogger().warn("No input module given");
  -        }
  -
  -        // obtain correct configuration objects
  -        // default vs dynamic
  -        Configuration inputConfig = this.inputConf;
  -        Configuration mConf = null;
  -        String inputName=null;
           String parameter=name;
  +        Configuration mConf = null;
           if (modeConf!=null) {
               mConf       = modeConf.getChild("values");
  -            inputName   = modeConf.getChild("input-module").getAttribute("name",null);
  -            parameter   = modeConf.getAttribute("parameter",parameter);
  -            if (inputName != null) {
  -                inputConfig = modeConf.getChild("input-module");
  -            }
           }
   
  -        // done reading configuration
  -        // setup modules and read values
  -        Object[] values = null;
  -        try {
  -            if (this.defaultInput != null || inputName != null) {
  -                if (this.input != null && inputName == null) {
  -                    // input module is thread safe
  -                    // thus we still have a reference to it
  -                    // and
  -                    // no other module is configured dynamically
  -                    values = input.getAttributeValues(parameter,this.inputConf,objectModel);
  -                } else {
  -                    // input was not thread safe
  -                    // or
  -                    // another module is configured dynamically
  -                    // so acquire it again
  -                    ComponentSelector iputSelector = null;
  -                    InputModule iput = null;
  -                    try {
  -                        // obtain input module
  -                        if (inputName == null) {
  -                            inputName   = this.defaultInput;
  -                            inputConfig = this.inputConf;
  -                        }
  -                        
  -                        iputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR); 
  -                        if (this.defaultInput != null 
  -                            && iputSelector != null 
  -                            && iputSelector.hasComponent(inputName)) {
  -                            
  -                            iput = (InputModule) iputSelector.select(inputName);
  -                        }
  -                        if (iput != null) {
  -                            values = iput.getAttributeValues(parameter, inputConfig, objectModel);
  -                        }           
  -                    } catch (Exception e) {
  -                        if (getLogger().isWarnEnabled()) 
  -                            getLogger().warn("A problem occurred acquiring a value from '" 
  -                                             + inputName + "' for '"+name+"': " + e.getMessage());
  -                    } finally {
  -                        // release components
  -                        if (iputSelector != null) {
  -                            if (iput != null)
  -                                iputSelector.release(iput);
  -                            this.manager.release(iputSelector);
  -                        }
  -                    }
  -                    
  -                }
  -            }
  -            
  -            // done reading values
  -            // start converting values and assemble array
  -
  -            if (values == null) {
  -                values = new Object[1];
  -                values[0] = (mConf!=null?mConf.getChild(parameter).getValue((String) this.constants.get(parameter)) : this.constants.get(parameter));
  -            }
  -            return values;
  -        } catch (Exception e) {
  -            if (getLogger().isWarnEnabled()) 
  -                getLogger().warn("A problem occurred acquiring a value from '" + inputName 
  -                                 + "' for '"+name+"': " + e.getMessage());
  -        }
  -        return null;        
  +        Object[] values = new Object[1];
  +        values[0] = (mConf!=null? mConf.getChild(parameter).getValue((String) this.constants.get(parameter)) 
  +                     : this.constants.get(parameter));
  +        return values;
       }
   
   
  -
  -
  -
  -    public Enumeration getAttributeNames( Configuration modeConf, Map objectModel ) 
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel ) 
           throws ConfigurationException {
   
  -        if (!this.initialized) {
  -            if (getLogger().isErrorEnabled()) 
  -                getLogger().error("Uninitialized Component! FAILING");
  -            return null;
  -        }
  -        if (this.defaultInput == null) {
  -            if (getLogger().isWarnEnabled()) 
  -                getLogger().warn("No input module given. FAILING");
  -            return null;
  -        }
  -
  -        // obtain correct configuration objects
  -        // default vs dynamic
  -
           SortedSet matchset = new TreeSet(this.constants.keySet());
           if (modeConf!=null) {
               Configuration[] consts = modeConf.getChild("values").getChildren();
               for (int i=0; i<consts.length; i++)
                   matchset.add(consts[i].getName());
           }
  -        return new EnumerationHelper(matchset.iterator());
  +        return matchset.iterator();
        }
  -
  -
   
   
       public Object getAttribute( String name, Configuration modeConf, Map objectModel ) 
  
  
  
  1.4.4.1   +62 -307   xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DigestMetaModule.java
  
  Index: DigestMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DigestMetaModule.java,v
  retrieving revision 1.4
  retrieving revision 1.4.4.1
  diff -u -r1.4 -r1.4.4.1
  --- DigestMetaModule.java	9 Aug 2002 08:32:11 -0000	1.4
  +++ DigestMetaModule.java	17 Nov 2002 19:12:49 -0000	1.4.4.1
  @@ -50,35 +50,18 @@
   */
   package org.apache.cocoon.components.modules.input;
   
  -
  -import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.activity.Initializable;
  -import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.component.ComponentSelector;
  -import org.apache.avalon.framework.component.ComponentException;
  -import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.component.Composable;
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
  -import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.framework.thread.ThreadSafe;
   
  -import org.apache.cocoon.components.modules.input.InputModule;
  -
  -import org.apache.cocoon.matching.AbstractWildcardMatcher;
  -
   import java.net.URLEncoder;
   
  -import java.util.ArrayList;
   import java.util.Map;
  -import java.util.Enumeration;
   import java.util.Iterator;
  -import java.util.SortedSet;
  -import java.util.TreeSet;
   
   import java.security.MessageDigest;
   import java.security.NoSuchAlgorithmException;
  +import java.security.NoSuchProviderException;
   
   /** Meta module that obtains values from other module and returns
    * message digest of value. Very useful for storing and checking
  @@ -91,21 +74,7 @@
    * @author <a href="mailto:haul@informatik.tu-darmstadt.de">Christian Haul</a>
    * @version CVS $Id$
    */
  -public class DigestMetaModule extends AbstractLogEnabled
  -    implements InputModule, Configurable, Initializable, Composable, Disposable {
  -
  -    /** The component manager instance */
  -    protected ComponentManager manager;
  -
  -    private String defaultInput = "request"; // default to request parameters
  -    private Configuration inputConf = null;  // will become an empty configuration object
  -                                             // during configure() so why bother here...
  -    String INPUT_MODULE_ROLE = InputModule.ROLE;
  -    String INPUT_MODULE_SELECTOR = INPUT_MODULE_ROLE+"Selector";
  -
  -    private boolean initialized = false;
  -    private InputModule input = null;
  -    private ComponentSelector inputSelector = null;
  +public class DigestMetaModule extends AbstractMetaModule {
   
       private String defaultAlgorithm = "SHA";
       private String defaultProvider = null;
  @@ -113,17 +82,6 @@
       private boolean defaultEncode = false;
   
   
  -    /**
  -     * Set the current <code>ComponentManager</code> instance used by this
  -     * <code>Composable</code>.
  -     */
  -    public void compose(ComponentManager manager) throws ComponentException {
  -
  -        this.manager=manager;
  -    }
  -
  -
  -    
       public void configure(Configuration config) throws ConfigurationException {
   
           this.inputConf = config.getChild("input-module");
  @@ -134,59 +92,10 @@
       }
   
   
  -
  -    public void initialize() {
  -
  -        try {
  -            // obtain input module
  -            this.inputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR); 
  -            if (this.defaultInput != null && 
  -                this.inputSelector != null && 
  -                this.inputSelector.hasComponent(this.defaultInput)
  -                ){
  -                this.input = (InputModule) this.inputSelector.select(this.defaultInput);
  -                if (!(this.input instanceof ThreadSafe && this.inputSelector instanceof ThreadSafe) ) {
  -                    this.inputSelector.release(this.input);
  -                    this.manager.release(this.inputSelector);
  -                    this.input = null;
  -                    this.inputSelector = null;
  -                }
  -                this.initialized = true;
  -            } else {
  -                if (getLogger().isErrorEnabled())
  -                    getLogger().error("A problem occurred setting up '" + this.defaultInput 
  -                                      + "': Selector is "+(this.inputSelector!=null?"not ":"")
  -                                      +"null, Component is "
  -                                      +(this.inputSelector!=null&&this.inputSelector.hasComponent(this.defaultInput)?"known":"unknown"));
  -            }
  -        } catch (Exception e) {
  -            if (getLogger().isWarnEnabled()) 
  -                getLogger().warn("A problem occurred setting up '" + this.defaultInput + "': " + e.getMessage());
  -        }
  -    }
  -
  -
  -
  -    public void dispose() {
  -
  -        if (!this.initialized) 
  -            if (getLogger().isErrorEnabled()) 
  -                getLogger().error("Uninitialized Component! FAILING");
  -        else 
  -            if (this.inputSelector != null) {
  -                if (this.input != null)
  -                    this.inputSelector.release(this.input);
  -                this.manager.release(this.inputSelector);
  -            }
  -    }
  -
  -
  -    
  -
       public Object getAttribute( String name, Configuration modeConf, Map objectModel ) 
           throws ConfigurationException {
   
  -        if (!this.initialized) {
  +        if (!this.initialized.booleanValue()) {
               if (getLogger().isErrorEnabled()) 
                   getLogger().error("Uninitialized Component! FAILING");
               return null;
  @@ -214,82 +123,33 @@
           String salt  = modeConf.getAttribute("salt" ,this.defaultSalt );
           boolean encode = modeConf.getAttributeAsBoolean("encode" ,this.defaultEncode );
   
  -        // done reading configuration
  -        // setup modules and read values
  -        Object result = null;
  -        try {
  -            Object value = null;
  -            if (this.input != null && inputName == null) {
  -                // input module is thread safe
  -                // thus we still have a reference to it
  -                // and
  -                // no other module is configured dynamically
  -                value = input.getAttribute(name,this.inputConf,objectModel);
  -            } else {
  -                // input was not thread safe
  -                // or
  -                // another module is configured dynamically
  -                // so acquire it again
  -                ComponentSelector iputSelector = null;
  -                InputModule iput = null;
  -                try {
  -                    // obtain input module
  -                    if (inputName == null) {
  -                        inputName   = this.defaultInput;
  -                        inputConfig = this.inputConf;
  -                    }
  -
  -                    iputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR); 
  -                    if (this.defaultInput != null 
  -                        && iputSelector != null 
  -                        && iputSelector.hasComponent(inputName)) {
  -                        
  -                        iput = (InputModule) iputSelector.select(inputName);
  -                    }
  -                    if (iput != null) {
  -                        value = iput.getAttribute(name, inputConfig, objectModel);
  -                    }           
  -                } catch (Exception e) {
  -                    if (getLogger().isWarnEnabled()) 
  -                        getLogger().warn("A problem occurred acquiring a value from '" 
  -                                         + inputName + "' for '"+name+"': " + e.getMessage());
  -                } finally {
  -                    // release components
  -                    if (iputSelector != null) {
  -                        if (iput != null)
  -                            iputSelector.release(iput);
  -                        this.manager.release(iputSelector);
  -                    }
  -                }
   
  +        Object result = null;
  +        Object value = getValue(name, objectModel,
  +                                this.input, this.defaultInput, this.inputConf,
  +                                null, inputName, inputConfig);
  +        
  +        if (value != null)
  +            try {
  +                MessageDigest md = (provider==null ? MessageDigest.getInstance(algorithm) : 
  +                                    MessageDigest.getInstance(algorithm,provider));
  +                
  +                md.update((salt+(value instanceof String? (String)value : value.toString())).getBytes());
  +                if (encode) {
  +                    return URLEncoder.encode(new String(md.digest()));
  +                } else {
  +                    return md.digest();
  +                }
  +            } catch (NoSuchAlgorithmException nsae) {
  +                if (getLogger().isWarnEnabled()) 
  +                    getLogger().warn("A problem occurred acquiring digest algorithm '" + algorithm 
  +                                     + (provider==null?"":"' from '"+provider) +"': " + nsae.getMessage());
  +            } catch (NoSuchProviderException nspe) {
  +                if (getLogger().isWarnEnabled()) 
  +                    getLogger().warn("A problem occurred acquiring digest algorithm '" + algorithm 
  +                                     + (provider==null?"":"' from '"+provider) +"': " + nspe.getMessage());
               }
  -            
  -            // done reading value
  -            // get message digest implementation and compute hash
  -
  -            if (value != null) {
  -
  -                try {
  -                    MessageDigest md = (provider==null ? MessageDigest.getInstance(algorithm) : 
  -                                        MessageDigest.getInstance(algorithm,provider));
  -                    
  -                    md.update((salt+(value instanceof String? (String)value : value.toString())).getBytes());
  -                    if (encode) {
  -                        return URLEncoder.encode(new String(md.digest()));
  -                    } else {
  -                        return md.digest();
  -                    }
  -                } catch (NoSuchAlgorithmException nsae) {
  -                    if (getLogger().isWarnEnabled()) 
  -                        getLogger().warn("A problem occurred acquiring digest algorithm '" + algorithm 
  -                                         + (provider==null?"":"' from '"+provider) +"': " + nsae.getMessage());
  -                }
  -            }
  -        } catch (Exception e) {
  -            if (getLogger().isWarnEnabled()) 
  -                getLogger().warn("A problem occurred acquiring a value from '" + inputName 
  -                                 + "' for '"+name+"': " + e.getMessage());
  -        }
  +
           return null;        
       }
   
  @@ -297,10 +157,10 @@
   
   
   
  -    public Enumeration getAttributeNames( Configuration modeConf, Map objectModel ) 
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel ) 
           throws ConfigurationException {
   
  -         if (!this.initialized) {
  +         if (!this.initialized.booleanValue()) {
               if (getLogger().isErrorEnabled()) 
                   getLogger().error("Uninitialized Component! FAILING");
               return null;
  @@ -322,68 +182,12 @@
               }
           }
   
  -        // read necessary parameters
  -
  -        // done reading configuration
  -        // setup modules and read values
  -        Object result = null;
  -        try {
  -            Enumeration names = null;
  -            if (this.input != null && inputName == null) {
  -                // input module is thread safe
  -                // thus we still have a reference to it
  -                // and
  -                // no other module is configured dynamically
  -                names = input.getAttributeNames(this.inputConf,objectModel);
  -            } else {
  -                // input was not thread safe
  -                // or
  -                // another module is configured dynamically
  -                // so acquire it again
  -                ComponentSelector iputSelector = null;
  -                InputModule iput = null;
  -                try {
  -                    // obtain input module
  -                    if (inputName == null) {
  -                        inputName   = this.defaultInput;
  -                        inputConfig = this.inputConf;
  -                    }
  -
  -                    iputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR); 
  -                    if (this.defaultInput != null 
  -                        && iputSelector != null 
  -                        && iputSelector.hasComponent(inputName)) {
  -                        
  -                        iput = (InputModule) iputSelector.select(inputName);
  -                    }
  -                    if (iput != null) {
  -                        names = iput.getAttributeNames(inputConfig, objectModel);
  -                    }           
  -                } catch (Exception e) {
  -                    if (getLogger().isWarnEnabled()) 
  -                        getLogger().warn("A problem occurred acquiring a names from '" 
  -                                         + inputName + "': " + e.getMessage());
  -                } finally {
  -                    // release components
  -                    if (iputSelector != null) {
  -                        if (iput != null)
  -                            iputSelector.release(iput);
  -                        this.manager.release(iputSelector);
  -                    }
  -                }
  +        Iterator names = getNames(objectModel, 
  +                                  this.input, this.defaultInput, this.inputConf, 
  +                                  null, inputName, inputConfig);
  +        
  +        return names;
   
  -            }
  -            
  -            // done reading value
  -
  -            return names;
  -
  -        } catch (Exception e) {
  -            if (getLogger().isWarnEnabled()) 
  -                getLogger().warn("A problem occurred acquiring names from '" + inputName 
  -                                 + "' : " + e.getMessage());
  -        }
  -        return null;        
      }
   
   
  @@ -392,7 +196,7 @@
       public Object[] getAttributeValues( String name, Configuration modeConf, Map objectModel ) 
           throws ConfigurationException {
   
  -        if (!this.initialized) {
  +        if (!this.initialized.booleanValue()) {
               if (getLogger().isErrorEnabled()) 
                   getLogger().error("Uninitialized Component! FAILING");
               return null;
  @@ -420,87 +224,38 @@
           String salt  = modeConf.getAttribute("salt" ,this.defaultSalt );
           boolean encode = modeConf.getAttributeAsBoolean("encode" ,this.defaultEncode );
   
  -        // done reading configuration
  -        // setup modules and read values
  +        Object[] values = getValues(name, objectModel, 
  +                                    this.input, this.defaultInput, this.inputConf, 
  +                                    null, inputName, inputConfig);
           Object[] result = null;
  -        try {
  -            Object[] values = null;
  -            if (this.input != null && inputName == null) {
  -                // input module is thread safe
  -                // thus we still have a reference to it
  -                // and
  -                // no other module is configured dynamically
  -                values = input.getAttributeValues(name,this.inputConf,objectModel);
  -            } else {
  -                // input was not thread safe
  -                // or
  -                // another module is configured dynamically
  -                // so acquire it again
  -                ComponentSelector iputSelector = null;
  -                InputModule iput = null;
  -                try {
  -                    // obtain input module
  -                    if (inputName == null) {
  -                        inputName   = this.defaultInput;
  -                        inputConfig = this.inputConf;
  -                    }
  -
  -                    iputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR); 
  -                    if (this.defaultInput != null 
  -                        && iputSelector != null 
  -                        && iputSelector.hasComponent(inputName)) {
  -                        
  -                        iput = (InputModule) iputSelector.select(inputName);
  -                    }
  -                    if (iput != null) {
  -                        values = iput.getAttributeValues(name, inputConfig, objectModel);
  -                    }           
  -                } catch (Exception e) {
  -                    if (getLogger().isWarnEnabled()) 
  -                        getLogger().warn("A problem occurred acquiring a value from '" 
  -                                         + inputName + "' for '"+name+"': " + e.getMessage());
  -                } finally {
  -                    // release components
  -                    if (iputSelector != null) {
  -                        if (iput != null)
  -                            iputSelector.release(iput);
  -                        this.manager.release(iputSelector);
  -                    }
  -                }
   
  -            }
  -            
  -            // done reading value
  -            // get message digest implementation and compute hash
  -
  -            if (values != null) {
  -                try {
  -                    MessageDigest md = (provider==null ? MessageDigest.getInstance(algorithm) : 
  -                                        MessageDigest.getInstance(algorithm,provider));
  -                    
  -                    result = new Object[values.length];
  -                    for (int i=0; i<values.length; i++) {
  -                        md.update((salt + (values[i] instanceof String? (String)values[i] : 
  -                                          values[i].toString())).getBytes());
  -                        if (encode) {
  -                            result[i] = URLEncoder.encode(new String(md.digest()));
  -                        } else {
  -                            result[i] = md.digest();
  -                        }
  +        if (values != null) {
  +            try {
  +                MessageDigest md = (provider==null ? MessageDigest.getInstance(algorithm) : 
  +                                    MessageDigest.getInstance(algorithm,provider));
  +                
  +                result = new Object[values.length];
  +                for (int i=0; i<values.length; i++) {
  +                    md.update((salt + (values[i] instanceof String? (String)values[i] : 
  +                                       values[i].toString())).getBytes());
  +                    if (encode) {
  +                        result[i] = URLEncoder.encode(new String(md.digest()));
  +                    } else {
  +                        result[i] = md.digest();
                       }
  -                } catch (NoSuchAlgorithmException nsae) {
  -                    if (getLogger().isWarnEnabled()) 
  -                        getLogger().warn("A problem occurred acquiring digest algorithm '" + algorithm 
  -                                         + (provider==null?"":"' from '"+provider) +"': " + nsae.getMessage());
                   }
                   return result;
  +            } catch (NoSuchAlgorithmException nsae) {
  +                if (getLogger().isWarnEnabled()) 
  +                    getLogger().warn("A problem occurred acquiring digest algorithm '" + algorithm 
  +                                     + (provider==null?"":"' from '"+provider) +"': " + nsae.getMessage());
  +            } catch (NoSuchProviderException nspe) {
  +                if (getLogger().isWarnEnabled()) 
  +                    getLogger().warn("A problem occurred acquiring digest algorithm '" + algorithm 
  +                                     + (provider==null?"":"' from '"+provider) +"': " + nspe.getMessage());
               }
  -        } catch (Exception e) {
  -            if (getLogger().isWarnEnabled()) 
  -                getLogger().warn("A problem occurred acquiring a value from '" + inputName 
  -                                 + "' for '"+name+"': " + e.getMessage());
           }
  -        return null;        
  +        return result;
       }
   
   }
  
  
  
  1.2.4.1   +4 -3      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/HeaderAttributeModule.java
  
  Index: HeaderAttributeModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/HeaderAttributeModule.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- HeaderAttributeModule.java	28 May 2002 13:41:28 -0000	1.2
  +++ HeaderAttributeModule.java	17 Nov 2002 19:12:49 -0000	1.2.4.1
  @@ -52,6 +52,7 @@
   package org.apache.cocoon.components.modules.input;
   
   import java.util.Enumeration;
  +import java.util.Iterator;
   import java.util.List;
   import java.util.LinkedList;
   import java.util.Map;
  @@ -84,10 +85,10 @@
       }
   
   
  -    public Enumeration getAttributeNames( Configuration modeConf, Map objectModel )
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel )
           throws ConfigurationException {
   
  -        return ObjectModelHelper.getRequest(objectModel).getHeaderNames();
  +        return new IteratorHelper(ObjectModelHelper.getRequest(objectModel).getHeaderNames());
       }
   
   
  
  
  
  1.4.4.1   +6 -6      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/InputModule.java
  
  Index: InputModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/InputModule.java,v
  retrieving revision 1.4
  retrieving revision 1.4.4.1
  diff -u -r1.4 -r1.4.4.1
  --- InputModule.java	7 Jun 2002 08:50:14 -0000	1.4
  +++ InputModule.java	17 Nov 2002 19:12:49 -0000	1.4.4.1
  @@ -52,7 +52,7 @@
   package org.apache.cocoon.components.modules.input;
   
   import java.util.SortedSet;
  -import java.util.Enumeration;
  +import java.util.Iterator;
   import java.util.Map;
   
   import org.apache.avalon.framework.component.Component;
  @@ -69,7 +69,7 @@
    */
   public interface InputModule extends Component {
   
  -    String ROLE = "org.apache.cocoon.components.modules.input.InputModule";
  +    String ROLE = InputModule.class.getName();
   
   
       /**
  @@ -90,14 +90,14 @@
   
   
       /**
  -     * Returns an Enumeration of String objects containing the names
  +     * Returns an Iterator of String objects containing the names
        * of the attributes available. If no attributes are available,
  -     * the method returns an empty Enumeration.
  +     * the method returns an empty Iterator.
        * @param modeConf column's mode configuration from resource
        * description. This argument is optional.
        * @param objectModel
        */
  -    Enumeration getAttributeNames( Configuration modeConf, Map objectModel ) throws ConfigurationException;
  +    Iterator getAttributeNames( Configuration modeConf, Map objectModel ) throws ConfigurationException;
   
   
       /**
  
  
  
  1.1.4.1   +16 -193   xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/MapMetaModule.java
  
  Index: MapMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/MapMetaModule.java,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- MapMetaModule.java	9 Aug 2002 08:32:11 -0000	1.1
  +++ MapMetaModule.java	17 Nov 2002 19:12:49 -0000	1.1.4.1
  @@ -50,27 +50,12 @@
   */
   package org.apache.cocoon.components.modules.input;
   
  -import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.activity.Initializable;
  -import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.component.ComponentSelector;
  -import org.apache.avalon.framework.component.ComponentException;
  -import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.component.Composable;
  -import org.apache.avalon.framework.logger.AbstractLoggable;
  -import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.framework.thread.ThreadSafe;
   
  -import org.apache.cocoon.components.modules.input.InputModule;
  -
  -import org.apache.cocoon.matching.AbstractWildcardMatcher;
  -
  -import java.net.URLEncoder;
  -
   import java.util.Map;
  -import java.util.Enumeration;
  +import java.util.Iterator;
   
   /** 
    * Meta module that obtains an Object from another module, assumes
  @@ -83,37 +68,12 @@
    * @author <a href="mailto:haul@informatik.tu-darmstadt.de">Christian Haul</a>
    * @version CVS $Id$
    */
  -public class MapMetaModule extends AbstractLoggable
  -    implements InputModule, Configurable, Initializable, Composable, Disposable {
  -
  -    /** The component manager instance */
  -    protected ComponentManager manager;
  -
  -    protected String defaultInput = "attribute"; // default to request attributes
  -    protected Configuration inputConf = null;  // will become an empty configuration object
  -                                             // during configure() so why bother here...
  -    protected String INPUT_MODULE_ROLE = InputModule.ROLE;
  -    protected String INPUT_MODULE_SELECTOR = INPUT_MODULE_ROLE+"Selector";
  -
  -    private boolean initialized = false;
  -    protected InputModule input = null;
  -    protected ComponentSelector inputSelector = null;
  +public class MapMetaModule extends AbstractMetaModule {
   
       protected String objectName = null;
       protected String parameter = null;
   
   
  -    /**
  -     * Set the current <code>ComponentManager</code> instance used by this
  -     * <code>Composable</code>.
  -     */
  -    public void compose(ComponentManager manager) throws ComponentException {
  -
  -        this.manager=manager;
  -    }
  -
  -
  -    
       public void configure(Configuration config) throws ConfigurationException {
   
           this.inputConf = config.getChild("input-module");
  @@ -122,58 +82,10 @@
       }
   
   
  -    public void initialize() {
  -
  -        try {
  -            // obtain input module
  -            this.inputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR); 
  -            if (this.defaultInput != null && 
  -                this.inputSelector != null && 
  -                this.inputSelector.hasComponent(this.defaultInput)
  -                ){
  -                this.input = (InputModule) this.inputSelector.select(this.defaultInput);
  -                if (!(this.input instanceof ThreadSafe && this.inputSelector instanceof ThreadSafe) ) {
  -                    this.inputSelector.release(this.input);
  -                    this.manager.release(this.inputSelector);
  -                    this.input = null;
  -                    this.inputSelector = null;
  -                }
  -                this.initialized = true;
  -            } else {
  -                if (getLogger().isErrorEnabled())
  -                    getLogger().error("A problem occurred setting up '" + this.defaultInput 
  -                                      + "': Selector is "+(this.inputSelector!=null?"not ":"")
  -                                      +"null, Component is "
  -                                      +(this.inputSelector!=null&&this.inputSelector.hasComponent(this.defaultInput)?"known":"unknown"));
  -            }
  -        } catch (Exception e) {
  -            if (getLogger().isWarnEnabled()) 
  -                getLogger().warn("A problem occurred setting up '" + this.defaultInput + "': " + e.getMessage());
  -        }
  -    }
  -
  -
  -
  -    public void dispose() {
  -
  -        if (!this.initialized) 
  -            if (getLogger().isErrorEnabled()) 
  -                getLogger().error("Uninitialized Component! FAILING");
  -        else 
  -            if (this.inputSelector != null) {
  -                if (this.input != null)
  -                    this.inputSelector.release(this.input);
  -                this.manager.release(this.inputSelector);
  -            }
  -    }
  -
  -
  -    
  -
       public Object getAttribute( String name, Configuration modeConf, Map objectModel ) 
           throws ConfigurationException {
   
  -        if (!this.initialized) {
  +        if (!this.initialized.booleanValue()) {
               if (getLogger().isErrorEnabled()) 
                   getLogger().error("Uninitialized Component! FAILING");
               return null;
  @@ -200,56 +112,12 @@
           }
           parameter = (parameter != null? parameter : name);
   
  -        // done reading configuration
  -        // setup modules and read values
  -        InputModule iput = this.input;
  -        ComponentSelector iputSelector = null;
  -        StringBuffer sb = new StringBuffer();
  -        Object value = null;
  -        try {
  -            if (this.input != null && inputName == null) {
  -                // thread safe input module
  -                // use existing reference
  -                iput = this.input;
  -            } else {
  -                // input was not thread safe
  -                // or
  -                // another module is configured dynamically
  -                // so acquire it again
  -                iputSelector = null;
  -                iput = null;
  -
  -                // obtain input module
  -                if (inputName == null) {
  -                    inputName   = this.defaultInput;
  -                    inputConfig = this.inputConf;
  -                }
  -                
  -                iputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR); 
  -                if (this.defaultInput != null 
  -                    && iputSelector != null 
  -                    && iputSelector.hasComponent(inputName)) {
  -                    
  -                    iput = (InputModule) iputSelector.select(inputName);
  -                }
  -            }
  -            if (iput != null) {
  -                value = iput.getAttribute(objectName, inputConfig, objectModel);
  -                value = (value!=null? ((Map) value).get(parameter) : null);
  -            }           
  -            
  -        } catch (Exception e) {
  -            if (getLogger().isWarnEnabled()) 
  -                getLogger().warn("A problem occurred acquiring a value from '" + inputName 
  -                                 + "' for '"+name+"': " + e.getMessage());
  -        } finally {
  -            // release components
  -            if (iputSelector != null) {
  -                if (iput != null)
  -                    iputSelector.release(iput);
  -                this.manager.release(iputSelector);
  -            }
  -        }
  +        Object value = getValue(objectName, objectModel, 
  +                                this.input, this.defaultInput, this.inputConf, 
  +                                null, inputName, modeConf);
  +
  +        value = (value!=null? ((Map) value).get(parameter) : null);
  +
           return value;        
       }
   
  @@ -257,10 +125,10 @@
   
   
   
  -    public Enumeration getAttributeNames( Configuration modeConf, Map objectModel ) 
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel ) 
           throws ConfigurationException {
   
  -         if (!this.initialized) {
  +         if (!this.initialized.booleanValue()) {
               if (getLogger().isErrorEnabled()) 
                   getLogger().error("Uninitialized Component! FAILING");
               return null;
  @@ -284,55 +152,10 @@
               }
           }
   
  -        // done reading configuration
  -        // setup modules and read values
  -        InputModule iput = this.input;
  -        ComponentSelector iputSelector = null;
  -        StringBuffer sb = new StringBuffer();
  -        Enumeration keys = null;
  -        try {
  -            if (this.input != null && inputName == null) {
  -                // thread safe input module
  -                // use existing reference
  -                iput = this.input;
  -            } else {
  -                // input was not thread safe
  -                // or
  -                // another module is configured dynamically
  -                // so acquire it again
  -                iputSelector = null;
  -                iput = null;
  -
  -                // obtain input module
  -                if (inputName == null) {
  -                    inputName   = this.defaultInput;
  -                    inputConfig = this.inputConf;
  -                }
  -                
  -                iputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR); 
  -                if (this.defaultInput != null 
  -                    && iputSelector != null 
  -                    && iputSelector.hasComponent(inputName)) {
  -                    
  -                    iput = (InputModule) iputSelector.select(inputName);
  -                }
  -            }
  -            if (iput != null) {
  -                keys = new EnumerationHelper(((Map) iput.getAttribute(objectName, inputConfig, objectModel)).keySet().iterator());
  -            }           
  -            
  -        } catch (Exception e) {
  -            if (getLogger().isWarnEnabled()) 
  -                getLogger().warn("A problem occurred acquiring a names from '" + inputName 
  -                                 + "' " + e.getMessage());
  -        } finally {
  -            // release components
  -            if (iputSelector != null) {
  -                if (iput != null)
  -                    iputSelector.release(iput);
  -                this.manager.release(iputSelector);
  -            }
  -        }
  +        Iterator keys = ((Map) getValue(objectName, objectModel, 
  +                                        this.input, this.defaultInput, this.inputConf,
  +                                        null, inputName, inputConfig)).keySet().iterator();
  +
           return keys;        
      }
   
  
  
  
  1.2.4.1   +3 -3      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/NullInputModule.java
  
  Index: NullInputModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/NullInputModule.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- NullInputModule.java	28 May 2002 13:41:28 -0000	1.2
  +++ NullInputModule.java	17 Nov 2002 19:12:49 -0000	1.2.4.1
  @@ -51,7 +51,7 @@
   
   package org.apache.cocoon.components.modules.input;
   
  -import java.util.Enumeration;
  +import java.util.Iterator;
   import java.util.List;
   import java.util.LinkedList;
   import java.util.StringTokenizer;
  @@ -79,7 +79,7 @@
       }
   
   
  -    public Enumeration getAttributeNames( Configuration modeConf, Map objectModel ) throws ConfigurationException {
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel ) throws ConfigurationException {
   
           return null;
       }
  
  
  
  1.2.4.1   +17 -8     xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RandomNumberModule.java
  
  Index: RandomNumberModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RandomNumberModule.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- RandomNumberModule.java	28 May 2002 13:41:28 -0000	1.2
  +++ RandomNumberModule.java	17 Nov 2002 19:12:49 -0000	1.2.4.1
  @@ -51,11 +51,12 @@
   
   package org.apache.cocoon.components.modules.input;
   
  -import java.util.Enumeration;
  +import java.util.Iterator;
   import java.util.List;
   import java.util.LinkedList;
   import java.util.StringTokenizer;
   import java.util.Map;
  +import java.util.Vector;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.component.Component;
  @@ -72,21 +73,29 @@
    */
   public class RandomNumberModule extends AbstractInputModule implements ThreadSafe {
   
  -    final static Enumeration returnNames = new StringTokenizer("stringConstant");
  +    final static Vector returnNames;
  +    static {
  +        Vector tmp = new Vector();
  +        tmp.add("randomNumber");
  +        returnNames = tmp;
  +    }
   
       public Object getAttribute( String name, Configuration modeConf, Map objectModel ) throws ConfigurationException {
           
  -        long min = Long.parseLong(modeConf.getAttribute("min","0"));
  -        long max = Long.parseLong(modeConf.getAttribute("max","9999999999"));
  -
  +        long min = 0;
  +        long max = java.lang.Long.MAX_VALUE;
  +        if (modeConf != null) {
  +            min = Long.parseLong(modeConf.getAttribute("min","0"));
  +            max = Long.parseLong(modeConf.getAttribute("max",String.valueOf(max)));
  +        }
           return Long.toString(java.lang.Math.round(java.lang.Math.random()*(max-min)));
   
       }
   
   
  -    public Enumeration getAttributeNames( Configuration modeConf, Map objectModel ) throws ConfigurationException {
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel ) throws ConfigurationException {
   
  -        return RandomNumberModule.returnNames;
  +        return RandomNumberModule.returnNames.iterator();
       }
   
   
  
  
  
  1.2.4.1   +4 -3      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestAttributeModule.java
  
  Index: RequestAttributeModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestAttributeModule.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- RequestAttributeModule.java	28 May 2002 13:41:28 -0000	1.2
  +++ RequestAttributeModule.java	17 Nov 2002 19:12:49 -0000	1.2.4.1
  @@ -52,6 +52,7 @@
   package org.apache.cocoon.components.modules.input;
   
   import java.util.Enumeration;
  +import java.util.Iterator;
   import java.util.List;
   import java.util.LinkedList;
   import java.util.Map;
  @@ -85,10 +86,10 @@
       }
   
   
  -    public Enumeration getAttributeNames( Configuration modeConf, Map objectModel )
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel )
           throws ConfigurationException {
   
  -        return ObjectModelHelper.getRequest(objectModel).getAttributeNames();
  +        return new IteratorHelper(ObjectModelHelper.getRequest(objectModel).getAttributeNames());
       }
   
   
  
  
  
  1.2.4.1   +4 -3      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestParameterModule.java
  
  Index: RequestParameterModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestParameterModule.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- RequestParameterModule.java	28 May 2002 13:41:28 -0000	1.2
  +++ RequestParameterModule.java	17 Nov 2002 19:12:49 -0000	1.2.4.1
  @@ -52,6 +52,7 @@
   package org.apache.cocoon.components.modules.input;
   
   import java.util.Enumeration;
  +import java.util.Iterator;
   import java.util.List;
   import java.util.LinkedList;
   import java.util.Map;
  @@ -86,9 +87,9 @@
       }
   
   
  -    public Enumeration getAttributeNames( Configuration modeConf, Map objectModel ) throws ConfigurationException {
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel ) throws ConfigurationException {
   
  -        return ObjectModelHelper.getRequest(objectModel).getParameterNames();
  +        return new IteratorHelper(ObjectModelHelper.getRequest(objectModel).getParameterNames());
       }
   
   
  
  
  
  1.2.4.1   +12 -7     xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestURIModule.java
  
  Index: RequestURIModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestURIModule.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- RequestURIModule.java	28 May 2002 13:41:28 -0000	1.2
  +++ RequestURIModule.java	17 Nov 2002 19:12:49 -0000	1.2.4.1
  @@ -51,11 +51,11 @@
   
   package org.apache.cocoon.components.modules.input;
   
  -import java.util.Enumeration;
  +import java.util.Iterator;
  +import java.util.Vector;
  +import java.util.Map;
   import java.util.List;
   import java.util.LinkedList;
  -import java.util.StringTokenizer;
  -import java.util.Map;
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.environment.ObjectModelHelper;
   import org.apache.avalon.framework.configuration.Configuration;
  @@ -71,7 +71,12 @@
    */
   public class RequestURIModule extends AbstractInputModule implements ThreadSafe {
   
  -    final static Enumeration returnNames = new StringTokenizer("requestURI");
  +    final static Vector returnNames;
  +    static {
  +        Vector tmp = new Vector();
  +        tmp.add("requestURI");
  +        returnNames = tmp;
  +    }
   
       public Object getAttribute( String name, Configuration modeConf, Map objectModel ) throws ConfigurationException {
   
  @@ -85,9 +90,9 @@
       }
   
   
  -    public Enumeration getAttributeNames( Configuration modeConf, Map objectModel ) throws ConfigurationException {
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel ) throws ConfigurationException {
   
  -        return RequestURIModule.returnNames;
  +        return RequestURIModule.returnNames.iterator();
       }
   
   
  
  
  
  1.2.4.1   +4 -3      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/SessionAttributeModule.java
  
  Index: SessionAttributeModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/SessionAttributeModule.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- SessionAttributeModule.java	28 May 2002 13:41:28 -0000	1.2
  +++ SessionAttributeModule.java	17 Nov 2002 19:12:49 -0000	1.2.4.1
  @@ -52,6 +52,7 @@
   package org.apache.cocoon.components.modules.input;
   
   import java.util.Enumeration;
  +import java.util.Iterator;
   import java.util.List;
   import java.util.LinkedList;
   import java.util.Map;
  @@ -86,10 +87,10 @@
       }
   
   
  -    public Enumeration getAttributeNames( Configuration modeConf, Map objectModel )
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel )
           throws ConfigurationException {
   
  -        return ObjectModelHelper.getRequest(objectModel).getSession().getAttributeNames();
  +        return new IteratorHelper(ObjectModelHelper.getRequest(objectModel).getSession().getAttributeNames());
       }
   
   
  
  
  
  1.2.4.1   +11 -5     xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/StringConstantModule.java
  
  Index: StringConstantModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/StringConstantModule.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- StringConstantModule.java	28 May 2002 13:41:28 -0000	1.2
  +++ StringConstantModule.java	17 Nov 2002 19:12:49 -0000	1.2.4.1
  @@ -51,8 +51,9 @@
   
   package org.apache.cocoon.components.modules.input;
   
  -import java.util.Enumeration;
  +import java.util.Iterator;
   import java.util.List;
  +import java.util.Vector;
   import java.util.LinkedList;
   import java.util.StringTokenizer;
   import java.util.Map;
  @@ -70,7 +71,12 @@
    */
   public class StringConstantModule extends AbstractInputModule implements ThreadSafe {
   
  -    final static Enumeration returnNames = new StringTokenizer("stringConstant");
  +    final static Vector returnNames;
  +    static {
  +        Vector tmp = new Vector();
  +        tmp.add("stringConstant");
  +        returnNames = tmp;
  +    }
   
       public Object getAttribute( String name, Configuration modeConf, Map objectModel ) throws ConfigurationException {
           
  @@ -82,9 +88,9 @@
       }
   
   
  -    public Enumeration getAttributeNames( Configuration modeConf, Map objectModel ) throws ConfigurationException {
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel ) throws ConfigurationException {
   
  -        return StringConstantModule.returnNames;
  +        return StringConstantModule.returnNames.iterator();
       }
   
   
  
  
  
  1.1.4.1   +41 -154   xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/XMLMetaModule.java
  
  Index: XMLMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/XMLMetaModule.java,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- XMLMetaModule.java	9 Aug 2002 08:32:11 -0000	1.1
  +++ XMLMetaModule.java	17 Nov 2002 19:12:49 -0000	1.1.4.1
  @@ -50,28 +50,13 @@
   */
   package org.apache.cocoon.components.modules.input;
   
  -import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.activity.Initializable;
  -import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.component.ComponentSelector;
  -import org.apache.avalon.framework.component.ComponentException;
  -import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.component.Composable;
  -import org.apache.avalon.framework.logger.AbstractLoggable;
  -import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.framework.thread.ThreadSafe;
   
  -import org.apache.cocoon.components.modules.input.InputModule;
  -
  -import org.apache.cocoon.matching.AbstractWildcardMatcher;
  -
  -import java.net.URLEncoder;
  -
   import java.util.Map;
  -import java.util.Enumeration;
  -import java.util.StringTokenizer;
  +import java.util.Iterator;
  +import java.util.Vector;
   
   /** 
    * Meta module that obtains values from other module and returns all
  @@ -119,36 +104,18 @@
    * @author <a href="mailto:haul@informatik.tu-darmstadt.de">Christian Haul</a>
    * @version CVS $Id$
    */
  -public class XMLMetaModule extends AbstractLoggable
  -    implements InputModule, Configurable, Initializable, Composable, Disposable {
  -
  -    /** The component manager instance */
  -    protected ComponentManager manager;
  -
  -    protected String defaultInput = "request"; // default to request parameters
  -    protected Configuration inputConf = null;  // will become an empty configuration object
  -                                             // during configure() so why bother here...
  -    protected String INPUT_MODULE_ROLE = InputModule.ROLE;
  -    protected String INPUT_MODULE_SELECTOR = INPUT_MODULE_ROLE+"Selector";
  -
  -    private boolean initialized = false;
  -    protected InputModule input = null;
  -    protected ComponentSelector inputSelector = null;
  +public class XMLMetaModule extends AbstractMetaModule {
   
       protected String rootName = "root";
       protected String ignore = null;
       protected String use = null;
       protected String strip = null;
   
  -    final static Enumeration returnNames = new StringTokenizer("XML");
  -
  -    /**
  -     * Set the current <code>ComponentManager</code> instance used by this
  -     * <code>Composable</code>.
  -     */
  -    public void compose(ComponentManager manager) throws ComponentException {
  -
  -        this.manager=manager;
  +    final static Vector returnNames;
  +    static {
  +        Vector tmp = new Vector();
  +        tmp.add("XML");
  +        returnNames = tmp;
       }
   
   
  @@ -163,58 +130,12 @@
       }
   
   
  -    public void initialize() {
  -
  -        try {
  -            // obtain input module
  -            this.inputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR); 
  -            if (this.defaultInput != null && 
  -                this.inputSelector != null && 
  -                this.inputSelector.hasComponent(this.defaultInput)
  -                ){
  -                this.input = (InputModule) this.inputSelector.select(this.defaultInput);
  -                if (!(this.input instanceof ThreadSafe && this.inputSelector instanceof ThreadSafe) ) {
  -                    this.inputSelector.release(this.input);
  -                    this.manager.release(this.inputSelector);
  -                    this.input = null;
  -                    this.inputSelector = null;
  -                }
  -                this.initialized = true;
  -            } else {
  -                if (getLogger().isErrorEnabled())
  -                    getLogger().error("A problem occurred setting up '" + this.defaultInput 
  -                                      + "': Selector is "+(this.inputSelector!=null?"not ":"")
  -                                      +"null, Component is "
  -                                      +(this.inputSelector!=null&&this.inputSelector.hasComponent(this.defaultInput)?"known":"unknown"));
  -            }
  -        } catch (Exception e) {
  -            if (getLogger().isWarnEnabled()) 
  -                getLogger().warn("A problem occurred setting up '" + this.defaultInput + "': " + e.getMessage());
  -        }
  -    }
  -
  -
   
  -    public void dispose() {
  -
  -        if (!this.initialized) 
  -            if (getLogger().isErrorEnabled()) 
  -                getLogger().error("Uninitialized Component! FAILING");
  -        else 
  -            if (this.inputSelector != null) {
  -                if (this.input != null)
  -                    this.inputSelector.release(this.input);
  -                this.manager.release(this.inputSelector);
  -            }
  -    }
  -
  -
  -    
   
       public Object getAttribute( String name, Configuration modeConf, Map objectModel ) 
           throws ConfigurationException {
   
  -        if (!this.initialized) {
  +        if (!this.initialized.booleanValue()) {
               if (getLogger().isErrorEnabled()) 
                   getLogger().error("Uninitialized Component! FAILING");
               return null;
  @@ -244,74 +165,40 @@
               }
           }
   
  -        // done reading configuration
  -        // setup modules and read values
  -        InputModule iput = this.input;
  -        ComponentSelector iputSelector = null;
  +        InputModule input = null;
  +        if (inputName != null) input = obtainModule(inputName);
  +
           StringBuffer sb = new StringBuffer();
           sb.append('<').append(rootName).append('>');
  -        try {
  -            if (this.input != null && inputName == null) {
  -                // thread safe input module
  -                // use existing reference
  -                iput = this.input;
  -            } else {
  -                // input was not thread safe
  -                // or
  -                // another module is configured dynamically
  -                // so acquire it again
  -                iputSelector = null;
  -                iput = null;
  -
  -                // obtain input module
  -                if (inputName == null) {
  -                    inputName   = this.defaultInput;
  -                    inputConfig = this.inputConf;
  -                }
  -                
  -                iputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR); 
  -                if (this.defaultInput != null 
  -                    && iputSelector != null 
  -                    && iputSelector.hasComponent(inputName)) {
  -                    
  -                    iput = (InputModule) iputSelector.select(inputName);
  -                }
  -            }
  -            if (iput != null) {
  -                Enumeration names = iput.getAttributeNames(inputConfig, objectModel);
  -                while (names.hasMoreElements()){
  -                    String attribute = (String) names.nextElement();
  -                    if ((use == null || attribute.startsWith(use)) &&
  -                        (ignore == null || !attribute.startsWith(ignore))) {
  -                        Object[] values = iput.getAttributeValues(attribute, inputConfig, objectModel);
  -                        if (strip != null && attribute.startsWith(strip)) 
  -                            attribute = attribute.substring(strip.length());
  -                        sb.append("<item name=\"").append(attribute).append("\">");
  -                        if (values.length == 1) {
  -                            sb.append(values[0]);
  -                        } else {
  -                            for (int i=0;i<values.length;i++){
  -                                sb.append("<value>").append(values[i]).append("</value>");
  -                            }
  -                        }
  -                        sb.append("</item>");
  +
  +        Iterator names = getNames(objectModel, 
  +                                  this.input, this.defaultInput, this.inputConf,
  +                                  input, inputName, inputConfig);
  +        while (names.hasNext()){
  +            String attribute = (String) names.next();
  +            if ((use == null || attribute.startsWith(use)) &&
  +                (ignore == null || !attribute.startsWith(ignore))) {
  +                Object[] values = getValues(attribute, objectModel,
  +                                            this.input, this.defaultInput, this.inputConf,
  +                                            input, inputName, inputConfig);
  +
  +                if (strip != null && attribute.startsWith(strip)) 
  +                    attribute = attribute.substring(strip.length());
  +                sb.append("<item name=\"").append(attribute).append("\">");
  +                if (values.length == 1) {
  +                    sb.append(values[0]);
  +                } else {
  +                    for (int i=0;i<values.length;i++){
  +                        sb.append("<value>").append(values[i]).append("</value>");
                       }
                   }
  -            }           
  -            
  -        } catch (Exception e) {
  -            if (getLogger().isWarnEnabled()) 
  -                getLogger().warn("A problem occurred acquiring a value from '" + inputName 
  -                                 + "' for '"+name+"': " + e.getMessage());
  -        } finally {
  -            // release components
  -            if (iputSelector != null) {
  -                if (iput != null)
  -                    iputSelector.release(iput);
  -                this.manager.release(iputSelector);
  +                sb.append("</item>");
               }
           }
  +        if (input != null) releaseModule(input);
  +
           sb.append('<').append('/').append(rootName).append('>');
  +
           return sb.toString();        
       }
   
  @@ -319,10 +206,10 @@
   
   
   
  -    public Enumeration getAttributeNames( Configuration modeConf, Map objectModel ) 
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel ) 
           throws ConfigurationException {
   
  -         if (!this.initialized) {
  +         if (!this.initialized.booleanValue()) {
               if (getLogger().isErrorEnabled()) 
                   getLogger().error("Uninitialized Component! FAILING");
               return null;
  @@ -333,7 +220,7 @@
               return null;
           }
   
  -        return XMLMetaModule.returnNames;
  +        return XMLMetaModule.returnNames.iterator();
      }
   
   
  @@ -342,7 +229,7 @@
       public Object[] getAttributeValues( String name, Configuration modeConf, Map objectModel ) 
           throws ConfigurationException {
   
  -        if (!this.initialized) {
  +        if (!this.initialized.booleanValue()) {
               if (getLogger().isErrorEnabled()) 
                   getLogger().error("Uninitialized Component! FAILING");
               return null;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.1   +0 -0      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/AbstractJXPathModule.java
  
  Index: AbstractJXPathModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/AbstractJXPathModule.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  
  
  
  1.3.2.1   +0 -0      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/AbstractMetaModule.java
  
  Index: AbstractMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/AbstractMetaModule.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  
  
  
  1.3.2.1   +0 -0      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/ChainMetaModule.java
  
  Index: ChainMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/ChainMetaModule.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  
  
  
  1.3.2.1   +0 -0      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DateMetaInputModule.java
  
  Index: DateMetaInputModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DateMetaInputModule.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/IteratorHelper.java
  
  Index: IteratorHelper.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/IteratorHelper.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/JXPathMetaModule.java
  
  Index: JXPathMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/JXPathMetaModule.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.2.2.1   +1 -1      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestContextPathModule.java
  
  Index: RequestContextPathModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestContextPathModule.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  
  
  
  1.1.2.1   +1 -1      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestModule.java
  
  Index: RequestModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestModule.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +1 -1      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/SessionModule.java
  
  Index: SessionModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/SessionModule.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +132 -0    xml-cocoon2/src/java/org/apache/cocoon/components/modules/database/Attic/PgsqlAutoIncrementModule.java
  
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message