cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/fom FOM_Cocoon.java FOM_JavaScriptInterpreter.java
Date Tue, 28 Oct 2003 17:21:14 GMT
vgritsenko    2003/10/28 09:21:14

  Modified:    src/java/org/apache/cocoon/components/flow/javascript
                        JSCocoon.java
               src/java/org/apache/cocoon/components/flow/javascript/fom
                        FOM_Cocoon.java FOM_JavaScriptInterpreter.java
               src/java/org/apache/cocoon/components/flow/javascript
                        JSCocoon.java
               src/java/org/apache/cocoon/components/flow/javascript/fom
                        FOM_Cocoon.java FOM_JavaScriptInterpreter.java
  Log:
  Fix bug with redirect from the flow: treeprocessor was not aware of redirect
  and was throwing exceptions
  
  Revision  Changes    Path
  1.12      +5 -2      cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/JSCocoon.java
  
  Index: JSCocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/JSCocoon.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JSCocoon.java	8 May 2003 00:05:04 -0000	1.11
  +++ JSCocoon.java	28 Oct 2003 17:21:13 -0000	1.12
  @@ -70,6 +70,7 @@
   import org.apache.cocoon.components.modules.output.OutputModule;
   import org.apache.cocoon.components.modules.input.InputModule;
   import org.apache.cocoon.components.CocoonComponentManager;
  +import org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode;
   import org.apache.cocoon.components.flow.ContinuationsManager;
   import org.apache.cocoon.components.flow.WebContinuation;
   import org.apache.cocoon.acting.Action;
  @@ -262,7 +263,9 @@
           throws JavaScriptException
       {
           try {
  -            environment.redirect(false, uri);
  +            // Cannot use environment directly as TreeProcessor uses own version of redirector
  +            // environment.redirect(false, uri);
  +            PipelinesNode.getRedirector(environment).redirect(false, uri);
           } catch (Exception e) {
               throw new JavaScriptException(e);
           }
  
  
  
  1.14      +9 -4      cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java
  
  Index: FOM_Cocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- FOM_Cocoon.java	15 Oct 2003 17:02:05 -0000	1.13
  +++ FOM_Cocoon.java	28 Oct 2003 17:21:14 -0000	1.14
  @@ -65,6 +65,7 @@
   import org.apache.cocoon.components.flow.ContinuationsManager;
   import org.apache.cocoon.components.flow.WebContinuation;
   import org.apache.cocoon.components.flow.Interpreter.Argument;
  +import org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode;
   import org.apache.cocoon.environment.Cookie;
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.environment.ObjectModelHelper;
  @@ -79,6 +80,7 @@
   import org.mozilla.javascript.Undefined;
   import org.mozilla.javascript.Wrapper;
   import org.mozilla.javascript.continuations.Continuation;
  +
   /**
    * Implementation of FOM (Flow Object Model).
    *
  @@ -87,7 +89,6 @@
    * @author <a href="mailto:reinhard.at.apache.org">Reinhard Pötz</a>
    * @version CVS $Id$
    */
  -
   public class FOM_Cocoon extends ScriptableObject {
   
       private FOM_JavaScriptInterpreter interpreter;
  @@ -203,7 +204,9 @@
       }
   
       public void jsFunction_redirectTo(String uri) throws Exception {
  -        environment.redirect(false, uri);
  +        // Cannot use environment directly as TreeProcessor uses own version of redirector
  +        // environment.redirect(false, uri);
  +        PipelinesNode.getRedirector(environment).redirect(false, uri);
       }
   
   /*
  @@ -434,7 +437,9 @@
           public String jsFunction_getHeader(String name) {
               return request.getHeader(name);
           }
  -        
  +
  +        // TODO: FOM_Header
  +
           public Enumeration jsFunction_getHeaders(String name) {
               return request.getHeaders(name);
           }
  
  
  
  1.12      +2 -2      cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
  
  Index: FOM_JavaScriptInterpreter.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- FOM_JavaScriptInterpreter.java	15 Oct 2003 17:02:05 -0000	1.11
  +++ FOM_JavaScriptInterpreter.java	28 Oct 2003 17:21:14 -0000	1.12
  @@ -517,7 +517,7 @@
                   cocoon.setParameters(parameters);
                   Object fun = ScriptableObject.getProperty(thrScope, funName);
                   if (fun == Scriptable.NOT_FOUND) {
  -                    throw new ResourceNotFoundException("Function \"javascript:"+funName+
"()\" not found");
  +                    throw new ResourceNotFoundException("Function \"javascript:" + funName
+ "()\" not found");
                   }
                   ScriptRuntime.call(context, fun, thrScope, 
                                      funArgs, thrScope);
  
  
  
  1.13      +5 -2      cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/JSCocoon.java
  
  Index: JSCocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/JSCocoon.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- JSCocoon.java	16 Oct 2003 14:57:36 -0000	1.12
  +++ JSCocoon.java	28 Oct 2003 17:21:14 -0000	1.13
  @@ -70,6 +70,7 @@
   import org.apache.cocoon.components.modules.output.OutputModule;
   import org.apache.cocoon.components.modules.input.InputModule;
   import org.apache.cocoon.components.CocoonComponentManager;
  +import org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode;
   import org.apache.cocoon.components.flow.ContinuationsManager;
   import org.apache.cocoon.components.flow.WebContinuation;
   import org.apache.cocoon.acting.Action;
  @@ -261,7 +262,9 @@
           throws JavaScriptException
       {
           try {
  -            environment.redirect(false, uri);
  +            // Cannot use environment directly as TreeProcessor uses own version of redirector
  +            // environment.redirect(false, uri);
  +            PipelinesNode.getRedirector(environment).redirect(false, uri);
           } catch (Exception e) {
               throw new JavaScriptException(e);
           }
  
  
  
  1.15      +8 -3      cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java
  
  Index: FOM_Cocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- FOM_Cocoon.java	16 Oct 2003 14:57:36 -0000	1.14
  +++ FOM_Cocoon.java	28 Oct 2003 17:21:14 -0000	1.15
  @@ -64,6 +64,7 @@
   import org.apache.cocoon.components.flow.ContinuationsManager;
   import org.apache.cocoon.components.flow.WebContinuation;
   import org.apache.cocoon.components.flow.Interpreter.Argument;
  +import org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode;
   import org.apache.cocoon.environment.Cookie;
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.environment.ObjectModelHelper;
  @@ -78,6 +79,7 @@
   import org.mozilla.javascript.Undefined;
   import org.mozilla.javascript.Wrapper;
   import org.mozilla.javascript.continuations.Continuation;
  +
   /**
    * Implementation of FOM (Flow Object Model).
    *
  @@ -86,7 +88,6 @@
    * @author <a href="mailto:reinhard.at.apache.org">Reinhard Pötz</a>
    * @version CVS $Id$
    */
  -
   public class FOM_Cocoon extends ScriptableObject {
   
       private FOM_JavaScriptInterpreter interpreter;
  @@ -202,7 +203,9 @@
       }
   
       public void jsFunction_redirectTo(String uri) throws Exception {
  -        environment.redirect(false, uri);
  +        // Cannot use environment directly as TreeProcessor uses own version of redirector
  +        // environment.redirect(false, uri);
  +        PipelinesNode.getRedirector(environment).redirect(false, uri);
       }
   
   /*
  @@ -433,6 +436,8 @@
           public String jsFunction_getHeader(String name) {
               return request.getHeader(name);
           }
  +
  +        // TODO: FOM_Header
   
           public Enumeration jsFunction_getHeaders(String name) {
               return request.getHeaders(name);
  
  
  
  1.12      +2 -2      cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
  
  Index: FOM_JavaScriptInterpreter.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- FOM_JavaScriptInterpreter.java	15 Oct 2003 17:04:50 -0000	1.11
  +++ FOM_JavaScriptInterpreter.java	28 Oct 2003 17:21:14 -0000	1.12
  @@ -517,7 +517,7 @@
                   cocoon.setParameters(parameters);
                   Object fun = ScriptableObject.getProperty(thrScope, funName);
                   if (fun == Scriptable.NOT_FOUND) {
  -                    throw new ResourceNotFoundException("Function \"javascript:"+funName+
"()\" not found");
  +                    throw new ResourceNotFoundException("Function \"javascript:" + funName
+ "()\" not found");
                   }
                   ScriptRuntime.call(context, fun, thrScope, 
                                      funArgs, thrScope);
  
  
  

Mime
View raw message