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 2010/06/29 18:17:22 UTC
svn commit: r959020 [5/5] - in /tcl/rivet/trunk: ./ doc/html/ doc/xml/
Modified: tcl/rivet/trunk/doc/html/session_package.html
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/html/session_package.html?rev=959020&r1=959019&r2=959020&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/html/session_package.html (original)
+++ tcl/rivet/trunk/doc/html/session_package.html Tue Jun 29 16:17:21 2010
@@ -1,4 +1,4 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Session Package</title><link rel="stylesheet" href="rivet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Apache Rivet"><link rel="up" href="index.html" title="Apache Rivet"><link rel="prev" href="diodisplay_package.html" title="DIODisplay"><link rel="next" href="form.html" title="Form: An HTML Form Fields Generation Utility"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Session Package</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="diodisplay_package.html"><img src="images/prev.png" alt="Prev"></a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="form.html"><img src="images/next.png" alt="Next
"></a></td></tr></table></div><div class="section" title="Session Package"><div class="titlepage"><div><div><hr><h2 class="title" style="clear: both"><a name="session_package"></a>Session Package</h2></div></div></div><div class="section" title="Introduction"><div class="titlepage"><div><div><h3 class="title"><a name="id369423"></a>Introduction</h3></div></div></div><p style="width:90%">
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Session Package</title><link rel="stylesheet" href="rivet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Apache Rivet"><link rel="up" href="index.html" title="Apache Rivet"><link rel="prev" href="diodisplay_package.html" title="DIODisplay"><link rel="next" href="form.html" title="Form: An HTML Form Fields Generation Utility"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Session Package</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="diodisplay_package.html"><img src="images/prev.png" alt="Prev"></a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="form.html"><img src="images/next.png" alt="Next
"></a></td></tr></table></div><div class="section" title="Session Package"><div class="titlepage"><div><div><hr><h2 class="title" style="clear: both"><a name="session_package"></a>Session Package</h2></div></div></div><div class="section" title="Introduction"><div class="titlepage"><div><div><h3 class="title"><a name="id350513"></a>Introduction</h3></div></div></div><p style="width:90%">
This is session management code. It provides an interface
to allow you to generate and track a browser's visit as a
"session", giving you a unique session ID and an interface
@@ -25,7 +25,7 @@
All DB interfacing is done through DIO, though, so it
should be relatively easy to add support for other
databases.
- </p></div><div class="section" title="Preparing To Use It"><div class="titlepage"><div><div><h3 class="title"><a name="id369758"></a>Preparing To Use It</h3></div></div></div><p style="width:90%">Create the tables in your SQL server. With Postgres,
+ </p></div><div class="section" title="Preparing To Use It"><div class="titlepage"><div><div><h3 class="title"><a name="id350849"></a>Preparing To Use It</h3></div></div></div><p style="width:90%">Create the tables in your SQL server. With Postgres,
do a <span style="font-family:monospace"><span class="command"><strong>psql www</strong></span></span> or whatever DB you
connect as, then a backslash-i on
<code class="filename">session-create.sql</code></p><p style="width:90%">(If you need to delete the tables, use <code class="filename">session-drop.sql</code>)</p><p style="width:90%">The session code by default requires a DIO handle
@@ -33,7 +33,7 @@
overridden). We get it by doing a</p><pre style="background:#ccc; margin: 2ex; margin-right: 10%; padding: 1ex; border: dashed black 1px ; white-space: pre; font-family: monospace; font-size: 90%;" class="programlisting">
RivetServerConf ChildInitScript "package require DIO"
RivetServerConf ChildInitScript "::DIO::handle Postgresql DIO -user www"
- </pre></div><div class="section" title="Example Usage"><div class="titlepage"><div><div><h3 class="title"><a name="id369804"></a>Example Usage</h3></div></div></div><p style="width:90%">In your httpd.conf, add:</p><pre style="background:#ccc; margin: 2ex; margin-right: 10%; padding: 1ex; border: dashed black 1px ; white-space: pre; font-family: monospace; font-size: 90%;" class="programlisting">RivetServerConf ChildInitScript "package require Session; Session SESSION"</pre><p style="width:90%">
+ </pre></div><div class="section" title="Example Usage"><div class="titlepage"><div><div><h3 class="title"><a name="id350894"></a>Example Usage</h3></div></div></div><p style="width:90%">In your httpd.conf, add:</p><pre style="background:#ccc; margin: 2ex; margin-right: 10%; padding: 1ex; border: dashed black 1px ; white-space: pre; font-family: monospace; font-size: 90%;" class="programlisting">RivetServerConf ChildInitScript "package require Session; Session SESSION"</pre><p style="width:90%">
This tells Rivet you want to create a session object named
SESSION in every child process Apache creates.</p><p style="width:90%">
You can configure the session at this point using numerous
@@ -54,7 +54,7 @@
additional requests are received during the session, all
under the control of the key-value pairs controlling the
session object.
- </p></div><div class="section" title="Using Sessions From Your Code"><div class="titlepage"><div><div><h3 class="title"><a name="id369860"></a>Using Sessions From Your Code</h3></div></div></div><p style="width:90%">The main methods your code will use are:</p><div class="variablelist"><dl><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">SESSION</span> <span style="font-weight:bold ; font-family:monospace">id</span> </div></div><div style="margin-bottom:1.5ex ; padding .5ex">
+ </p></div><div class="section" title="Using Sessions From Your Code"><div class="titlepage"><div><div><h3 class="title"><a name="id350950"></a>Using Sessions From Your Code</h3></div></div></div><p style="width:90%">The main methods your code will use are:</p><div class="variablelist"><dl><dt></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">SESSION</span> <span style="font-weight:bold ; font-family:monospace">id</span> </div></div><div style="margin-bottom:1.5ex ; padding .5ex">
After doing a <span style="font-family:monospace"><span class="command"><strong>SESSION activate</strong></span></span>,
this will return a 32-byte ASCII-encoded random
hexadecimal string. Every time this browser comes
@@ -81,7 +81,7 @@
none was set. (Status is set to the DIO error that
occurred, it can be fetched using the status
method.)
- </div></div></dd></dl></div></div><div class="section" title="Session Configuration Options"><div class="titlepage"><div><div><h3 class="title"><a name="id370057"></a>Session Configuration Options</h3></div></div></div><p style="width:90%">The following key-value pairs can be specified when a
+ </div></div></dd></dl></div></div><div class="section" title="Session Configuration Options"><div class="titlepage"><div><div><h3 class="title"><a name="id351148"></a>Session Configuration Options</h3></div></div></div><p style="width:90%">The following key-value pairs can be specified when a
session object (like SESSION above) is created:</p><div class="variablelist"><dl><dt><span class="term">sessionLifetime</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">how many seconds the session will live for.
7200 == 2 hours
</div></div></dd><dt><span class="term">sessionRefreshInterval</span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ; width:75%"><div style="margin-bottom:1.5ex ; padding .5ex">
@@ -134,7 +134,7 @@
file handle that debugging messages will be written
to (default
<code class="varname">stdout</code>)
- </div></div></dd></dl></div></div><div class="section" title="Session Methods"><div class="titlepage"><div><div><h3 class="title"><a name="id370285"></a>Session Methods</h3></div></div></div><p style="width:90%">
+ </div></div></dd></dl></div></div><div class="section" title="Session Methods"><div class="titlepage"><div><div><h3 class="title"><a name="id351375"></a>Session Methods</h3></div></div></div><p style="width:90%">
The following methods can be invoked to find out
information about the current session, store and fetch
server data identified with this session, etc:
@@ -173,7 +173,7 @@
If they don't have one or it isn't valid (timed out,
etc), create a session and drop a cookie on
them.
- </div></div></dd></dl></div></div><div class="section" title="Getting Additional Randomness From The Entropy File"><div class="titlepage"><div><div><h3 class="title"><a name="id370511"></a>Getting Additional Randomness From The Entropy File</h3></div></div></div><pre style="background:#ccc; margin: 2ex; margin-right: 10%; padding: 1ex; border: dashed black 1px ; white-space: pre; font-family: monospace; font-size: 90%;" class="programlisting">RivetServerConf ChildInitScript "Session SESSION -entropyFile /dev/urandom \
+ </div></div></dd></dl></div></div><div class="section" title="Getting Additional Randomness From The Entropy File"><div class="titlepage"><div><div><h3 class="title"><a name="id351601"></a>Getting Additional Randomness From The Entropy File</h3></div></div></div><pre style="background:#ccc; margin: 2ex; margin-right: 10%; padding: 1ex; border: dashed black 1px ; white-space: pre; font-family: monospace; font-size: 90%;" class="programlisting">RivetServerConf ChildInitScript "Session SESSION -entropyFile /dev/urandom \
-entropyLength 10 -debugMode 1"</pre><p style="width:90%">
This options say we want to get randomness from an entropy
file (random data pseudo-device) of /dev/urandom, to get ten
Modified: tcl/rivet/trunk/doc/html/unescape_string.html
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/html/unescape_string.html?rev=959020&r1=959019&r2=959020&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/html/unescape_string.html (original)
+++ tcl/rivet/trunk/doc/html/unescape_string.html Tue Jun 29 16:17:21 2010
@@ -1,4 +1,4 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>unescape_string</title><link rel="stylesheet" href="rivet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Apache Rivet"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="escape_shell_command.html" title="escape_shell_command"><link rel="next" href="apache_log_error.html" title="apache_log_error"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">unescape_string</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="escape_shell_command.html"><img src="images/prev.png" alt="Prev"></a> </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right"> <a accesskey="n" hr
ef="apache_log_error.html"><img src="images/next.png" alt="Next"></a></td></tr></table></div><div class="refentry" title="unescape_string"><div class="refentry.separator"><hr></div><a name="unescape_string"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>unescape_string — unescape escaped characters in a string.</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">unescape_string</span> ?<span style="font-family:monospace; font-weight: bold;">string</span>?</div></div></div><div class="refsect1" title="Description"><a name="id353622"></a><h2>Description</h2><p style="width:90%">
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>unescape_string</title><link rel="stylesheet" href="rivet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Apache Rivet"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="escape_shell_command.html" title="escape_shell_command"><link rel="next" href="apache_log_error.html" title="apache_log_error"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">unescape_string</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="escape_shell_command.html"><img src="images/prev.png" alt="Prev"></a> </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right"> <a accesskey="n" hr
ef="apache_log_error.html"><img src="images/next.png" alt="Next"></a></td></tr></table></div><div class="refentry" title="unescape_string"><div class="refentry.separator"><hr></div><a name="unescape_string"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>unescape_string — unescape escaped characters in a string.</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">unescape_string</span> ?<span style="font-family:monospace; font-weight: bold;">string</span>?</div></div></div><div class="refsect1" title="Description"><a name="id334713"></a><h2>Description</h2><p style="width:90%">
Scans through each character in the specified string looking
for escaped character sequences (characters containing a
percent sign and two hexadecimal characters, unescaping them
Modified: tcl/rivet/trunk/doc/html/upgrading.html
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/html/upgrading.html?rev=959020&r1=959019&r2=959020&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/html/upgrading.html (original)
+++ tcl/rivet/trunk/doc/html/upgrading.html Tue Jun 29 16:17:21 2010
@@ -5,8 +5,8 @@
compatibility was not a primary goal when creating Rivet, but we
do provide this information which may be of use to those wishing
to upgrade from mod_dtcl or NWS installations.
- </p><div class="section" title="mod_dtcl"><div class="titlepage"><div><div><h3 class="title"><a name="id375493"></a>mod_dtcl</h3></div></div></div><p style="width:90%">
+ </p><div class="section" title="mod_dtcl"><div class="titlepage"><div><div><h3 class="title"><a name="id356761"></a>mod_dtcl</h3></div></div></div><p style="width:90%">
Rivet was originally based on the dtcl code, but it has
changed (improved!) quite a bit. The concepts remain the
same, but many of the commands have changed.
- </p></div><div class="section" title="NeoWebScript"><div class="titlepage"><div><div><h3 class="title"><a name="id375504"></a>NeoWebScript</h3></div></div></div><p style="width:90%">TODO</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="internals.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top">Rivet Internals </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
+ </p></div><div class="section" title="NeoWebScript"><div class="titlepage"><div><div><h3 class="title"><a name="id356773"></a>NeoWebScript</h3></div></div></div><p style="width:90%">TODO</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="internals.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top">Rivet Internals </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
Modified: tcl/rivet/trunk/doc/html/upload.html
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/html/upload.html?rev=959020&r1=959019&r2=959020&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/html/upload.html (original)
+++ tcl/rivet/trunk/doc/html/upload.html Tue Jun 29 16:17:21 2010
@@ -1,4 +1,4 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>upload</title><link rel="stylesheet" href="rivet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Apache Rivet"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="var.html" title="var"><link rel="next" href="load_response.html" title="load_response"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">upload</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="var.html"><img src="images/prev.png" alt="Prev"></a> </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right"> <a accesskey="n" href="load_response.html"><img src="images/next.png" alt="Next"></a></td></tr
></table></div><div class="refentry" title="upload"><div class="refentry.separator"><hr></div><a name="upload"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>upload — handle a file uploaded by a client.</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">upload</span> (<span style="font-family:monospace; font-weight: bold;">channel</span> | <span style="font-family:monospace; font-weight: bold;">save</span> | <span style="font-family:monospace; font-weight: bold;">data</span> | <span style="font-family:monospace; font-weight: bold;">exists</span> | <span style="font-family:monospace; font-weight: bold;">size</span> | <span style="font-family:monospace; font-weight: bold;">type</span> | <span style="font-family:monospace; font-w
eight: bold;">filename</span>)</div></div></div><div class="refsect1" title="Description"><a name="id351792"></a><h2>Description</h2><p style="width:90%">The upload command is for file upload manipulation.
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>upload</title><link rel="stylesheet" href="rivet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Apache Rivet"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="var.html" title="var"><link rel="next" href="load_response.html" title="load_response"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">upload</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="var.html"><img src="images/prev.png" alt="Prev"></a> </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right"> <a accesskey="n" href="load_response.html"><img src="images/next.png" alt="Next"></a></td></tr
></table></div><div class="refentry" title="upload"><div class="refentry.separator"><hr></div><a name="upload"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>upload — handle a file uploaded by a client.</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">upload</span> (<span style="font-family:monospace; font-weight: bold;">channel</span> | <span style="font-family:monospace; font-weight: bold;">save</span> | <span style="font-family:monospace; font-weight: bold;">data</span> | <span style="font-family:monospace; font-weight: bold;">exists</span> | <span style="font-family:monospace; font-weight: bold;">size</span> | <span style="font-family:monospace; font-weight: bold;">type</span> | <span style="font-family:monospace; font-w
eight: bold;">filename</span>)</div></div></div><div class="refsect1" title="Description"><a name="id332882"></a><h2>Description</h2><p style="width:90%">The upload command is for file upload manipulation.
See the relevant Apache Directives to further configure the
behavior of this Rivet feature.
</p><div class="variablelist"><dl><dt><span class="term">
Modified: tcl/rivet/trunk/doc/html/var.html
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/html/var.html?rev=959020&r1=959019&r2=959020&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/html/var.html (original)
+++ tcl/rivet/trunk/doc/html/var.html Tue Jun 29 16:17:21 2010
@@ -1,4 +1,4 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>var</title><link rel="stylesheet" href="rivet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Apache Rivet"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="next" href="upload.html" title="upload"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">var</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="commands.html"><img src="images/prev.png" alt="Prev"></a> </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right"> <a accesskey="n" href="upload.html"><img src="images/next.png" alt="Next"><
/a></td></tr></table></div><div class="refentry" title="var"><a name="var"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>var, var_qs, var_post — get the value of a form variable.</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">var</span> (<span style="font-family:monospace; font-weight: bold;">get</span> | <span style="font-family:monospace; font-weight: bold;">list</span> | <span style="font-family:monospace; font-weight: bold;">exists</span> | <span style="font-family:monospace; font-weight: bold;">number</span> | <span style="font-family:monospace; font-weight: bold;">all</span>)</div></div><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-
spacing:1ex "><span style="font-weight:bold ; font-family:monospace">var_qs</span> (<span style="font-family:monospace; font-weight: bold;">get</span> | <span style="font-family:monospace; font-weight: bold;">list</span> | <span style="font-family:monospace; font-weight: bold;">exists</span> | <span style="font-family:monospace; font-weight: bold;">number</span> | <span style="font-family:monospace; font-weight: bold;">all</span>)</div></div><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">var_post</span> (<span style="font-family:monospace; font-weight: bold;">get</span> | <span style="font-family:monospace; font-weight: bold;">list</span> | <span style="font-family:monospace; font-weight: bold;">exists</span> | <span style="font-family:monospace; font-weight: bold;">number</span> | <span style="font-family:monospace; font-
weight: bold;">all</span>)</div></div></div><div class="refsect1" title="Description"><a name="id351454"></a><h2>Description</h2><p style="width:90%">
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>var</title><link rel="stylesheet" href="rivet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="Apache Rivet"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="next" href="upload.html" title="upload"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">var</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="commands.html"><img src="images/prev.png" alt="Prev"></a> </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right"> <a accesskey="n" href="upload.html"><img src="images/next.png" alt="Next"><
/a></td></tr></table></div><div class="refentry" title="var"><a name="var"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>var, var_qs, var_post — get the value of a form variable.</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">var</span> (<span style="font-family:monospace; font-weight: bold;">get</span> | <span style="font-family:monospace; font-weight: bold;">list</span> | <span style="font-family:monospace; font-weight: bold;">exists</span> | <span style="font-family:monospace; font-weight: bold;">number</span> | <span style="font-family:monospace; font-weight: bold;">all</span>)</div></div><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-
spacing:1ex "><span style="font-weight:bold ; font-family:monospace">var_qs</span> (<span style="font-family:monospace; font-weight: bold;">get</span> | <span style="font-family:monospace; font-weight: bold;">list</span> | <span style="font-family:monospace; font-weight: bold;">exists</span> | <span style="font-family:monospace; font-weight: bold;">number</span> | <span style="font-family:monospace; font-weight: bold;">all</span>)</div></div><div class="cmdsynopsis" style="width:80%"><div style="background:#ccccff ; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">var_post</span> (<span style="font-family:monospace; font-weight: bold;">get</span> | <span style="font-family:monospace; font-weight: bold;">list</span> | <span style="font-family:monospace; font-weight: bold;">exists</span> | <span style="font-family:monospace; font-weight: bold;">number</span> | <span style="font-family:monospace; font-
weight: bold;">all</span>)</div></div></div><div class="refsect1" title="Description"><a name="id332544"></a><h2>Description</h2><p style="width:90%">
The <span style="font-family:monospace"><span class="command"><strong>var</strong></span></span> command retrieves information
about GET or POST variables sent to the script via client
request. It treats both GET and POST variables the same,
Modified: tcl/rivet/trunk/doc/xml/form.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/doc/xml/form.xml?rev=959020&r1=959019&r2=959020&view=diff
==============================================================================
--- tcl/rivet/trunk/doc/xml/form.xml (original)
+++ tcl/rivet/trunk/doc/xml/form.xml Tue Jun 29 16:17:21 2010
@@ -14,13 +14,9 @@
<cmdsynopsis>
<command>form</command>
<arg choice="plain"><replaceable>form_name</replaceable></arg>
- <group choice="opt">
- <arg>-option1</arg>
- <arg><replaceable>option value 1</replaceable></arg>
- <arg>-option2</arg>
- <arg><replaceable>option value 2</replaceable></arg>
- <arg>...</arg>
- </group>
+ <arg>-option1 <replaceable>value_1</replaceable></arg>
+ <arg>-option2 <replaceable>value_2</replaceable></arg>
+ <arg>...</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
@@ -31,6 +27,10 @@
working out a solution for better standardization and readability of the code.
<command>form</command> requires that just the basic information of interest to the code are
typed, greatly simplyfing the development of forms.
+ Option to the command are treated as a list of parameter-value pairs that become the defaults
+ for the corresponding attributes of the form.
+ </para>
+ <para>
A <command>form</command> object has specialized menthods to generate all the standard
input fields, i.e. text, password, hidden, generic button, submit or reset buttons and
image. <command>form</command> creates select input fields, radiobutton and checkbox
@@ -42,7 +42,7 @@
</para>
</refsect1>
<refsect1>
- <title>Form Object subcommands</title>
+ <title>Form Object Commands</title>
<para>
Form Objects are Tcl commands that need subcommands to invoke specific actions on an object.
They have a general syntax that follow this scheme:
@@ -51,8 +51,8 @@
<varlistentry>
<listitem>
<cmdsynopsis>
- form_object <arg choice="plain">subcommand</arg> <arg><replaceable>name</replaceable></arg>
- <arg>-option1</arg> <arg>value1</arg> <arg>-option2</arg> <arg>value2</arg>
+ form_object <arg choice="plain">subcommand</arg> <arg>name</arg>
+ <arg>-option1 <replaceable>value1</replaceable></arg> <arg>-option2 <replaceable>value2</replaceable></arg>
</cmdsynopsis>
</listitem>
</varlistentry>
@@ -60,73 +60,15 @@
<para>
Where <arg>name</arg> is to become the value of a 'name' attribute in input field tag. The list
of switches that follows <arg>name</arg> is copied into the a tag as attribute="value" pairs.
- Some subcommand (e.g. radiobuttons and checkboxes) treat specific options in a way that fits
- the specific organization of these fields.
+ Some subcommand (e.g. form, radiobuttons and checkboxes) treat specific options in a way that fits
+ the specific organization and function of these fields.
</para>
</refsect1>
<refsect1>
- <title>Options</title>
- <varlistentry>
- <listitem>
- <cmdsynopsis>
- <arg choice="plain">-method</arg>
- <arg choice="opt">post|get</arg>
- </cmdsynopsis>
- <para>
- The method to be used to encode the form data. Possible values are get or post
- </para>
- <note>
- At the time of writing only the 'get' method is implemented
- </note>
- </listitem>
- </varlistentry>
- <varlistentry>
- <listitem>
- <cmdsynopsis>
- <arg choice="plain">-name</arg>
- <arg choice="opt"><replaceable>form_name</replaceable></arg>
- </cmdsynopsis>
- <para>
- a name for the form being generated: this value becomes the value of the
- attribute 'name' in the <form> tag.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <listitem>
- <cmdsynopsis>
- <arg choice="plain">-defaults</arg>
- <arg choice="opt"><replaceable>default_values</replaceable></arg>
- </cmdsynopsis>
- <para>
- an array of default values to be assigned to the fields of the form.
- Every name in the array is matched with an input field, when
- a given field gets added to the form it is initialized with the
- value of the corresponding variable in the array.
- This option works well in conjuction with the
- <command>load_response</command> command of Rivet when default values
- come from another form.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <listitem>
- <cmdsynopsis>
- <arg choice="plain">-action</arg>
- <arg choice="opt"><replaceable>URL to form data processing procedure</replaceable></arg>
- </cmdsynopsis>
- <para>
- The URL to the procedure data are being sent to. If no <arg>-action</arg> switch is specified
- the data are sent to the form's URL.
- </para>
- </listitem>
- </varlistentry>
-
- </refsect1>
- <refsect1>
<variablelist>
+ <title>Subcommands</title>
<varlistentry>
- <listitem>
+ <listitem>
<cmdsynopsis>
<arg choice="plain">start</arg>
</cmdsynopsis>
@@ -149,8 +91,73 @@ myform end</programlisting>
switch to specify a different URL to process the data
</para>
</listitem>
+ </varlistentry>
+ </variablelist>
+ <refsect2>
+
+ <variablelist>
+ <title>Options</title>
+ <varlistentry>
+ <listitem>
+ <cmdsynopsis>
+ <arg choice="plain">-method</arg>
+ <arg choice="opt">post|get</arg>
+ </cmdsynopsis>
+ <para>
+ The method to be used to encode the form data. Possible values are get or post
+ </para>
+ <note>
+ At the time of writing only the 'get' method is implemented
+ </note>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <listitem>
+ <cmdsynopsis>
+ <arg choice="plain">-name</arg>
+ <arg choice="opt"><replaceable>form_name</replaceable></arg>
+ </cmdsynopsis>
+ <para>
+ a name for the form being generated: this value becomes the value of the
+ attribute 'name' in the <form> tag.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <listitem>
+ <cmdsynopsis>
+ <arg choice="plain">-defaults</arg>
+ <arg choice="opt"><replaceable>default_values</replaceable></arg>
+ </cmdsynopsis>
+ <para>
+ an array of default values to be assigned to the fields of the form.
+ Every name in the array is matched with an input field, when
+ a given field gets added to the form it is initialized with the
+ value of the corresponding variable in the array.
+ This option works well in conjuction with the
+ <command>load_response</command> command of Rivet when default values
+ come from another form.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <listitem>
+ <cmdsynopsis>
+ <arg choice="plain">-action</arg>
+ <arg choice="opt"><replaceable>URL</replaceable></arg>
+ </cmdsynopsis>
+ <para>
+ The URL to the procedure data are being sent to. If no <arg>-action</arg> switch is specified
+ the data are sent to the form's URL.
+ </para>
+ </listitem>
</varlistentry>
-
+ </variablelist>
+ </refsect2>
+ </refsect1>
+ <refsect1>
+ <title>Subcommands</title>
+ <variablelist>
<varlistentry>
<listitem>
<cmdsynopsis>
@@ -181,6 +188,76 @@ myform end</programlisting>
<varlistentry>
<listitem>
<cmdsynopsis>
+ <arg choice="plain">radiobuttons</arg>
+ <arg>name</arg>
+ <arg>-values <replaceable>values</replaceable></arg>
+ <arg>-labels <replaceable>labels</replaceable></arg>
+ <arg>args</arg>
+ </cmdsynopsis>
+ <para>
+ the <command>radiobutton</command> creates a whole radiobutton group
+ with the values and labels specified in the argument list. If no <arg>-labels</arg> switch is
+ passed to the subcommand the values are printed as labels of the radiobutton. Example:
+ </para>
+ <programlisting>
+form myform -defaults response -method get -name formname
+myform start
+myform text text_entry -size 20
+myform radiobuttons fruit -values {big medium small} \
+ -labels {Watermelon Orange Strawberry} \
+ -class myradiobclass
+myform submit submit -value Search
+myform end</programlisting>
+ <para>
+ will generate the following HTML code.
+ </para>
+ <programlisting>
+<input type="radio" name="fruit" class="myradiobclass" value="big" />Watermelon
+<input type="radio" name="fruit" class="myradiobclass" value="medium" />Orange
+<input type="radio" name="fruit" class="myradiobclass" value="small" />Strawberry
+</programlisting>
+ <para>
+ if the 'response' array has a variable for the name 'fruit' the corresponding
+ radiobutton field is automatically checked. The options <arg>values</arg> and <arg>labels</arg>
+ are used internally and don't get into the tag attributes. If a <arg>labels</arg>
+ switch is not given labels are generated using the <arg>values</arg> list.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <listitem>
+ <cmdsynopsis>
+ <arg choice="plain">checkbox</arg>
+ <arg>name</arg>
+ <arg>-label <replaceable>label</replaceable></arg>
+ <arg>-value <replaceable>value</replaceable></arg>
+ <arg>args</arg>
+ </cmdsynopsis>
+ <para>
+ The <arg choice="plain">checkbox</arg> subcommand emits a checkbox type input field with
+ the name, label and value attributes set accordingly to the parameters passed to the subcommand.
+ Example, the following code:
+ </para>
+ <programlisting>myform checkbox options -value opt1 -label "Option 1"
+myform checkbox options -value opt2 -label "Option 2"
+myform checkbox options -value opt3 -label "Option 3"
+myform checkbox options -value opt4 -label "Option 4"
+ </programlisting>
+ <para>
+ Provided opt2 was in the list valued response array (in the 'options' variable) that
+ initialized the form, the output would look like this
+ </para>
+ <programlisting><input type="checkbox" name="options" label="Option 1" value="opt1" />Option 1
+<input type="checkbox" name="options" label="Option 2" value="opt2"
+ checked="checked" />Option 2
+<input type="checkbox" name="options" label="Option 3" value="opt3" />Option 3
+<input type="checkbox" name="options" label="Option 4" value="opt4" />Option 4
+ </programlisting>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <listitem>
+ <cmdsynopsis>
<arg choice="plain">text</arg>
<arg>name</arg>
<arg choice="opt">args</arg>
@@ -493,44 +570,6 @@ myform submit submit -value Search</prog
</para>
</listitem>
</varlistentry>
- <varlistentry>
- <listitem>
- <cmdsynopsis>
- <arg choice="plain">name</arg>
- <arg>-values <replaceable>values list</replaceable></arg>
- <arg>-labels <replaceable>labels list</replaceable></arg>
- <arg>args</arg>
- </cmdsynopsis>
- <para>
- the <command>radiobutton</command> creates a whole radiobutton group
- with the values and labels specified in the argument list. If no <arg>-labels</arg> switch is
- passed to the subcommand the values are printed as labels of the radiobutton. Example:
- </para>
- <programlisting>
-form myform -defaults response -method get -name formname
-myform start
-myform text text_entry -size 20
-myform radiobuttons fruit -values {big medium small} \
- -labels {Watermelon Orange Strawberry} \
- -class myradiobuttonclass
-myform submit submit -value Search
-myform end</programlisting>
- <para>
- will generate the following HTML code.
- </para>
- <programlisting>
-<input type="radio" name="fruit" class="myradiobuttonclass" value="big" />Watermelon
-<input type="radio" name="fruit" class="myradiobuttonclass" value="medium" />Orange
-<input type="radio" name="fruit" class="myradiobuttonclass" value="small" />Strawberry
-</programlisting>
- <para>
- if the 'response' array has a variable for the name 'fruit' the corresponding
- radiobutton field is automatically checked. The options <arg>values</arg> and <arg>labels</arg>
- are used internally and don't get into the tag attributes. If a <arg>labels</arg>
- switch is not given labels are generated using the <arg>values</arg> argument.
- </para>
- </listitem>
- </varlistentry>
</variablelist>
</refsect1>
</refentry>
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-cvs-help@tcl.apache.org