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/java/org/apache/cocoon/components/treeprocessor/sitemap MountNode.java
Date Thu, 24 Jun 2004 13:18:01 GMT
cziegeler    2004/06/24 06:18:01

  Modified:    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
               src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        MountNode.java
  Log:
  Adding mount to profiling
  
  Revision  Changes    Path
  1.5       +12 -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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SitemapExecutor.java	17 Jun 2004 13:52:35 -0000	1.4
  +++ SitemapExecutor.java	24 Jun 2004 13:18:01 -0000	1.5
  @@ -110,4 +110,15 @@
        */
       void popVariables(ExecutionContext context,
                         Map              objectModel);
  +    
  +    /**
  +     * Enter a new sitemap
  +     * @param context     The execution context
  +     * @param objectModel The object model
  +     * @param source The uri of the sitemap
  +     * @return The uri of the sitemap to read
  +     */
  +    String enterSitemap(ExecutionContext context, 
  +                        Map              objectModel,
  +                        String           source);
   }
  
  
  
  1.5       +9 -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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DefaultExecutor.java	17 Jun 2004 13:52:35 -0000	1.4
  +++ DefaultExecutor.java	24 Jun 2004 13:18:01 -0000	1.5
  @@ -102,4 +102,12 @@
                                String key, Map variables) {
           return variables;
       }
  +    
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.sitemap.SitemapExecutor#enterSitemap(org.apache.cocoon.sitemap.ExecutionContext,
java.util.Map, java.lang.String)
  +     */
  +    public String enterSitemap(ExecutionContext context, Map objectModel,
  +            String source) {
  +        return source;
  +    }
   }
  
  
  
  1.4       +16 -1     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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SimpleSitemapExecutor.java	17 Jun 2004 13:52:35 -0000	1.3
  +++ SimpleSitemapExecutor.java	24 Jun 2004 13:18:01 -0000	1.4
  @@ -37,6 +37,12 @@
    * @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 {
  @@ -141,5 +147,14 @@
           return variables;
       }
       
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.sitemap.SitemapExecutor#enterSitemap(org.apache.cocoon.sitemap.ExecutionContext,
java.util.Map, java.lang.String)
  +     */
  +    public String enterSitemap(ExecutionContext context, 
  +                               Map objectModel,
  +                               String source) {
  +        this.getLogger().info("- Entering sitemap " + source);
  +        return source;
  +    }
   }
   
  
  
  
  1.15      +9 -3      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
  
  Index: MountNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- MountNode.java	8 Jun 2004 13:09:27 -0000	1.14
  +++ MountNode.java	24 Jun 2004 13:18:01 -0000	1.15
  @@ -62,10 +62,13 @@
           this.checkReload = checkReload;
       }
   
  +    /* (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();
   
           String resolvedSource = this.source.resolve(context, objectModel);
           String resolvedPrefix = this.prefix.resolve(context, objectModel);
  @@ -73,6 +76,8 @@
           if (resolvedSource.length()==0) {
               throw new ProcessingException("Source of mount statement is empty"); 
           }
  +        
  +        resolvedSource = this.executor.enterSitemap(this, objectModel, resolvedSource);
           TreeProcessor processor = getProcessor(resolvedSource, resolvedPrefix);
   
           String oldPrefix = env.getURIPrefix();
  @@ -135,5 +140,6 @@
           while(iter.hasNext()) {
               ((TreeProcessor)iter.next()).dispose();
           }
  +        this.processors.clear();
       }
   }
  
  
  

Mime
View raw message