You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by sy...@apache.org on 2005/09/01 18:26:17 UTC

svn commit: r265752 - in /cocoon/branches/BRANCH_2_1_X: src/documentation/xdocs/userdocs/flow/api.xml src/java/org/apache/cocoon/components/flow/javascript/fom/fom_system.js status.xml

Author: sylvain
Date: Thu Sep  1 09:26:08 2005
New Revision: 265752

URL: http://svn.apache.org/viewcvs?rev=265752&view=rev
Log:
Add cocoon.exit() to exit the current flowscript invocation, as discussed in http://mail-archives.apache.org/mod_mbox/cocoon-dev/200503.mbox/%3c4231A8CF.6040001@apache.org%3e

Modified:
    cocoon/branches/BRANCH_2_1_X/src/documentation/xdocs/userdocs/flow/api.xml
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/fom_system.js
    cocoon/branches/BRANCH_2_1_X/status.xml

Modified: cocoon/branches/BRANCH_2_1_X/src/documentation/xdocs/userdocs/flow/api.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/documentation/xdocs/userdocs/flow/api.xml?rev=265752&r1=265751&r2=265752&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/documentation/xdocs/userdocs/flow/api.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/src/documentation/xdocs/userdocs/flow/api.xml Thu Sep  1 09:26:08 2005
@@ -230,6 +230,22 @@
      Dispose an object that has been created using <code>createObject</code>.
     </p>
     </s3>
+    <s3 title="exit">
+    <p><em>Function</em> <code>exit()</code></p>
+    <p>
+     Exit the current flowscript invocation.
+    </p>
+    <p>
+     There are some flowscript use cases where we want to stop the current 
+     flowscript without creating a continuation, as we don't want the user 
+     to go back to the script and return from the current function.
+    </p>
+    <p>
+     An example is a "login" function where the caller function expects this 
+     function to exit only if login is successful, but that has to handle 
+     e.g. a registration process that includes a "cancel" button.
+    </p>
+    </s3>
     </s2>
     <s2 title="Request Object"><anchor id="request"/>
 

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/fom_system.js
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/fom_system.js?rev=265752&r1=265751&r2=265752&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/fom_system.js (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/fom_system.js Thu Sep  1 09:26:08 2005
@@ -38,3 +38,17 @@
    return wk;
 }
 
+/**
+ * Exit the current flowscript invocation.
+ * <p>
+ * There are some flowscript use cases where we want to stop the current 
+ * flowscript without creating a continuation, as we don't want to the user 
+ * to go back to the script.
+ * <p>
+ * An example is a "login" function where the caller function expects this 
+ * function to exit only if login is successful, but that has to handle 
+ * e.g. a registration process that includes a "cancel" button.
+ */
+FOM_Cocoon.prototype.exit = function() {
+    FOM_Cocoon.suicide();
+}

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/status.xml?rev=265752&r1=265751&r2=265752&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Thu Sep  1 09:26:08 2005
@@ -196,6 +196,10 @@
 
   <changes>
   <release version="@version@" date="@date@">
+	 <action dev="SW" type="add">
+		Add a "cocoon.exit()" method to flowscript, which allows to exit the current flowscript invocation without
+		creating a continuation.
+	 </action>
     <action dev="SW" type="fix" fixes-bug="35575" due-to="Jean-Baptiste Quenot" due-to-email="jbq@anyware-tech.com">
   	   XMLdb block: Don't rely on the sitemap components to stream the contents of a xmldb source.
     </action>