cziegeler    02/05/27 07:31:27

  Modified:    src/java/org/apache/cocoon/components/source
                        SitemapSource.java
               src/java/org/apache/cocoon/components/source/impl
                        SitemapSource.java
               src/java/org/apache/cocoon/components/treeprocessor
                        InvokeContext.java
               src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        MountNode.java
  Log:
  Fixed cocoon:// protocol from sub-sitemap
  
  Revision  Changes    Path
  1.14      +10 -10    
xml-cocoon2/src/java/org/apache/cocoon/components/source/SitemapSource.java
  
  Index: SitemapSource.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/SitemapSource.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- SitemapSource.java        27 May 2002 14:02:29 -0000      1.13
  +++ SitemapSource.java        27 May 2002 14:31:26 -0000      1.14
  @@ -87,7 +87,7 @@
    * Description of a source which is defined by a pipeline.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Carsten Ziegeler</a>
  - * @version CVS $Id: SitemapSource.java,v 1.13 2002/05/27 14:02:29 cziegeler Exp $
  + * @version CVS $Id: SitemapSource.java,v 1.14 2002/05/27 14:31:26 cziegeler Exp $
    */
   
   public final class SitemapSource
  @@ -262,10 +262,10 @@
           reset();
           try {
               this.environment.setURI(this.prefix, this.uri);
  -            this.processingPipeline = 
this.processor.processInternal(this.environment);
               this.environment.changeToLastContext();
  -                String redirectURL = this.environment.getRedirectURL();
  -                if (redirectURL == null) {
  +            this.processingPipeline = 
this.processor.processInternal(this.environment);
  +            String redirectURL = this.environment.getRedirectURL();
  +            if (redirectURL == null) {
                       // FIXME (CZ) - Caching
   /*                    if (this.eventPipeline.getGenerator() != null &&
                           this.eventPipeline instanceof CacheableEventPipeline) {
  @@ -282,13 +282,13 @@
                               }
                           }
                       }*/
  -                } else {
  -                    if (redirectURL.indexOf(":") == -1) {
  -                        redirectURL = "cocoon:/" + redirectURL;
  -                    }
  -                    this.redirectSource = this.environment.resolve(redirectURL);
  -                    this.lastModificationDate = 
this.redirectSource.getLastModified();
  +            } else {
  +                if (redirectURL.indexOf(":") == -1) {
  +                    redirectURL = "cocoon:/" + redirectURL;
                   }
  +                this.redirectSource = this.environment.resolve(redirectURL);
  +                this.lastModificationDate = this.redirectSource.getLastModified();
  +            }
           } catch (ProcessingException e) {
               reset();
               this.exception = e;
  
  
  
  1.7       +25 -25    
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
  
  Index: SitemapSource.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SitemapSource.java        27 May 2002 14:02:29 -0000      1.6
  +++ SitemapSource.java        27 May 2002 14:31:26 -0000      1.7
  @@ -93,7 +93,7 @@
    * Description of a source which is defined by a pipeline.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Carsten Ziegeler</a>
  - * @version CVS $Id: SitemapSource.java,v 1.6 2002/05/27 14:02:29 cziegeler Exp $
  + * @version CVS $Id: SitemapSource.java,v 1.7 2002/05/27 14:31:26 cziegeler Exp $
    */
   
   public final class SitemapSource
  @@ -247,7 +247,7 @@
               return new ByteArrayInputStream(os.toByteArray());
   
           } catch (Exception e) {
  -            throw new IOException("Exception during processing of " + 
this.systemId);
  +            throw new SourceException("Exception during processing of " + 
this.systemId, e);
           } finally {
               // Unhide wrapped environment output stream
               this.environment.setOutputStream(null);
  @@ -300,33 +300,33 @@
           try {
   
               this.environment.setURI(this.prefix, this.uri);
  -            this.processingPipeline = 
this.processor.processInternal(this.environment);
               this.environment.changeToLastContext();
  -                String redirectURL = this.environment.getRedirectURL();
  -                if (redirectURL == null) {
  -                    // FIXME (CZ) - Caching
  -                    /*if (this.processingPipeline.getGenerator() != null &&
  -                        this.eventPipeline instanceof CacheableEventPipeline) {
  -                        CacheableEventPipeline cep = 
(CacheableEventPipeline)this.eventPipeline;
  -                        PipelineCacheKey pck = cep.generateKey(this.environment);
  -                        Map validity = null;
  -                        if (pck != null) {
  -                            validity = cep.generateValidity(this.environment);
  -                            if (validity != null) {
  -                                // the event pipeline is cacheable
  -                                // now calculate a last modification date
  -                                String hashKey = pck.toString() + 
validity.toString();
  -                                this.lastModificationDate = HashUtil.hash(hashKey);
  -                            }
  +            this.processingPipeline = 
this.processor.processInternal(this.environment);
  +            String redirectURL = this.environment.getRedirectURL();
  +            if (redirectURL == null) {
  +                // FIXME (CZ) - Caching
  +                /*if (this.processingPipeline.getGenerator() != null &&
  +                    this.eventPipeline instanceof CacheableEventPipeline) {
  +                    CacheableEventPipeline cep = 
(CacheableEventPipeline)this.eventPipeline;
  +                    PipelineCacheKey pck = cep.generateKey(this.environment);
  +                    Map validity = null;
  +                    if (pck != null) {
  +                        validity = cep.generateValidity(this.environment);
  +                        if (validity != null) {
  +                            // the event pipeline is cacheable
  +                            // now calculate a last modification date
  +                            String hashKey = pck.toString() + validity.toString();
  +                            this.lastModificationDate = HashUtil.hash(hashKey);
                           }
  -                    } */
  -                } else {
  -                    if (redirectURL.indexOf(":") == -1) {
  -                        redirectURL = "cocoon:/" + redirectURL;
                       }
  -                    this.redirectSource = this.environment.resolveURI(redirectURL);
  -                    this.redirectValidity = this.redirectSource.getValidity();
  +                } */
  +            } else {
  +                if (redirectURL.indexOf(":") == -1) {
  +                    redirectURL = "cocoon:/" + redirectURL;
                   }
  +                this.redirectSource = this.environment.resolveURI(redirectURL);
  +                this.redirectValidity = this.redirectSource.getValidity();
  +            }
           } catch (SAXException e) {
               reset();
               this.exception = e;
  
  
  
  1.9       +10 -2     
xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java
  
  Index: InvokeContext.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- InvokeContext.java        27 May 2002 14:02:29 -0000      1.8
  +++ InvokeContext.java        27 May 2002 14:31:27 -0000      1.9
  @@ -76,7 +76,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Sylvain Wallez</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Carsten Ziegeler</a>
  - * @version CVS $Id: InvokeContext.java,v 1.8 2002/05/27 14:02:29 cziegeler Exp $
  + * @version CVS $Id: InvokeContext.java,v 1.9 2002/05/27 14:31:27 cziegeler Exp $
    */
   
   public class InvokeContext implements Recomposable, Disposable, Loggable {
  @@ -177,6 +177,13 @@
       }
   
       /**
  +     * Set the processing pipeline for sub-sitemaps
  +     */
  +    public void setProcessingPipeline(ProcessingPipeline pipeline) {
  +        this.processingPipeline = pipeline;
  +    }
  +
  +    /**
        * Is this an internal request ?
        */
       public final boolean isInternalRequest() {
  @@ -251,7 +258,8 @@
                   this.pipelineSelector = null;
               }
               this.pipelinesManager = null;
  +            this.processingPipelineParameters = null;
           }
  -        this.processingPipelineParameters = null;
  +
       }
   }
  
  
  
  1.5       +13 -9     
xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
  
  Index: MountNode.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MountNode.java    27 May 2002 14:02:30 -0000      1.4
  +++ MountNode.java    27 May 2002 14:31:27 -0000      1.5
  @@ -50,24 +50,22 @@
   */
   package org.apache.cocoon.components.treeprocessor.sitemap;
   
  +import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
  -
  -import org.apache.cocoon.environment.Environment;
  -import org.apache.cocoon.sitemap.PatternException;
  -
  +import org.apache.avalon.framework.component.Composable;
  +import org.apache.cocoon.components.pipeline.ProcessingPipeline;
   import org.apache.cocoon.components.treeprocessor.MapStackResolver;
   import org.apache.cocoon.components.treeprocessor.AbstractProcessingNode;
   import org.apache.cocoon.components.treeprocessor.TreeProcessor;
   import org.apache.cocoon.components.treeprocessor.InvokeContext;
  -
  +import org.apache.cocoon.environment.Environment;
  +import org.apache.cocoon.sitemap.PatternException;
   import java.util.*;
  -import org.apache.avalon.framework.component.Composable;
  -import org.apache.avalon.framework.component.ComponentException;
   
   /**
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Sylvain Wallez</a>
  - * @version CVS $Id: MountNode.java,v 1.4 2002/05/27 14:02:30 cziegeler Exp $
  + * @version CVS $Id: MountNode.java,v 1.5 2002/05/27 14:31:27 cziegeler Exp $
    */
   
   public class MountNode extends AbstractProcessingNode implements Composable {
  @@ -122,7 +120,13 @@
   
               if (context.isInternalRequest()) {
                   // Propagate pipelines
  -                return (processor.processInternal(env) != null);
  +                ProcessingPipeline pp = processor.processInternal(env);
  +                if ( pp != null ) {
  +                    context.setProcessingPipeline( pp );
  +                    return true;
  +                } else {
  +                    return false;
  +                }
               } else {
                   // Processor will create its own pipelines
                   return processor.process(env);
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to