atom feed1 message in org.apache.tcl.rivet-devcvs commit: tcl-rivet/src mod_rivet.c...
FromSent OnAttachments
dav...@apache.orgOct 18, 2002 12:01 am 
Subject:cvs commit: tcl-rivet/src mod_rivet.c rivetParser.c
From:dav...@apache.org (dav@apache.org)
Date:Oct 18, 2002 12:01:32 am
List:org.apache.tcl.rivet-dev

davidw 2002/10/18 00:01:32

Modified: . ChangeLog doc rivet.xml rivet.xsl doc/html commands.html directives.html help.html index.html installation.html internals.html upgrading.html src mod_rivet.c rivetParser.c Added: doc/examples hello.rvt doc/html examples.html table.png Log: * doc/rivet.xml: Several examples of how to use Rivet.

* doc/rivet.xml: Added Entities to deal with included files. This makes it easier to correctly format the source code that is to be included.

* doc/rivet.xml: Added 'Introduction' section.

* doc/rivet.xml: Reworked several elements to better utilize docbook.

Revision Changes Path 1.71 +10 -0 tcl-rivet/ChangeLog

Index: ChangeLog =================================================================== RCS file: /home/cvs/tcl-rivet/ChangeLog,v retrieving revision 1.70 retrieving revision 1.71 diff -u -r1.70 -r1.71 --- ChangeLog 10 Oct 2002 02:08:53 -0000 1.70 +++ ChangeLog 18 Oct 2002 07:01:31 -0000 1.71 @@ -1,3 +1,13 @@ +2002-10-18 David N. Welton <dav@dedasys.com> + + * doc/rivet.xml: Several examples of how to use Rivet. + +2002-10-17 David N. Welton <dav@dedasys.com> + + * doc/rivet.xml: Added Entities to deal with included files. This + makes it easier to correctly format the source code that is to be + included. + 2002-10-09 David N. Welton <dav@dedasys.com>

* src/buildscripts/findapxs.tcl: Added /usr/sbin/ at the request

1.10 +404 -246 tcl-rivet/doc/rivet.xml

Index: rivet.xml =================================================================== RCS file: /home/cvs/tcl-rivet/doc/rivet.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- rivet.xml 2 Oct 2002 19:15:00 -0000 1.9 +++ rivet.xml 18 Oct 2002 07:01:31 -0000 1.10 @@ -1,7 +1,14 @@ <?xml version="1.0" encoding="iso-8859-1"?>

<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" - "http://www.oasis-open.org/committees/docbook/xml/4.1.2/docbookx.dtd"> + "http://www.oasis-open.org/committees/docbook/xml/4.1.2/docbookx.dtd" [ + <!ENTITY hello.rvt SYSTEM "examples/hello.rvt" > + <!ENTITY table.rvt SYSTEM "examples/table.rvt" > + <!ENTITY vars.html SYSTEM "examples/vars.html" > + <!ENTITY vars.rvt SYSTEM "examples/vars.rvt" > + <!ENTITY upload.html SYSTEM "examples/upload.html" > + <!ENTITY upload.rvt SYSTEM "examples/upload.rvt" > +]>

<article> <articleinfo> @@ -32,7 +39,7 @@

<section> - <title>Introduction to Apache Rivet</title> + <title>Introduction to Apache Rivet</title> <para> Apache Rivet is a system for creating dynamic web content via a programming language integrated with Apache Web Server. It is @@ -104,7 +111,7 @@ wish to compile them.

<programlisting>gunzip tcl-rivet-X.X.X.tar.gz -tar -xvf tcl-rivet-X.X.X.tar.gz</programlisting> + tar -xvf tcl-rivet-X.X.X.tar.gz</programlisting>

</para> </step> @@ -132,7 +139,7 @@ system:</para>

<programlisting>cd src/ -./make.tcl <replaceable>option</replaceable></programlisting> + ./make.tcl <replaceable>option</replaceable></programlisting>

<para>where <replaceable>option</replaceable> can be either <option>shared</option> or @@ -170,7 +177,7 @@ </para>

<programlisting>AddType application/x-httpd-rivet .rvt -AddType application/x-rivet-tcl .tcl</programlisting> + AddType application/x-rivet-tcl .tcl</programlisting>

<para> These tell Apache to process files with the @@ -469,81 +476,103 @@ <section id="commands"> <title>Rivet Tcl Commands and Variables</title> <variablelist> - <varlistentry> - <term> - <cmdsynopsis> - <command>var</command> - <arg>get</arg> - <arg><replaceable>varname</replaceable></arg> - </cmdsynopsis> - </term> - <listitem> - <para> - Returns the value of variable - <option><replaceable>varname</replaceable></option> as a - string (even if there are multiple values). - </para> - </listitem> - </varlistentry>

<varlistentry> <term> <cmdsynopsis> <command>var</command> - <arg>list</arg> - <arg><replaceable>varname</replaceable></arg> + <group choice="req"> + <arg>get</arg> + <arg>list</arg> + <arg>exists</arg> + <arg>number</arg> + <arg>all</arg> + </group> </cmdsynopsis> </term> <listitem> <para> - Returns the value of variable - <option><replaceable>varname</replaceable></option> as a - list, if there are multiple values. + The <command>var</command> command manipulates variables + set by the user. </para> - </listitem> - </varlistentry> + <variablelist> + <varlistentry> + <term> + <cmdsynopsis> + <arg>get</arg> + <arg><replaceable>varname</replaceable></arg> + </cmdsynopsis> + </term> + <listitem> + <para> + Returns the value of variable + <option><replaceable>varname</replaceable></option> as a + string (even if there are multiple values). + </para> + </listitem> + </varlistentry>

- <varlistentry> - <term> - <cmdsynopsis> - <command>var</command> - <arg>exists</arg> - <arg><replaceable>varname</replaceable></arg> - </cmdsynopsis> - </term> - <listitem> - <para> - Returns 1 if - <option><replaceable>varname</replaceable></option> - exists, 0 if it doesn't. - </para> - </listitem> - </varlistentry> + <varlistentry> + <term> + <cmdsynopsis> + <arg>list</arg> + <arg><replaceable>varname</replaceable></arg> + </cmdsynopsis> + </term> + <listitem> + <para> + Returns the value of variable + <option><replaceable>varname</replaceable></option> as a + list, if there are multiple values. + </para> + </listitem> + </varlistentry>

- <varlistentry> - <term> - <cmdsynopsis> - <command>var</command> - <arg>number</arg> - </cmdsynopsis> - </term> - <listitem> - <para> - Returns the number of variables. - </para> - </listitem> - </varlistentry> + <varlistentry> + <term> + <cmdsynopsis> + <arg>exists</arg> + <arg><replaceable>varname</replaceable></arg> + </cmdsynopsis> + </term> + <listitem> + <para> + Returns 1 if + <option><replaceable>varname</replaceable></option> + exists, 0 if it doesn't. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <cmdsynopsis> + <arg>number</arg> + </cmdsynopsis> + </term> + <listitem> + <para> + Returns the number of variables. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <cmdsynopsis> + <arg>all</arg> + </cmdsynopsis> + </term> + <listitem> + <para> + Return a list of variable names and values. + </para> + </listitem> + </varlistentry> + </variablelist>

- <varlistentry> - <term> - <cmdsynopsis> - <command>var</command> - <arg>all</arg> - </cmdsynopsis> - </term> - <listitem> <para> - Return a list of variable names and values. + See the example. </para> </listitem> </varlistentry> @@ -554,129 +583,130 @@ <term> <cmdsynopsis> <command>upload</command> - <arg>channel</arg> - <arg><replaceable>uploadname</replaceable></arg> - </cmdsynopsis> - </term> - <listitem> - <para> - When given the name of a file upload - <option><replaceable>uploadname</replaceable></option>, - returns a Tcl channel that can be used to access the - uploaded file. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - <cmdsynopsis> - <command>upload</command> - <arg>save</arg> - <arg><replaceable>uploadname</replaceable></arg> - <arg><replaceable>filename</replaceable></arg> - </cmdsynopsis> - </term> - <listitem> - <para> - Saves the - <option><replaceable>uploadname</replaceable></option> in - the file - <option><replaceable>filename</replaceable></option>. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - <cmdsynopsis> - <command>upload</command> - <arg>data</arg> - <arg><replaceable>uploadname</replaceable></arg> - </cmdsynopsis> - </term> - <listitem> - <para> - Returns data uploaded to the server. This is binary clean - - in other words, it will work even with files like - images, executables, compressed files, and so on. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - <cmdsynopsis> - <command>upload</command> - <arg>size</arg> - <arg><replaceable>uploadname</replaceable></arg> - </cmdsynopsis> - </term> - <listitem> - <para> - Returns the size of the file uploaded. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - <cmdsynopsis> - <command>upload</command> - <arg>type</arg> - </cmdsynopsis> - </term> - <listitem> - <para> - If the Content-type is set, it is returned, otherwise, an - empty string. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - <cmdsynopsis> - <command>upload</command> - <arg>filename</arg> - <arg><replaceable>uploadname</replaceable></arg> - </cmdsynopsis> - </term> - <listitem> - <para> - Returns the filename on the remote host that uploaded the file. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - <cmdsynopsis> - <command>upload</command> - <arg>names</arg> + <group choice="req"> + <arg>channel</arg> + <arg>save</arg> + <arg>data</arg> + <arg>exists</arg> + <arg>size</arg> + <arg>type</arg> + <arg>filename</arg> + </group> </cmdsynopsis> </term> <listitem> + <para>The upload command is for file upload manipulation. + See the relevant Apache Directives to further configure the + behavior of this Rivet feature.</para> + <variablelist> + <varlistentry> + <term> + <cmdsynopsis> + <arg>channel</arg> + <arg><replaceable>uploadname</replaceable></arg> + </cmdsynopsis> + </term> + <listitem> + <para> + When given the name of a file upload + <option><replaceable>uploadname</replaceable></option>, + returns a Tcl channel that can be used to access the + uploaded file. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <cmdsynopsis> + <arg>save</arg> + <arg><replaceable>uploadname</replaceable></arg> + <arg><replaceable>filename</replaceable></arg> + </cmdsynopsis> + </term> + <listitem> + <para> + Saves the + <option><replaceable>uploadname</replaceable></option> in + the file + <option><replaceable>filename</replaceable></option>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <cmdsynopsis> + <arg>data</arg> + <arg><replaceable>uploadname</replaceable></arg> + </cmdsynopsis> + </term> + <listitem> + <para> + Returns data uploaded to the server. This is binary clean + - in other words, it will work even with files like + images, executables, compressed files, and so on. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <cmdsynopsis> + <arg>size</arg> + <arg><replaceable>uploadname</replaceable></arg> + </cmdsynopsis> + </term> + <listitem> + <para> + Returns the size of the file uploaded. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <cmdsynopsis> + <arg>type</arg> + </cmdsynopsis> + </term> + <listitem> + <para> + If the <varname>Content-type</varname> is set, it is + returned, otherwise, an empty string. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <cmdsynopsis> + <arg>filename</arg> + <arg><replaceable>uploadname</replaceable></arg> + </cmdsynopsis> + </term> + <listitem> + <para> + Returns the filename on the remote host that uploaded the file. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <cmdsynopsis> + <arg>names</arg> + </cmdsynopsis> + </term> + <listitem> + <para> + Returns the variable names, as a list, of all the files + uploaded. + </para> + </listitem> + </varlistentry> + </variablelist> <para> - Returns the variable names, as a list, of all the files - uploaded. + Please see the upload example. </para> </listitem> </varlistentry> </variablelist>

- <example> - <title>upload</title> - The following HTML: - - <programlisting>&lt;form action="foo.ttml" enctype="multipart/form-data" -method="post"&gt; -&lt;input type="file" name="MyUpload"&gt;&lt;/input&gt; -&lt;/form&gt;</programlisting> - - Can be used with the following Tcl code in order to create a - file upload form. - - <programlisting>upload save MyUpload /tmp/uploadfiles/file1 -puts "Saved file [upload filename MyUpload] -([upload size MyUploadto] bytes) to server"</programlisting> - - </example> - <variablelist> <varlistentry> <term> @@ -766,77 +796,97 @@ <term> <cmdsynopsis> <command>headers</command> - <arg>redirect</arg> - <arg><replaceable>uri</replaceable></arg> - </cmdsynopsis> - </term> - <listitem> - <para> - Redirect from the current page to a new - URI. <emphasis>Must</emphasis> be done in the first block - of TCL code. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - <cmdsynopsis> - <command>headers</command> - <arg>setcookie</arg> - <arg>-name</arg> - <arg><replaceable>cookie-name</replaceable></arg> - <arg>-value</arg> - <arg><replaceable>cookie-value</replaceable></arg> - <arg choice="opt">-expires <replaceable>date/time</replaceable></arg> - <arg choice="opt">-domain <replaceable>domain</replaceable></arg> - <arg choice="opt">-path <replaceable>path</replaceable></arg> - <arg choice="opt">-secure</arg> - </cmdsynopsis> - </term> - <listitem> - <para> - This command is for setting cookies for the server to send - to the client. <option>cookie-name</option> is the name - of the cookie, <option>cookie-value</option> is the data - associated with the cookie. <option>-expires</option> - sets an expiration date for the cookie, and must be in the - format <constant>'DD-Mon-YY HH:MM:SS'</constant>, - <option>-path</option> sets the path for which the cookie - is valid, and <option>-secure</option> specifies that the - cookie is only to be transmitted if the connection is - secure (HTTPS). - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term><cmdsynopsis> - <command>headers</command> - <arg>type</arg> - <arg><replaceable>content-type</replaceable></arg> + <group choice="req"> + <arg>set</arg> + <arg>redirect</arg> + <arg>add</arg> + <arg>type</arg> + <arg>numeric</arg> + </group> </cmdsynopsis> </term> <listitem> <para> - This command sets the <constant>Content-type</constant> - header returned by the script, which is useful if you wish - to send content other than HTML with Rivet - PNG or jpeg - images, for example. + The <command>headers</command> command is for setting and + parsing HTTP headers. </para> - </listitem> - </varlistentry> - - <varlistentry> - <term><cmdsynopsis> - <command>headers</command> - <arg>set</arg> - <arg><replaceable>headername</replaceable></arg> - <arg><replaceable>value</replaceable></arg> - </cmdsynopsis> - </term> - <listitem> <para> - Set arbitrary header names and values. + <variablelist> + <varlistentry> + <term> + <cmdsynopsis> + <arg>redirect</arg> + <arg><replaceable>uri</replaceable></arg> + </cmdsynopsis> + </term> + <listitem> + <para> + Redirect from the current page to a new + URI. <emphasis>Must</emphasis> be done in the first block + of TCL code. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <cmdsynopsis> + <arg>setcookie</arg> + <arg>-name</arg> + <arg><replaceable>cookie-name</replaceable></arg> + <arg>-value</arg> + <arg><replaceable>cookie-value</replaceable></arg> + <arg choice="opt">-expires <replaceable>date/time</replaceable></arg> + <arg choice="opt">-domain <replaceable>domain</replaceable></arg> + <arg choice="opt">-path <replaceable>path</replaceable></arg> + <arg choice="opt">-secure</arg> + </cmdsynopsis> + </term> + <listitem> + <para> + This command is for setting cookies for the server to send + to the client. <option>cookie-name</option> is the name + of the cookie, <option>cookie-value</option> is the data + associated with the cookie. <option>-expires</option> + sets an expiration date for the cookie, and must be in the + format <constant>'DD-Mon-YY HH:MM:SS'</constant>, + <option>-path</option> sets the path for which the cookie + is valid, and <option>-secure</option> specifies that the + cookie is only to be transmitted if the connection is + secure (HTTPS). + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term><cmdsynopsis> + <arg>type</arg> + <arg><replaceable>content-type</replaceable></arg> + </cmdsynopsis> + </term> + <listitem> + <para> + This command sets the <constant>Content-type</constant> + header returned by the script, which is useful if you wish + to send content other than HTML with Rivet - PNG or jpeg + images, for example. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term><cmdsynopsis> + <arg>set</arg> + <arg><replaceable>headername</replaceable></arg> + <arg><replaceable>value</replaceable></arg> + </cmdsynopsis> + </term> + <listitem> + <para> + Set arbitrary header names and values. + </para> + </listitem> + </varlistentry> + </variablelist> </para> </listitem> </varlistentry> @@ -863,6 +913,114 @@

</section>

+ <section id="examples"> + <title>Examples and Usage</title> + + <para> + Some examples of Rivet usage follow. Some prior Tcl knowledge + is assumed. If you don't know much Tcl, don't worry, it's easy, + and there are some good resources available on the web that will + get you up to speed quickly. Go to the <link + linkend="websites">web sites</link> section and have a look. + </para> + + <example id="hello world"> + <title>Hello World</title> + <para> + As with any tool, it's always nice to see something work, so + let's create a small "Hello World" page.</para> + <para> + Assuming you have Apache configured correctly, create a file + called <filename>hello.rvt</filename> where Apache can find + it, with the following content: + </para> + <programlisting>&hello.rvt;</programlisting> + <para> + If you then access it with your browser, you should see a + blank page with the text "Hello World" (without the quotes) on + it. + </para> + </example> + + <example id="table"> + <title>Generate a Table</title> + <para> + In another simple example, we dynamically generate a table: + </para> + <programlisting>&table.rvt;</programlisting> + <para> + If you read the code, you can see that this is pure Tcl. We + could take the same code, run it outside of Rivet, and it + would generate the same HTML! + </para> + <para> + The result should look something like this: + </para> + <graphic fileref="table.png"/> + + </example> + + <example> + <title>Variable Access</title> + <para> + Here, we demonstrate how to access variables set by GET or + POST operations. + </para> + <para> + Given an HTML form like the following: + </para> + <programlisting>&vars.html;</programlisting> + <para> + We can use this Rivet script to get the variable values: + </para> + <programlisting>&vars.rvt;</programlisting> + <para> + The first statement checks to make sure that the + <varname>boss</varname> variable has been passed to the + script, and then does something with that information. If + it's not present, an error is added to the list of errors. + </para> + <para> + In the second block of code, the variable + <varname>salary</varname> is fetched, with one more error + check - because it's a number, it needs to be composed of + digits. + </para> + <para> + The <varname>boss</varname> variable isn't required to have + been sent - we set it to "Mr. Burns" if it isn't among the + information we received. + </para> + <para> + The last bit of variable handing code is a bit trickier. + Because <varname>skills</varname> is a listbox, and can + potentially have multiple values, we opt to receive them as a + list, so that at some point, we could iterate over them. + </para> + <para> + The script then checks to make sure that + <varname>errlist</varname> is empty (printing an error if it + is) and outputting a thankyou message. + </para> + </example> + + <example id="upload"> + <title>File Upload</title> + <para> + The following HTML in one file, say, + <filename>upload.html</filename> + </para> + <programlisting>&upload.html;</programlisting> + <para> + Can be used with the following Tcl code, in a second file + (<filename>upload.rvt</filename> for instance) + in order to create a file upload form. + </para> + <programlisting>&upload.rvt;</programlisting> + </example> + + </section> + <section id="help"> <title>Resources - How to Get Help</title>

@@ -884,7 +1042,7 @@ </para> </section>

- <section> + <section id="websites"> <title>Web Sites</title>

<para>

1.8 +1 -1 tcl-rivet/doc/rivet.xsl

Index: rivet.xsl =================================================================== RCS file: /home/cvs/tcl-rivet/doc/rivet.xsl,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- rivet.xsl 29 Sep 2002 23:09:05 -0000 1.7 +++ rivet.xsl 18 Oct 2002 07:01:31 -0000 1.8 @@ -286,7 +286,7 @@ </pre> </xsl:when> <xsl:otherwise> - <div style="background:#bbffbb ; width:80ex ; margin: 2ex ; + <div style="background:#bbffbb ; width:90ex ; margin: 2ex ; padding: 1ex; border: solid black 1px ; white-space: pre; font-family:monospace ; " class="{name(.)}"> <xsl:apply-templates/>

1.1 tcl-rivet/doc/examples/hello.rvt

Index: hello.rvt =================================================================== &lt;? puts "Hello World" ?&gt;

1.2 +111 -104 tcl-rivet/doc/html/commands.html

Index: commands.html =================================================================== RCS file: /home/cvs/tcl-rivet/doc/html/commands.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- commands.html 29 Sep 2002 23:09:05 -0000 1.1 +++ commands.html 18 Oct 2002 07:01:31 -0000 1.2 @@ -1,82 +1,82 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> -<html><head><meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type"><title>Rivet Tcl Commands and Variables</title><meta
name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home"
href="index.html" title="Apache Rivet"><link rel="up" href="index.html"
title="Apache Rivet"><link rel="previous" href="directives.html" title="Rivet
Apache Directives"><link rel="next" href="help.html" title="Resources - How to
Get Help"></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">Rivet Tcl
Commands and Variables</th></tr><tr><td width="20%" align="left"><a
accesskey="p" href="directives.html">Prev</a> </td><th width="60%"
align="center"> </th><td width="20%" align="right"> <a accesskey="n"
href="help.html">Next</a></td></tr></table><hr></div><div class="section"><div
class="titlepage"><div><hr><h2 class="title" style="clear: both"><a
name="commands"></a>Rivet Tcl Commands and Variables</h2></div></div><div
class="variablelist"><dl><dt><span class="term"> - <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">var</span> <span style="font-family:monospace;
text-decoration:underline">get</span> <span style="font-family:monospace;
text-decoration:underline"><i><tt>varname</tt></i></span></span></div> +<html><head><meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type"><title>Rivet Tcl Commands and Variables</title><meta
name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home"
href="index.html" title="Apache Rivet"><link rel="up" href="index.html"
title="Apache Rivet"><link rel="previous" href="directives.html" title="Rivet
Apache Directives"><link rel="next" href="examples.html" title="Examples and
Usage"></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">Rivet Tcl Commands and
Variables</th></tr><tr><td width="20%" align="left"><a accesskey="p"
href="directives.html">Prev</a> </td><th width="60%" align="center"> </th><td
width="20%" align="right"> <a accesskey="n"
href="examples.html">Next</a></td></tr></table><hr></div><div
class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear:
both"><a name="commands"></a>Rivet Tcl Commands and
Variables</h2></div></div><div class="variablelist"><dl><dt><span class="term"> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">var</span> (<span style="font-family:monospace;
text-decoration:underline">get</span> | <span style="font-family:monospace;
text-decoration:underline">list</span> | <span style="font-family:monospace;
text-decoration:underline">exists</span> | <span style="font-family:monospace;
text-decoration:underline">number</span> | <span style="font-family:monospace;
text-decoration:underline">all</span>)</span></div> </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> - Returns the value of variable - <tt><span
style="text-decoration:underline"><i><tt>varname</tt></i></span></tt> as a - string (even if there are multiple values). - </div></div></dd><dt><span class="term"> - <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">var</span> <span style="font-family:monospace;
text-decoration:underline">list</span> <span style="font-family:monospace;
text-decoration:underline"><i><tt>varname</tt></i></span></span></div> - </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> - Returns the value of variable - <tt><span
style="text-decoration:underline"><i><tt>varname</tt></i></span></tt> as a - list, if there are multiple values. - </div></div></dd><dt><span class="term"> - <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">var</span> <span style="font-family:monospace;
text-decoration:underline">exists</span> <span style="font-family:monospace;
text-decoration:underline"><i><tt>varname</tt></i></span></span></div> - </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> - Returns 1 if - <tt><span
style="text-decoration:underline"><i><tt>varname</tt></i></span></tt> - exists, 0 if it doesn't. - </div></div></dd><dt><span class="term"> - <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">var</span> <span style="font-family:monospace;
text-decoration:underline">number</span></span></div> - </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> - Returns the number of variables. - </div></div></dd><dt><span class="term"> - <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">var</span> <span style="font-family:monospace;
text-decoration:underline">all</span></span></div> - </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> - Return a list of variable names and values. + The <span style="font-family:monospace"><b>var</b></span> command manipulates
variables + set by the user. + </div><div class="variablelist"><dl><dt><span class="term"> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span
style="font-family:monospace; text-decoration:underline">get</span> <span
style="font-family:monospace;
text-decoration:underline"><i><tt>varname</tt></i></span></span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + Returns the value of variable + <tt><span
style="text-decoration:underline"><i><tt>varname</tt></i></span></tt> as a + string (even if there are multiple values). + </div></div></dd><dt><span class="term"> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span
style="font-family:monospace; text-decoration:underline">list</span> <span
style="font-family:monospace;
text-decoration:underline"><i><tt>varname</tt></i></span></span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + Returns the value of variable + <tt><span
style="text-decoration:underline"><i><tt>varname</tt></i></span></tt> as a + list, if there are multiple values. + </div></div></dd><dt><span class="term"> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span
style="font-family:monospace; text-decoration:underline">exists</span> <span
style="font-family:monospace;
text-decoration:underline"><i><tt>varname</tt></i></span></span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + Returns 1 if + <tt><span
style="text-decoration:underline"><i><tt>varname</tt></i></span></tt> + exists, 0 if it doesn't. + </div></div></dd><dt><span class="term"> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span
style="font-family:monospace;
text-decoration:underline">number</span></span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + Returns the number of variables. + </div></div></dd><dt><span class="term"> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span
style="font-family:monospace; text-decoration:underline">all</span></span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + Return a list of variable names and values. + </div></div></dd></dl></div><div style=" margin:1ex ; margin-bottom:1.5ex ;
padding .5ex"> + See the example. + </div></div></dd></dl></div><div class="variablelist"><dl><dt><span
class="term"> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">upload</span> (<span style="font-family:monospace;
text-decoration:underline">channel</span> | <span style="font-family:monospace;
text-decoration:underline">save</span> | <span style="font-family:monospace;
text-decoration:underline">data</span> | <span style="font-family:monospace;
text-decoration:underline">exists</span> | <span style="font-family:monospace;
text-decoration:underline">size</span> | <span style="font-family:monospace;
text-decoration:underline">type</span> | <span style="font-family:monospace;
text-decoration:underline">filename</span>)</span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex">The
upload command is for file upload manipulation. + See the relevant Apache Directives to further configure the + behavior of this Rivet feature.</div><div class="variablelist"><dl><dt><span
class="term"> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span
style="font-family:monospace; text-decoration:underline">channel</span> <span
style="font-family:monospace;
text-decoration:underline"><i><tt>uploadname</tt></i></span></span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + When given the name of a file upload + <tt><span
style="text-decoration:underline"><i><tt>uploadname</tt></i></span></tt>, + returns a Tcl channel that can be used to access the + uploaded file. + </div></div></dd><dt><span class="term"> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span
style="font-family:monospace; text-decoration:underline">save</span> <span
style="font-family:monospace;
text-decoration:underline"><i><tt>uploadname</tt></i></span> <span
style="font-family:monospace;
text-decoration:underline"><i><tt>filename</tt></i></span></span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + Saves the + <tt><span
style="text-decoration:underline"><i><tt>uploadname</tt></i></span></tt> in + the file + <tt><span
style="text-decoration:underline"><i><tt>filename</tt></i></span></tt>. + </div></div></dd><dt><span class="term"> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span
style="font-family:monospace; text-decoration:underline">data</span> <span
style="font-family:monospace;
text-decoration:underline"><i><tt>uploadname</tt></i></span></span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + Returns data uploaded to the server. This is binary clean + - in other words, it will work even with files like + images, executables, compressed files, and so on. + </div></div></dd><dt><span class="term"> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span
style="font-family:monospace; text-decoration:underline">size</span> <span
style="font-family:monospace;
text-decoration:underline"><i><tt>uploadname</tt></i></span></span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + Returns the size of the file uploaded. + </div></div></dd><dt><span class="term"> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span
style="font-family:monospace;
text-decoration:underline">type</span></span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + If the <tt>Content-type</tt> is set, it is + returned, otherwise, an empty string. + </div></div></dd><dt><span class="term"> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span
style="font-family:monospace; text-decoration:underline">filename</span> <span
style="font-family:monospace;
text-decoration:underline"><i><tt>uploadname</tt></i></span></span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + Returns the filename on the remote host that uploaded the file. + </div></div></dd><dt><span class="term"> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span
style="font-family:monospace;
text-decoration:underline">names</span></span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + Returns the variable names, as a list, of all the files + uploaded. + </div></div></dd></dl></div><div style=" margin:1ex ; margin-bottom:1.5ex ;
padding .5ex"> + Please see the upload example. </div></div></dd></dl></div><div class="variablelist"><dl><dt><span
class="term"> - <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">upload</span> <span style="font-family:monospace;
text-decoration:underline">channel</span> <span style="font-family:monospace;
text-decoration:underline"><i><tt>uploadname</tt></i></span></span></div> - </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> - When given the name of a file upload - <tt><span
style="text-decoration:underline"><i><tt>uploadname</tt></i></span></tt>, - returns a Tcl channel that can be used to access the - uploaded file. - </div></div></dd><dt><span class="term"> - <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">upload</span> <span style="font-family:monospace;
text-decoration:underline">save</span> <span style="font-family:monospace;
text-decoration:underline"><i><tt>uploadname</tt></i></span> <span
style="font-family:monospace;
text-decoration:underline"><i><tt>filename</tt></i></span></span></div> - </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> - Saves the - <tt><span
style="text-decoration:underline"><i><tt>uploadname</tt></i></span></tt> in - the file - <tt><span
style="text-decoration:underline"><i><tt>filename</tt></i></span></tt>. - </div></div></dd><dt><span class="term"> - <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">upload</span> <span style="font-family:monospace;
text-decoration:underline">data</span> <span style="font-family:monospace;
text-decoration:underline"><i><tt>uploadname</tt></i></span></span></div> - </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> - Returns data uploaded to the server. This is binary clean - - in other words, it will work even with files like - images, executables, compressed files, and so on. - </div></div></dd><dt><span class="term"> - <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">upload</span> <span style="font-family:monospace;
text-decoration:underline">size</span> <span style="font-family:monospace;
text-decoration:underline"><i><tt>uploadname</tt></i></span></span></div> - </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> - Returns the size of the file uploaded. - </div></div></dd><dt><span class="term"> - <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">upload</span> <span style="font-family:monospace;
text-decoration:underline">type</span></span></div> - </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> - If the Content-type is set, it is returned, otherwise, an - empty string. - </div></div></dd><dt><span class="term"> - <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">upload</span> <span style="font-family:monospace;
text-decoration:underline">filename</span> <span style="font-family:monospace;
text-decoration:underline"><i><tt>uploadname</tt></i></span></span></div> - </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> - Returns the filename on the remote host that uploaded the file. - </div></div></dd><dt><span class="term"> - <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">upload</span> <span style="font-family:monospace;
text-decoration:underline">names</span></span></div> - </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> - Returns the variable names, as a list, of all the files - uploaded. - </div></div></dd></dl></div><div class="example"><p class="title"><b>Example
1. upload</b></p> - The following HTML: - - <div style="background:#bbffbb ; width:80ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">&lt;form action=&quot;foo.ttml&quot;
enctype=&quot;multipart/form-data&quot; -method=&quot;post&quot;&gt; -&lt;input type=&quot;file&quot; name=&quot;MyUpload&quot;&gt;&lt;/input&gt; -&lt;/form&gt;</div> - - Can be used with the following Tcl code in order to create a - file upload form. - - <div style="background:#bbffbb ; width:80ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">upload save MyUpload /tmp/uploadfiles/file1 -puts &quot;Saved file [upload filename MyUpload] -([upload size MyUploadto] bytes) to server&quot;</div></div><div
class="variablelist"><dl><dt><span class="term"> <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">load_env</span> ?<span style="font-family:monospace;
text-decoration:underline"><i><tt>array_name</tt></i></span>?</span></div> </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> Load the array of environment variables into the specified @@ -112,40 +112,47 @@ parses for Rivet &lt;? and ?&gt; processing tags. Using this command, you can use one .rvt file from another. </div></div></dd><dt><span class="term"> - <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">headers</span> <span style="font-family:monospace;
text-decoration:underline">redirect</span> <span style="font-family:monospace;
text-decoration:underline"><i><tt>uri</tt></i></span></span></div> - </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> - Redirect from the current page to a new - URI. <span class="emphasis"><em>Must</em></span> be done in the first block - of TCL code. - </div></div></dd><dt><span class="term"> - <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">headers</span> <span style="font-family:monospace;
text-decoration:underline">setcookie</span> <span style="font-family:monospace;
text-decoration:underline">-name</span> <span style="font-family:monospace;
text-decoration:underline"><i><tt>cookie-name</tt></i></span> <span
style="font-family:monospace; text-decoration:underline">-value</span> <span
style="font-family:monospace;
text-decoration:underline"><i><tt>cookie-value</tt></i></span> ?<span
style="font-family:monospace; text-decoration:underline">-expires
<i><tt>date/time</tt></i></span>? ?<span style="font-family:monospace;
text-decoration:underline">-domain <i><tt>domain</tt></i></span>? ?<span
style="font-family:monospace; text-decoration:underline">-path
<i><tt>path</tt></i></span>? ?<span style="font-family:monospace;
text-decoration:underline">-secure</span>?</span></div> - </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> - This command is for setting cookies for the server to send - to the client. <tt><span
style="text-decoration:underline">cookie-name</span></tt> is the name - of the cookie, <tt><span
style="text-decoration:underline">cookie-value</span></tt> is the data - associated with the cookie. <tt><span
style="text-decoration:underline">-expires</span></tt> - sets an expiration date for the cookie, and must be in the - format <tt>'DD-Mon-YY HH:MM:SS'</tt>, - <tt><span style="text-decoration:underline">-path</span></tt> sets the path
for which the cookie - is valid, and <tt><span style="text-decoration:underline">-secure</span></tt>
specifies that the - cookie is only to be transmitted if the connection is - secure (HTTPS). - </div></div></dd><dt><span class="term"><div class="cmdsynopsis"
style="width:80%"><span style="background:#bbbbff ; margin:1ex ; padding:.4ex ;
word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">headers</span> <span style="font-family:monospace;
text-decoration:underline">type</span> <span style="font-family:monospace;
text-decoration:underline"><i><tt>content-type</tt></i></span></span></div> - </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> - This command sets the <tt>Content-type</tt> - header returned by the script, which is useful if you wish - to send content other than HTML with Rivet - PNG or jpeg - images, for example. - </div></div></dd><dt><span class="term"><div class="cmdsynopsis"
style="width:80%"><span style="background:#bbbbff ; margin:1ex ; padding:.4ex ;
word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">headers</span> <span style="font-family:monospace;
text-decoration:underline">set</span> <span style="font-family:monospace;
text-decoration:underline"><i><tt>headername</tt></i></span> <span
style="font-family:monospace;
text-decoration:underline"><i><tt>value</tt></i></span></span></div> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">headers</span> (<span style="font-family:monospace;
text-decoration:underline">set</span> | <span style="font-family:monospace;
text-decoration:underline">redirect</span> | <span style="font-family:monospace;
text-decoration:underline">add</span> | <span style="font-family:monospace;
text-decoration:underline">type</span> | <span style="font-family:monospace;
text-decoration:underline">numeric</span>)</span></div> </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> - Set arbitrary header names and values. + The <span style="font-family:monospace"><b>headers</b></span> command is for
setting and + parsing HTTP headers. + </div><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + <div class="variablelist"><dl><dt><span class="term"> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span
style="font-family:monospace; text-decoration:underline">redirect</span> <span
style="font-family:monospace;
text-decoration:underline"><i><tt>uri</tt></i></span></span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + Redirect from the current page to a new + URI. <span class="emphasis"><em>Must</em></span> be done in the first block + of TCL code. + </div></div></dd><dt><span class="term"> + <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span
style="font-family:monospace; text-decoration:underline">setcookie</span> <span
style="font-family:monospace; text-decoration:underline">-name</span> <span
style="font-family:monospace;
text-decoration:underline"><i><tt>cookie-name</tt></i></span> <span
style="font-family:monospace; text-decoration:underline">-value</span> <span
style="font-family:monospace;
text-decoration:underline"><i><tt>cookie-value</tt></i></span> ?<span
style="font-family:monospace; text-decoration:underline">-expires
<i><tt>date/time</tt></i></span>? ?<span style="font-family:monospace;
text-decoration:underline">-domain <i><tt>domain</tt></i></span>? ?<span
style="font-family:monospace; text-decoration:underline">-path
<i><tt>path</tt></i></span>? ?<span style="font-family:monospace;
text-decoration:underline">-secure</span>?</span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + This command is for setting cookies for the server to send + to the client. <tt><span
style="text-decoration:underline">cookie-name</span></tt> is the name + of the cookie, <tt><span
style="text-decoration:underline">cookie-value</span></tt> is the data + associated with the cookie. <tt><span
style="text-decoration:underline">-expires</span></tt> + sets an expiration date for the cookie, and must be in the + format <tt>'DD-Mon-YY HH:MM:SS'</tt>, + <tt><span style="text-decoration:underline">-path</span></tt> sets the path
for which the cookie + is valid, and <tt><span style="text-decoration:underline">-secure</span></tt>
specifies that the + cookie is only to be transmitted if the connection is + secure (HTTPS). + </div></div></dd><dt><span class="term"><div class="cmdsynopsis"
style="width:80%"><span style="background:#bbbbff ; margin:1ex ; padding:.4ex ;
word-spacing:1ex "><span style="font-family:monospace;
text-decoration:underline">type</span> <span style="font-family:monospace;
text-decoration:underline"><i><tt>content-type</tt></i></span></span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + This command sets the <tt>Content-type</tt> + header returned by the script, which is useful if you wish + to send content other than HTML with Rivet - PNG or jpeg + images, for example. + </div></div></dd><dt><span class="term"><div class="cmdsynopsis"
style="width:80%"><span style="background:#bbbbff ; margin:1ex ; padding:.4ex ;
word-spacing:1ex "><span style="font-family:monospace;
text-decoration:underline">set</span> <span style="font-family:monospace;
text-decoration:underline"><i><tt>headername</tt></i></span> <span
style="font-family:monospace;
text-decoration:underline"><i><tt>value</tt></i></span></span></div> + </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> + Set arbitrary header names and values. + </div></div></dd></dl></div> </div></div></dd><dt><span class="term"> <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span style="font-weight:bold ;
font-family:monospace">makeurl</span> <span style="font-family:monospace;
text-decoration:underline"><i><tt>filename</tt></i></span></span></div> </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> Create a self referencing URL from a filename. For example: - <div style="background:#bbffbb ; width:80ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">makeurl /tclp.gif</div> + <div style="background:#bbffbb ; width:90ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">makeurl /tclp.gif</div> returns <tt>http://[hostname]:[port]/tclp.gif</tt>. where hostname and port are the hostname and port of the server in question. - </div></div></dd></dl></div></div><div class="navfooter"><hr><table
width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a
accesskey="p" href="directives.html">Prev</a> </td><td width="20%"
align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%"
align="right"> <a accesskey="n" href="help.html">Next</a></td></tr><tr><td
width="40%" align="left" valign="top">Rivet Apache Directives </td><td
width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td
width="40%" align="right" valign="top"> Resources - How to Get
Help</td></tr></table></div></body></html> + </div></div></dd></dl></div></div><div class="navfooter"><hr><table
width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a
accesskey="p" href="directives.html">Prev</a> </td><td width="20%"
align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%"
align="right"> <a accesskey="n" href="examples.html">Next</a></td></tr><tr><td
width="40%" align="left" valign="top">Rivet Apache Directives </td><td
width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td
width="40%" align="right" valign="top"> Examples and
Usage</td></tr></table></div></body></html>

1.3 +1 -1 tcl-rivet/doc/html/directives.html

Index: directives.html =================================================================== RCS file: /home/cvs/tcl-rivet/doc/html/directives.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- directives.html 2 Oct 2002 19:15:00 -0000 1.2 +++ directives.html 18 Oct 2002 07:01:31 -0000 1.3 @@ -23,7 +23,7 @@ is an actual Tcl script, so to run a file, you would do:

- <div style="background:#bbffbb ; width:80ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">Rivet_Script GlobalInitScript &quot;source
/var/www/foobar.tcl&quot;</div> + <div style="background:#bbffbb ; width:90ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">Rivet_Script GlobalInitScript &quot;source
/var/www/foobar.tcl&quot;</div> </div></div></dd><dt><span class="term"> <div class="cmdsynopsis" style="width:80%"><span style="background:#bbbbff ;
margin:1ex ; padding:.4ex ; word-spacing:1ex "><span
style="font-family:monospace; text-decoration:underline">ChildInitScript</span>
<span style="font-family:monospace;
text-decoration:underline"><i><tt>script</tt></i></span></span></div> </span></dt><dd><div style="padding:4 ; margin-top:3 ; margin-bottom:3 ;
width:75%"><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex">

1.3 +4 -4 tcl-rivet/doc/html/help.html

Index: help.html =================================================================== RCS file: /home/cvs/tcl-rivet/doc/html/help.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- help.html 2 Oct 2002 19:15:00 -0000 1.2 +++ help.html 18 Oct 2002 07:01:31 -0000 1.3 @@ -1,5 +1,5 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> -<html><head><meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type"><title>Resources - How to Get Help</title><meta
name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home"
href="index.html" title="Apache Rivet"><link rel="up" href="index.html"
title="Apache Rivet"><link rel="previous" href="commands.html" title="Rivet Tcl
Commands and Variables"><link rel="next" href="internals.html" title="Rivet
Internals"></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">Resources - How
to Get Help</th></tr><tr><td width="20%" align="left"><a accesskey="p"
href="commands.html">Prev</a> </td><th width="60%" align="center"> </th><td
width="20%" align="right"> <a accesskey="n"
href="internals.html">Next</a></td></tr></table><hr></div><div
class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear:
both"><a name="help"></a>Resources - How to Get Help</h2></div></div><div
class="section"><div class="titlepage"><div><h3 class="title"><a
name="id5347185"></a>Mailing Lists</h3></div></div><p style="width:90%"> +<html><head><meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type"><title>Resources - How to Get Help</title><meta
name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home"
href="index.html" title="Apache Rivet"><link rel="up" href="index.html"
title="Apache Rivet"><link rel="previous" href="examples.html" title="Examples
and Usage"><link rel="next" href="internals.html" title="Rivet
Internals"></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">Resources - How
to Get Help</th></tr><tr><td width="20%" align="left"><a accesskey="p"
href="examples.html">Prev</a> </td><th width="60%" align="center"> </th><td
width="20%" align="right"> <a accesskey="n"
href="internals.html">Next</a></td></tr></table><hr></div><div
class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear:
both"><a name="help"></a>Resources - How to Get Help</h2></div></div><div
class="section"><div class="titlepage"><div><h3 class="title"><a
name="id5347738"></a>Mailing Lists</h3></div></div><p style="width:90%"> The Rivet mailing list is the first place you should turn for help, if you haven't found the solution to your problem in the documentation. Send email to @@ -10,7 +10,7 @@ <tt>&lt;<a
href="mailto:rive@tcl.apache.org">rivet-<i><tt>list</tt></i>-subs@tcl.apache.org</a>&gt;</tt>. </p><p style="width:90%"> The mailing list archives are available at <a href="http://www.apachelabs.org"
target="_top">http://www.apachelabs.org</a> - </p></div><div class="section"><div class="titlepage"><div><h3
class="title"><a name="id5347231"></a>Web Sites</h3></div></div><p
style="width:90%"> + </p></div><div class="section"><div class="titlepage"><div><h3
class="title"><a name="websites"></a>Web Sites</h3></div></div><p
style="width:90%"> There are several web sites that cover Apache and Tcl extensively. </p><div class="itemizedlist"><ul type="disc"><li><div style=" margin:1ex ;
margin-bottom:1.5ex ; padding .5ex"> @@ -27,8 +27,8 @@ </div></li><li><div style=" margin:1ex ; margin-bottom:1.5ex ; padding .5ex"> <a href="http://wiki.tcl.tk" target="_top">http://wiki.tcl.tk</a> is the Tcl'ers
Wiki, a free-form place to search for answers and ask for help. - </div></li></ul></div></div><div class="section"><div
class="titlepage"><div><h3 class="title"><a name="id5347313"></a>Bug Tracking
System</h3></div></div><p style="width:90%"> + </div></li></ul></div></div><div class="section"><div
class="titlepage"><div><h3 class="title"><a name="id5347888"></a>Bug Tracking
System</h3></div></div><p style="width:90%"> Apache Rivet uses the Apache Bug Tracking system at <a
href="http://nagoya.apache.org/bugzilla/"
target="_top">http://nagoya.apache.org/bugzilla/</a>. Here, you can report problems, or check and see if existing issues are already known and being dealt with. - </p></div></div><div class="navfooter"><hr><table width="100%"
summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p"
href="commands.html">Prev</a> </td><td width="20%" align="center"><a
accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a
accesskey="n" href="internals.html">Next</a></td></tr><tr><td width="40%"
align="left" valign="top">Rivet Tcl Commands and Variables </td><td width="20%"
align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%"
align="right" valign="top"> Rivet
Internals</td></tr></table></div></body></html> + </p></div></div><div class="navfooter"><hr><table width="100%"
summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p"
href="examples.html">Prev</a> </td><td width="20%" align="center"><a
accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a
accesskey="n" href="internals.html">Next</a></td></tr><tr><td width="40%"
align="left" valign="top">Examples and Usage </td><td width="20%"
align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%"
align="right" valign="top"> Rivet
Internals</td></tr></table></div></body></html>

1.3 +3 -3 tcl-rivet/doc/html/index.html

Index: index.html =================================================================== RCS file: /home/cvs/tcl-rivet/doc/html/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- index.html 2 Oct 2002 19:15:00 -0000 1.2 +++ index.html 18 Oct 2002 07:01:31 -0000 1.3 @@ -1,9 +1,9 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> -<html><head><meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type"><title>Apache Rivet</title><meta name="generator"
content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="index.html"
title="Apache Rivet"><link rel="next" href="installation.html" title="Apache
Rivet Installation"></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">Apache
Rivet</th></tr><tr><td width="20%" align="left"> </td><th width="60%"
align="center"> </th><td width="20%" align="right"> <a accesskey="n"
href="installation.html">Next</a></td></tr></table><hr></div><div
class="article"><div class="titlepage"><div><h1 class="title"><a
name="id5343471"></a>Apache Rivet</h1></div><div><div class="author"><h3
class="author">David Welton</h3><div class="affiliation"><div
class="address"><p> +<html><head><meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type"><title>Apache Rivet</title><meta name="generator"
content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="index.html"
title="Apache Rivet"><link rel="next" href="installation.html" title="Apache
Rivet Installation"></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">Apache
Rivet</th></tr><tr><td width="20%" align="left"> </td><th width="60%"
align="center"> </th><td width="20%" align="right"> <a accesskey="n"
href="installation.html">Next</a></td></tr></table><hr></div><div
class="article"><div class="titlepage"><div><h1 class="title"><a
name="id5343357"></a>Apache Rivet</h1></div><div><div class="author"><h3
class="author">David Welton</h3><div class="affiliation"><div
class="address"><p> <tt>&lt;<a href="mailto:dav@apache.org">dav@apache.org</a>&gt;</tt> </p></div></div></div></div><div><div class="author"><h3 class="author">Damon
Courtney</h3><div class="affiliation"><div class="address"><p> - <tt>&lt;<a href="mailto:dam@apache.org">dam@apache.org</a>&gt;</tt> - </p></div></div></div></div><div><p class="copyright">Copyright © 2002 Apache
Software Foundation</p></div><hr></div><div class="toc"><p><b>Table of
Contents</b></p><dl><dt><a href="index.html#id5343609">Introduction to Apache
Rivet</a></dt><dt><a href="installation.html">Apache Rivet
Installation</a></dt><dt><a href="directives.html">Rivet Apache
Directives</a></dt><dt><a href="commands.html">Rivet Tcl Commands and
Variables</a></dt><dt><a href="help.html">Resources - How to Get
Help</a></dt><dd><dl><dt><a href="help.html#id5347185">Mailing
Lists</a></dt><dt><a href="help.html#id5347231">Web Sites</a></dt><dt><a
href="help.html#id5347313">Bug Tracking System</a></dt></dl></dd><dt><a
href="internals.html">Rivet Internals</a></dt><dd><dl><dt><a
href="internals.html#id5347353">Initialization</a></dt><dt><a
href="internals.html#id5347390">RivetChan</a></dt><dt><a
href="internals.html#id5347419">Page Parsing, Execution and
Cacheing</a></dt></dl></dd><dt><a href="upgrading.html">Upgrading from mod_dtcl
or NeoWebScript</a></dt><dd><dl><dt><a
href="upgrading.html#id5347498">mod_dtcl</a></dt><dt><a
href="upgrading.html#id5347513">NeoWebScript</a></dt></dl></dd></dl></div><div
class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear:
both"><a name="id5343609"></a>Introduction to Apache Rivet</h2></div></div><p
style="width:90%"> + <tt>&lt;<a href="mailto:dam@apache.org">dam@apache.org</a>&gt;</tt> + </p></div></div></div></div><div><p class="copyright">Copyright © 2002 Apache
Software Foundation</p></div><hr></div><div class="toc"><p><b>Table of
Contents</b></p><dl><dt><a href="index.html#id5342961">Introduction to Apache
Rivet</a></dt><dt><a href="installation.html">Apache Rivet
Installation</a></dt><dt><a href="directives.html">Rivet Apache
Directives</a></dt><dt><a href="commands.html">Rivet Tcl Commands and
Variables</a></dt><dt><a href="examples.html">Examples and Usage</a></dt><dt><a
href="help.html">Resources - How to Get Help</a></dt><dd><dl><dt><a
href="help.html#id5347738">Mailing Lists</a></dt><dt><a
href="help.html#websites">Web Sites</a></dt><dt><a
href="help.html#id5347888">Bug Tracking System</a></dt></dl></dd><dt><a
href="internals.html">Rivet Internals</a></dt><dd><dl><dt><a
href="internals.html#id5347938">Initialization</a></dt><dt><a
href="internals.html#id5347974">RivetChan</a></dt><dt><a
href="internals.html#id5348003">Page Parsing, Execution and
Cacheing</a></dt></dl></dd><dt><a href="upgrading.html">Upgrading from mod_dtcl
or NeoWebScript</a></dt><dd><dl><dt><a
href="upgrading.html#id5348082">mod_dtcl</a></dt><dt><a
href="upgrading.html#id5347491">NeoWebScript</a></dt></dl></dd></dl></div><div
class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear:
both"><a name="id5342961"></a>Introduction to Apache Rivet</h2></div></div><p
style="width:90%"> Apache Rivet is a system for creating dynamic web content via a programming language integrated with Apache Web Server. It is designed to be fast, powerful and extensible, consume few system

1.2 +7 -7 tcl-rivet/doc/html/installation.html

Index: installation.html =================================================================== RCS file: /home/cvs/tcl-rivet/doc/html/installation.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- installation.html 2 Oct 2002 19:15:00 -0000 1.1 +++ installation.html 18 Oct 2002 07:01:31 -0000 1.2 @@ -21,8 +21,8 @@ You must uncompress the Rivet sources in the directory where you wish to compile them.

- </p><div style="background:#bbffbb ; width:80ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">gunzip tcl-rivet-X.X.X.tar.gz -tar -xvf tcl-rivet-X.X.X.tar.gz</div><p style="width:90%"> + </p><div style="background:#bbffbb ; width:90ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">gunzip tcl-rivet-X.X.X.tar.gz + tar -xvf tcl-rivet-X.X.X.tar.gz</div><p style="width:90%">

</p></li><li><p class="title"><b>Building Rivet</b></p><p style="width:90%"> Rivet uses a unique build system which we created especially @@ -36,8 +36,8 @@ set certain options. Try the next step first, and see if it's successful. </p></li><li><p style="width:90%">At this point, you are ready to run the build - system:</p><div style="background:#bbffbb ; width:80ex ; margin: 2ex ;
padding: 1ex; border: solid black 1px ; white-space: pre; font-family:monospace
; " class="programlisting">cd src/ -./make.tcl <i><tt>option</tt></i></div><p style="width:90%">where
<i><tt>option</tt></i> can be + system:</p><div style="background:#bbffbb ; width:90ex ; margin: 2ex ;
padding: 1ex; border: solid black 1px ; white-space: pre; font-family:monospace
; " class="programlisting">cd src/ + ./make.tcl <i><tt>option</tt></i></div><p style="width:90%">where
<i><tt>option</tt></i> can be either <tt><span style="text-decoration:underline">shared</span></tt> or <tt><span style="text-decoration:underline">static</span></tt>. </p></li><li><p class="title"><b>Install</b></p><p style="width:90%"> @@ -51,13 +51,13 @@ </p></li></ol></li><li><p class="title"><b>Apache Configuration Files</b></p><p
style="width:90%"> Rivet is relatively easy to configure - we start off by adding the module itself: - </p><div style="background:#bbffbb ; width:80ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">LoadModule rivet_module
<i><tt>/usr/lib/apache/1.3/mod_rivet.so</tt></i></div><p style="width:90%"> + </p><div style="background:#bbffbb ; width:90ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">LoadModule rivet_module
<i><tt>/usr/lib/apache/1.3/mod_rivet.so</tt></i></div><p style="width:90%"> This tells Apache to load the Rivet shared object, wherever it happens to reside on your file system. Now we have to tell Apache what kind of files are &quot;Rivet&quot; files and how to process them: - </p><div style="background:#bbffbb ; width:80ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">AddType application/x-httpd-rivet .rvt -AddType application/x-rivet-tcl .tcl</div><p style="width:90%"> + </p><div style="background:#bbffbb ; width:90ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">AddType application/x-httpd-rivet .rvt + AddType application/x-rivet-tcl .tcl</div><p style="width:90%"> These tell Apache to process files with the <tt>.rvt</tt> and <tt>.tcl</tt> extensions as Rivet files.

1.3 +3 -3 tcl-rivet/doc/html/internals.html

Index: internals.html =================================================================== RCS file: /home/cvs/tcl-rivet/doc/html/internals.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- internals.html 2 Oct 2002 19:15:00 -0000 1.2 +++ internals.html 18 Oct 2002 07:01:31 -0000 1.3 @@ -4,7 +4,7 @@ code is removed, and changes are made. The best place to look is the source code itself. If you are interested in the changes themselves FIXME. - </p><div class="section"><div class="titlepage"><div><h3 class="title"><a
name="id5347353"></a>Initialization</h3></div></div><p style="width:90%"> + </p><div class="section"><div class="titlepage"><div><h3 class="title"><a
name="id5347938"></a>Initialization</h3></div></div><p style="width:90%"> When Apache is started, (or when child Apache processes are started if a threaded Tcl is used), <tt>Rivet_InitTclStuff</tt> is called, which @@ -15,7 +15,7 @@ executes Rivet's <tt>init.tcl</tt>. The caching system is also set up, and if there is a <span style="font-family:monospace"><b>GlobalInitScript</b></span>, it is run. - </p></div><div class="section"><div class="titlepage"><div><h3
class="title"><a name="id5347390"></a>RivetChan</h3></div></div><p
style="width:90%"> + </p></div><div class="section"><div class="titlepage"><div><h3
class="title"><a name="id5347974"></a>RivetChan</h3></div></div><p
style="width:90%"> The RivetChan system was created in order to have an actual Tcl channel that we could redirect standard output to. This lets us use, for instance, the @@ -25,7 +25,7 @@ Tcl's regular standard output is replaced with an instance of this channel type, so that, by default, output will go to the web page. - </p></div><div class="section"><div class="titlepage"><div><h3
class="title"><a name="id5347419"></a>Page Parsing, Execution and
Cacheing</h3></div></div><p style="width:90%"> + </p></div><div class="section"><div class="titlepage"><div><h3
class="title"><a name="id5348003"></a>Page Parsing, Execution and
Cacheing</h3></div></div><p style="width:90%"> When a Rivet page is requested, it is transformed into an ordinary Tcl script by parsing the file for the &lt;? ?&gt; processing instruction tags. Everything outside these tags

1.3 +2 -2 tcl-rivet/doc/html/upgrading.html

Index: upgrading.html =================================================================== RCS file: /home/cvs/tcl-rivet/doc/html/upgrading.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- upgrading.html 2 Oct 2002 19:15:00 -0000 1.2 +++ upgrading.html 18 Oct 2002 07:01:31 -0000 1.3 @@ -6,8 +6,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"><div class="titlepage"><div><h3 class="title"><a
name="id5347498"></a>mod_dtcl</h3></div></div><p style="width:90%"> + </p><div class="section"><div class="titlepage"><div><h3 class="title"><a
name="id5348082"></a>mod_dtcl</h3></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"><div class="titlepage"><div><h3
class="title"><a name="id5347513"></a>NeoWebScript</h3></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">Prev</a> </td><td width="20%"
align="center"><a accesskey="u" href="index.html">Up</a></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">Home</a></td><td width="40%" align="right"
valign="top"> </td></tr></table></div></body></html> + </p></div><div class="section"><div class="titlepage"><div><h3
class="title"><a name="id5347491"></a>NeoWebScript</h3></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">Prev</a> </td><td width="20%"
align="center"><a accesskey="u" href="index.html">Up</a></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">Home</a></td><td width="40%" align="right"
valign="top"> </td></tr></table></div></body></html>

1.1 tcl-rivet/doc/html/examples.html

Index: examples.html =================================================================== <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> <html><head><meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type"><title>Examples and Usage</title><meta
name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home"
href="index.html" title="Apache Rivet"><link rel="up" href="index.html"
title="Apache Rivet"><link rel="previous" href="commands.html" title="Rivet Tcl
Commands and Variables"><link rel="next" href="help.html" title="Resources - How
to Get Help"></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">Examples and
Usage</th></tr><tr><td width="20%" align="left"><a accesskey="p"
href="commands.html">Prev</a> </td><th width="60%" align="center"> </th><td
width="20%" align="right"> <a accesskey="n"
href="help.html">Next</a></td></tr></table><hr></div><div class="section"><div
class="titlepage"><div><hr><h2 class="title" style="clear: both"><a
name="examples"></a>Examples and Usage</h2></div></div><p style="width:90%"> Some examples of Rivet usage follow. Some prior Tcl knowledge is assumed. If you don't know much Tcl, don't worry, it's easy, and there are some good resources available on the web that will get you up to speed quickly. Go to the <a href="help.html#websites" title="Web
Sites">web sites</a> section and have a look. </p><div class="example"><a name="hello world"></a><p class="title"><b>Example
1. Hello World</b></p><p style="width:90%"> As with any tool, it's always nice to see something work, so let's create a small &quot;Hello World&quot; page.</p><p style="width:90%"> Assuming you have Apache configured correctly, create a file called <tt>hello.rvt</tt> where Apache can find it, with the following content: </p><div style="background:#bbffbb ; width:90ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">&lt;? puts &quot;Hello World&quot; ?&gt; </div><p style="width:90%"> If you then access it with your browser, you should see a blank page with the text &quot;Hello World&quot; (without the quotes) on it. </p></div><div class="example"><a name="table"></a><p class="title"><b>Example
2. Generate a Table</b></p><p style="width:90%"> In another simple example, we dynamically generate a table: </p><div style="background:#bbffbb ; width:90ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">&lt;? puts &quot;&lt;table&gt;\n&quot; for {set i 1} { $i &lt;= 8 } {incr i} { puts &quot;&lt;tr&gt;\n&quot; for {set j 1} {$j &lt;= 8} {incr j} { set num [ expr $i * $j * 4 - 1] puts [ format &quot;&lt;td bgcolor=%2x%2x%2x &gt; $num $num $num
&lt;/td&gt;\n&quot; \ $num $num $num ] } puts &quot;&lt;/tr&gt;\n&quot; } puts &quot;&lt;/table&gt;\n&quot; ?&gt; </div><p style="width:90%"> If you read the code, you can see that this is pure Tcl. We could take the same code, run it outside of Rivet, and it would generate the same HTML! </p><p style="width:90%"> The result should look something like this: </p><p><img src="table.png"></p></div><div class="example"><p
class="title"><b>Example 3. Variable Access</b></p><p style="width:90%"> Here, we demonstrate how to access variables set by GET or POST operations. </p><p style="width:90%"> Given an HTML form like the following: </p><div style="background:#bbffbb ; width:90ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">&lt;form action=&quot;vars.rvt&quot;&gt; &lt;p&gt; &lt;input name=&quot;title&quot;&gt; &lt;input name=&quot;salary&quot;&gt; &lt;input name=&quot;boss&quot;&gt; &lt;select name=&quot;skills&quot; multiple=&quot;multiple&quot;&gt; &lt;option&gt;c&lt;/option&gt; &lt;option&gt;java&lt;/option&gt; &lt;option&gt;Tcl&lt;/option&gt; &lt;option&gt;Perl&lt;/option&gt; &lt;/select&gt; &lt;/p&gt; &lt;/form&gt; </div><p style="width:90%"> We can use this Rivet script to get the variable values: </p><div style="background:#bbffbb ; width:90ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">&lt;? set errlist {} if { [var exists title] } { set salary [var get title] } else { set errlist &quot;You need to enter a title&quot; }

if { [var exists salary] } { set salary [var get salary] if { ! [string is digit $salary] } { lappend errlist &quot;Salary must be a number&quot; } } else { lappend errlist &quot;You need to enter a salary&quot; }

if { [var exists boss] } { set boss [var get boss] } else { set boss &quot;Mr. Burns&quot; }

if { [var exists skills] } { set skills [var list skills] } else { lappend errlist &quot;You need to enter some skills&quot; }

if { [llength $errlist] != 0 } { foreach err $errlist { puts &quot;&lt;b&gt; $err &lt;/b&gt;&quot; } } else { puts &quot;Thanks for the information!&quot; } ?&gt;</div><p style="width:90%"> The first statement checks to make sure that the <tt>boss</tt> variable has been passed to the script, and then does something with that information. If it's not present, an error is added to the list of errors. </p><p style="width:90%"> In the second block of code, the variable <tt>salary</tt> is fetched, with one more error check - because it's a number, it needs to be composed of digits. </p><p style="width:90%"> The <tt>boss</tt> variable isn't required to have been sent - we set it to &quot;Mr. Burns&quot; if it isn't among the information we received. </p><p style="width:90%"> The last bit of variable handing code is a bit trickier. Because <tt>skills</tt> is a listbox, and can potentially have multiple values, we opt to receive them as a list, so that at some point, we could iterate over them. </p><p style="width:90%"> The script then checks to make sure that <tt>errlist</tt> is empty (printing an error if it is) and outputting a thankyou message. </p></div><div class="example"><a name="upload"></a><p class="title"><b>Example
4. File Upload</b></p><p style="width:90%"> The following HTML in one file, say, <tt>upload.html</tt> </p><div style="background:#bbffbb ; width:90ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">&lt;form action=&quot;foo.ttml&quot;
enctype=&quot;multipart/form-data&quot; method=&quot;post&quot;&gt; &lt;input type=&quot;file&quot; name=&quot;MyUpload&quot;&gt;&lt;/input&gt; &lt;/form&gt;</div><p style="width:90%"> Can be used with the following Tcl code, in a second file (<tt>upload.rvt</tt> for instance) in order to create a file upload form. </p><div style="background:#bbffbb ; width:90ex ; margin: 2ex ; padding: 1ex;
border: solid black 1px ; white-space: pre; font-family:monospace ; "
class="programlisting">&lt;? upload save MyUpload /tmp/uploadfiles/file1 puts &quot;Saved file [upload filename MyUpload] \ ([upload size MyUploadto] bytes) to server&quot; ?&gt;</div></div></div><div class="navfooter"><hr><table width="100%"
summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p"
href="commands.html">Prev</a> </td><td width="20%" align="center"><a
accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a
accesskey="n" href="help.html">Next</a></td></tr><tr><td width="40%"
align="left" valign="top">Rivet Tcl Commands and Variables </td><td width="20%"
align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%"
align="right" valign="top"> Resources - How to Get
Help</td></tr></table></div></body></html>

1.1 tcl-rivet/doc/html/table.png

<<Binary file>>

1.50 +4 -1 tcl-rivet/src/mod_rivet.c

Index: mod_rivet.c =================================================================== RCS file: /home/cvs/tcl-rivet/src/mod_rivet.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- mod_rivet.c 29 Sep 2002 23:09:06 -0000 1.49 +++ mod_rivet.c 18 Oct 2002 07:01:32 -0000 1.50 @@ -409,6 +409,9 @@

ap_cpystrn(error, DEFAULT_ERROR_MSG, sizeof(error)); ap_cpystrn(timefmt, DEFAULT_TIME_FORMAT, sizeof(timefmt)); + + /* This one is the big catch when it comes to moving towards + Apache 2.0, or one of them, at least. */ ap_chdir_file(r->filename);

Rivet_PropagatePerDirConfArrays( interp, rdc );

1.6 +3 -4 tcl-rivet/src/rivetParser.c

Index: rivetParser.c =================================================================== RCS file: /home/cvs/tcl-rivet/src/rivetParser.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- rivetParser.c 27 Sep 2002 17:28:17 -0000 1.5 +++ rivetParser.c 18 Oct 2002 07:01:32 -0000 1.6 @@ -166,8 +166,7 @@ { if ((++p) == startseqlen) { - /* We have matched the whole ending sequence. - */ + /* We have matched the whole ending sequence. */ Tcl_AppendToObj(outbuf, "\"\n", 2); inside = 1; p = 0; @@ -221,7 +220,7 @@ p = 0; } } else { - /* plop stuff into outbuf, which we will then eval */ + /* Plop stuff into outbuf, which we will then eval. */ if (p > 0) { Tcl_AppendToObj(outbuf, (char *)strend, p); p = 0;