cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From coli...@apache.org
Subject cvs commit: cocoon-2.1/src/scratchpad/src/org/apache/cocoon/components/flow/javascript/fom FOM_Cocoon.java FOM_JavaScriptInterpreter.java
Date Sun, 22 Jun 2003 18:12:27 GMT
coliver     2003/06/22 11:12:27

  Modified:    src/scratchpad/src/org/apache/cocoon/components/flow/javascript/fom
                        FOM_Cocoon.java FOM_JavaScriptInterpreter.java
  Log:
  minor refactoring
  
  Revision  Changes    Path
  1.3       +11 -0     cocoon-2.1/src/scratchpad/src/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java
  
  Index: FOM_Cocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/scratchpad/src/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FOM_Cocoon.java	20 Jun 2003 08:30:29 -0000	1.2
  +++ FOM_Cocoon.java	22 Jun 2003 18:12:27 -0000	1.3
  @@ -87,6 +87,17 @@
           return "FOM_Cocoon";
       }
   
  +    // Called by FOM_JavaScriptInterpreter
  +    static void init(Scriptable scope) throws Exception {
  +        defineClass(scope, FOM_Cocoon.class);
  +        defineClass(scope, FOM_Request.class);
  +        defineClass(scope, FOM_Response.class);
  +        defineClass(scope, FOM_Cookie.class);
  +        defineClass(scope, FOM_Session.class);
  +        defineClass(scope, FOM_Context.class);
  +        defineClass(scope, FOM_Log.class);
  +    }
  +
       public void setup(FOM_JavaScriptInterpreter interp,
                         Environment env, 
                         ComponentManager manager) {
  
  
  
  1.2       +12 -23    cocoon-2.1/src/scratchpad/src/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
  
  Index: FOM_JavaScriptInterpreter.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/scratchpad/src/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FOM_JavaScriptInterpreter.java	20 Jun 2003 08:28:20 -0000	1.1
  +++ FOM_JavaScriptInterpreter.java	22 Jun 2003 18:12:27 -0000	1.2
  @@ -249,19 +249,7 @@
           try {
               scope = new Global(context);
               // Access to Cocoon internal objects
  -            ScriptableObject.defineClass(scope, FOM_Cocoon.class);
  -            ScriptableObject.defineClass(scope,
  -                                         FOM_Cocoon.FOM_Request.class);
  -            ScriptableObject.defineClass(scope,
  -                                         FOM_Cocoon.FOM_Response.class);
  -            ScriptableObject.defineClass(scope,
  -                                         FOM_Cocoon.FOM_Session.class);
  -            ScriptableObject.defineClass(scope,
  -                                         FOM_Cocoon.FOM_Context.class);
  -            ScriptableObject.defineClass(scope,
  -                                         FOM_Cocoon.FOM_Cookie.class);
  -            ScriptableObject.defineClass(scope,
  -                                         FOM_Cocoon.FOM_Log.class);
  +            FOM_Cocoon.init(scope);
               errorReporter = new JSErrorReporter(getLogger());
           }
           catch (Exception e) {
  @@ -608,17 +596,17 @@
           if (enableDebugger) {
               getDebugger().setVisible(true);
           }
  -        int size = (params != null ? params.size() : 0);
  -        NativeArray parameters = new NativeArray(size);
  +        //int size = (params != null ? params.size() : 0);
  +        //NativeArray parameters = new NativeArray(size);
   
  -        if (size != 0) {
  -            for (int i = 0; i < size; i++) {
  -                Interpreter.Argument arg = (Interpreter.Argument)params.get(i);
  -                parameters.put(arg.name, parameters, arg.value);
  -            }
  -        }
  -        Object[] args = new Object[] {k};
  +        //if (size != 0) {
  +        //for (int i = 0; i < size; i++) {
  +        //Interpreter.Argument arg = (Interpreter.Argument)params.get(i);
  +        //parameters.put(arg.name, parameters, arg.value);
  +        //}
  +        //}
           //cocoon.setParameters(parameters);
  +        Object[] args = new Object[] {k};
           try {
               ScriptableObject.callMethod(cocoon, "handleContinuation", args);
           } catch (JavaScriptException ex) {
  @@ -644,6 +632,7 @@
               }
               throw new CascadingRuntimeException(ee.getMessage(), ee);
           } finally {
  +            cocoon.invalidate();
               Context.exit();
           }
       }
  
  
  

Mime
View raw message