cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap SerializeNode.java SerializeNodeBuilder.java
Date Fri, 21 Nov 2003 18:15:44 GMT
sylvain     2003/11/21 10:15:44

  Modified:    src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        SerializeNode.java SerializeNodeBuilder.java
  Log:
  Terminate the ability for serializer to be SitemapModelComponents
  
  Revision  Changes    Path
  1.6       +13 -5     cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNode.java
  
  Index: SerializeNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNode.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SerializeNode.java	12 Aug 2003 15:48:02 -0000	1.5
  +++ SerializeNode.java	21 Nov 2003 18:15:44 -0000	1.6
  @@ -56,6 +56,7 @@
   import org.apache.cocoon.Constants;
   import org.apache.cocoon.components.pipeline.ProcessingPipeline;
   import org.apache.cocoon.components.treeprocessor.InvokeContext;
  +import org.apache.cocoon.components.treeprocessor.ParameterizableProcessingNode;
   import org.apache.cocoon.components.treeprocessor.PipelineEventComponentProcessingNode;
   import org.apache.cocoon.components.treeprocessor.ProcessingNode;
   import org.apache.cocoon.components.treeprocessor.variables.VariableResolver;
  @@ -68,14 +69,17 @@
    * @version CVS $Id$
    */
   
  -public class SerializeNode extends PipelineEventComponentProcessingNode {
  +public class SerializeNode extends PipelineEventComponentProcessingNode implements ParameterizableProcessingNode{
   
       private String serializerName;
   
  +    private VariableResolver source;
  +
       private VariableResolver mimeType;
   
       private int statusCode;
   
  +    private Map parameters;
   
       /**
        * Build a <code>SerializerNode</code> having a name, a mime-type and a
status code (HTTP codes).
  @@ -84,12 +88,16 @@
        * @param mimeType the mime-type, or <code>null</code> not specified.
        * @param statusCode the HTTP response status code, or <code>-1</code>
if not specified.
        */
  -    public SerializeNode(String name, VariableResolver mimeType, int statusCode) throws
PatternException {
  +    public SerializeNode(String name, VariableResolver source, VariableResolver mimeType,
int statusCode) throws PatternException {
           this.serializerName = name;
  +        this.source = source;
           this.mimeType = mimeType;
           this.statusCode = statusCode;
       }
   
  +    public void setParameters(Map parameterMap) {
  +        this.parameters = parameterMap;
  +    }
   
       public final boolean invoke(Environment env, InvokeContext context)
         throws Exception {
  @@ -129,8 +137,8 @@
   
           pipeline.setSerializer(
               this.serializerName,
  -            null,
  -            Parameters.EMPTY_PARAMETERS, // No parameters on serializers
  +            source.resolve(context, objectModel),
  +            VariableResolver.buildParameters(this.parameters, context, objectModel),
               this.pipelineHints == null
                   ? Parameters.EMPTY_PARAMETERS
                   : VariableResolver.buildParameters(this.pipelineHints, context, objectModel),
  
  
  
  1.2       +4 -3      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNodeBuilder.java
  
  Index: SerializeNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNodeBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SerializeNodeBuilder.java	9 Mar 2003 00:09:22 -0000	1.1
  +++ SerializeNodeBuilder.java	21 Nov 2003 18:15:44 -0000	1.2
  @@ -75,9 +75,9 @@
       private Collection views;
       private Map  pipelineHints;
   
  -    /** This builder has no parameters -- return <code>false</code> */
  +    /** Serializers can have parameters -- return <code>true</code> */
       protected boolean hasParameters() {
  -        return false;
  +        return true;
       }
   
       public ProcessingNode buildNode(Configuration config) throws Exception {
  @@ -89,6 +89,7 @@
   
           this.node = new SerializeNode(
               type,
  +            VariableResolverFactory.getResolver(config.getAttribute("src", null), this.manager),
               VariableResolverFactory.getResolver(config.getAttribute("mime-type", null),
this.manager),
               config.getAttributeAsInteger("status-code", -1)
           );
  
  
  

Mime
View raw message