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 TreeProcessor.java
Date Tue, 25 May 2004 13:48:13 GMT
cziegeler    2004/05/25 06:48:13

  Modified:    src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        ActSetNode.java ActTypeNode.java
                        RedirectToURINode.java ContinueNode.java
                        CallFunctionNode.java PipelinesNode.java
               src/java/org/apache/cocoon/components/treeprocessor
                        TreeProcessor.java
  Log:
  Store redirector in the invoke context
  
  Revision  Changes    Path
  1.3       +2 -2      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActSetNode.java
  
  Index: ActSetNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActSetNode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ActSetNode.java	5 Mar 2004 13:02:51 -0000	1.2
  +++ ActSetNode.java	25 May 2004 13:48:12 -0000	1.3
  @@ -62,7 +62,7 @@
   
           Map result = this.actionSet.call(env, context, resolvedParams);
   
  -        if (PipelinesNode.getRedirector(env).hasRedirected()) {
  +        if (context.getRedirector().hasRedirected()) {
               return true;
   
           } else if (result == null) {
  
  
  
  1.7       +2 -2      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActTypeNode.java
  
  Index: ActTypeNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActTypeNode.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ActTypeNode.java	25 May 2004 13:30:10 -0000	1.6
  +++ ActTypeNode.java	25 May 2004 13:48:12 -0000	1.7
  @@ -89,7 +89,7 @@
   
           // Prepare data needed by the action
           Map objectModel = env.getObjectModel();
  -        Redirector redirector = PipelinesNode.getRedirector(env);
  +        Redirector redirector = context.getRedirector();
           SourceResolver resolver = EnvironmentHelper.getCurrentProcessor().getSourceResolver();
           String resolvedSource = source.resolve(context, objectModel);
           Parameters resolvedParams =
  
  
  
  1.6       +2 -2      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/RedirectToURINode.java
  
  Index: RedirectToURINode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/RedirectToURINode.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RedirectToURINode.java	5 Mar 2004 13:02:52 -0000	1.5
  +++ RedirectToURINode.java	25 May 2004 13:48:12 -0000	1.6
  @@ -59,7 +59,7 @@
               getLogger().info("Redirecting to '" + resolvedURI + "' at " + this.getLocation());
           }
   
  -        final Redirector redirector = PipelinesNode.getRedirector(env);
  +        final Redirector redirector = context.getRedirector();
   
           if( this.global ) {
               redirector.globalRedirect(this.createSession, resolvedURI);
  
  
  
  1.6       +2 -2      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ContinueNode.java
  
  Index: ContinueNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ContinueNode.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ContinueNode.java	5 Mar 2004 13:02:51 -0000	1.5
  +++ ContinueNode.java	25 May 2004 13:48:12 -0000	1.6
  @@ -111,7 +111,7 @@
           Interpreter interpreter = (Interpreter)selector.select(language);
   
           try {
  -            interpreter.handleContinuation(contId, params, PipelinesNode.getRedirector(env));
  +            interpreter.handleContinuation(contId, params, context.getRedirector());
           } finally {
               selector.release((Component)interpreter);
           }
  
  
  
  1.10      +3 -3      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/CallFunctionNode.java
  
  Index: CallFunctionNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/CallFunctionNode.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CallFunctionNode.java	5 Mar 2004 13:02:51 -0000	1.9
  +++ CallFunctionNode.java	25 May 2004 13:48:12 -0000	1.10
  @@ -117,7 +117,7 @@
           // If the continuation id is not null, it takes precedence over
           // the function call, so we invoke it here.
           if (continuation != null && continuation.length() > 0) {
  -            interpreter.handleContinuation(continuation, params, PipelinesNode.getRedirector(env));
  +            interpreter.handleContinuation(continuation, params, context.getRedirector());
               return true;
           }
   
  @@ -127,7 +127,7 @@
           String name = functionName.resolve(context, env.getObjectModel());
   
           if (name != null && name.length() > 0) {
  -            interpreter.callFunction(name, params, PipelinesNode.getRedirector(env));
  +            interpreter.callFunction(name, params, context.getRedirector());
               return true;
           }
           
  
  
  
  1.10      +1 -5      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java
  
  Index: PipelinesNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- PipelinesNode.java	5 Mar 2004 13:02:52 -0000	1.9
  +++ PipelinesNode.java	25 May 2004 13:48:12 -0000	1.10
  @@ -76,10 +76,6 @@
           super.setChildren(nodes);
       }
   
  -    public static Redirector getRedirector(Environment env) {
  -        return (Redirector)env.getAttribute(TreeProcessor.REDIRECTOR_ATTR);
  -    }
  -
       /**
        * Process the environment. Also adds a <code>SourceResolver</code>
        * and a <code>Redirector</code> in the object model. The previous resolver
and
  
  
  
  1.30      +6 -8      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
  
  Index: TreeProcessor.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- TreeProcessor.java	25 May 2004 13:42:51 -0000	1.29
  +++ TreeProcessor.java	25 May 2004 13:48:12 -0000	1.30
  @@ -53,6 +53,7 @@
   import org.apache.cocoon.components.source.impl.DelayedRefreshSourceWrapper;
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.environment.ForwardRedirector;
  +import org.apache.cocoon.environment.Redirector;
   import org.apache.cocoon.environment.internal.EnvironmentHelper;
   import org.apache.cocoon.environment.wrapper.EnvironmentWrapper;
   import org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade;
  @@ -77,7 +78,6 @@
                  Disposable,
                  Initializable {
   
  -    public static final String REDIRECTOR_ATTR = "sitemap:redirector";
       public static final String COCOON_REDIRECT_ATTR = "sitemap:cocoon-redirect";
   
       private static final String XCONF_URL =
  @@ -333,15 +333,13 @@
           // and now process
           EnvironmentHelper.enterProcessor(this, this.serviceManager, environment);
   
  -        Map objectModel = environment.getObjectModel();
  -
  -        Object oldRedirector = environment.getAttribute(REDIRECTOR_ATTR);
  +        final Redirector oldRedirector = context.getRedirector();
   
           // Build a redirector
           TreeProcessorRedirector redirector = new TreeProcessorRedirector(environment, context);
           setupLogger(redirector);
  +        context.setRedirector(redirector);
   
  -        environment.setAttribute(REDIRECTOR_ATTR, redirector);
           try {
               boolean success = this.rootNode.invoke(environment, context);
               
  @@ -349,8 +347,8 @@
   
           } finally {
               EnvironmentHelper.leaveProcessor();
  -            // Restore old redirector and resolver
  -            environment.setAttribute(REDIRECTOR_ATTR, oldRedirector);
  +            // Restore old redirector 
  +            context.setRedirector(oldRedirector);
           }
       }
           
  
  
  

Mime
View raw message