cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/sitemap Manager.java
Date Mon, 20 Aug 2001 21:49:15 GMT
vgritsenko    01/08/20 14:49:15

  Modified:    src/org/apache/cocoon/environment Tag: cocoon_20_branch
                        Environment.java AbstractEnvironment.java
               src/org/apache/cocoon/sitemap Tag: cocoon_20_branch
                        Manager.java
  Log:
  QUICK FIX to make handle-errors work again.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.8   +3 -1      xml-cocoon2/src/org/apache/cocoon/environment/Environment.java
  
  Index: Environment.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/Environment.java,v
  retrieving revision 1.2.2.7
  retrieving revision 1.2.2.8
  diff -u -r1.2.2.7 -r1.2.2.8
  --- Environment.java	2001/08/20 14:07:30	1.2.2.7
  +++ Environment.java	2001/08/20 21:49:14	1.2.2.8
  @@ -20,7 +20,7 @@
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.2.2.7 $ $Date: 2001/08/20 14:07:30 $
  + * @version CVS $Revision: 1.2.2.8 $ $Date: 2001/08/20 21:49:14 $
    */
   
   public interface Environment extends SourceResolver {
  @@ -49,6 +49,8 @@
        * Get current context
        */
       URL getContext();
  +
  +    void setContext(URL url);
   
       /**
        * Get the Root Context
  
  
  
  1.6.2.11  +5 -2      xml-cocoon2/src/org/apache/cocoon/environment/AbstractEnvironment.java
  
  Index: AbstractEnvironment.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/AbstractEnvironment.java,v
  retrieving revision 1.6.2.10
  retrieving revision 1.6.2.11
  diff -u -r1.6.2.10 -r1.6.2.11
  --- AbstractEnvironment.java	2001/08/20 14:07:30	1.6.2.10
  +++ AbstractEnvironment.java	2001/08/20 21:49:14	1.6.2.11
  @@ -24,7 +24,7 @@
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.6.2.10 $ $Date: 2001/08/20 14:07:30 $
  + * @version CVS $Revision: 1.6.2.11 $ $Date: 2001/08/20 21:49:14 $
    */
   public abstract class AbstractEnvironment extends AbstractLoggable implements Environment
{
   
  @@ -132,6 +132,10 @@
           return this.context;
       }
   
  +    public void setContext(URL context) {
  +        this.context = context;
  +    }
  +
       /**
        * Get the prefix of the URI in progress
        */
  @@ -275,5 +279,4 @@
       public void setResponseIsNotModified() {
           // does nothing
       }
  -
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.12  +18 -4     xml-cocoon2/src/org/apache/cocoon/sitemap/Manager.java
  
  Index: Manager.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/sitemap/Manager.java,v
  retrieving revision 1.2.2.11
  retrieving revision 1.2.2.12
  diff -u -r1.2.2.11 -r1.2.2.12
  --- Manager.java	2001/08/20 14:07:34	1.2.2.11
  +++ Manager.java	2001/08/20 21:49:15	1.2.2.12
  @@ -27,13 +27,14 @@
   import java.util.HashMap;
   import java.util.Iterator;
   
  +import java.net.URL;
   /**
    * This class manages all sub <code>Sitemap</code>s of a <code>Sitemap</code>
    * Invokation of sub sitemaps will be done by this instance as well
    * checking regeneration of the sub <code>Sitemap</code>
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.2.2.11 $ $Date: 2001/08/20 14:07:34 $
  + * @version CVS $Revision: 1.2.2.12 $ $Date: 2001/08/20 21:49:15 $
    */
   public class Manager extends AbstractLoggable implements Component, Configurable, Composable,
Contextualizable, ThreadSafe {
       private Context context;
  @@ -99,7 +100,13 @@
               Handler sitemapHandler = getHandler(newManager, environment, source, check_reload,
reload_asynchron);
               // setup to invoke the processing
               setupProcessing(environment, sitemapHandler, uri_prefix, source);
  -            return sitemapHandler.process(environment);
  +            URL context = environment.getContext();
  +            try{
  +                environment.changeContext(uri_prefix, source);
  +                return sitemapHandler.process(environment);
  +            }finally{
  +                environment.setContext(context);
  +            }
       }
   
       /** invokes the sitemap handler to process a request
  @@ -116,8 +123,15 @@
               // get a sitemap handler
               Handler sitemapHandler = getHandler(newManager, environment, source, check_reload,
reload_asynchron);
               // setup to invoke the processing
  +            environment.changeContext(uri_prefix, source);
               setupProcessing(environment, sitemapHandler, uri_prefix, source);
  -            return sitemapHandler.process(environment, pipeline, eventPipeline);
  +            URL context = environment.getContext();
  +            try{
  +                environment.changeContext(uri_prefix, source);
  +                return sitemapHandler.process(environment, pipeline, eventPipeline);
  +            }finally{
  +                environment.setContext(context);
  +            }
       }
   
       /** has the sitemap changed
  @@ -191,7 +205,7 @@
   
       private void setupProcessing(Environment environment, Handler sitemapHandler, String
uri_prefix,
           String source) throws Exception {
  -            environment.changeContext(uri_prefix, source);
  +//            environment.changeContext(uri_prefix, source);
               if (!sitemapHandler.available()) {
                   throw new ProcessingException("The sitemap handler's sitemap is not available.
" +
                       "Please check "+ logFilePath +" for the exact error.",
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message