cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/profiler/java/org/apache/cocoon/components/profiler SimpleSitemapExecutor.java
Date Wed, 14 Jul 2004 13:17:45 GMT
cziegeler    2004/07/14 06:17:45

  Modified:    src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        ReadNode.java TransformNode.java GenerateNode.java
                        SerializeNode.java SwitchSelectNode.java
               src/java/org/apache/cocoon/sitemap SitemapExecutor.java
               src/java/org/apache/cocoon/sitemap/impl DefaultExecutor.java
               src/blocks/profiler/java/org/apache/cocoon/components/profiler
                        SimpleSitemapExecutor.java
  Log:
  Add pipeline components and switch selector to profiler
  
  Revision  Changes    Path
  1.4       +20 -8     cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ReadNode.java
  
  Index: ReadNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ReadNode.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ReadNode.java	5 Mar 2004 13:02:52 -0000	1.3
  +++ ReadNode.java	14 Jul 2004 13:17:45 -0000	1.4
  @@ -21,6 +21,7 @@
   import org.apache.cocoon.components.treeprocessor.ParameterizableProcessingNode;
   import org.apache.cocoon.components.treeprocessor.variables.VariableResolver;
   import org.apache.cocoon.environment.Environment;
  +import org.apache.cocoon.sitemap.SitemapExecutor;
   
   import java.util.Map;
   
  @@ -60,18 +61,29 @@
           this.parameters = parameterMap;
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(org.apache.cocoon.environment.Environment,
org.apache.cocoon.components.treeprocessor.InvokeContext)
  +     */
       public final boolean invoke(Environment env,  InvokeContext context)
  -      throws Exception {
  +    throws Exception {
  +
  +        final Map objectModel = env.getObjectModel();
   
  -        Map objectModel = env.getObjectModel();
  +        final ProcessingPipeline pipeline = context.getProcessingPipeline();
   
  -        ProcessingPipeline pipeline = context.getProcessingPipeline();
  +        SitemapExecutor.PipelineComponentDescription desc = new SitemapExecutor.PipelineComponentDescription();
  +        desc.type = this.readerName;
  +        desc.source = source.resolve(context, objectModel);
  +        desc.parameters = VariableResolver.buildParameters(this.parameters, context, objectModel);
  +        desc.mimeType = this.mimeType.resolve(context, objectModel);
  +        
  +        desc = this.executor.addReader(this, objectModel, desc);
   
           pipeline.setReader(
  -            this.readerName,
  -            source.resolve(context, objectModel),
  -            VariableResolver.buildParameters(this.parameters, context, objectModel),
  -            this.mimeType.resolve(context, objectModel)
  +            desc.type,
  +            desc.source,
  +            desc.parameters,
  +            desc.mimeType
           );
   
           // Set status code if there is one
  
  
  
  1.3       +26 -10    cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/TransformNode.java
  
  Index: TransformNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/TransformNode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TransformNode.java	5 Mar 2004 13:02:52 -0000	1.2
  +++ TransformNode.java	14 Jul 2004 13:17:45 -0000	1.3
  @@ -16,6 +16,7 @@
   package org.apache.cocoon.components.treeprocessor.sitemap;
   
   import org.apache.avalon.framework.parameters.Parameters;
  +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;
  @@ -23,6 +24,7 @@
   import org.apache.cocoon.components.treeprocessor.variables.VariableResolver;
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.sitemap.PatternException;
  +import org.apache.cocoon.sitemap.SitemapExecutor;
   
   import java.util.Map;
   
  @@ -51,25 +53,39 @@
       }
   
   
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(org.apache.cocoon.environment.Environment,
org.apache.cocoon.components.treeprocessor.InvokeContext)
  +     */
       public final boolean invoke(Environment env, InvokeContext context)
  -      throws Exception {
  +    throws Exception {
   
  -        Map objectModel = env.getObjectModel();
  +        final Map objectModel = env.getObjectModel();
   
  -        context.getProcessingPipeline().addTransformer(
  -            this.transformerName,
  -            source.resolve(context, objectModel),
  -            VariableResolver.buildParameters(this.parameters, context, objectModel),
  -            this.pipelineHints == null
  +        final ProcessingPipeline pipeline = context.getProcessingPipeline();
  +        
  +        SitemapExecutor.PipelineComponentDescription desc = new SitemapExecutor.PipelineComponentDescription();
  +        desc.type = this.transformerName;
  +        desc.source = source.resolve(context, objectModel);
  +        desc.parameters = VariableResolver.buildParameters(this.parameters, context, objectModel);
  +        desc.hintParameters = this.pipelineHints == null
                   ? Parameters.EMPTY_PARAMETERS
  -                : VariableResolver.buildParameters(this.pipelineHints, context, objectModel)
  +                : VariableResolver.buildParameters(this.pipelineHints, context, objectModel);
  +
  +        // inform executor
  +        desc = this.executor.addTransformer(this, objectModel, desc);
  +
  +        pipeline.addTransformer(
  +            desc.type,
  +            desc.source,
  +            desc.parameters,
  +            desc.hintParameters
           );
   
           // Check view
           if (this.views != null) {
   	   
               //inform the pipeline that we have a branch point
  -            context.getProcessingPipeline().informBranchPoint();
  +            pipeline.informBranchPoint();
   	    
               String cocoonView = env.getView();
               if (cocoonView != null) {
  
  
  
  1.5       +21 -9     cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/GenerateNode.java
  
  Index: GenerateNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/GenerateNode.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- GenerateNode.java	5 Mar 2004 13:02:52 -0000	1.4
  +++ GenerateNode.java	14 Jul 2004 13:17:45 -0000	1.5
  @@ -25,6 +25,7 @@
   import org.apache.cocoon.components.treeprocessor.variables.VariableResolver;
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.sitemap.PatternException;
  +import org.apache.cocoon.sitemap.SitemapExecutor;
   
   /**
    *
  @@ -49,18 +50,29 @@
           this.parameters = parameterMap;
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(org.apache.cocoon.environment.Environment,
org.apache.cocoon.components.treeprocessor.InvokeContext)
  +     */
       public final boolean invoke(Environment env, InvokeContext context)
       throws Exception {
   
  -        Map objectModel = env.getObjectModel();
  -
  -        context.getProcessingPipeline().setGenerator(
  -            this.generatorName,
  -            source.resolve(context, objectModel),
  -            VariableResolver.buildParameters(this.parameters, context, objectModel),
  -            this.pipelineHints == null
  +        final Map objectModel = env.getObjectModel();
  +        
  +        SitemapExecutor.PipelineComponentDescription desc = new SitemapExecutor.PipelineComponentDescription();
  +        desc.type = this.generatorName;
  +        desc.source = source.resolve(context, objectModel);
  +        desc.parameters = VariableResolver.buildParameters(this.parameters, context, objectModel);
  +        desc.hintParameters = this.pipelineHints == null
                   ? Parameters.EMPTY_PARAMETERS
  -                : VariableResolver.buildParameters(this.pipelineHints, context, objectModel)
  +                : VariableResolver.buildParameters(this.pipelineHints, context, objectModel);
  +        
  +        desc = this.executor.addGenerator(this, objectModel, desc);
  +        
  +        context.getProcessingPipeline().setGenerator(
  +            desc.type,
  +            desc.source,
  +            desc.parameters,
  +            desc.hintParameters
           );
   
   
  
  
  
  1.9       +24 -10    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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SerializeNode.java	5 Mar 2004 13:02:52 -0000	1.8
  +++ SerializeNode.java	14 Jul 2004 13:17:45 -0000	1.9
  @@ -27,6 +27,7 @@
   import org.apache.cocoon.components.treeprocessor.variables.VariableResolver;
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.sitemap.PatternException;
  +import org.apache.cocoon.sitemap.SitemapExecutor;
   /**
    *
    * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
  @@ -64,6 +65,9 @@
           this.parameters = parameterMap;
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(org.apache.cocoon.environment.Environment,
org.apache.cocoon.components.treeprocessor.InvokeContext)
  +     */
       public final boolean invoke(Environment env, InvokeContext context)
       throws Exception {
   
  @@ -88,8 +92,8 @@
               }
           }
           
  -        Map objectModel = env.getObjectModel();
  -        ProcessingPipeline pipeline = context.getProcessingPipeline();
  +        final Map objectModel = env.getObjectModel();
  +        final ProcessingPipeline pipeline = context.getProcessingPipeline();
   
           // Perform link translation if requested
           if (objectModel.containsKey(Constants.LINK_OBJECT)) {
  @@ -100,14 +104,24 @@
               pipeline.addTransformer("<gatherer>", null, Parameters.EMPTY_PARAMETERS,
Parameters.EMPTY_PARAMETERS);
           }
   
  -        pipeline.setSerializer(
  -            this.serializerName,
  -            source.resolve(context, objectModel),
  -            VariableResolver.buildParameters(this.parameters, context, objectModel),
  -            this.pipelineHints == null
  +        SitemapExecutor.PipelineComponentDescription desc = new SitemapExecutor.PipelineComponentDescription();
  +        desc.type = this.serializerName;
  +        desc.source = source.resolve(context, objectModel);
  +        desc.parameters = VariableResolver.buildParameters(this.parameters, context, objectModel);
  +        desc.hintParameters = this.pipelineHints == null
                   ? Parameters.EMPTY_PARAMETERS
  -                : VariableResolver.buildParameters(this.pipelineHints, context, objectModel),
  -            this.mimeType.resolve(context, env.getObjectModel())
  +                : VariableResolver.buildParameters(this.pipelineHints, context, objectModel);
  +        desc.mimeType = this.mimeType.resolve(context, objectModel);
  +
  +        // inform executor
  +        desc = this.executor.addSerializer(this, objectModel, desc);
  +        
  +        pipeline.setSerializer(
  +                desc.type,
  +                desc.source,
  +                desc.parameters,
  +                desc.hintParameters,
  +                desc.mimeType
           );
   
           // Set status code if there is one
  
  
  
  1.6       +20 -4     cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SwitchSelectNode.java
  
  Index: SwitchSelectNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SwitchSelectNode.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SwitchSelectNode.java	5 Mar 2004 13:02:52 -0000	1.5
  +++ SwitchSelectNode.java	14 Jul 2004 13:17:45 -0000	1.6
  @@ -69,6 +69,9 @@
           this.otherwhiseNodes = otherwhiseNodes;
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
  +     */
       public void compose(ComponentManager manager) throws ComponentException {
           this.manager = manager;
   
  @@ -78,6 +81,9 @@
           this.threadSafeSelector = (SwitchSelector)this.getThreadSafeComponent();
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(org.apache.cocoon.environment.Environment,
org.apache.cocoon.components.treeprocessor.InvokeContext)
  +     */
       public final boolean invoke(Environment env, InvokeContext context)
       throws Exception {
   	
  @@ -85,7 +91,7 @@
           super.invoke(env, context);
   
           // Prepare data needed by the action
  -        Map objectModel = env.getObjectModel();
  +        final Map objectModel = env.getObjectModel();
           Parameters resolvedParams = VariableResolver.buildParameters(this.parameters, context,
objectModel);
   
           // If selector is ThreadSafe, avoid select() and try/catch block (faster !)
  @@ -94,7 +100,12 @@
               Object ctx = this.threadSafeSelector.getSelectorContext(objectModel, resolvedParams);
   
               for (int i = 0; i < this.whenTests.length; i++) {
  -                if (this.threadSafeSelector.select(whenTests[i].resolve(context, objectModel),
ctx)) {
  +                if (this.executor.invokeSwitchSelector(this, 
  +                                                       objectModel, 
  +                                                       this.threadSafeSelector, 
  +                                                       whenTests[i].resolve(context, objectModel),

  +                                                       resolvedParams, 
  +                                                       ctx)) {
                       return invokeNodes(this.whenNodes[i], env, context);
                   }
               }
  @@ -112,7 +123,12 @@
              
               try {
                   for (int i = 0; i < this.whenTests.length; i++) {
  -                    if (selector.select(whenTests[i].resolve(context, objectModel), ctx))
{
  +                    if (this.executor.invokeSwitchSelector(this, 
  +                            objectModel, 
  +                            selector, 
  +                            whenTests[i].resolve(context, objectModel), 
  +                            resolvedParams, 
  +                            ctx)) {
                           return invokeNodes(this.whenNodes[i], env, context);
                       }
                   }
  
  
  
  1.6       +73 -1     cocoon-2.1/src/java/org/apache/cocoon/sitemap/SitemapExecutor.java
  
  Index: SitemapExecutor.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/sitemap/SitemapExecutor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SitemapExecutor.java	24 Jun 2004 13:18:01 -0000	1.5
  +++ SitemapExecutor.java	14 Jul 2004 13:17:45 -0000	1.6
  @@ -24,6 +24,7 @@
   import org.apache.cocoon.matching.Matcher;
   import org.apache.cocoon.matching.PreparableMatcher;
   import org.apache.cocoon.selection.Selector;
  +import org.apache.cocoon.selection.SwitchSelector;
   
   /**
    * The sitemap executor executes all sitemap statements, so it actually
  @@ -32,6 +33,7 @@
    * plugin custom profiling or debugging tools.
    *
    * TODO - This is not finished yet!
  + * TODO - we should add invocation of a Redirector as well
    * 
    * @since 2.2
    * @version CVS $Id$
  @@ -41,6 +43,15 @@
       /** The component role */
       String ROLE = SitemapExecutor.class.getName();
       
  +    public static class PipelineComponentDescription {
  +        public String type;
  +        public String source;
  +        public Parameters parameters;
  +        public Parameters hintParameters;
  +        /** Mime-type for serializers and readers */
  +        public String mimeType;
  +    }
  +    
       /**
        * Invoke an action and return the result.
        */
  @@ -89,6 +100,23 @@
               Parameters parameters);
       
       /**
  +     * Invoke a switch selector
  +     * @param context
  +     * @param objectModel
  +     * @param selector
  +     * @param expression
  +     * @param parameters
  +     * @param selectorContext The context object for the switch selector
  +     * @return
  +     */
  +    boolean invokeSwitchSelector(ExecutionContext context,
  +                                 Map             objectModel,
  +                                 SwitchSelector  selector, 
  +                                 String expression, 
  +                                 Parameters parameters,
  +                                 Object selectorContext);
  +
  +    /**
        * Push map of information on the context stack.
        * @param context The execution context
        * @param objectModel The object model
  @@ -121,4 +149,48 @@
       String enterSitemap(ExecutionContext context, 
                           Map              objectModel,
                           String           source);
  +
  +    /**
  +     * Add a generator
  +     * @param context
  +     * @param objectModel
  +     * @param desc The descrption of the component
  +     * @return The desc of the component to use
  +     */
  +    PipelineComponentDescription addGenerator(ExecutionContext context, 
  +                                              Map              objectModel,
  +                                              PipelineComponentDescription desc);
  +
  +    /**
  +     * Add a transformer
  +     * @param context
  +     * @param objectModel
  +     * @param desc The descrption of the component
  +     * @return The desc of the component to use
  +     */
  +    PipelineComponentDescription addTransformer(ExecutionContext context, 
  +                                                Map              objectModel,
  +                                                PipelineComponentDescription desc);
  +
  +    /**
  +     * Add a serializer
  +     * @param context
  +     * @param objectModel
  +     * @param desc The descrption of the component
  +     * @return The desc of the component to use
  +     */
  +    PipelineComponentDescription addSerializer(ExecutionContext context, 
  +                                               Map              objectModel,
  +                                               PipelineComponentDescription desc);
  +
  +    /**
  +     * Add a reader
  +     * @param context
  +     * @param objectModel
  +     * @param desc The descrption of the component
  +     * @return The desc of the component to use
  +     */
  +    PipelineComponentDescription addReader(ExecutionContext context, 
  +                                           Map              objectModel,
  +                                           PipelineComponentDescription desc);
   }
  
  
  
  1.6       +45 -1     cocoon-2.1/src/java/org/apache/cocoon/sitemap/impl/DefaultExecutor.java
  
  Index: DefaultExecutor.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/sitemap/impl/DefaultExecutor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultExecutor.java	24 Jun 2004 13:18:01 -0000	1.5
  +++ DefaultExecutor.java	14 Jul 2004 13:17:45 -0000	1.6
  @@ -24,6 +24,7 @@
   import org.apache.cocoon.matching.Matcher;
   import org.apache.cocoon.matching.PreparableMatcher;
   import org.apache.cocoon.selection.Selector;
  +import org.apache.cocoon.selection.SwitchSelector;
   import org.apache.cocoon.sitemap.ExecutionContext;
   import org.apache.cocoon.sitemap.PatternException;
   import org.apache.cocoon.sitemap.SitemapExecutor;
  @@ -87,6 +88,16 @@
       }
       
       /* (non-Javadoc)
  +     * @see org.apache.cocoon.sitemap.SitemapExecutor#invokeSwitchSelector(org.apache.cocoon.sitemap.ExecutionContext,
java.util.Map, org.apache.cocoon.selection.SwitchSelector, java.lang.String, org.apache.avalon.framework.parameters.Parameters,
Object)
  +     */
  +    public boolean invokeSwitchSelector(ExecutionContext context,
  +            Map objectModel, SwitchSelector selector, String expression,
  +            Parameters parameters, Object selectorContext) {
  +        // TODO Auto-generated method stub
  +        return selector.select(expression, selectorContext);
  +    }
  +    
  +    /* (non-Javadoc)
        * @see org.apache.cocoon.sitemap.SitemapExecutor#popVariables(org.apache.cocoon.sitemap.ExecutionContext,
java.util.Map)
        */
       public void popVariables(ExecutionContext context,
  @@ -109,5 +120,38 @@
       public String enterSitemap(ExecutionContext context, Map objectModel,
               String source) {
           return source;
  +    }
  +    
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.sitemap.SitemapExecutor#addGenerator(org.apache.cocoon.sitemap.ExecutionContext,
java.util.Map, org.apache.cocoon.sitemap.SitemapExecutor.PipelineComponentDescription)
  +     */
  +    public PipelineComponentDescription addGenerator(ExecutionContext context,
  +            Map objectModel, PipelineComponentDescription desc) {
  +        return desc;
  +    }
  +    
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.sitemap.SitemapExecutor#addReader(org.apache.cocoon.sitemap.ExecutionContext,
java.util.Map, org.apache.cocoon.sitemap.SitemapExecutor.PipelineComponentDescription)
  +     */
  +    public PipelineComponentDescription addReader(ExecutionContext context,
  +            Map objectModel, PipelineComponentDescription desc) {
  +        return desc;
  +    }
  +    
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.sitemap.SitemapExecutor#addSerializer(org.apache.cocoon.sitemap.ExecutionContext,
java.util.Map, org.apache.cocoon.sitemap.SitemapExecutor.PipelineComponentDescription)
  +     */
  +    public PipelineComponentDescription addSerializer(ExecutionContext context,
  +            Map objectModel, PipelineComponentDescription desc) {
  +        return desc;
  +    }
  +    
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.sitemap.SitemapExecutor#addTransformer(org.apache.cocoon.sitemap.ExecutionContext,
java.util.Map, org.apache.cocoon.sitemap.SitemapExecutor.PipelineComponentDescription)
  +     */
  +    public PipelineComponentDescription addTransformer(
  +            ExecutionContext context, Map objectModel,
  +            PipelineComponentDescription desc) {
  +        return desc;
       }
   }
  
  
  
  1.5       +62 -8     cocoon-2.1/src/blocks/profiler/java/org/apache/cocoon/components/profiler/SimpleSitemapExecutor.java
  
  Index: SimpleSitemapExecutor.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/profiler/java/org/apache/cocoon/components/profiler/SimpleSitemapExecutor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SimpleSitemapExecutor.java	24 Jun 2004 13:18:01 -0000	1.4
  +++ SimpleSitemapExecutor.java	14 Jul 2004 13:17:45 -0000	1.5
  @@ -27,22 +27,17 @@
   import org.apache.cocoon.matching.Matcher;
   import org.apache.cocoon.matching.PreparableMatcher;
   import org.apache.cocoon.selection.Selector;
  +import org.apache.cocoon.selection.SwitchSelector;
   import org.apache.cocoon.sitemap.ExecutionContext;
   import org.apache.cocoon.sitemap.PatternException;
   import org.apache.cocoon.sitemap.SitemapExecutor;
   
   /**
  - * Sampe sitemap executor that prints out everything to a logger
  + * Sample sitemap executor that prints out everything to a logger
    * 
    * @since 2.2
    * @version CVS $Id$
    */
  -/**
  - * @author CZiegeler
  - *
  - * To change the template for this generated type comment go to
  - * Window - Preferences - Java - Code Generation - Code and Comments
  - */
   public class SimpleSitemapExecutor 
       extends AbstractLogEnabled
       implements ThreadSafe, SitemapExecutor {
  @@ -124,6 +119,24 @@
           }
           return result;
       }
  +    
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.sitemap.SitemapExecutor#invokeSwitchSelector(org.apache.cocoon.sitemap.ExecutionContext,
java.util.Map, org.apache.cocoon.selection.SwitchSelector, java.lang.String, org.apache.avalon.framework.parameters.Parameters,
java.lang.Object)
  +     */
  +    public boolean invokeSwitchSelector(ExecutionContext context,
  +            Map objectModel, SwitchSelector selector, String expression,
  +            Parameters parameters, Object selectorContext) {
  +        this.getLogger().info("- Invoking selector '" + context.getType() + "' (" +
  +                context.getLocation() + ").");
  +        final boolean result = selector.select(expression, selectorContext);
  +        if ( result ) {
  +            this.getLogger().info("- Selector '" + context.getType() + "' succeeded.");
  +        } else {
  +            this.getLogger().info("- Selector '" + context.getType() + "' failed.");  
         
  +        }
  +        return result;
  +    }
  +
       /* (non-Javadoc)
        * @see org.apache.cocoon.sitemap.SitemapExecutor#popVariables(org.apache.cocoon.sitemap.ExecutionContext,
java.util.Map)
        */
  @@ -155,6 +168,47 @@
                                  String source) {
           this.getLogger().info("- Entering sitemap " + source);
           return source;
  +    }
  +
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.sitemap.SitemapExecutor#addGenerator(org.apache.cocoon.sitemap.ExecutionContext,
java.util.Map, org.apache.cocoon.sitemap.SitemapExecutor.PipelineComponentDescription)
  +     */
  +    public PipelineComponentDescription addGenerator(ExecutionContext context,
  +            Map objectModel, PipelineComponentDescription desc) {
  +        this.getLogger().info("- Adding generator '" + desc.type + "' (" +
  +                context.getLocation() + ").");
  +        return desc;
  +    }
  +    
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.sitemap.SitemapExecutor#addReader(org.apache.cocoon.sitemap.ExecutionContext,
java.util.Map, org.apache.cocoon.sitemap.SitemapExecutor.PipelineComponentDescription)
  +     */
  +    public PipelineComponentDescription addReader(ExecutionContext context,
  +            Map objectModel, PipelineComponentDescription desc) {
  +        this.getLogger().info("- Adding reader '" + desc.type + "' (" +
  +                context.getLocation() + ").");
  +        return desc;
  +    }
  +    
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.sitemap.SitemapExecutor#addSerializer(org.apache.cocoon.sitemap.ExecutionContext,
java.util.Map, org.apache.cocoon.sitemap.SitemapExecutor.PipelineComponentDescription)
  +     */
  +    public PipelineComponentDescription addSerializer(ExecutionContext context,
  +            Map objectModel, PipelineComponentDescription desc) {
  +        this.getLogger().info("- Adding serializer '" + desc.type + "' (" +
  +                context.getLocation() + ").");
  +        return desc;
  +    }
  +    
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.sitemap.SitemapExecutor#addTransformer(org.apache.cocoon.sitemap.ExecutionContext,
java.util.Map, org.apache.cocoon.sitemap.SitemapExecutor.PipelineComponentDescription)
  +     */
  +    public PipelineComponentDescription addTransformer(
  +            ExecutionContext context, Map objectModel,
  +            PipelineComponentDescription desc) {
  +        this.getLogger().info("- Adding transformer '" + desc.type + "' (" +
  +                context.getLocation() + ").");
  +        return desc;
       }
   }
   
  
  
  

Mime
View raw message