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/11/17 21:33:12 UTC

svn commit: r1770278 - in /tcl/rivet/branches/2.3: ChangeLog contrib/validate_mac.tcl doc/xml/commands.xml

Author: mxmanghi
Date: Thu Nov 17 21:33:12 2016
New Revision: 1770278

URL: http://svn.apache.org/viewvc?rev=1770278&view=rev
Log:
    * rivet/packages/dio/dio_Postgresql.tcl: applied
    consistent single quote character handling by
    calling PgTcl function pg_quote (closes bug #60378)
    * rivet/packages/formbroker/formbroker.tcl: fixed
    bug in method response. Package version number
    bumped up to 1.0
    * doc/xml/formbroker.xml: first draft of the
    manual page of package formbroker
    * contrib/validate_mac.tcl: add example of
    a validator
    * doc/xml/commands.xml: fixed typo in ::rivet::xml
    manual page



Added:
    tcl/rivet/branches/2.3/contrib/validate_mac.tcl
Modified:
    tcl/rivet/branches/2.3/ChangeLog
    tcl/rivet/branches/2.3/doc/xml/commands.xml

Modified: tcl/rivet/branches/2.3/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.3/ChangeLog?rev=1770278&r1=1770277&r2=1770278&view=diff
==============================================================================
--- tcl/rivet/branches/2.3/ChangeLog (original)
+++ tcl/rivet/branches/2.3/ChangeLog Thu Nov 17 21:33:12 2016
@@ -7,6 +7,10 @@
     bumped up to 1.0
     * doc/xml/formbroker.xml: first draft of the
     manual page of package formbroker
+    * contrib/validate_mac.tcl: add example of
+    a validator
+    * doc/xml/commands.xml: fixed typo in ::rivet::xml
+    manual page
 
 2016-11-15 Massimo Manghi <mx...@apache.org>
     * rivet/rivet-tcl/catch.tcl|try.tcl: better

Added: tcl/rivet/branches/2.3/contrib/validate_mac.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.3/contrib/validate_mac.tcl?rev=1770278&view=auto
==============================================================================
--- tcl/rivet/branches/2.3/contrib/validate_mac.tcl (added)
+++ tcl/rivet/branches/2.3/contrib/validate_mac.tcl Thu Nov 17 21:33:12 2016
@@ -0,0 +1,38 @@
+# -- validate_mac 
+#
+# mac address validator to be used with the form broker 
+
+    proc validate_mac {_mac_address_d} {
+        upvar $_mac_address_d mac_address_d
+
+        dict with mac_address_d {
+
+            set var [string trim $var]
+            if {[regexp {^[[:xdigit:]]{2}([:-][[:xdigit:]]{2}){5}$} $var]} {
+
+                set var [string tolower $var]
+
+                # we normalize the mac address to the Unix form.
+                # The dash '-' characters in the windows representation 
+                # are replaced by columns ':'
+
+                set var [regsub -all -- {-} $var :]
+
+                # the 'constrain' field is bidirectional:
+                # it tells the validator to curb/change the value
+                # within the bonds/forms/representation suitable. 
+                # By setting it the validator tells the FormBroker
+                # to copy the value back in the response array
+
+                set constrain 1
+                return FB_OK
+
+            } else {
+
+                return FB_WRONG_MAC
+
+            }
+
+        }
+    }
+ 

Modified: tcl/rivet/branches/2.3/doc/xml/commands.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.3/doc/xml/commands.xml?rev=1770278&r1=1770277&r2=1770278&view=diff
==============================================================================
--- tcl/rivet/branches/2.3/doc/xml/commands.xml (original)
+++ tcl/rivet/branches/2.3/doc/xml/commands.xml Thu Nov 17 21:33:12 2016
@@ -2092,7 +2092,7 @@ form_request end</programlisting>
         <refsect1>
             <title>Description</title>
             <para>
-                Given a string and a variable number of tag descriptors return XML framgment made
+                Given a string and a variable number of tag descriptors return XML fragment made
                 by nesting the tags with the same hierarchical order they are listed on the command
                 line. The tag descriptors can be a one element list (the tag) or an odd-length list whose
                 first argument is the tag name and the remaining elements are interpreted as 



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