You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cr...@apache.org on 2002/12/04 12:25:41 UTC

cvs commit: xml-cocoon2/src/webapp/samples/flow/examples/prefs prefs.js

crafterm    2002/12/04 03:25:40

  Modified:    src/java/org/apache/cocoon/components/flow/javascript
                        system.js
               src/webapp/samples/flow/examples/calc calc.js
               src/webapp/samples/flow/examples/prefs prefs.js
  Log:
  * Applied BZ#14903 which changes sendPage* method names as follows:
  
    sendPage() becomes sendPageAndWait()
    sendPageAndContinue() becomes sendPage()
  
    as discussed:
  
    http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=103796994100696&w=2
  
  PR: BZ#14903
  Submitted By: Michael Melhem <mi...@managesoft.com>
  
  Revision  Changes    Path
  1.5       +8 -3      xml-cocoon2/src/java/org/apache/cocoon/components/flow/javascript/system.js
  
  Index: system.js
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/flow/javascript/system.js,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- system.js	7 Sep 2002 01:42:05 -0000	1.4
  +++ system.js	4 Dec 2002 11:25:40 -0000	1.5
  @@ -16,14 +16,14 @@
     return func.apply(this, args);
   }
   
  -function sendPage(uri, bizData, timeToLive)
  +function sendPageAndWait(uri, bizData, timeToLive)
   {
  -  var kont = _sendPage(uri, bizData, timeToLive);
  +  var kont = _sendPageAndWait(uri, bizData, timeToLive);
     lastContinuation = kont;
     return kont;
   }
   
  -function _sendPage(uri, bizData, timeToLive)
  +function _sendPageAndWait(uri, bizData, timeToLive)
   {
     var k = new Continuation();
     var kont = new WebContinuation(cocoon, k, lastContinuation, timeToLive);
  @@ -33,6 +33,11 @@
   }
   
   function sendPageAndContinue(uri, bizData)
  +{
  +    log.error("Deprecated: Please use sendPage instead");
  +}
  +
  +function sendPage(uri, bizData)
   {
     cocoon.forwardTo("cocoon://" + cocoon.environment.getURIPrefix() + uri,
                      bizData, null);
  
  
  
  1.3       +3 -3      xml-cocoon2/src/webapp/samples/flow/examples/calc/calc.js
  
  Index: calc.js
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/flow/examples/calc/calc.js,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- calc.js	5 Sep 2002 23:55:58 -0000	1.2
  +++ calc.js	4 Dec 2002 11:25:40 -0000	1.3
  @@ -21,18 +21,18 @@
   function getNumber(name, a, b)
   {
     var uri = "getNumber" + name.toUpperCase() + ".html";
  -  sendPage(uri, { "a" : a, "b" : b });
  +  sendPageAndWait(uri, { "a" : a, "b" : b });
     return parseFloat(cocoon.request.getParameter(name));
   }
   
   function getOperator(a, b)
   {
  -  sendPage("getOperator.html", { "a" : a, "b" : b });
  +  sendPageAndWait("getOperator.html", { "a" : a, "b" : b });
     return cocoon.request.getParameter("operator");
   }
   
   function sendResult(a, b, op, result)
   {
  -  sendPage("displayResult.html",
  +  sendPageAndWait("displayResult.html",
              { "a" : a, "b" : b, "operator" : op, "result" : result });
   }
  
  
  
  1.3       +22 -22    xml-cocoon2/src/webapp/samples/flow/examples/prefs/prefs.js
  
  Index: prefs.js
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/flow/examples/prefs/prefs.js,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- prefs.js	6 Sep 2002 03:59:10 -0000	1.2
  +++ prefs.js	4 Dec 2002 11:25:40 -0000	1.3
  @@ -46,13 +46,13 @@
       // and print an indicator close to where the errors
       // are. `errorMsg' if not null is printed at the top of the page
       // as an error message.
  -    sendPage("userInfo.html",
  -             { "check" : check, "errorMsg" : errorMsg,
  -                 "title": "New User Registration",
  -                 "button" : "Register",
  -                 "login" : login, "password" : password,
  -                 "firstName" : firstName, "lastName" : lastName,
  -                 "email" : email});
  +    sendPageAndWait("userInfo.html",
  +                    { "check" : check, "errorMsg" : errorMsg,
  +                    "title": "New User Registration",
  +                    "button" : "Register",
  +                    "login" : login, "password" : password,
  +                    "firstName" : firstName, "lastName" : lastName,
  +                    "email" : email});
   
       check = false;
       errorMsg = null;
  @@ -108,8 +108,8 @@
     //
     // In the case of this particular function, this is the only exit
     // point.
  -  sendPageAndContinue("registrationSuccessful.html",
  -                      {"firstName" : firstName, "lastName" : lastName});
  +  sendPage("registrationSuccessful.html",
  +           {"firstName" : firstName, "lastName" : lastName});
   }
   
   
  @@ -120,8 +120,8 @@
     var password = "";
   
     while (true) {
  -    sendPage("login.html",
  -             {"errorMsg" : errorMsg, "login" : login, "password" : password});
  +    sendPageAndWait("login.html",
  +                    {"errorMsg" : errorMsg, "login" : login, "password" : password});
   
       errorMsg = null;
     
  @@ -148,8 +148,8 @@
     // We send to the user a welcome page which contains links back to
     // what (s)he can do. These links essentially point to other top
     // level functions in this script.
  -  sendPageAndContinue("welcome.html",
  -                      {"firstName" : user.firstName, "lastName" : user.lastName});
  +  sendPage("welcome.html",
  +           {"firstName" : user.firstName, "lastName" : user.lastName});
   }
   
   // This function is called to edit the preferences of an already
  @@ -175,13 +175,13 @@
       // and print an indicator close to where the errors
       // are. `errorMsg' if not null is printed at the top of the page
       // as an error message.
  -    sendPage("userInfo.html",
  -             { "check" : check, "errorMsg" : errorMsg,
  -                 "title": "Edit account",
  -                 "button" : "Change", "cancel" : true,
  -                 "login" : login, "password" : password,
  -                 "firstName" : firstName, "lastName" : lastName,
  -                 "email" : email});
  +    sendPageAndWait("userInfo.html",
  +                    { "check" : check, "errorMsg" : errorMsg,
  +                    "title": "Edit account",
  +                    "button" : "Change", "cancel" : true,
  +                    "login" : login, "password" : password,
  +                    "firstName" : firstName, "lastName" : lastName,
  +                    "email" : email});
   
       if (cocoon.request.get("cancel"))
         break;
  @@ -213,8 +213,8 @@
       }
     }
   
  -  sendPageAndContinue("welcome.html",
  -                      {"firstName" : user.firstName, "lastName" : user.lastName});
  +  sendPage("welcome.html",
  +           {"firstName" : user.firstName, "lastName" : user.lastName});
   }
   
   function logout()
  
  
  

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