You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tcl.apache.org by mx...@apache.org on 2019/10/13 23:31:10 UTC

[tcl-rivet] 01/02: documentation improvements

This is an automated email from the ASF dual-hosted git repository.

mxmanghi pushed a commit to branch quattuor
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git

commit 4f6a0a845af70706206bfef6b9b88179f4b8e4e3
Author: Massimo Manghi <mx...@apache.org>
AuthorDate: Sun Oct 13 23:56:28 2019 +0200

    documentation improvements
---
 ChangeLog                                   |  4 +++
 doc/examples-sgml/myapp_request_handler.tcl |  8 +++---
 doc/examples/myapp_request_handler.tcl      | 33 ++++++++++++-------------
 doc/xml/directives.xml                      | 38 ++++++++++++++++++-----------
 doc/xml/processing.xml                      |  2 +-
 doc/xml/request.xml                         |  2 +-
 6 files changed, 50 insertions(+), 37 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cfc6f8a..c3a69d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2019-10-13 Massimo Manghi <mx...@apache.org>
+    * doc/xml/directives.xml: configuration directives table expanded
+    * doc/examples/
+
 2019-09-30 Massimo Manghi <mx...@apache.org>
     * src/mod_rivet_ng/rivetCore.c: revised argument checking
 
diff --git a/doc/examples-sgml/myapp_request_handler.tcl b/doc/examples-sgml/myapp_request_handler.tcl
index 2ba192b..9af42e0 100644
--- a/doc/examples-sgml/myapp_request_handler.tcl
+++ b/doc/examples-sgml/myapp_request_handler.tcl
@@ -1,13 +1,13 @@
 # -- myapp_request_handler.tcl
 #
-# This script will be read by mod_rivet at the thread initialization
-# stage and its content stored in a Tcl_Obj object. This object will
-# be evaluated calling Tcl_EvalObjExe
+# This script will be read by mod_rivet during the process/thread 
+# initialization stage and its content stored in a Tcl_Obj object. 
+# This object is evaluated internally by mod_rivet
 #
 
 ::try {
 
-    $::theApplication request_processing [::rivet::var_qs all]
+    ::theApplication request_processing [::rivet::var_qs all]
 
 } trap {RIVET ABORTPAGE} {err opts} {
 
diff --git a/doc/examples/myapp_request_handler.tcl b/doc/examples/myapp_request_handler.tcl
index 7bc724e..83e65b6 100644
--- a/doc/examples/myapp_request_handler.tcl
+++ b/doc/examples/myapp_request_handler.tcl
@@ -1,8 +1,8 @@
 # -- myapp_request_handler.tcl
 #
-# This script will be read by mod_rivet at the thread initialization
-# stage and its content stored in a Tcl_Obj object. This object will
-# be evaluated calling Tcl_EvalObjExe
+# This script will be read by mod_rivet during the process/thread
+# initialization stage and its content stored in a Tcl_Obj object.
+# This object is evaluated internally by mod_rivet at every request
 #
 
 ::try {
@@ -11,22 +11,21 @@
 
 } trap {RIVET ABORTPAGE} {err opts} {
 
-     set abort_code [::rivet::abort_code]
+    set abort_code [::rivet::abort_code]
 
     switch $abort_code {
-       code1 {
-           # handling abort_page with code1
-           ....
-       }
-       code2 {
-           # handling abort_page with code2
-          ....      
-       }
-       # ...
-       default {
-           # default abort handler
-       }
-   }
+        code1 {
+            # handling abort_page with code1
+            ....
+        }
+        code2 {
+            # handling abort_page with code2
+            ....      
+        }
+        default {
+            # default abort handler
+        }
+    }
 
 } trap {RIVET THREAD_EXIT} {err opts} {
     
diff --git a/doc/xml/directives.xml b/doc/xml/directives.xml
index 500fa25..38113fc 100644
--- a/doc/xml/directives.xml
+++ b/doc/xml/directives.xml
@@ -46,9 +46,8 @@
 &lt;Directory /var/www/myrivetapp&gt;
     RivetDirConf BeforeScript &quot;source /var/www/myrivetapp/before_script.tcl&quot;
 &lt;/Directory&gt;</programlisting>
-	   
-	</section>	
-	
+	</section>
+
 	<section>
 		<title>Configuration Directives</title>
 		<table align="center" title="Configuration Directives application scopes" class="directives">
@@ -56,24 +55,35 @@
 				<td>Configuration Directives</td><td>DirConf</td><td>UserConf</td><td>ServerConf</td><td>Virtual Host</td><td>Notes</td>
 			</thead>
 			<tbody>
-				<tr><td>AbortScript</td><td>X</td><td>X</td><td>X</td><td>X</td><td></td></tr> 
-				<tr><td>AfterScript</td><td>X</td><td>X</td><td>X</td><td>X</td><td></td></tr> 
-				<tr><td>AfterEveryScript</td><td>X</td><td>X</td><td>X</td><td>X</td><td></td></tr> 
-				<tr><td>BeforeScript</td><td>X</td><td>X</td><td>X</td><td>X</td><td></td></tr> 
+				<tr><td>AbortScript</td><td>X</td><td>X</td><td>X</td><td>X</td>
+					<td>This directive is meaningful with the default request handler. In order
+					to have this triggered by calling ::rivet::abort_page or ::rivet::exit
+					any special request handler should explicitly read this script from the configuration
+					using ::rivet::inspect and evaluate it (see <xref linkend="request">request processing</xref>)</td>
+				</tr>
+				<tr><td>AfterScript</td><td>X</td><td>X</td><td>X</td><td>X</td><td>Special request handler developers
+				should read this script from the configuration calling ::rivet::inspect and evaluate it</td></tr>
+				<tr><td>AfterEveryScript</td><td>X</td><td>X</td><td>X</td><td>X</td><td>See notes for the AfterScript directive</td></tr>
+				<tr><td>BeforeScript</td><td>X</td><td>X</td><td>X</td><td>X</td>
+					 <td>See notes for the AfterScript directive</td></tr>
 				<tr><td>CacheSize</td><td></td><td></td><td>X</td><td></td><td></td></tr>
-				<tr><td>ChildExitScript</td><td></td><td></td><td>X</td><td></td><td></td></tr> 
-				<tr><td>ChildInitScript</td><td></td><td></td><td>X</td><td></td><td></td></tr> 
-				<tr><td>ErrorScript</td><td>X</td><td>X</td><td>X</td><td>X</td><td></td></tr> 				
+				<tr><td>ChildExitScript</td><td></td><td></td><td>X</td><td>X</td><td></td></tr>
+				<tr><td>ChildInitScript</td><td></td><td></td><td>X</td><td>X</td><td></td></tr>
+				<tr><td>ErrorScript</td><td>X</td><td>X</td><td>X</td><td>X</td>
+					<td>Rivet provides a default error handler. In case you are developing your own request
+					handling procedure you need to call that handler yourself or develop a new.
+					See notes for the AbortScript and AfterScript directives</td></tr>
 				<tr><td>ExportRivetNS</td><td></td><td></td><td>X</td><td></td><td></td></tr>
-				<tr><td>GlobalInitScript</td><td></td><td></td><td>X</td><td></td><td>effective only when SeparateVirtualInterps is Off (default)</td></tr> 
-				<tr><td>ImportRivetNS</td><td></td><td></td><td>X</td><td></td><td></td></tr>
-				<tr><td>HonorHeaderOnlyRequests</td><td></td><td></td><td>X</td><td></td><td></td></tr> 
+				<tr><td>GlobalInitScript</td><td></td><td></td><td>X</td><td></td>
+				    <td>effective only when SeparateVirtualInterps is Off (default)</td></tr>
+				<tr><td>ImportRivetNS</td><td></td><td></td><td>X</td><td></td><td>global setting</td></tr>
+				<tr><td>HonorHeaderOnlyRequests</td><td></td><td></td><td>X</td><td></td><td>global setting</td></tr>
 				<tr><td>MpmBridge</td><td></td><td></td><td>X</td><td></td><td>global setting</td></tr>
 				<tr><td>RequestHandler</td><td></td><td></td><td>X</td><td>X</td><td></td></tr>
 				<tr><td>SeparateChannels</td><td></td><td></td><td>X</td><td></td><td>global setting</td></tr> 
 				<tr><td>SeparateVirtualInterps</td><td></td><td></td><td>X</td><td></td><td>global setting</td></tr> 
 				<tr><td>ServerInitScript</td><td></td><td></td><td>X</td><td></td><td></td></tr>
-				<tr><td>SingleThreadExit</td><td></td><td></td><td>X</td><td></td><td>global setting only</td></tr>
+				<tr><td>SingleThreadExit</td><td></td><td></td><td>X</td><td></td><td>global setting</td></tr>
 				<tr><td>UploadDirectory</td><td></td><td>X</td><td>X</td><td>X</td><td></td></tr> 
 				<tr><td>UploadFilesToVar</td><td></td><td></td><td>X</td><td></td><td></td></tr> 
 				<tr><td>UploadMaxSize</td><td></td><td></td><td>X</td><td>X</td><td></td></tr>
diff --git a/doc/xml/processing.xml b/doc/xml/processing.xml
index 763e922..f4a9297 100644
--- a/doc/xml/processing.xml
+++ b/doc/xml/processing.xml
@@ -3,7 +3,7 @@
 	<section>
 		<title>Tcl Scripts Processing</title>
 		<para>
-			The mod_rivet &version2-series; modules handle an HTTP request
+			The mod_rivet &version2-generic; modules handle an HTTP request
 			by running a Tcl script or a Rivet (.rvt file) template 
 			whose path appears encoded in the URI (an alias translation or 
 			URL rewriting might occur to establish the real path). 
diff --git a/doc/xml/request.xml b/doc/xml/request.xml
index d41b811..22dd93e 100644
--- a/doc/xml/request.xml
+++ b/doc/xml/request.xml
@@ -11,7 +11,7 @@
             agents when the workload is requiring it. 
        </para>
        <para>
-            Apache Rivet &version2-series; supported only the
+            Apache Rivet &version2-generic; supported only the
             <ulink url="&apachedoc-prefork;">prefork</ulink>
             MPM which creates child processes as independent agents responding to network requests. 
             Starting with &version30; also the <ulink url="&apachedoc-worker;">worker</ulink> and


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