cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@locus.apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/sitemap GenericProcessor.java
Date Sun, 27 Feb 2000 07:14:32 GMT
pier        00/02/26 23:14:32

  Modified:    src/org/apache/cocoon/sitemap Tag: xml-cocoon2
                        GenericProcessor.java
  Log:
  [Cocoon 2.0] Initial support for components parametrization.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.4   +13 -5     xml-cocoon/src/org/apache/cocoon/sitemap/Attic/GenericProcessor.java
  
  Index: GenericProcessor.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/GenericProcessor.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- GenericProcessor.java	2000/02/27 05:45:19	1.1.2.3
  +++ GenericProcessor.java	2000/02/27 07:14:32	1.1.2.4
  @@ -17,6 +17,7 @@
   import org.apache.arch.config.Configurable;
   import org.apache.arch.config.Configuration;
   import org.apache.arch.config.ConfigurationException;
  +import org.apache.cocoon.Parameters;
   import org.apache.cocoon.Processor;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.Request;
  @@ -34,7 +35,7 @@
    *
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version CVS $Revision: 1.1.2.3 $ $Date: 2000/02/27 05:45:19 $
  + * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/02/27 07:14:32 $
    */
   public class GenericProcessor implements Composer, Configurable, Processor {
   
  @@ -48,10 +49,16 @@
       private PatternTranslator targetTranslator=null;
       /** The generator role */
       private String generator=null;
  +    /** The generator parameters */
  +    private Parameters generatorParam=null;
       /** The filter roles vector */
       private Vector filters=new Vector();
  +    /** The filter parameters vector */
  +    private Vector filtersParam=new Vector();
       /** The serializer role */
       private String serializer=null;
  +    /** The serializer role */
  +    private Parameters serializerParam=null;
   
       /**
        * Create a new <code>SitemapPartition</code> instance.
  @@ -92,11 +99,13 @@
           if (c==null)
               throw new ConfigurationException("Generator not specified",conf);
           this.generator="generator:"+c.getAttribute("name");
  +        this.generatorParam=Parameters.fromConfiguration(c);
           // Get the serializer
           c=conf.getConfiguration("serializer");
           if (c==null)
               throw new ConfigurationException("Serializer not specified",conf);
           this.serializer="serializer:"+c.getAttribute("name");
  +        this.serializerParam=Parameters.fromConfiguration(c);
           // Set up the filters vetctor
           Enumeration e=conf.getConfigurations("filter");
           while (e.hasMoreElements()) {
  @@ -120,9 +129,8 @@
                   throw new ProcessingException("Error translating \""+
                                                 req.getUri()+"\"");
           }
  -if (this.serializer==null) throw new NullPointerException("SER");
           Serializer s=(Serializer)this.manager.getComponent(this.serializer);
  -        s.setup(req,res,src,null);
  +        s.setup(req,res,src,this.serializerParam);
           s.setOutputStream(out);
           XMLConsumer current=s;
           for (int x=0; x<this.filters.size(); x++) {
  @@ -132,10 +140,10 @@
               f.setConsumer(current);
               current=f;
           }
  -if (this.generator==null) throw new NullPointerException("GEN");
  +
           Generator g=(Generator)this.manager.getComponent(this.generator);
           g.setConsumer(current);
  -        g.setup(req,res,src,null);
  +        g.setup(req,res,src,this.generatorParam);
           g.generate();
           return(true);
       }
  
  
  

Mime
View raw message