You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ov...@apache.org on 2002/09/06 02:14:09 UTC

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/flow/javascript JSCocoon.java

ovidiu      2002/09/05 17:14:06

  Modified:    src/java/org/apache/cocoon/components/flow/javascript
                        JSCocoon.java
  Log:
  Use WebContinuation instead of JSWebContinuation. Document
  jsFunction_createSession. Added removeSession.
  
  Revision  Changes    Path
  1.7       +27 -8     xml-cocoon2/src/java/org/apache/cocoon/components/flow/javascript/JSCocoon.java
  
  Index: JSCocoon.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/flow/javascript/JSCocoon.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JSCocoon.java	30 Aug 2002 00:48:31 -0000	1.6
  +++ JSCocoon.java	6 Sep 2002 00:14:06 -0000	1.7
  @@ -70,6 +70,7 @@
   import org.apache.cocoon.components.flow.ContinuationsManagerImpl;
   import org.apache.cocoon.components.flow.ContinuationsManager;
   import org.apache.cocoon.components.flow.AbstractInterpreter;
  +import org.apache.cocoon.components.flow.WebContinuation;
   import org.apache.cocoon.acting.Action;
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.framework.component.ComponentSelector;
  @@ -204,25 +205,43 @@
         bizData = ((Wrapper)bizData).unwrap();
       else if (bizData instanceof Scriptable)
         bizData = jsobjectToMap((Scriptable)bizData);
  +    
  +    WebContinuation kont = null;
   
  -    JSWebContinuation kont = (JSWebContinuation)cont;
  +    if (cont != null)
  +      kont = ((JSWebContinuation)cont).getWebContinuation();
   
  -    interp.forwardTo(uri, bizData, kont.getWebContinuation(), environment);
  +    interp.forwardTo(uri, bizData, kont, environment);
     }
   
  +  /**
  +     Set the Scope object in the session object of the current
  +     user. This effectively means that at the next invocation from the
  +     sitemap of a JavaScript function (using the <map:call
  +     function="...">), will obtain the same scope as the current
  +     one.
  +  */
     public void jsFunction_createSession()
     {
       Map objectModel = environment.getObjectModel();
       Request request = ObjectModelHelper.getRequest(objectModel);
       Session session = request.getSession(true);
   
  -    // Set the Scope object in the session object of the current
  -    // user. This effectively means that at the next invocation from
  -    // the sitemap of a JavaScript function (using the <map:call
  -    // function="...">), will obtain the same scope as the current
  -    // one.
       session.setAttribute(JavaScriptInterpreter.USER_GLOBAL_SCOPE, scope);
  -}
  +  }
  +
  +  /**
  +     Remove the Scope object from the session object of the current
  +     user.
  +  */
  +  public void jsFunction_removeSession()
  +  {
  +    Map objectModel = environment.getObjectModel();
  +    Request request = ObjectModelHelper.getRequest(objectModel);
  +    Session session = request.getSession(true);
  +
  +    session.removeAttribute(JavaScriptInterpreter.USER_GLOBAL_SCOPE);
  +  }
   
     public void jsFunction_diplayAllContinuations()
       throws ComponentException
  
  
  

----------------------------------------------------------------------
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