You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by mx...@apache.org on 2011/03/01 23:29:50 UTC

svn commit: r1076037 - in /tcl/rivet/branches/2.0/doc/xml: commands.xml directives.xml

Author: mxmanghi
Date: Tue Mar  1 22:29:50 2011
New Revision: 1076037

URL: http://svn.apache.org/viewvc?rev=1076037&view=rev
Log:
new commands and configuration scripts explained

Modified:
    tcl/rivet/branches/2.0/doc/xml/commands.xml
    tcl/rivet/branches/2.0/doc/xml/directives.xml

Modified: tcl/rivet/branches/2.0/doc/xml/commands.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/doc/xml/commands.xml?rev=1076037&r1=1076036&r2=1076037&view=diff
==============================================================================
--- tcl/rivet/branches/2.0/doc/xml/commands.xml (original)
+++ tcl/rivet/branches/2.0/doc/xml/commands.xml Tue Mar  1 22:29:50 2011
@@ -782,28 +782,77 @@
 
     <refentry id="abort_page">
       <refnamediv>
-	<refname>abort_page</refname>
-	<refpurpose>Stops outputing data to web page, similar in
-	  purpose to PHP's <command>die</command> command.</refpurpose>
+			<refname>abort_page</refname>
+			<refpurpose>
+				Stops outputing data to web page, similar in
+			  	purpose to PHP's <command>die</command> command.
+			</refpurpose>
       </refnamediv>
 
       <refsynopsisdiv>
-	<cmdsynopsis>
-	  <command>abort_page</command>
-	</cmdsynopsis>
+			<cmdsynopsis>
+			  	<command>abort_page</command>
+			  	<group choice="req">
+					<arg><replaceable>abort code</replaceable></arg>
+					<arg><replaceable>-aborting</replaceable></arg>
+				</group>
+			</cmdsynopsis>
       </refsynopsisdiv>
 
       <refsect1>
-	<title>Description</title> <para>This command flushes the
-	output buffer and stops the Tcl script from sending any more
-	data to the client.  A normal Tcl script might use the
-	<command>exit</command> command, but that cannot be used in
-	Rivet without actually exiting the apache child
-	process!</para>
+			<title>Description</title> 
+			<para>
+				This command flushes the output buffer and stops the Tcl 
+				script from sending any more data to the client.
+				A normal Tcl script might use the
+				<command>exit</command> command, but that cannot be used in
+				Rivet without actually exiting the apache child
+				process!
+				<command>abort_page</command> triggers
+				the execution of an optional AbortScript that has to be
+				specified in the configuration. The value of the
+				argument <arg>abort code</arg> can be retrieved with the 
+				<command>abort_code</command> command during the
+				execution of AbortScript or AfterEveryScript, allowing 
+				the script to take appropriate actions in order to deal
+				with the cause of the abort. 
+			</para>
+			<para>
+				When passed the argument <option>-aborting</option> the
+				command returns 1 if <option>abort_page</option>
+				had been called earlier in the request processing, thus
+				providing a tool for code in AfterEveryScript to tell
+				if the an abort condition took place.
+			</para>
       </refsect1>
-    </refentry>
+   </refentry>
 
-    <refentry id="no_body">
+	<refentry id="abort_code">
+		<refnamediv>
+			<refname>abort_code</refname>
+			<refpurpose>
+				Returns the code passed to <command>abort_page</command>
+				earlier during the request processing
+			</refpurpose>
+		</refnamediv>
+		<refsynopsisdiv>
+			<cmdsynopsis>
+			  <command>abort_code</command>
+			</cmdsynopsis>
+      </refsynopsisdiv>
+      <refsect1>
+			<title>Description</title> 
+			<para>
+				Usage of this command is meaningful only in scripts run as
+				AbortScript or AfterEveryScript. 
+				<command>abort_code</command> returns the value of the optional 
+				parameter passed to <command>abort_page</command> earlier during
+				the same request processing.
+			</para>
+      </refsect1>
+	</refentry>
+	
+   <refentry id="no_body">
       <refnamediv>
 	<refname>no_body</refname>
 	<refpurpose>Prevents Rivet from sending any content.</refpurpose>

Modified: tcl/rivet/branches/2.0/doc/xml/directives.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.0/doc/xml/directives.xml?rev=1076037&r1=1076036&r2=1076037&view=diff
==============================================================================
--- tcl/rivet/branches/2.0/doc/xml/directives.xml (original)
+++ tcl/rivet/branches/2.0/doc/xml/directives.xml Tue Mar  1 22:29:50 2011
@@ -23,6 +23,8 @@
 	      <arg>BeforeScript</arg>
 	      <arg>AfterScript</arg>
 	      <arg>ErrorScript</arg>
+	      <arg>AbortScript</arg>
+	      <arg>AfterEveryScript</arg>
 	      <arg>UploadDirectory</arg>
 	      <arg>UploadMaxSize</arg>
 	      <arg>UploadFilesToVar</arg>
@@ -201,6 +203,47 @@
 
 	    <varlistentry>
 	      <term>
+				<cmdsynopsis>
+				  <arg choice="plain">AfterEveryScript</arg>
+				  <arg><replaceable>script</replaceable></arg>
+				</cmdsynopsis>
+	      </term>
+	      <listitem>
+				<para>
+					<option>AfterEveryScript</option> is a script that is to
+					be run anyway before requests processing ends. This script
+					is therefore run both when the content generation script
+					completes successfully and when its execution is interrupted
+					by <xref linkend="abort_page" />. The code in this script
+					can tell whether we are running after an abort condition
+					occurred by passing the argument <arg>-aborting</arg> to
+					<xref linkend="abort_page" /> which in turn returns 1 if
+					abort_page had been called earlier in the request processing.
+				</para>
+	      </listitem>
+	    </varlistentry>
+
+		<varlistentry>
+			<term>
+				<cmdsynopsis>
+					<arg choice="plain">AbortScript</arg>
+					<arg><replaceable>script</replaceable></arg>
+				</cmdsynopsis>
+			</term>
+			<listitem>
+				<para>
+					Execution of a content generating script can be
+					done by invoking <xref linkend="abort_page" />. When 
+					an <option>AbortScript</option> is defined for the page
+					being generated, control is passed to it as a way
+					to undertake specific action that might be necessary
+					to catch resources left dangling by the sudden interruption.				
+				</para>			
+			</listitem>
+		</varlistentry>
+
+	    <varlistentry>
+	      <term>
 		<cmdsynopsis>
 		  <arg choice="plain">UploadDirectory</arg>
 		  <arg><replaceable>directory</replaceable></arg>



---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-cvs-help@tcl.apache.org