You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by mx...@apache.org on 2016/07/04 15:28:45 UTC

svn commit: r1751320 - in /tcl/rivet/trunk: ChangeLog doc/xml/commands.xml rivet/packages/form/form2.tcl src/mod_rivet/mod_rivet_generator.c src/mod_rivet/rivetCore.c

Author: mxmanghi
Date: Mon Jul  4 15:28:45 2016
New Revision: 1751320

URL: http://svn.apache.org/viewvc?rev=1751320&view=rev
Log:
    * doc/xml/commands.xml: ::rivet::catch man page example corrected
    * rivet/packages/form/form2.tcl: fixed output in code for the 
    <select>...</select> form element method
    * src/mod_rivet/mod_rivet_generator.c: removed code commented away 
    * src/mod_rivet/rivetCore.c: FQ var command name 


Modified:
    tcl/rivet/trunk/ChangeLog
    tcl/rivet/trunk/doc/xml/commands.xml
    tcl/rivet/trunk/rivet/packages/form/form2.tcl
    tcl/rivet/trunk/src/mod_rivet/mod_rivet_generator.c
    tcl/rivet/trunk/src/mod_rivet/rivetCore.c

Modified: tcl/rivet/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=1751320&r1=1751319&r2=1751320&view=diff
==============================================================================
--- tcl/rivet/trunk/ChangeLog (original)
+++ tcl/rivet/trunk/ChangeLog Mon Jul  4 15:28:45 2016
@@ -1,3 +1,10 @@
+2016-07-04 Massimo Manghi <mx...@apache.org>
+    * doc/xml/commands.xml: ::rivet::catch man page example corrected
+    * rivet/packages/form/form2.tcl: fixed output in code for the 
+    <select>...</select> form element method
+    * src/mod_rivet/mod_rivet_generator.c: removed code commented away 
+    * src/mod_rivet/rivetCore.c: FQ var command name 
+
 2016-06-16 Massimo Manghi <mx...@apache.org>
     * doc/xml/commands.xml: rephrasing the ::rivet::catch manual page
 

Modified: tcl/rivet/trunk/doc/xml/commands.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/xml/commands.xml?rev=1751320&r1=1751319&r2=1751320&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/xml/commands.xml (original)
+++ tcl/rivet/trunk/doc/xml/commands.xml Mon Jul  4 15:28:45 2016
@@ -371,11 +371,11 @@
 			</para>
 			
 			<note>
-				This command is not meant to replace the core command, thus it's notexported from the 
-                <command>::rivet</command> namespace and therefore has to be fully qualified.
+				This command is not meant to replace the core command, thus it's not exported from the 
+            <command>::rivet</command> namespace and therefore has to be fully qualified.
 			</note>
 	    </refsect1>
-
+	    
 	</refentry>	
     <!-- Reference page for command 'clock_to_rfc' -->
 	<refentry id="clock_to_rfc">
@@ -1595,9 +1595,9 @@ bab</programlisting>
 			</para>
 			<programlisting>&lt;html&gt;&lt;?::rivet::try {
 	if {[::rivet::var_qs exists exit]} {
-	    ::rivet::exit 100
+	    ::rivet::exit [::rivet::var_qs get exit]
 	} elseif {[::rivet::var_qs exists abort]} {
-	    ::rivet::abort_page 
+	    ::rivet::abort_page [::rivet::var_qs get abort]
 	} elseif {[::rivet::var_qs exists fail]} {
 	    # this is just a non existent command
 	    wrong_command

Modified: tcl/rivet/trunk/rivet/packages/form/form2.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/packages/form/form2.tcl?rev=1751320&r1=1751319&r2=1751320&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/packages/form/form2.tcl (original)
+++ tcl/rivet/trunk/rivet/packages/form/form2.tcl Mon Jul  4 15:28:45 2016
@@ -15,12 +15,12 @@
 # limitations under the License.
 
 package require Itcl
-
 package provide form 2.0
 
-#
 # Rivet form class
 #
+#
+
 ::itcl::class form {
 
     constructor {args} {
@@ -61,6 +61,10 @@ package provide form 2.0
     protected method import_data {type name arrayName list} {
         upvar 1 $arrayName data
 
+        # we now guarantee an array, though empty, will exist
+
+        array set data {}
+
         #
         # If there are elements in the defaultArgs array for the
         # specified type, combine them with the list of key-value
@@ -557,19 +561,18 @@ package provide form 2.0
             set labels $values 
         }
 
-        # emit the selector
-        html "<select name=\"$name\" [argstring data]>"
-
-        # emit each label-value pair
+        # emit the selector with each label-value pair
+        # we adopt the style imposed by the ::rivet::xml command generating
+        # the innermost elements and then wrapping them up with the 'select' tag
+        set options_list {}
         foreach label $labels value $values {
             if {[info exists default_list] && $value in $default_list } {
-                set string "<option value=\"$value\" selected=\"selected\">"
+                lappend options_list [::rivet::xml $label [list option value $value selected selected]]
             } else {
-                set string "<option value=\"$value\">"
+                lappend options_list [::rivet::xml $label [list option value $value]]
             }
-            html "$string$label</option>"
         }
-        html "</select>"
+        puts [::rivet::xml [join $options_list "\n"] [list select name $name {*}[array get data]]]
     }
 
     #

Modified: tcl/rivet/trunk/src/mod_rivet/mod_rivet_generator.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet/mod_rivet_generator.c?rev=1751320&r1=1751319&r2=1751320&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet/mod_rivet_generator.c (original)
+++ tcl/rivet/trunk/src/mod_rivet/mod_rivet_generator.c Mon Jul  4 15:28:45 2016
@@ -82,7 +82,7 @@ Rivet_ReleaseScripts (running_scripts* s
 
 /* -- Rivet_ExecuteErrorHandler
  *
- * Invoking either the default error handler or the ErrorScript.
+ * Invoking either the default error handler or ErrorScript.
  * In case the error handler fails a standard error message is printed
  * (you're better off if you make your error handlers fail save)
  *
@@ -248,24 +248,9 @@ Rivet_ExecuteAndCheck(rivet_thread_priva
          * as normal
          */
 
-        // if (strcmp (Tcl_GetString (errorCodeElementObj), "RIVET") == 0) 
         if (private->page_aborting)
         {
-            //char*       errorCodeSubString;
-
-            /* dig the second element out of the errorCode list, make sure
-             * it succeeds -- it should always
-             */
-            //ap_assert (Tcl_ListObjIndex (interp_obj->interp, errorCodeListObj, 1, &errorCodeElementObj) == TCL_OK);
-
-            //errorCodeSubString = Tcl_GetString (errorCodeElementObj);
-            //if ((strcmp(errorCodeSubString, ABORTPAGE_CODE) == 0) || 
-            //    (strcmp(errorCodeSubString, THREAD_EXIT_CODE) == 0))
-            //
-            //{
-                Rivet_RunAbortScript(private);
-            //}
- 
+            Rivet_RunAbortScript(private);
         }
         else 
         {

Modified: tcl/rivet/trunk/src/mod_rivet/rivetCore.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet/rivetCore.c?rev=1751320&r1=1751319&r2=1751320&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet/rivetCore.c (original)
+++ tcl/rivet/trunk/src/mod_rivet/rivetCore.c Mon Jul  4 15:28:45 2016
@@ -582,7 +582,7 @@ TCL_CMD_HEADER ( Rivet_Var )
     int                     source;
 
     THREAD_PRIVATE_DATA(private)
-    CHECK_REQUEST_REC(private,"::rivet::var,var_post,var_qs")
+    CHECK_REQUEST_REC(private,"::rivet::var,::rivet::var_post,::rivet::var_qs")
     if (objc < 2 || objc > 4)
     {
         Tcl_WrongNumArgs(interp, 1, objv,



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