You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by da...@apache.org on 2002/08/01 19:24:09 UTC

cvs commit: tcl-site/websh/quickref Apache_module_specific_commands.html command_dispatching_and_session_management.html configuration.html context_handling.html data_encryption.html file_handling_and_file_IO.html index.html inter-process_and_-system_communication.html logging.html misc_commands.html request_data_handling.html response_data_handling.html uri-html-_en-decoding.html

davidw      2002/08/01 10:24:09

  Modified:    websh    support.ws3 websh.interpclass.initializer
                        whitepaper.ws3
  Added:       websh/quickref Apache_module_specific_commands.html
                        command_dispatching_and_session_management.html
                        configuration.html context_handling.html
                        data_encryption.html file_handling_and_file_IO.html
                        index.html
                        inter-process_and_-system_communication.html
                        logging.html misc_commands.html
                        request_data_handling.html
                        response_data_handling.html
                        uri-html-_en-decoding.html
  Log:
  Use quickref html from tcl-websh module.  We will have to manually
  copy it from there to here and check it in, but it's better than
  nothing.
  
  Revision  Changes    Path
  1.8       +2 -2      tcl-site/websh/support.ws3
  
  Index: support.ws3
  ===================================================================
  RCS file: /home/cvs/tcl-site/websh/support.ws3,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- support.ws3	28 Jul 2002 21:35:47 -0000	1.7
  +++ support.ws3	1 Aug 2002 17:24:08 -0000	1.8
  @@ -16,7 +16,7 @@
       and support. We work hard to keep the site
       up-to-date with all information you need. Here, you can find
       the {pageLink whitepaper.ws3 -show "Websh white paper"} and
  -    the {pageLink quickref.ws3 -show "quick reference"} as well as
  +    the {pageLink quickref/ -show "quick reference"} as well as
       a list of {pageLink faq.ws3 -show "frequently asked questions"}.
         <br><br>
   
  
  
  
  1.4       +2 -2      tcl-site/websh/websh.interpclass.initializer
  
  Index: websh.interpclass.initializer
  ===================================================================
  RCS file: /home/cvs/tcl-site/websh/websh.interpclass.initializer,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- websh.interpclass.initializer	28 Jul 2002 21:35:47 -0000	1.3
  +++ websh.interpclass.initializer	1 Aug 2002 17:24:08 -0000	1.4
  @@ -261,7 +261,7 @@
   	{navBarStart}
           {navBarElement "docu.ws3" "documentation" [expr $where != 0]}
           {navBarElement "whitepaper.ws3" "white paper" [expr $where != 1]}
  -        {navBarElement "quickref.ws3" "quick reference" [expr $where != 2]}
  +        {navBarElement "quickref/" "quick reference" [expr $where != 2]}
           {navBarElement "examples.ws3" "examples" [expr $where != 4]}
   	{navBarEnd}
       }
  
  
  
  1.6       +2 -2      tcl-site/websh/whitepaper.ws3
  
  Index: whitepaper.ws3
  ===================================================================
  RCS file: /home/cvs/tcl-site/websh/whitepaper.ws3,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- whitepaper.ws3	28 Jul 2002 20:36:13 -0000	1.5
  +++ whitepaper.ws3	1 Aug 2002 17:24:08 -0000	1.6
  @@ -537,7 +537,7 @@
   
   This section lists the main commands of Websh. For a complete
   overview, you may want to look at the
  -<a href="quickref.html">Quick Reference</a>.
  +<a href="quickref/">Quick Reference</a>.
   
   <br><br>
   <a name="474"><a href="#toc"><h2>6.1 request and url management</h2></a>
  
  
  
  1.1                  tcl-site/websh/quickref/Apache_module_specific_commands.html
  
  Index: Apache_module_specific_commands.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>Apache module specific commands</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="index.html" title="Websh Reference"><link rel="up" href="index.html" title="Websh Reference"><link rel="previous" href="inter-process_and_-system_communication.html" title="Inter-process/-system communication"><link rel="next" href="misc_commands.html" title="Miscellaneous commands"></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 module specific commands</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="inter-process_and_-system_communication.html">Prev</a>�</td><th width="60%" align="center">�</th><td width="20%" align="right">�<a accesskey="n" href="misc_commands.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear: both"><a name="Apache_module_specific_commands"></a>Apache module specific commands</h2></div></div><p style="width:90%">
        Note that these commands are implemented as dummies in the CGI
        version of Websh only. They don't do anything except for
        web::initializer and web::finalizer, which just evaluate the
        code provided in the argument.
      </p><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::initializer"></a>web::initializer</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::initializer</tt></span>  <tt><span style="text-decoration:underline"><i><tt>code</tt></i></span></tt></span></div><p style="width:90%">
  
  	This code is executed only when a new interpreter is created.
  	Note that the &quot;main&quot; Websh script can
  	<span style="font-family:monospace"><b>source</b></span> several modules which each call
  	their initialization code.
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::finalizer"></a>web::finalizer</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::finalizer</tt></span>  <tt><span style="text-decoration:underline"><i><tt>code</tt></i></span></tt></span></div><p style="width:90%">
  
  	Register code to be exectuted when the interpreter for this
  	Websh script is deleted. <span style="font-family:monospace"><b>web::dofinalize</b></span>
  	will then call each <tt><span style="text-decoration:underline">code</span></tt> block that has been
  	registered, starting with the most recently added
  	<tt><span style="text-decoration:underline">code</span></tt>.
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::finalize"></a>web::finalize</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::finalize</tt></span> </span></div><p style="width:90%">
  
  	Execute finalizer code that has been registerd using
  	<span style="font-family:monospace"><b>web::finalizer</b></span>, starting with the most
  	recently added <tt><span style="text-decoration:underline">code</span></tt>.  Note that this command
  	is executed automatically and does not have to be called
  	manually. However, it can be used as a hook, when the
  	interpreter is deleted:
  
  	</p><div class="example"><p class="title"><b>Example 13. web::finalize</b></p><pre style="background:#bbffbb ; width:75%" class="programlisting">
  	    rename web::finalize web::finalize.orig
  	    proc web::myFinalize {} {
  	    # code to eval before finalize.orig
  	    finalize.orig
  	    # code to eval after finalize.orig
  	    }
  	  </pre></div><p style="width:90%">
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::maineval"></a>web::maineval</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::maineval</tt></span>  <tt><span style="text-decoration:underline"><i><tt>code</tt></i></span></tt></span></div><p style="width:90%">
  
  	Execute code in the &quot;main&quot; interpreter of mod_websh. (Note
  	that this is synchronized, i.e. the main interpreter is locked for
  	exclusive access by the current thread within the process. However,
  	running Apache in a prefork setting sets up a main interpreter per
  	child, so the exclusive access does not refer to server wide
  	exclusivity, but only to child process wide exclusiveity.)
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::interpclasscfg"></a>web::interpclasscfg</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::interpclasscfg</tt></span>  <tt><span style="text-decoration:underline"><i><tt>classid</tt></i></span></tt> <tt><span style="text-decoration:underline"><i><tt>property</tt></i></span></tt> ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?</span></div><p style="width:90%">
  
  	Properties are: <tt><span style="text-decoration:underline">maxrequests</span></tt>,
  	<tt><span style="text-decoration:underline">maxttl</span></tt>, <tt><span style="text-decoration:underline">maxidletime</span></tt>
  
  	Set or accesses properties of the interpreter class
  	<tt><span style="text-decoration:underline">classid</span></tt>.
  
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term">
  	      <span style="font-family:monospace"><b>web::interpclasscfg</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>classid</tt></i></span></tt>
  	      <tt><span style="text-decoration:underline">maxrequests</span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?
  	    </span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		gets or sets the maximum number of requests
  		interpreters of this class should handle. If
  		<tt><span style="text-decoration:underline">value</span></tt> is 0, handle an unlimited
  		number of requests. Default: 1.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::interpclasscfg</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>classid</tt></i></span></tt>
  	      <tt><span style="text-decoration:underline">maxttl</span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		gets or sets the maximum number of seconds
  		interpreters of this class should live. If
  		<tt><span style="text-decoration:underline">value</span></tt> is 0, it lives
  		forever. Default: 0.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::interpclasscfg</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>classid</tt></i></span></tt> <tt><span style="text-decoration:underline">maxidletime</span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?
  	    </span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		gets or sets the maximum number of seconds
  		interpreters of this class should live beeing idle. If
  		<tt><span style="text-decoration:underline">value</span></tt> is 0, no idle timeout is
  		assumed. Default: 0.
  	      </div></div></dd></dl></div><p style="width:90%">
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::interpcfg"></a>web::interpcfg</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::interpcfg</tt></span>  ?<tt><span style="text-decoration:underline"><i><tt>property</tt></i></span></tt>? ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?</span></div><p style="width:90%">
  
  	Properties are: <tt><span style="text-decoration:underline">numreq</span></tt>,
  	<tt><span style="text-decoration:underline">retire</span></tt>, <tt><span style="text-decoration:underline">starttime</span></tt>,
  	<tt><span style="text-decoration:underline">lastusedtime</span></tt>
  
  	Sets or accesses properties of the current interpreter.
  
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::interpcfg</b></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		    returns <tt><span style="text-decoration:underline">classid</span></tt> of current
  		    interpreter.
  		  </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::interpcfg</b></span>
  		  <tt><span style="text-decoration:underline">numreq</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		    gets the number of requests handled by this
  		    interpreter.
  		  </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::interpcfg</b></span>
  		  <tt><span style="text-decoration:underline">retire</span></tt>
  		  ?<tt><span style="text-decoration:underline">boolean</span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		    gets or sets the flag indicating this interpreter
  		    should be removed after handling the current request.
  		  </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::interpcfg</b></span>
  		  <tt><span style="text-decoration:underline">starttime</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		    returns the time in seconds since the epoch, this
  		    interpreter was started.
  		  </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::interpcfg</b></span>
  		  <tt><span style="text-decoration:underline">lastusedtime</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		    returns the time in seconds since the epoch, this
  		    interpreter was last used (starttime in case of first
  		    request).
  		  </div></div></dd></dl></div><p style="width:90%">
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::interpmap"></a>web::interpmap</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::interpmap</tt></span> <tt><span style="text-decoration:underline"><i><tt>filename</tt></i></span></tt></span></div><p style="width:90%">
  
  	Hook to define interpreter classes depending on the requested file.
  	Note that this hook must be defined in the Websh configuration file
  	(WebshConfig directive of mod_websh).
        </p><p style="width:90%">
  	When a request is directed to mod_websh, Websh needs to determine the
  	interpreter class for that reqest. It does that by calling
  	<span style="font-family:monospace"><b>web::interpmap</b></span> with the requested file as argument.
  	The return value of that command is the name of the interpreter class
  	and at the same time the filename of the script for this interpreter
  	class.
        </p><div class="section"><div class="titlepage"><div><h4 class="title"><a name="id5352675"></a>Example</h4></div></div><p style="width:90%">
  	  <pre style="background:#bbffbb ; width:75%" class="programlisting">
  	    proc web::interpmap {filename} {
  	    if {[string match &quot;/path/to/myApp&quot; $filename]} {
  	    # this is my special app
  	    return /real/path/to/myApp
  	    }
  	    if {[string match &quot;*.ws3&quot;]} {
  	    # scripts have their own interp class
  	    return $filename
  	    }
  	    # default: all templates are handled by my handler
  	    return /my/special/template/handler
  	    }
  	  </pre>
  	</p></div><p style="width:90%">
          The default implementation of web::interpmap is
  	<pre style="background:#bbffbb ; width:75%" class="programlisting">
  	  proc web::interpmap {filename} {return $filename}
  	</pre>
          which sets up a separate interpreter class for every requested URL
  	and takes the file itself as script.
        </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="inter-process_and_-system_communication.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="misc_commands.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Inter-process/-system communication�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Miscellaneous commands</td></tr></table></div></body></html>
  
  
  
  1.1                  tcl-site/websh/quickref/command_dispatching_and_session_management.html
  
  Index: command_dispatching_and_session_management.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>Command dispatching and session management</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="index.html" title="Websh Reference"><link rel="up" href="index.html" title="Websh Reference"><link rel="previous" href="configuration.html" title="Configuration"><link rel="next" href="request_data_handling.html" title="Request data handling"></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">Command dispatching and session management</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="configuration.html">Prev</a>�</td><th width="60%" align="center">�</th><td width="20%" align="right">�<a accesskey="n" href="request_data_handling.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear: both"><a name="command_dispatching_and_session_management"></a>Command dispatching and session management</h2></div></div><p style="width:90%">
        Websh provides a command dispatching mechanism to produce,
        for example, different HTML pages within one &quot;application&quot;,
        which is most likely one file on the file system. The name of
        the command to be used for a particular page is encoded in the
        querystring (see <span style="font-family:monospace"><b>web::cmdurl</b></span> for details on
        how to produce such querystrings).  Command dispatching is
        initiated with the command <span style="font-family:monospace"><b>web::dispatch</b></span>.
        Commands are defined with <span style="font-family:monospace"><b>web::command</b></span>.
      </p><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::command"></a>web::command</h3></div></div><p style="width:90%">
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::command</tt></span>  ?<tt><span style="text-decoration:underline"><i><tt>cmdName</tt></i></span></tt>? <tt><span style="text-decoration:underline"><i><tt>cmdBody</tt></i></span></tt></span></div><p style="width:90%">
  
  	Registers <tt><span style="text-decoration:underline">cmdBody</span></tt> as
  	<tt><span style="text-decoration:underline">cmdName</span></tt>. If <tt><span style="text-decoration:underline">cmdName</span></tt> is
  	omitted, &quot;default&quot; is used.
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::getcommand"></a>web::getcommand</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::getcommand</tt></span>  ?<tt><span style="text-decoration:underline"><i><tt>cmdName</tt></i></span></tt>?</span></div><p style="width:90%">
  
  	Retrieves the body of the command <tt><span style="text-decoration:underline">commandName</span></tt>
  	or of the command &quot;default&quot; if
  	<tt><span style="text-decoration:underline">cmdName</span></tt> is omitted.
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::cmdurl"></a>web::cmdurl</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::cmdurl</tt></span>  ?<tt><span style="text-decoration:underline"><i><tt>options</tt></i></span></tt>? <tt><span style="text-decoration:underline"><i><tt>cmdName</tt></i></span></tt> ?<tt><span style="text-decoration:underline"><i><tt>key-value-list</tt></i></span></tt>?</span></div><p style="width:90%">
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::cmdurl</tt></span>  ?<tt><span style="text-decoration:underline"><i><tt>options</tt></i></span></tt>? <tt><span style="text-decoration:underline"><i><tt>cmdName</tt></i></span></tt> ?<tt><span style="text-decoration:underline"><i><tt>k1 v1 ... kN vN</tt></i></span></tt>?</span></div><p style="width:90%">
        </p><p style="width:90%">
  	Options are: <tt><span style="text-decoration:underline">-notimestamp</span></tt>, and
  	<tt><span style="text-decoration:underline">-urlformat</span></tt>
        </p><p style="width:90%">
  	Generate URLs including querystring. By default, URLs are
  	self-referencing, but the exact output is subject to
  	configuration. The querystring is encrypted, using the
  	encryption method specified by configuration (see
  	<span style="font-family:monospace"><b>web::config</b></span>). If <tt><span style="text-decoration:underline">cmdName</span></tt>
  	is &quot;&quot;, no command parameter is produced in the query
  	string.
  
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-notimestamp</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		do not add a timestamp to the URL.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-urlformat</span></tt> <tt><span style="text-decoration:underline"><i><tt>list</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		specify what items will be used to format just this
  		URL.  Default is: <span style="font-family:monospace"><b>{scriptname pathinfo
  		  querystring}</b></span>.
  	      </div><div style="margin-bottom:6">
  		Note: Use <span style="font-family:monospace"><b>web::cmdurlcfg</b></span> to define the
  		url format for all URLs produced by
  		<span style="font-family:monospace"><b>web::cmdurl</b></span> in one request.
  	      </div><div style="margin-bottom:6">
  		<div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">scheme</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  			include the protocol, only &quot;http&quot;
  			and &quot;https&quot; are currently supported.
  		      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">host</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  			include the host name,
  			e.g. &quot;websh.com&quot;.
  		      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">port</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  			include the port,
  			e.g. &quot;80&quot;</div><div style="margin-bottom:6"> Trying to set
  			this item without host will throw an error.
  		      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">scriptname</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  			include scriptname,
  			e.g. &quot;/cgi-bin/orderbooks&quot;.
  		      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">pathinfo</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  			include pathinfo,
  			e.g. &quot;/merchants/shop1&quot;.
  		      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">querystring</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  			include the querystring,
  			e.g. &quot;select=download&quot;.
  		      </div></div></dd></dl></div>
  		<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p style="width:90%">
  		    Note that there are two more commands that control
  		    the output of <span style="font-family:monospace"><b>web::cmdurl</b></span>:
  		    <span style="font-family:monospace"><b>web::config</b></span> <tt><span style="text-decoration:underline">cmdparam</span></tt> and
  		    <span style="font-family:monospace"><b>web::config</b></span> <tt><span style="text-decoration:underline">timeparam</span></tt>.
  		  </p></div>
  	      </div></div></dd></dl></div><p style="width:90%">
        </p><div class="example"><p class="title"><b>Example 2. web::cmdurl</b></p><pre style="background:#bbffbb ; width:75%" class="programlisting">
  	  % web::cmdurl -notimestamp -urlformat [list scheme host scriptname pathinfo querystring] &quot;test&quot;
  	  http://websh.com/bin/returnmail/member?XDZuRD2rnsfHjFH
  	  %
  	</pre></div></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::cmdurlcfg"></a>web::cmdurlcfg</h3></div></div><p style="width:90%">
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::cmdurlcfg</tt></span>  ?<tt><span style="text-decoration:underline"><i><tt>options</tt></i></span></tt>? ?<tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt>? ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?</span></div><p style="width:90%">
        </p><p style="width:90%">
  	Command options are exactly like those of
  	<span style="font-family:monospace"><b>web::param</b></span>.
        </p><p style="width:90%">
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::cmdurlcfg</tt></span>  <tt><span style="text-decoration:underline"><i><tt>option</tt></i></span></tt> ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?</span></div><p style="width:90%">
        </p><p style="width:90%">
  	Options are <tt><span style="text-decoration:underline">-scheme</span></tt>,
  	<tt><span style="text-decoration:underline">-host</span></tt>, <tt><span style="text-decoration:underline">-port</span></tt>,
  	<tt><span style="text-decoration:underline">-scriptname</span></tt>,
  	<tt><span style="text-decoration:underline">-pathinfo</span></tt>,
  	<tt><span style="text-decoration:underline">-querystring</span></tt>,
  	<tt><span style="text-decoration:underline">-urlformat</span></tt></p><p style="width:90%"> If
  	<tt><span style="text-decoration:underline">value</span></tt> is omitted, the current value is
  	returned.  Otherwise, the <tt><span style="text-decoration:underline">value</span></tt> is stored.
  
  	Configuration for web::cmdurl.  This command serves two purposes:
  	</p><div class="orderedlist"><ol type="1"><li><div style="margin-bottom:6">management of static parameters</div></li><li><div style="margin-bottom:6">configuration for <span style="font-family:monospace"><b>web::cmdurl</b></span></div></li></ol></div><p style="width:90%">
  	By &quot;static parameters&quot;, we mean those which are set for every
  	page, instead of set on a per-page basis.
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="management_of_static_parameters"></a>Management of static parameters</h3></div></div><p style="width:90%">
  
  	In order to set, retrieve, append or unset static parameters,
  	use the syntax of the <span style="font-family:monospace"><b>web::param</b></span> command,
  	for example:
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::cmdurlcfg</b></span> -set
  	      <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		add the static parameter <tt><span style="text-decoration:underline">key</span></tt>.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::cmdurlcfg</b></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		returns a list of all known static parameters.
  	      </div></div></dd></dl></div><p style="width:90%">
  
        </p><p style="width:90%">
  	<span class="emphasis"><em>Important</em></span>: <span style="font-family:monospace"><b>web::cmdurl</b></span>
  	compares every key from the static parameters (see
  	<span style="font-family:monospace"><b>web::cmdurlcfg</b></span>) against the keys from the
  	command line. The static parameter is only used if there is no
  	parameter of the same name given on the command line.
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="configuration_for_web_cmdurl"></a>Configuration for <span style="font-family:monospace"><b>web::cmdurl</b></span></h3></div></div><p style="width:90%">
  
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-protocol</span></tt> ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		protocol to be used. Defaults to the scheme used to
  		access the page, which is overridden if the user gives
  		sets a value.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-servername</span></tt> ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		server name to be used. Default: taken from request.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-port</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		port number to be used. Default: 80.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-scriptname</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		name of CGI executable. Default: taken from request.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-pathinfo</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		path info (path after scriptname). Default: taken from
  		request.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-urlformat</span></tt> <tt><span style="text-decoration:underline"><i><tt>list</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		changes the urlformat permanently. See
  		<span style="font-family:monospace"><b>web::cmdurl</b></span> for the description of
  		this option.
  	      </div></div></dd></dl></div><p style="width:90%">
  
  	In all cases, &quot;web::cmdurlcfg -option
  	<tt><span style="text-decoration:underline">value</span></tt>&quot; sets the value of the given
  	option and returns the value that was used before the change,
  	while &quot;web::cmdurlcfg -option&quot; returns the current
  	value.  If no value has been set using web::cmdurlcfg, but is
  	requested for the URL generation, the value from the request
  	will be used.  This value, however, can not be retrieved using
  	web::cmdurlcfg.
  
        </p><p style="width:90%">
  	Note that setting a value to an empty string amounts to
  	<span style="font-family:monospace"><b>unset</b></span>.
  
  	<span class="emphasis"><em>Note also</em></span>: web::cmdurl compares every key
  	from the static parameters see --&gt;(web::cmdurlcfg) against
  	the keys from the command line. The static parameter is only
  	used if there is no such parameter on the command line.
  
        </p><div class="example"><p class="title"><b>Example 3. web::cmdurl</b></p><pre style="background:#bbffbb ; width:75%" class="programlisting">
  	  % web::cmdurl &quot;&quot;
  	  ?XDqPtk34XvyPh41gUBo
  	  % web::cmdurlcfg -scriptname bin/test_script
  	  % web::cmdurl &quot;&quot;
  	  bin/test_script?XDqPtk34XvyPh41gUBo
  	  % web::cmdurlcfg -scriptname &quot;&quot;
  	  % web::cmdurl &quot;&quot;
  	  ?XDqPtk34XvyPh41gUBo
  	  %
  	</pre></div></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::dispatch"></a>web::dispatch</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::dispatch</tt></span>  ?<tt><span style="text-decoration:underline"><i><tt>options</tt></i></span></tt>?</span></div><p style="width:90%">
  
  	Options are: <tt><span style="text-decoration:underline">-cmd</span></tt>,
  	<tt><span style="text-decoration:underline">-querystring</span></tt>, <tt><span style="text-decoration:underline">-postdata</span></tt>,
  	<tt><span style="text-decoration:underline">-track</span></tt> and <tt><span style="text-decoration:underline">-hook</span></tt>.
        </p>
        Parse information and call a command.
        <p style="width:90%">
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-cmd</span></tt> <tt><span style="text-decoration:underline"><i><tt>cmdName</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		switch into command <tt><span style="text-decoration:underline">cmdName</span></tt>. If
  		<tt><span style="text-decoration:underline">cmdName</span></tt> is an empty string, no
  		command is called. By default,
  		<tt><span style="text-decoration:underline">cmdName</span></tt> is taken from the
  		querystring.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-querystring</span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>string</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		parse <tt><span style="text-decoration:underline">string</span></tt> as the querystring. If
  		<tt><span style="text-decoration:underline">string</span></tt> is an empty string,
  		querystring parsing is turned off. By default,
  		querystring is taken from the request data (CGI
  		environment or apache module request object).
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-postdata</span></tt> <tt><span style="text-decoration:underline"><i><tt>string</tt></i></span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>content_type</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		parse <tt><span style="text-decoration:underline">string</span></tt> as POST data input with
  		type <tt><span style="text-decoration:underline">content_type</span></tt>.
  		<tt><span style="text-decoration:underline">content_type</span></tt> can be <tt>application/x-www-form-urlencoded</tt>
  		or <tt>multipart/form-data;
  		  boundary=xxx</tt>. In the second case,
  		<tt><span style="text-decoration:underline">content-type</span></tt> must specify the
  		boundary as well. By default, POST data is taken from
  		the request data.</div><div style="margin-bottom:6"> If
  		<tt><span style="text-decoration:underline">string</span></tt> is an empty string, postdata
  		parsing is turned off.</div><div style="margin-bottom:6"> Default for
  		<tt><span style="text-decoration:underline">content_type</span></tt> is
  		&quot;application/x-www-form-urlencoded&quot;.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term">
  	      <tt><span style="text-decoration:underline">-postdata</span></tt> <tt><span style="text-decoration:underline"><i><tt>channelName</tt></i></span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>content_length</tt></i></span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>content_type</tt></i></span></tt>
  	    </span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		As above, but reads the POST data from channel
  		<tt><span style="text-decoration:underline">channelName</span></tt>.
  	      </div><div style="margin-bottom:6">
  		Use the keyword <tt>end</tt> for
  		<tt><span style="text-decoration:underline">content_length</span></tt> to indicate that
  		Websh should read all content.</div><div style="margin-bottom:6">
  		Examples for <tt><span style="text-decoration:underline">content_type</span></tt> include:
  		<div class="itemizedlist"><ul type="disc"><li><div style="margin-bottom:6"><tt>multipart/form-data; boundary=xxxx</tt></div></li><li><div style="margin-bottom:6"><tt>application/x-www-form-urlencoded</tt></div></li></ul></div>
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-track</span></tt> <tt><span style="text-decoration:underline"><i><tt>paramKeyList</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		Track a parameter: register it as &quot;static&quot;
  		for the generation of URLs with web::cmdurl. Thus,
  		each parameter with the key in
  		<tt><span style="text-decoration:underline">paramKeyList</span></tt> will be repeated in
  		every URL generated with web::cmdurl. See the
  		documentation of <span style="font-family:monospace"><b>web::cmdurl</b></span> for
  		details.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-hook</span></tt> <tt><span style="text-decoration:underline"><i><tt>code</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		Causes web::dispatch to eval <tt><span style="text-decoration:underline">code</span></tt>
  		just before the command (from any source) is
  		evaluated. When <tt><span style="text-decoration:underline">code</span></tt> is evaluated,
  		the full request information has been parsed.  That
  		is, web::param, web::formvar etc. will have up-to-date
  		information when <tt><span style="text-decoration:underline">code</span></tt> is evaluated.
  	      </div></div></dd></dl></div><p style="width:90%">
  
  	<span class="emphasis"><em>Note</em></span> that, if no command is passed to
  	web::dispatch either in the querystring or with the
  	<tt><span style="text-decoration:underline">-cmd</span></tt> option, web::dispatch will call the
  	command &quot;default&quot;.
  
        </p><div class="example"><p class="title"><b>Example 4. web::command and web::dispatch</b></p><pre style="background:#bbffbb ; width:75%" class="programlisting">
  	  % set tst {puts &quot;On the hook&quot;}
  	  puts &quot;On the hook&quot;
  	  % web::command acmd {puts &quot;this is acmd&quot;}
  	  % web::dispatch -cmd acmd -querystring &quot;&quot; -postdata &quot;&quot;
  	  this is acmd
  	  % web::dispatch -cmd acmd -querystring &quot;&quot; -postdata &quot;&quot; -hook $tst
  	  On the hook
  	  this is acmd
  	  %
  	</pre></div></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="session_management"></a>Session management</h3></div></div><p style="width:90%">
  	Websh session management consits of two parts:
  	</p><div class="itemizedlist"><ul type="disc"><li><div style="margin-bottom:6">session id tracking</div></li><li><div style="margin-bottom:6">session context management</div></li></ul></div><p style="width:90%">
        </p><p style="width:90%">
  	Session context managers are described in detail below
  	(<span style="font-family:monospace"><b>web::filecontext</b></span>,
  	<span style="font-family:monospace"><b>web::cookiecontext</b></span>). Session id tracking is
  	managed by <span style="font-family:monospace"><b>web::dispatch -track</b></span>. The two
  	parts are connected with the <tt><span style="text-decoration:underline">-attachto</span></tt> option
  	of the session context manager.  The control is as follows:
        </p><p style="width:90%">
  	</p><div class="itemizedlist"><ul type="disc"><li><div style="margin-bottom:6">
  	      A user uses the Websh script for the first
  	      time.<span style="font-family:monospace"><b>web::dispatch -track</b></span> will not
  	      see any session id, and, consequently, not set the
  	      static parameter <tt>id</tt>.
  	    </div></li><li><div style="margin-bottom:6">
  	      Within the application, the session is initialized using
  	      <span style="font-family:monospace"><b>mgr::init</b></span>. <span style="font-family:monospace"><b>init</b></span>
  	      will find no static parameter <tt>id</tt> (which has been specified at
  	      creation time of the session manager using the
  	      <tt><span style="text-decoration:underline">-attachto</span></tt> option).  Now, it tries to
  	      create a new session id. This will be possible if a
  	      session id generator has been specified when the manager
  	      was created using the <tt><span style="text-decoration:underline">-idgen</span></tt> option.
  	      From now, on the session id will be a static parameter,
  	      and will therefore be present in every URL generated
  	      with <span style="font-family:monospace"><b>web::cmdurl</b></span>.
  	    </div></li><li><div style="margin-bottom:6">
  	      The next time the user visits the Websh application
  	      using one of these URLs,
  	      <span style="font-family:monospace"><b>web::dispatch</b></span> will detect the
  	      session id, and <span style="font-family:monospace"><b>mgr::init</b></span> will directly load
  	      the corresponding session context without generating a
  	      new session id.
  	    </div></li></ul></div><p style="width:90%">
        </p></div><div class="section"><div class="titlepage"></div><p style="width:90%">
  	Examples:
  
  	See <a href="http://tcl.apache.org/websh/examples.ws3" target="_top">http://tcl.apache.org/websh/examples.ws3</a>
  	for several sample application demonstrating Websh's
  	session management facilities.
  
        </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="configuration.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="request_data_handling.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Configuration�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Request data handling</td></tr></table></div></body></html>
  
  
  
  1.1                  tcl-site/websh/quickref/configuration.html
  
  Index: configuration.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>Configuration</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="index.html" title="Websh Reference"><link rel="up" href="index.html" title="Websh Reference"><link rel="previous" href="index.html" title="Websh Reference"><link rel="next" href="command_dispatching_and_session_management.html" title="Command dispatching and session management"></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">Configuration</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a>�</td><th width="60%" align="center">�</th><td width="20%" align="right">�<a accesskey="n" href="command_dispatching_and_session_management.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear: both"><a name="configuration"></a>Configuration</h2></div></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::config"></a>web::config</h3></div></div><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::config</tt></span>  <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt> ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?</span></div><p style="width:90%">
  	If <tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt> is
  	ommitted, the current value of
  	<tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt> is returned.
        </p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">uploadfilesize</span></tt>
  	    ?<tt><span style="text-decoration:underline"><i><tt>size</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  	      Sets the maximum number of bytes allowed to be uploaded.
  	      Default: 0.
  	    </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">cmdparam</span></tt> ?<tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  	      Name of the <span style="font-family:monospace"><b>web::command</b></span> parameter in
  	      the URL. Default: &quot;cmd&quot;.
  	    </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">timeparam</span></tt> ?<tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  	      Name of the timestamp parameter in the URL. Default:
  	      &quot;t&quot;.
  	    </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">logsubst</span></tt> ?<tt><span style="text-decoration:underline">boolean</span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  	      Turns substitution of log messages on or off. Default:
  	      off.
  	    </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">putxmarkup</span></tt>
  	    ?<tt><span style="text-decoration:underline">brace|tag</span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  	      Sets the markup characters for sections to be eval'd in
  	      web::putx and web::putxfile commands to either curly
  	      braces ({ ... }) or special tags (&lt;?
  	      ... ?&gt;). Please note that when using the tags &lt;?
  	      ?&gt;, they cannot be nested. Default: brace.
  	    </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">version</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  	      Returns the version info string.
  	    </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">copyright</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  	      Returns a copyright message string.
  	    </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">encryptchain</span></tt> ?<tt><span style="text-decoration:underline"><i><tt>list</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  	      defines which commands should be tried, in sequence, to
  	      encrypt a message. Default: &quot;web::encryptd&quot;.
  	    </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">decryptchain</span></tt> ?<tt><span style="text-decoration:underline"><i><tt>list</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  	      defines which commands should be tried, in sequence, to
  	      decrypt a message. Default: &quot;web::decryptd&quot;.
  	    </div></div></dd></dl></div></div><div class="example"><p class="title"><b>Example 1. web::config</b></p><pre style="background:#bbffbb ; width:75%" class="programlisting">
  	% web::config decryptchain
  	web::encryptd
  	%
        </pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.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="command_dispatching_and_session_management.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Websh Reference�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Command dispatching and session management</td></tr></table></div></body></html>
  
  
  
  1.1                  tcl-site/websh/quickref/context_handling.html
  
  Index: context_handling.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>Context handling</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="index.html" title="Websh Reference"><link rel="up" href="index.html" title="Websh Reference"><link rel="previous" href="logging.html" title="Logging"><link rel="next" href="file_handling_and_file_IO.html" title="File handling and file I/O"></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">Context handling</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="logging.html">Prev</a>�</td><th width="60%" align="center">�</th><td width="20%" align="right">�<a accesskey="n" href="file_handling_and_file_IO.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear: both"><a name="context_handling"></a>Context handling</h2></div></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::context"></a>web::context</h3></div></div><p style="width:90%">
  	Creation
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::context</tt></span>  <tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt></span></div><p style="width:90%">
  	Creates a namespace <tt><span style="text-decoration:underline">name</span></tt> with the following
  	commands:
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt><i><tt>name</tt></i>::subcommand</tt></span>  <tt><span style="text-decoration:underline"><i><tt>args</tt></i></span></tt></span></div><p style="width:90%">
  
  	Subcommands are: <tt><span style="text-decoration:underline">cset</span></tt>,
  	<tt><span style="text-decoration:underline">cappend</span></tt>, <tt><span style="text-decoration:underline">clappend</span></tt>,
  	<tt><span style="text-decoration:underline">cget</span></tt>, <tt><span style="text-decoration:underline">cexists</span></tt>,
  	<tt><span style="text-decoration:underline">cunset</span></tt>, <tt><span style="text-decoration:underline">carray</span></tt>,
  	<tt><span style="text-decoration:underline">cnames</span></tt>, and <tt><span style="text-decoration:underline">dump</span></tt>.
  
  	Manages data of the context. The subcommands behave like the
  	Tcl commands with similar names.
  
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::cset</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt> <tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		store <tt><span style="text-decoration:underline">value</span></tt>.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::cappend</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt> <tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?
  	      ?<tt><span style="text-decoration:underline"><i><tt>...</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		append <tt><span style="text-decoration:underline">value</span></tt> to existing value for
  		<tt><span style="text-decoration:underline">key</span></tt>.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::clappend</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt> <tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?
  	      ?<tt><span style="text-decoration:underline"><i><tt>...</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		append <tt><span style="text-decoration:underline">value</span></tt> to existing list of
  		values for <tt><span style="text-decoration:underline">key</span></tt>.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::cget</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>default</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		access the value for key <tt><span style="text-decoration:underline">key</span></tt>, or
  		return <tt><span style="text-decoration:underline">default</span></tt> if
  		<tt><span style="text-decoration:underline">key</span></tt> does not exist in the context. If
  		<tt><span style="text-decoration:underline">default</span></tt> is omitted, an empty string
  		is returned if <tt><span style="text-decoration:underline">key</span></tt> is unknown.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::cexists</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		returns true (1) if <tt><span style="text-decoration:underline">key</span></tt> exists in
  		context, false (0) otherwise.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::cunset</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		remove <tt><span style="text-decoration:underline">key</span></tt> from context.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::carray</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>option</tt></i></span></tt> <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>arg</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		array manipulation as known from the Tcl command
  		<span class="emphasis"><em>array</em></span>.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::cnames</b></span>
  	      ?<tt><span style="text-decoration:underline"><i><tt>pattern</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		lists existing keys of context matching
  		<tt><span style="text-decoration:underline">pattern</span></tt>.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::dump</b></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		serialize context.
  	      </div></div></dd></dl></div><p style="width:90%">
  
  	</p><div class="example"><p class="title"><b>Example 8. web::context</b></p><pre style="background:#bbffbb ; width:75%" class="programlisting">
  	    % web::context sc
  	    % sc::cset lang FR
  	    FR
  	    % # ... some code ...
  	    % set lang [sc::cget lang EN]
  	    FR
  	    %
  	  </pre></div><p style="width:90%">
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::filecontext"></a>web::filecontext</h3></div></div><p style="width:90%">
  
  	Creation:
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::filecontext</tt></span>  <tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt> ?<tt><span style="text-decoration:underline"><i><tt>options</tt></i></span></tt>?</span></div><p style="width:90%">
  
  	Options are: <tt><span style="text-decoration:underline">-perm</span></tt>, <tt><span style="text-decoration:underline">-path</span></tt>,
  	<tt><span style="text-decoration:underline">-crypt</span></tt>, <tt><span style="text-decoration:underline">-idgen</span></tt>, and
  	<tt><span style="text-decoration:underline">-attachto</span></tt>.
  
  	Creates a namespace <tt><span style="text-decoration:underline">name</span></tt> to manage file-based
  	context data:
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt><i><tt>name</tt></i>::subcommand</tt></span>  <tt><span style="text-decoration:underline"><i><tt>args</tt></i></span></tt></span></div><p style="width:90%">
  
  	Subcommands are: <tt><span style="text-decoration:underline">cset</span></tt>,
  	<tt><span style="text-decoration:underline">cappend</span></tt>, <tt><span style="text-decoration:underline">clappend</span></tt>,
  	<tt><span style="text-decoration:underline">cget</span></tt>, <tt><span style="text-decoration:underline">cexists</span></tt>,
  	<tt><span style="text-decoration:underline">cunset</span></tt>, <tt><span style="text-decoration:underline">carray</span></tt>,
  	<tt><span style="text-decoration:underline">cnames</span></tt>, <tt><span style="text-decoration:underline">init</span></tt>,
  	<tt><span style="text-decoration:underline">new</span></tt>, <tt><span style="text-decoration:underline">commit</span></tt>,
  	<tt><span style="text-decoration:underline">invalidate</span></tt>, and <tt><span style="text-decoration:underline">id</span></tt>.
  
  	Manages file-based context data. The subcommands have their
  	familiar behaviour of the Tcl commands with similar
  	names. Please refer to the section <a href="context_handling.html#context_handling" title="Context handling">context management</a> for a
  	description of the commands <tt><span style="text-decoration:underline">cset</span></tt>,
  	<tt><span style="text-decoration:underline">cappend</span></tt>, <tt><span style="text-decoration:underline">clappend</span></tt>,
  	<tt><span style="text-decoration:underline">cget</span></tt>, <tt><span style="text-decoration:underline">cexists</span></tt>,
  	<tt><span style="text-decoration:underline">cunset</span></tt>, <tt><span style="text-decoration:underline">carray</span></tt>, and
  	<tt><span style="text-decoration:underline">cnames</span></tt>.
  
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term">
  	      <span style="font-family:monospace"><b><i><tt>name</tt></i>::init</b></span>
  	      ?<tt><span style="text-decoration:underline"><i><tt>id</tt></i></span></tt>?
  	    </span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		load an existing session context with id
  		<tt><span style="text-decoration:underline">id</span></tt>, or create a new one, if
  		possible. Automation depends on the settings of the
  		actual context manager settings, see
  		below.</div><div style="margin-bottom:6"> If you specify an
  		<tt><span style="text-decoration:underline">id</span></tt>, you must decide when to create a
  		new file and when to use the old one, if any, by
  		yourself.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::new</b></span>
  	      ?<tt><span style="text-decoration:underline"><i><tt>id</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		create a new session context. Automation depends on
  		the settings of the actual context manager settings,
  		see below.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::commit</b></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		make session context persistent.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::id</b></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		return id of session.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::invalidate</b></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		delete session in memory and on file system.
  	      </div></div></dd></dl></div><p style="width:90%">
  
  	Options:
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::filecontext</tt></span>  <tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt> <tt><span style="text-decoration:underline">-perm</span></tt> <tt><span style="text-decoration:underline"><i><tt>perm</tt></i></span></tt></span></div><p style="width:90%">
  
  	set the file permissions of the session context files
  	<tt><span style="text-decoration:underline">perm</span></tt> is an unix-like octal value like 0644.
  
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::filecontext</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt> <tt><span style="text-decoration:underline">-path</span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>path</tt></i></span></tt>
  	    </span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		specify where to store session context files and how
  		to name them. Suppose that the session id is 99.
  		<span class="emphasis"><em>-path [file join .. data s%d.dat]</em></span>
  		would then cause filecontext to save the session
  		context as <tt>../data/s99.dat</tt>.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::filecontext</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt> <tt><span style="text-decoration:underline">-crypt</span></tt>
  	      <tt><span style="text-decoration:underline">boolean</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		Flag to turn crypting of session context on and off.
  		Default is on.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::filecontext</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt> <tt><span style="text-decoration:underline">-idgen</span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>idgen</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		Sets command <tt><span style="text-decoration:underline">idgen</span></tt> to find a new
  		session id. See doc of
  		<span style="font-family:monospace"><b>web::filecounter</b></span> below for an
  		implementation provided with Websh.
  	      </div><div style="margin-bottom:6">
  		<tt><span style="text-decoration:underline">idgen</span></tt> is used in case that no
  		<tt><span style="text-decoration:underline">id</span></tt> argument has been passed to
  		<tt><span style="text-decoration:underline">init</span></tt> or <tt><span style="text-decoration:underline">new</span></tt>.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::filecontext</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt> <tt><span style="text-decoration:underline">-attachto</span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>idparam</tt></i></span></tt>
  	    </span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		the next using the querystring (this is one reason why
  		the querystring is encrypted). After web::dispatch has
  		parsed the querystring, web::param will report the
  		current session id, if any. <span class="emphasis"><em>Note</em></span>
  		that you can maintain several sessions in parallel,
  		and attach every session to its own
  		<tt><span style="text-decoration:underline">idparam</span></tt>.
  	      </div><div style="margin-bottom:6">
  		Using <span class="emphasis"><em>web::dispatch -track</em></span>
  		further automates the passing of session ids from
  		request to request.
  	      </div></div></dd></dl></div><p style="width:90%">
  
  	<span class="emphasis"><em>Note:</em></span> Whenever you create a new
  	file-based context, the context is initialized and you loose
  	whatever information that you might have stored in the context
  	before you initialized it as a file-based session context.
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::cookiecontext"></a>web::cookiecontext</h3></div></div><p style="width:90%">
  
  	Creation:
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::cookiecontext</tt></span>  <tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt> ?<tt><span style="text-decoration:underline"><i><tt>options</tt></i></span></tt>?</span></div><p style="width:90%">
  
  	Options are: <tt><span style="text-decoration:underline">-expires</span></tt>,
  	<tt><span style="text-decoration:underline">-path</span></tt>, <tt><span style="text-decoration:underline">-domain</span></tt>,
  	<tt><span style="text-decoration:underline">-secure</span></tt>, <tt><span style="text-decoration:underline">-crypt</span></tt>, and
  	<tt><span style="text-decoration:underline">-channel</span></tt>.
  
  	Creates a namespace <tt><span style="text-decoration:underline">name</span></tt> to manage
  	cookie-based context data:
  
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		<span style="font-family:monospace"><b><i><tt>name</tt></i>::subcommand</b></span>
  		<tt><span style="text-decoration:underline"><i><tt>args</tt></i></span></tt></div><div style="margin-bottom:6">
  		Subcommands are: <tt><span style="text-decoration:underline">cset</span></tt>,
  		<tt><span style="text-decoration:underline">cappend</span></tt>, <tt><span style="text-decoration:underline">clappend</span></tt>,
  		<tt><span style="text-decoration:underline">cget</span></tt>, <tt><span style="text-decoration:underline">cexists</span></tt>,
  		<tt><span style="text-decoration:underline">cunset</span></tt>, <tt><span style="text-decoration:underline">carray</span></tt>,
  		<tt><span style="text-decoration:underline">cnames</span></tt>, <tt><span style="text-decoration:underline">init</span></tt>,
  		<tt><span style="text-decoration:underline">new</span></tt>, <tt><span style="text-decoration:underline">commit</span></tt>,
  		<tt><span style="text-decoration:underline">invalidate</span></tt>, and <tt><span style="text-decoration:underline">id</span></tt>.
  	      </div></div></dd></dl></div><p style="width:90%">
  
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::init</b></span>
  	      ?<tt><span style="text-decoration:underline"><i><tt>id</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		load an existing session context (cookie must have
  		been sent by the client).
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::new</b></span>
  	      ?<tt><span style="text-decoration:underline"><i><tt>id</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		create a new session context.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::commit</b></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		send a cookie.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::id</b></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		return id of session.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b><i><tt>name</tt></i>::invalidate</b></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		delete session in memory and on client side.
  	      </div></div></dd></dl></div><p style="width:90%">
  
  	Options:
  
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::cookiecontext</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt> <tt><span style="text-decoration:underline">-expires</span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>time</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		set the expiration date of the cookie. Possible values
  		for <tt><span style="text-decoration:underline">time</span></tt> are <span class="emphasis"><em>day</em></span>
  		(lifetime: one day), <span class="emphasis"><em>week</em></span>,
  		<span class="emphasis"><em>today</em></span>,
  		<span class="emphasis"><em>seconds</em></span> (time in seconds since
  		1-1-1970) or <span class="emphasis"><em>date-string</em></span>.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::cookiecontext</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt> <tt><span style="text-decoration:underline">-path</span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>path</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		set the <tt><span style="text-decoration:underline">path</span></tt> property of the cookie.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::cookiecontext</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt> <tt><span style="text-decoration:underline">-domain</span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>domain</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		set the <tt><span style="text-decoration:underline">domain</span></tt> property of the cookie.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::cookiecontext</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt>
  	      <tt><span style="text-decoration:underline">-secure</span></tt> <tt><span style="text-decoration:underline">boolean</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		set the <tt><span style="text-decoration:underline">secure</span></tt> property of the cookie.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::cookiecontext</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt> <tt><span style="text-decoration:underline">-crypt</span></tt>
  	      <tt><span style="text-decoration:underline">boolean</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		Flag to turn crypting of cookie context on and off.
  		Default is on.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::cookiecontext</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt> <tt><span style="text-decoration:underline">-channel</span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>channelName</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		The response object to send the cookie to (see also
  		<span style="font-family:monospace"><b>web::response</b></span>).
  	      </div></div></dd></dl></div><p style="width:90%">
  
  	Because cookies are client-based, in principle no id is
  	needed. Websh uses <tt><span style="text-decoration:underline">id</span></tt> to name the cookie,
  	however, and the <span style="font-family:monospace"><b>new</b></span>,
  	<span style="font-family:monospace"><b>init</b></span>, and <span style="font-family:monospace"><b>load</b></span> commands
  	still require the <tt><span style="text-decoration:underline">id</span></tt> argument. (fixme: any
  	changes?) Please note that property settings of a cookie
  	context can only be changed <span class="emphasis"><em>before</em></span>
  	anything is output on the respective channel.
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::filecounter"></a>web::filecounter</h3></div></div><p style="width:90%">
  
  	This is a numeric sequence-number generator which stores its
  	state in a file. Basic usage:
  
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term">Creation:</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		<span style="font-family:monospace"><b>web::filecounter</b></span>
  		<tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt> <tt><span style="text-decoration:underline">-filename</span></tt>
  		<tt><span style="text-decoration:underline"><i><tt>fname</tt></i></span></tt>
  		?<tt><span style="text-decoration:underline"><i><tt>options</tt></i></span></tt>?
  	      </div><div style="margin-bottom:6">
  		Options are: <tt><span style="text-decoration:underline">-min</span></tt>,
  		<tt><span style="text-decoration:underline">-max</span></tt>, <tt><span style="text-decoration:underline">-seed</span></tt>,
  		<tt><span style="text-decoration:underline">-incr</span></tt>, <tt><span style="text-decoration:underline">-mask</span></tt>,
  		<tt><span style="text-decoration:underline">-wrap</span></tt>
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-filename</span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>filename</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		uses <tt><span style="text-decoration:underline">filename</span></tt> to store the current
  		value (no default)
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-min</span></tt> <tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		uses this value as a minimum at start and after wrap,
  		if wrap is true (default is 0).
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-max</span></tt> <tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		uses this value as a maximum, if wrap is true (default is 2147483647).
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-seed</span></tt> <tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		if persistent file does not yet exists, use this value
  		as a starting point (default is 0).
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-incr</span></tt> <tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		uses this value as an increment for each 'nextval'
  		(default is 1).
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-perms</span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		sets the permissions on the newly created files
  		(default is 0644).
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline">-wrap</span></tt>
  	      <tt><span style="text-decoration:underline">boolean</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		indicates whether this counter should wrap around its
  		values (from min to max) (default is false).
  	      </div></div></dd></dl></div><p style="width:90%">
  
  	After creation, a new command <tt><span style="text-decoration:underline">name</span></tt> is
  	registered with the following two subcommands:
  
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt> nextval</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		return the next value.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt> curval</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		return the current value, that is, the value that the
  		last call to &quot;nextval&quot; reported (as opposed
  		to the current value in the file).
  	      </div></div></dd></dl></div><p style="width:90%">
  
        </p><div class="example"><p class="title"><b>Example 9. web::filecounter</b></p><pre style="background:#bbffbb ; width:75%" class="programlisting">
  	  % web::filecounter handleName -filename &quot;test.dat&quot;
  	  handleName
  	  % # from now on, use handleName &lt;curval|nextval|config&gt;
  	  % handleName config
  	  file test.dat handle handleName seed 0 min 0 max 2147483647 incr 1 wrap false curr {not valid}
  	  % web::filecounter otherHandleName -filename &quot;othertest.dat&quot; -min 1 -max 10 -seed 1 -incr 2 -wrap 1
  	  otherHandleName
  	  % otherHandleName config
  	  file othertest.dat handle otherHandleName seed 1 min 1 max 10 incr 2 wrap true curr {not valid}
  	  %
  	</pre></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="logging.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="file_handling_and_file_IO.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Logging�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�File handling and file I/O</td></tr></table></div></body></html>
  
  
  
  1.1                  tcl-site/websh/quickref/data_encryption.html
  
  Index: data_encryption.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>Data encryption</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="index.html" title="Websh Reference"><link rel="up" href="index.html" title="Websh Reference"><link rel="previous" href="file_handling_and_file_IO.html" title="File handling and file I/O"><link rel="next" href="uri-html-_en-decoding.html" title="Uri-/html- en-/decoding"></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">Data encryption</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="file_handling_and_file_IO.html">Prev</a>�</td><th width="60%" align="center">�</th><td width="20%" align="right">�<a accesskey="n" href="uri-html-_en-decoding.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear: both"><a name="data_encryption"></a>Data encryption</h2></div></div><p style="width:90%">
        Encrypt (<span style="font-family:monospace"><b>web::encrypt</b></span>) and decrypt
        (<span style="font-family:monospace"><b>web::decrypt</b></span>) data. By default, the
        built-in, weak encryption is used. encryption is extensible by
        plug-Ins.  The encryption module tries all plug-Ins from a list
        until the first plug-In was able to en-/decrypt the input.  See
        <span style="font-family:monospace"><b>web::config</b></span> for the configuration of the
        plug-Ins to be used.
      </p><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::encrypt"></a>web::encrypt</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::encrypt</tt></span>  <tt><span style="text-decoration:underline"><i><tt>data</tt></i></span></tt></span></div><p style="width:90%">
  	Returns encrypted data.
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::decrypt"></a>web::decrypt</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::decrypt</tt></span>  <tt><span style="text-decoration:underline"><i><tt>data</tt></i></span></tt></span></div><p style="width:90%">
  
  	Returns decrypted data.
  
  	</p><div class="example"><p class="title"><b>Example 11. web::encrypt</b></p><pre style="background:#bbffbb ; width:75%" class="programlisting">
  	    % web::encrypt &quot;Hello, world!&quot;
  	    XDIVAhkgkxRjcfA7UTwpD7
  	    % web::decrypt [web::encrypt &quot;Hello, world!&quot;]
  	    Hello, world!
  	    %
  	  </pre></div><p style="width:90%">
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="encryption_plug-in_D"></a>Encryption plug-in D</h3></div></div><p style="width:90%">
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::encryptd"></a>web::encryptd</h3></div></div><p style="width:90%">
  
  	By default, Websh uses this plug-In for weak data
  	encryption for encryption (<span style="font-family:monospace"><b>web::encryptd</b></span>)
  	and decryption (<span style="font-family:monospace"><b>web::decryptd</b></span>).  The
  	encryption key is managed with
  	<span style="font-family:monospace"><b>web::crpytdkey</b></span>.
  
        </p><p style="width:90%">
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::encryptd</tt></span>  <tt><span style="text-decoration:underline"><i><tt>data</tt></i></span></tt></span></div><p style="width:90%">
  
  	Returns encrypted  <tt><span style="text-decoration:underline"><i><tt>data</tt></i></span></tt>.
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::decryptd"></a>web::decryptd</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::decryptd</tt></span>  <tt><span style="text-decoration:underline"><i><tt>data</tt></i></span></tt></span></div><p style="width:90%">
  
  	Returns decrypted  <tt><span style="text-decoration:underline"><i><tt>data</tt></i></span></tt>.
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::cryptdkey"></a>web::cryptdkey</h3></div></div><p style="width:90%">
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::cryptdkey</tt></span>  ?<tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt>?</span></div><p style="width:90%">
  
  	Sets the new key for encryption. If no argument is given,
  	resets to the default key. This command does not return the
  	currently active key, in difference to other configuration
  	commands of Websh.
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="encryption_plug-in_interface_"></a>Encryption plug-in interface</h3></div></div><p style="width:90%">
  	<span class="emphasis"><em>For plug-in developers only</em></span>
        </p><p style="width:90%">
  	The encryption plug-in is required to implement the interface
  	described below (note that to activate your plugin, use <span style="font-family:monospace"><b>web::config encryptchain</b></span> and <span style="font-family:monospace"><b>web::config decryptchain</b></span> respectively):
  	</p><div class="itemizedlist"><ul type="disc"><li><div style="margin-bottom:6">
  	      <span style="font-family:monospace"><b>web::yourencrypt</b></span> accepts one argument
  	      web::yourencrypt takes a string as input and generates a
  	      string which must be URI compliant.
  	    </div></li><li><div style="margin-bottom:6">
  	      <span style="font-family:monospace"><b>web::yourdecrypt</b></span> accepts one argument
  	      web::yourdecrypt takes a string as input and returns a
  	      string.
  	    </div></li><li><div style="margin-bottom:6">symmetry: <span class="emphasis"><em><span style="font-family:monospace"><b>$in ==
  		  [web::yourdecrypt [web::yourencrypt
  		  $in]]</b></span></em></span>
  	    </div></li><li><div style="margin-bottom:6">
  	      error messaging: <span class="emphasis"><em>TCL_OK</em></span> for
  	      success. <span class="emphasis"><em>TCL_ERROR</em></span> for any error
  	      during en-/decryption. <span class="emphasis"><em>TCL_CONTINUE</em></span>
  	      for unknown encryption type (pass on to next method).
  	    </div></li></ul></div><p style="width:90%">
        </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="file_handling_and_file_IO.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="uri-html-_en-decoding.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">File handling and file I/O�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Uri-/html- en-/decoding</td></tr></table></div></body></html>
  
  
  
  1.1                  tcl-site/websh/quickref/file_handling_and_file_IO.html
  
  Index: file_handling_and_file_IO.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>File handling and file I/O</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="index.html" title="Websh Reference"><link rel="up" href="index.html" title="Websh Reference"><link rel="previous" href="context_handling.html" title="Context handling"><link rel="next" href="data_encryption.html" title="Data encryption"></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">File handling and file I/O</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="context_handling.html">Prev</a>�</td><th width="60%" align="center">�</th><td width="20%" align="right">�<a accesskey="n" href="data_encryption.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear: both"><a name="file_handling_and_file_IO"></a>File handling and file I/O</h2></div></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::include"></a>web::include</h3></div></div><p style="width:90%">
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web_include</tt></span>  <tt><span style="text-decoration:underline"><i><tt>fileName</tt></i></span></tt> ?<tt><span style="text-decoration:underline"><i><tt>msg</tt></i></span></tt>?</span></div><p style="width:90%">
  
  	If the file <tt><span style="text-decoration:underline">fileName</span></tt> exists, it is sourced (must be a
  	script). Otherwise if the library fileName+&quot;shared lib extension&quot;
  	exists, it is loaded (must be a shared library). Returns 0 on success,
  	1 otherwise. If an error occurs, an error message is written to <tt><span style="text-decoration:underline">msg</span></tt>.
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::readfile"></a>web::readfile</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::readfile</tt></span>  <tt><span style="text-decoration:underline"><i><tt>file</tt></i></span></tt> <tt><span style="text-decoration:underline"><i><tt>varName</tt></i></span></tt> <tt><span style="text-decoration:underline"><i><tt>msg</tt></i></span></tt></span></div><p style="width:90%">
  
  	<tt><span style="text-decoration:underline">file</span></tt> is read and written to
  	<tt><span style="text-decoration:underline">varName</span></tt>. Returns 0 on success, 1
  	otherwise. If an error occurs, an error message is written to
  	the variable <tt><span style="text-decoration:underline">msg</span></tt>.
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::lockfile_and_web::unlockfile"></a>web::lockfile and web::unlockfile</h3></div></div><p style="width:90%">
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::lockfile</tt></span>  <tt><span style="text-decoration:underline"><i><tt>fh</tt></i></span></tt></span></div><p style="width:90%">
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::unlockfile</tt></span>  <tt><span style="text-decoration:underline"><i><tt>fh</tt></i></span></tt></span></div><p style="width:90%">
  
  	Interface to lockf(). lockf() works best on local filesystems.
  	Please read the documentation of lockf on your system to learn
  	about the problems and limitations of file locking. Note that
  	web::lockfile also performs a seek() and resets the file
  	cursor to the beginning of the file.
  
  	<span class="emphasis"><em>Note</em></span> that the file needs to be open for
  	writing.
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::truncatefile"></a>web::truncatefile</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::truncatefile</tt></span>  <tt><span style="text-decoration:underline"><i><tt>fh</tt></i></span></tt></span></div><p style="width:90%">
  
  	Interface to truncate(). Truncates a file based on the file
  	handle, while Tcl's file commands are based on file
  	names. This is used to truncate a file while holding the lock.
  
        </p></div><div class="section"><div class="titlepage"></div><div class="example"><p class="title"><b>Example 10. web::lockfile</b></p><pre style="background:#bbffbb ; width:75%" class="programlisting">
  	  set fh [open [web::tempfile] w]
  	  web::lockfile $fh
  	  puts $fh foo
  	  web::unlockfile $fh
  	  close $fh
  	</pre></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="context_handling.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="data_encryption.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Context handling�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Data encryption</td></tr></table></div></body></html>
  
  
  
  1.1                  tcl-site/websh/quickref/index.html
  
  Index: index.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>Websh Reference</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="index.html" title="Websh Reference"><link rel="next" href="configuration.html" title="Configuration"></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">Websh Reference</th></tr><tr><td width="20%" align="left">�</td><th width="60%" align="center">�</th><td width="20%" align="right">�<a accesskey="n" href="configuration.html">Next</a></td></tr></table><hr></div><div class="article"><div class="titlepage"><div><h2 class="title"><a name="id5343794"></a>Websh Reference</h2></div><div><p class="releaseinfo">
        $Id: index.html,v 1.1 2002/08/01 17:24:08 davidw Exp $
      </p></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="index.html#intro">Introduction</a></dt><dd><dl><dt><a href="index.html#general_remarks">General remarks</a></dt><dt><a href="index.html#about">About this document</a></dt></dl></dd><dt><a href="configuration.html">Configuration</a></dt><dd><dl><dt><a href="configuration.html#web::config">web::config</a></dt></dl></dd><dt><a href="command_dispatching_and_session_management.html">Command dispatching and session management</a></dt><dd><dl><dt><a href="command_dispatching_and_session_management.html#web::command">web::command</a></dt><dt><a href="command_dispatching_and_session_management.html#web::getcommand">web::getcommand</a></dt><dt><a href="command_dispatching_and_session_management.html#web::cmdurl">web::cmdurl</a></dt><dt><a href="command_dispatching_and_session_management.html#web::cmdurlcfg">web::cmdurlcfg</a></dt><dt><a href="command_dispatching_and_session_management.html#management_of_static_parameters">Management of static parameters</a></dt><dt><a href="command_dispatching_and_session_management.html#configuration_for_web_cmdurl">Configuration for web::cmdurl</a></dt><dt><a href="command_dispatching_and_session_management.html#web::dispatch">web::dispatch</a></dt><dt><a href="command_dispatching_and_session_management.html#session_management">Session management</a></dt><dt><a href="command_dispatching_and_session_management.html#Examples5"></a></dt></dl></dd><dt><a href="request_data_handling.html">Request data handling</a></dt><dd><dl><dt><a href="request_data_handling.html#web::request">web::request</a></dt><dt><a href="request_data_handling.html#web::param">web::param</a></dt><dt><a href="request_data_handling.html#web::formvar">web::formvar</a></dt><dt><a href="request_data_handling.html#id5347333"></a></dt></dl></dd><dt><a href="response_data_handling.html">Response data handling</a></dt><dd><dl><dt><a href="response_data_handling.html#web::response">web::response</a></dt><dt><a href="response_data_handling.html#web::put">web::put</a></dt><dt><a href="response_data_handling.html#web::putx">web::putx</a></dt><dt><a href="response_data_handling.html#web::putxfile">web::putxfile</a></dt></dl></dd><dt><a href="logging.html">Logging</a></dt><dd><dl><dt><a href="logging.html#web::logdest">web::logdest</a></dt><dt><a href="logging.html#web::logfilter">web::logfilter</a></dt><dt><a href="logging.html#web::log">web::log</a></dt><dt><a href="logging.html#log_plug-ins">Log plug-ins</a></dt></dl></dd><dt><a href="context_handling.html">Context handling</a></dt><dd><dl><dt><a href="context_handling.html#web::context">web::context</a></dt><dt><a href="context_handling.html#web::filecontext">web::filecontext</a></dt><dt><a href="context_handling.html#web::cookiecontext">web::cookiecontext</a></dt><dt><a href="context_handling.html#web::filecounter">web::filecounter</a></dt></dl></dd><dt><a href="file_handling_and_file_IO.html">File handling and file I/O</a></dt><dd><dl><dt><a href="file_handling_and_file_IO.html#web::include">web::include</a></dt><dt><a href="file_handling_and_file_IO.html#web::readfile">web::readfile</a></dt><dt><a href="file_handling_and_file_IO.html#web::lockfile_and_web::unlockfile">web::lockfile and web::unlockfile</a></dt><dt><a href="file_handling_and_file_IO.html#web::truncatefile">web::truncatefile</a></dt><dt><a href="file_handling_and_file_IO.html#Examples10"></a></dt></dl></dd><dt><a href="data_encryption.html">Data encryption</a></dt><dd><dl><dt><a href="data_encryption.html#web::encrypt">web::encrypt</a></dt><dt><a href="data_encryption.html#web::decrypt">web::decrypt</a></dt><dt><a href="data_encryption.html#encryption_plug-in_D">Encryption plug-in D</a></dt><dt><a href="data_encryption.html#web::encryptd">web::encryptd</a></dt><dt><a href="data_encryption.html#web::decryptd">web::decryptd</a></dt><dt><a href="data_encryption.html#web::cryptdkey">web::cryptdkey</a></dt><dt><a href="data_encryption.html#encryption_plug-in_interface_">Encryption plug-in interface</a></dt></dl></dd><dt><a href="uri-html-_en-decoding.html">Uri-/html- en-/decoding</a></dt><dd><dl><dt><a href="uri-html-_en-decoding.html#web::htmlify">web::htmlify</a></dt><dt><a href="uri-html-_en-decoding.html#web::dehtmlify">web::dehtmlify</a></dt><dt><a href="uri-html-_en-decoding.html#web::uriencode">web::uriencode</a></dt><dt><a href="uri-html-_en-decoding.html#web::uridecode">web::uridecode</a></dt><dt><a href="uri-html-_en-decoding.html#Examples11"></a></dt></dl></dd><dt><a href="inter-process_and_-system_communication.html">Inter-process/-system communication</a></dt><dd><dl><dt><a href="inter-process_and_-system_communication.html#web::send">web::send</a></dt><dt><a href="inter-process_and_-system_communication.html#web::recv">web::recv</a></dt><dt><a href="inter-process_and_-system_communication.html#web::msgflag">web::msgflag</a></dt></dl></dd><dt><a href="Apache_module_specific_commands.html">Apache module specific commands</a></dt><dd><dl><dt><a href="Apache_module_specific_commands.html#web::initializer">web::initializer</a></dt><dt><a href="Apache_module_specific_commands.html#web::finalizer">web::finalizer</a></dt><dt><a href="Apache_module_specific_commands.html#web::finalize">web::finalize</a></dt><dt><a href="Apache_module_specific_commands.html#web::maineval">web::maineval</a></dt><dt><a href="Apache_module_specific_commands.html#web::interpclasscfg">web::interpclasscfg</a></dt><dt><a href="Apache_module_specific_commands.html#web::interpcfg">web::interpcfg</a></dt><dt><a href="Apache_module_specific_commands.html#web::interpmap">web::interpmap</a></dt></dl></dd><dt><a href="misc_commands.html">Miscellaneous commands</a></dt><dd><dl><dt><a href="misc_commands.html#web::match">web::match</a></dt><dt><a href="misc_commands.html#web::tempfile">web::tempfile</a></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear: both"><a name="intro"></a>Introduction</h2></div></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="general_remarks"></a>General remarks</h3></div></div><p style="width:90%">
  	Websh 3.5 (pronounced &quot;web shell&quot;) embeds a Tcl 8.3 interpreter,
  	and all Tcl 8.3 commands are available.
        </p><p style="width:90%">
  	Typically, Websh commands have the following syntax:
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::acommand</tt></span>  ?<tt><span style="text-decoration:underline">options</span></tt>? ?<tt><span style="text-decoration:underline">subcommands</span></tt>? ?<tt><span style="text-decoration:underline">arguments</span></tt>?</span></div><p style="width:90%">
  	Options start with a dash (&quot;-&quot;). As usual, dash-dash
  	(&quot;--&quot;) indicates the
  	&quot;end-of-options&quot;. Thus,
  	<pre style="background:#bbffbb ; width:75%" class="programlisting">web::acommand -o1 a1 -- -o2</pre>
  	takes &quot;-o2&quot; as the first argument.
        </p><p style="width:90%">
  	Instead of the normal Tcl behaviour, Websh configuration
  	commands normally return the previous value when a new value
  	is set.
        </p><p style="width:90%">
  	In addition to the examples given here, you might find <a href="http://tcl.apache.org/websh/examples.ws3" target="_top">http://tcl.apache.org/websh/examples.ws3</a>
  	a useful source of information.
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="about"></a>About this document</h3></div></div><p style="width:90%">
  	The original version of this document can always be found at
  	<a href="http://tcl.apache.org/websh/download/" target="_top">http://tcl.apache.org/websh/download/</a>.
        </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3>
  	We try to keep this quick reference up-to-date and hope that
  	it will be useful. We do not guarantee that it is suitable for
  	any particular purpose whatsoever. The authors accept no
  	liability with regards to this information or its use.
        </div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left">�</td><td width="20%" align="center">�</td><td width="40%" align="right">�<a accesskey="n" href="configuration.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">�</td><td width="20%" align="center">�</td><td width="40%" align="right" valign="top">�Configuration</td></tr></table></div></body></html>
  
  
  
  1.1                  tcl-site/websh/quickref/inter-process_and_-system_communication.html
  
  Index: inter-process_and_-system_communication.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>Inter-process/-system communication</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="index.html" title="Websh Reference"><link rel="up" href="index.html" title="Websh Reference"><link rel="previous" href="uri-html-_en-decoding.html" title="Uri-/html- en-/decoding"><link rel="next" href="Apache_module_specific_commands.html" title="Apache module specific commands"></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">Inter-process/-system communication</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="uri-html-_en-decoding.html">Prev</a>�</td><th width="60%" align="center">�</th><td width="20%" align="right">�<a accesskey="n" href="Apache_module_specific_commands.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear: both"><a name="inter-process_and_-system_communication"></a>Inter-process/-system communication</h2></div></div><p style="width:90%">
        Send to and receive from sockets.
      </p><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::send"></a>web::send</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::send</tt></span>  <tt><span style="text-decoration:underline"><i><tt>channel</tt></i></span></tt> <tt><span style="text-decoration:underline"><i><tt>cmdNr</tt></i></span></tt> <tt><span style="text-decoration:underline"><i><tt>message</tt></i></span></tt> ?<tt><span style="text-decoration:underline"><i><tt>flags</tt></i></span></tt>?</span></div><p style="width:90%">
  
  	Send the command <tt><span style="text-decoration:underline">cmdNr</span></tt> and the message
  	<tt><span style="text-decoration:underline">message</span></tt> to channel
  	<tt><span style="text-decoration:underline">channelName</span></tt> using the flags
  	<tt><span style="text-decoration:underline">flags</span></tt>. The command numbers are application
  	specific. If #<tt><span style="text-decoration:underline">flags</span></tt> is used, flags is the
  	numeric (integer) representation of the flags is to be set. If
  	the # is omitted, <tt><span style="text-decoration:underline">flags</span></tt> is a list of symbolic
  	flags. Currently, there is only one flag: &quot;multiple&quot;
  	or &quot;noflush&quot; with the same meaning, indicating that
  	there is more to follow and no automatic flush on the channel
  	should be done.
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::recv"></a>web::recv</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::recv</tt></span>  <tt><span style="text-decoration:underline"><i><tt>channel</tt></i></span></tt> <tt><span style="text-decoration:underline"><i><tt>cmdVarName</tt></i></span></tt> <tt><span style="text-decoration:underline"><i><tt>msgVarName</tt></i></span></tt> <tt><span style="text-decoration:underline"><i><tt>flagVarName</tt></i></span></tt></span></div><p style="width:90%">
  
  	Receives a message from <tt><span style="text-decoration:underline">channelName</span></tt>. The
  	other arguments are the names of the corresponding variables
  	which will contain the message.  The flags are returned
  	numeric. (To handle these flags, use the web::msgflag
  	function).
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::msgflag"></a>web::msgflag</h3></div></div><p style="width:90%">
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::msgflag</tt></span>  ?<tt><span style="text-decoration:underline"><i><tt>flags</tt></i></span></tt>? ?<tt><span style="text-decoration:underline"><i><tt>testflags</tt></i></span></tt>?</span></div><p style="width:90%">
  
  	Set or test flags.
  
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::msgflag</b></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		returns a list of all known message flags.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::msgflag</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>flags</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		returns the integer representation of the flags listed
  		in <tt><span style="text-decoration:underline">flags</span></tt>.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::msgflag</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>flags</tt></i></span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>testflags</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		returns 1, if the flags in <tt><span style="text-decoration:underline">testflags</span></tt>
  		are set in <tt><span style="text-decoration:underline">flags</span></tt>.
  	      </div></div></dd></dl></div><p style="width:90%">
  
        </p><p style="width:90%">
        </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="uri-html-_en-decoding.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="Apache_module_specific_commands.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Uri-/html- en-/decoding�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Apache module specific commands</td></tr></table></div></body></html>
  
  
  
  1.1                  tcl-site/websh/quickref/logging.html
  
  Index: logging.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>Logging</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="index.html" title="Websh Reference"><link rel="up" href="index.html" title="Websh Reference"><link rel="previous" href="response_data_handling.html" title="Response data handling"><link rel="next" href="context_handling.html" title="Context handling"></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">Logging</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="response_data_handling.html">Prev</a>�</td><th width="60%" align="center">�</th><td width="20%" align="right">�<a accesskey="n" href="context_handling.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear: both"><a name="logging"></a>Logging</h2></div></div><p style="width:90%">
        Logging consists of two parts. <span style="font-family:monospace"><b>web::log</b></span>
        issues a logging message, while
        <span style="font-family:monospace"><b>web::logfilter</b></span> and
        <span style="font-family:monospace"><b>web::logdest</b></span> determine where to send a
        message. Websh uses a two-step filtering. First, Websh
        determines whether it should handle a message, or not, using the
        filters configured with &quot;web::logfilter&quot;. Then,
        Websh determines which message is to be sent where, using the
        filters configured with <span style="font-family:monospace"><b>web::logdest</b></span>.
      </p><p style="width:90%">
        A filter consists of a tag and a level, separated by a
        &quot;.&quot;. The tag is free text. Typically, it is the name
        of the application, say &quot;foo&quot;. Example:
        &quot;ws3.debug&quot;. Levels are, in order:
        </p><div class="itemizedlist"><ul type="disc"><li><div style="margin-bottom:6">alert</div></li><li><div style="margin-bottom:6">error</div></li><li><div style="margin-bottom:6">warning</div></li><li><div style="margin-bottom:6">info</div></li><li><div style="margin-bottom:6">debug</div></li></ul></div><p style="width:90%">
      </p><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::logdest"></a>web::logdest</h3></div></div><p style="width:90%">
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::logdest</tt></span>  <tt><span style="text-decoration:underline"><i><tt>subcommand</tt></i></span></tt> ?<tt><span style="text-decoration:underline"><i><tt>options</tt></i></span></tt>? <tt><span style="text-decoration:underline"><i><tt>level</tt></i></span></tt> <tt><span style="text-decoration:underline"><i><tt>plugin</tt></i></span></tt></span></div><p style="width:90%">
  
  	Subcommands are: <tt><span style="text-decoration:underline">add</span></tt>,
  	<tt><span style="text-decoration:underline">delete</span></tt>, and <tt><span style="text-decoration:underline">names</span></tt>.  Options
  	are: <tt><span style="text-decoration:underline">-maxchar</span></tt>, and
  	<tt><span style="text-decoration:underline">-format</span></tt>.
        </p><p style="width:90%">
  
  	Known plug-ins are: <tt><span style="text-decoration:underline">file</span></tt>,
  	<tt><span style="text-decoration:underline">syslog</span></tt>, <tt><span style="text-decoration:underline">command</span></tt>,
  	<tt><span style="text-decoration:underline">channel</span></tt>, and
  	<tt><span style="text-decoration:underline">apache</span></tt>. <span class="emphasis"><em>Note</em></span>: the
  	plugins may have indiviudal options
  	(<tt><span style="text-decoration:underline">-unbuffered</span></tt>), see documentation below.
  
  	The format string consits of format specifications for
  	<tt>fprintf()</tt> plus: <tt>p</tt> (process id), <tt>t</tt> (thread id), <tt>n</tt> (log level), <tt>f</tt> (log type), and <tt>m</tt> (the message).
  
        </p><p style="width:90%">
  	<pre style="background:#bbffbb ; width:75%" class="programlisting">
  	  web::logdest add -maxchar 25 -format &quot;%x %X \$l \$m&quot; *.-debug command logTest</pre>
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::logfilter"></a>web::logfilter</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::logfilter</tt></span>  <tt><span style="text-decoration:underline">subcommand</span></tt> <tt><span style="text-decoration:underline">args</span></tt></span></div><p style="width:90%">
  
  	Subcommands are: <tt><span style="text-decoration:underline">add</span></tt>,
  	<tt><span style="text-decoration:underline">delete</span></tt>, and <tt><span style="text-decoration:underline">names</span></tt>.
        </p><p style="width:90%">
  	Add a filter to the list.
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::logfilter</b></span>
  	      <tt><span style="text-decoration:underline">add</span></tt> <tt><span style="text-decoration:underline"><i><tt>level</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		add a level to the list.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::logfilter</b></span>
  	      <tt><span style="text-decoration:underline">delete</span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>name</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		remove a <tt><span style="text-decoration:underline">name</span></tt> from list, or remove all
  		filters if <tt><span style="text-decoration:underline">name</span></tt> is omitted.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::logfilter</b></span>
  	      <tt><span style="text-decoration:underline"><i><tt>names</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		list all filters that have been set.
  	      </div></div></dd></dl></div><p style="width:90%">
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::log"></a>web::log</h3></div></div><p style="width:90%">
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::log</tt></span>  <tt><span style="text-decoration:underline"><i><tt>level</tt></i></span></tt> <tt><span style="text-decoration:underline"><i><tt><i><tt>msg</tt></i></tt></i></span></tt></span></div><p style="width:90%">
  
  	Issue a log message.  It is possible, should the user so
  	desire, to have the <span style="font-family:monospace"><b>web::log</b></span> run
  	<span style="font-family:monospace"><b>subst</b></span> on its arguments.  This behaviour is
  	turned off by default, and can be turned on by doing:
  	<pre style="background:#bbffbb ; width:75%" class="programlisting">web::config logsubst 1</pre>.
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="log_plug-ins"></a>Log plug-ins</h3></div></div><div class="section"><div class="titlepage"><div><h4 class="title"><a name="file"></a>File</h4></div></div><p style="width:90%">
  
  	  </p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::logdest</tt></span>   <tt>add</tt>  <tt><span style="text-decoration:underline"><i><tt>destination</tt></i>.-<i><tt>level</tt></i></span></tt> <tt><span style="text-decoration:underline">file</span></tt> ?<tt><span style="text-decoration:underline"><i><tt>options</tt></i></span></tt>? <tt><span style="text-decoration:underline"><i><tt>filename</tt></i></span></tt></span></div><p style="width:90%">
  	  Option is: <tt><span style="text-decoration:underline">-unbuffered</span></tt>
  	</p></div><div class="section"><div class="titlepage"><div><h4 class="title"><a name="syslog"></a>Syslog</h4></div></div><p style="width:90%">
  
  	  </p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::logdest</tt></span>   <tt>add</tt>  <tt><span style="text-decoration:underline">*.-debug</span></tt> <tt><span style="text-decoration:underline">syslog</span></tt> ?<tt><span style="text-decoration:underline"><i><tt>level</tt></i></span></tt>?</span></div><p style="width:90%">
  
  	  See the man page for syslog for levels on your system. Typical: 10.
  
  	</p></div><div class="section"><div class="titlepage"><div><h4 class="title"><a name="command"></a>Command</h4></div></div><p style="width:90%">
  
  	  </p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::logdest</tt></span>   <tt>add</tt>  <tt><span style="text-decoration:underline">*.-debug</span></tt>  <tt>command</tt>  <tt><span style="text-decoration:underline"><i><tt>cmdName</tt></i></span></tt></span></div><p style="width:90%">
  	</p></div><div class="section"><div class="titlepage"><div><h4 class="title"><a name="channel"></a>Channel</h4></div></div><p style="width:90%">
  
  
  	  </p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::logdest</tt></span>   <tt>add</tt>  <tt><span style="text-decoration:underline">*.-debug</span></tt>  <tt>channel</tt>  ?<tt><span style="text-decoration:underline"><i><tt>options</tt></i></span></tt>? <tt><span style="text-decoration:underline"><i><tt>channel</tt></i></span></tt></span></div><p style="width:90%">
  	  Option is: <tt><span style="text-decoration:underline">-unbuffered</span></tt>
  	</p></div><div class="section"><div class="titlepage"><div><h4 class="title"><a name="apache"></a>Apache</h4></div></div><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::logdest</tt></span>   <tt>add</tt>  <tt><span style="text-decoration:underline">*.-debug</span></tt>  <tt>apache</tt> </span></div><p style="width:90%">
  	  Available in mod_websh only.
  	</p></div><div class="section"><div class="titlepage"><div><h4 class="title"><a name="id5348904"></a></h4></div></div><div class="example"><p class="title"><b>Example 7. web::log</b></p><pre style="background:#bbffbb ; width:75%" class="programlisting">
  	    % web::logfilter add *.-debug
  	    logfilter0
  	    % web::logdest add *.-debug channel stdout
  	    logdest0
  	    % web::log info {Websh is cool}
  	    03/01/00 00:00:00 [111] user.info: Websh is cool
  	    % web::logdest delete logdest0
  	    % web::logdest add -format &quot;--&gt; \$m\n&quot; *.-debug channel stdout
  	    logdest1
  	    % web::log info {Websh is cool}
  	    --&gt; Websh is cool
  	    % web::logdest delete logdest1
  	    % web::logdest add -maxchar 5 *.-debug channel stdout
  	    % web::log info {Websh is cool}
  	    03/01/00 00:00:00 [111] user.info: Websh
  	    %
  	  </pre></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="response_data_handling.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="context_handling.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Response data handling�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Context handling</td></tr></table></div></body></html>
  
  
  
  1.1                  tcl-site/websh/quickref/misc_commands.html
  
  Index: misc_commands.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>Miscellaneous commands</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="index.html" title="Websh Reference"><link rel="up" href="index.html" title="Websh Reference"><link rel="previous" href="Apache_module_specific_commands.html" title="Apache module specific commands"></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">Miscellaneous commands</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="Apache_module_specific_commands.html">Prev</a>�</td><th width="60%" align="center">�</th><td width="20%" align="right">�</td></tr></table><hr></div><div class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear: both"><a name="misc_commands"></a>Miscellaneous commands</h2></div></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::match"></a>web::match</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff">
  	  web::match  <tt><span style="text-decoration:underline">result</span></tt> <tt><span style="text-decoration:underline">listToBeSearched</span></tt> <tt><span style="text-decoration:underline">searchFor</span></tt></span></div><p style="width:90%">
  
  	In case <tt><span style="text-decoration:underline">searchFor</span></tt> exists in
  	<tt><span style="text-decoration:underline">listToBeSearched</span></tt>, web::match returns
  	<tt><span style="text-decoration:underline">result</span></tt>, otherwise an empty string.
  
        </p><p style="width:90%">
  
  	web::match treats v1 as a list. Thus, <span class="emphasis"><em>web::match
  	  &quot;ok&quot; {tv dvd vcr} dvd</em></span> will return
  	<span class="emphasis"><em>ok</em></span>.
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::tempfile"></a>web::tempfile</h3></div></div><p style="width:90%">
  	Returns a unique name of a temporary file. The maximum of
  	guaranteed unique names per application is system dependent.
  	This command just returns the name of a file. It is the
  	programmers job to handle the file, for example to open
  	it. Note that Websh keeps an internal list of all file
  	names generated with web::tempfile and will attempt to delete
  	all files when the interpreter dies.
        </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="Apache_module_specific_commands.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">Apache module specific commands�</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-site/websh/quickref/request_data_handling.html
  
  Index: request_data_handling.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>Request data handling</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="index.html" title="Websh Reference"><link rel="up" href="index.html" title="Websh Reference"><link rel="previous" href="command_dispatching_and_session_management.html" title="Command dispatching and session management"><link rel="next" href="response_data_handling.html" title="Response data handling"></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">Request data handling</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="command_dispatching_and_session_management.html">Prev</a>�</td><th width="60%" align="center">�</th><td width="20%" align="right">�<a accesskey="n" href="response_data_handling.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear: both"><a name="request_data_handling"></a>Request data handling</h2></div></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::request"></a>web::request</h3></div></div><p style="width:90%">
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::request</tt></span>  ?<tt><span style="text-decoration:underline"><i><tt>options</tt></i></span></tt>? ?<tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt>? ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?<span style="font-weight:bold"><tt>web::request</tt></span>  ?<tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt>? ?<tt><span style="text-decoration:underline"><i><tt>default</tt></i></span></tt>?</span></div><p style="width:90%">
        </p><p style="width:90%">
  	Options are: <tt><span style="text-decoration:underline">-count</span></tt>, <tt><span style="text-decoration:underline">-set</span></tt>,
          <tt><span style="text-decoration:underline">-lappend</span></tt>, <tt><span style="text-decoration:underline">-names</span></tt>,
          <tt><span style="text-decoration:underline">-unset</span></tt>, <tt><span style="text-decoration:underline">-reset</span></tt> and
          <tt><span style="text-decoration:underline">-channel</span></tt> fixme: gibt es -channel noch?
        </p><p style="width:90%">
  
  	web::request is an accessor to CGI related information.
  
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::request</b></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		returns a list of all known keys.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::request</b></span> <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>default</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		returns the value for <tt><span style="text-decoration:underline">key</span></tt>. Can be a
  		list. In case that <tt><span style="text-decoration:underline">key</span></tt> does not
  		exist, return <tt><span style="text-decoration:underline">default</span></tt>, if it is
  		given, or an empty string.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::request</b></span>
  	      <tt><span style="text-decoration:underline">-count</span></tt> <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		returns number of items in list for
  		<tt><span style="text-decoration:underline">key</span></tt>; returns 0 if
  		<tt><span style="text-decoration:underline">key</span></tt> does not exist.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::request</b></span>
  	      <tt><span style="text-decoration:underline">-set</span></tt> <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		does the same as <span style="font-family:monospace"><b>web::request</b></span>
  		<tt><span style="text-decoration:underline">key</span></tt>.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::request</b></span>
  	      <tt><span style="text-decoration:underline">-set</span></tt> <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?
  	      ?<tt><span style="text-decoration:underline"><i><tt>...</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		adds the parameter <tt><span style="text-decoration:underline">key</span></tt> to the
  		web::request data.  Any existing parameters with
  		<tt><span style="text-decoration:underline">key</span></tt> are overwritten.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::request</b></span>
  	      <tt><span style="text-decoration:underline">-lappend</span></tt> <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?
  	      ?<tt><span style="text-decoration:underline"><i><tt>...</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		append parameters with the same <tt><span style="text-decoration:underline">key</span></tt>
  		to the web::request data. In this case the existing
  		<tt><span style="text-decoration:underline">value</span></tt> is not overwritten.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::request</b></span>
  	      <tt><span style="text-decoration:underline">-unset</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		deletes all parameters from the web::request data.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::request</b></span>
  	      <tt><span style="text-decoration:underline">-unset</span></tt> <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		deletes a parameter from the web::request data.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::request</b></span>
  	      <tt><span style="text-decoration:underline">-reset</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		deletes all parameters from the web::request data
  		(like 'web::request -unset'), removes all static
  		parameters (like 'web::cmdurlcfg -unset'), all form
  		variables (like 'web::formvar -unset'), all query
  		string parameters (like 'web::param -unset'), and all
  		temporary files created by HTTP form upload.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::request</b></span>
  	      <tt><span style="text-decoration:underline">-channel</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		fixme: what does it do?
  	      </div></div></dd></dl></div><p style="width:90%">
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::param"></a>web::param</h3></div></div><p style="width:90%">
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::param</tt></span>  ?<tt><span style="text-decoration:underline"><i><tt>options</tt></i></span></tt>? ?<tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt>? ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>? ?<tt><span style="text-decoration:underline"><i><tt>...</tt></i></span></tt>?</span></div><p style="width:90%">
  
  	Options are: <tt><span style="text-decoration:underline">-count</span></tt>, <tt><span style="text-decoration:underline">-set</span></tt>,
  	<tt><span style="text-decoration:underline">-lappend</span></tt>, <tt><span style="text-decoration:underline">-names</span></tt>, and
  	<tt><span style="text-decoration:underline">-unset</span></tt>
  
        </p><p style="width:90%">
  	web::param is an accessor to state information from the
  	querystring.  Suppose the querystring is &quot;lang=EN&quot;.
  	After web::dispatch has parsed the querystring,
  	<span style="font-family:monospace"><b>web::param</b></span> <tt><span style="text-decoration:underline">lang</span></tt> will
  	report <tt>EN</tt>.  Additionaly,
  	web::param can manage this data and add, append, and delete
  	parameters as needed.
  
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::param</b></span> <tt><span style="text-decoration:underline">-names</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		returns a list of all known keys.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::param</b></span> <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>default</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		returns the value for <tt><span style="text-decoration:underline">key</span></tt>. Can be a
  		list. In case that <tt><span style="text-decoration:underline">key</span></tt> does not
  		exist, return <tt><span style="text-decoration:underline">default</span></tt>, if it is
  		given, or an empty string.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::param</b></span>
  	      <tt><span style="text-decoration:underline">-count</span></tt> <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		returns number of items in list of
  		<tt><span style="text-decoration:underline">key</span></tt>.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::param</b></span> <tt><span style="text-decoration:underline">-set</span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		does the same as '<span style="font-family:monospace"><b>web::param</b></span>
  		<tt><span style="text-decoration:underline">key</span></tt>'.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::param</b></span> <tt><span style="text-decoration:underline">-set</span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt> <tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?
  	      ?<tt><span style="text-decoration:underline"><i><tt>...</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		add the parameter <tt><span style="text-decoration:underline">key</span></tt> to the
  		web::param data.  Any existing parameters with
  		<tt><span style="text-decoration:underline">key</span></tt> are overwritten.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::param</b></span>
  	      <tt><span style="text-decoration:underline">-lappend</span></tt> <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?
  	      ?<tt><span style="text-decoration:underline"><i><tt>...</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		append parameters with the same <tt><span style="text-decoration:underline">key</span></tt>
  		to the web::param data.  In this case the existing
  		<tt><span style="text-decoration:underline">value</span></tt> is not overwritten.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::param</b></span> <tt><span style="text-decoration:underline">-unset</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		deletes all parameters from the web::param data.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::param</b></span>
  	      <tt><span style="text-decoration:underline">-unset</span></tt> <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		delete a parameter from the web::param data.
  	      </div></div></dd></dl></div><p style="width:90%">
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::formvar"></a>web::formvar</h3></div></div><p style="width:90%">
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::formvar</tt></span>  ?<tt><span style="text-decoration:underline"><i><tt>options</tt></i></span></tt>? ?<tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt>? ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?</span></div><p style="width:90%">
        </p>
        Exactly like <span style="font-family:monospace"><b>web::param</b></span>.
        <p style="width:90%">
  	<span style="font-family:monospace"><b>web::formvar</b></span> is an accessor to HTML FORM
  	data.  After <span style="font-family:monospace"><b>web::dispatch</b></span> has parsed the
  	POST data, you can access all form fields using
  	<span style="font-family:monospace"><b>web::formvar</b></span>.
        </p></div><div class="section"><div class="titlepage"></div><div class="example"><p class="title"><b>Example 5. web::param</b></p><pre style="background:#bbffbb ; width:75%" class="programlisting">
  	  % web::request CONTENT_LENGTH
  	  % web::dispatch -querystring &quot;cmd=default&amp;t=100&quot; -postdata &quot;&quot; -cmd &quot;&quot;
  	  % web::param -names
  	  t cmd
  	  % web::param cmd
  	  default
  	  % web::param -set k v
  	  v
  	  % web::param -names
  	  t cmd k
  	  %
  	</pre></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="command_dispatching_and_session_management.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="response_data_handling.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Command dispatching and session management�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Response data handling</td></tr></table></div></body></html>
  
  
  
  1.1                  tcl-site/websh/quickref/response_data_handling.html
  
  Index: response_data_handling.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>Response data handling</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="index.html" title="Websh Reference"><link rel="up" href="index.html" title="Websh Reference"><link rel="previous" href="request_data_handling.html" title="Request data handling"><link rel="next" href="logging.html" title="Logging"></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">Response data handling</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="request_data_handling.html">Prev</a>�</td><th width="60%" align="center">�</th><td width="20%" align="right">�<a accesskey="n" href="logging.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear: both"><a name="response_data_handling"></a>Response data handling</h2></div></div><p style="width:90%">
        Websh can send output to any Tcl channel and to global
        variables (<span style="font-family:monospace"><b>web::put</b></span>). Optionally, data is
        scanned for Tcl code before it is output to a channel
        (<span style="font-family:monospace"><b>web::putx</b></span>). Websh manages
        <span class="emphasis"><em>response objects</em></span> that are related to Tcl
        channels and are identified using the name of the corresponding
        Tcl channel. Configuration is achieved with
        <span style="font-family:monospace"><b>web::response</b></span>.
      </p><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::response"></a>web::response</h3></div></div><p style="width:90%">
  
  
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::response</tt></span> <span style="font-weight:bold"><tt>web::response</tt></span>  ?<tt><span style="text-decoration:underline"><i><tt>option</tt></i></span></tt>?<span style="font-weight:bold"><tt>web::response</tt></span>  ?<tt><span style="text-decoration:underline"><i><tt>subcommand</tt></i></span></tt>? <tt><span style="text-decoration:underline"><i><tt>args</tt></i></span></tt></span></div><p style="width:90%">
  
  	Subcommands are <tt><span style="text-decoration:underline">-select</span></tt>,
  	<tt><span style="text-decoration:underline">-set</span></tt>, <tt><span style="text-decoration:underline">-lappend</span></tt>,
  	<tt><span style="text-decoration:underline">-names</span></tt>, <tt><span style="text-decoration:underline">-count</span></tt>,
  	<tt><span style="text-decoration:underline">-unset</span></tt>, <tt><span style="text-decoration:underline">-reset</span></tt>, and
  	<tt><span style="text-decoration:underline">-resetall</span></tt> Options are
  	<tt><span style="text-decoration:underline">-sendheader</span></tt>, <tt><span style="text-decoration:underline">-httpresponse</span></tt>,
  	and <tt><span style="text-decoration:underline">-bytessent</span></tt>.</p><p style="width:90%">
  
  	Selects the default response object and sets and accesses
  	properties of the response object, and returns the name of the
  	response object.
        </p><p style="width:90%">
  	</p><div class="variablelist"><dl><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::response</b></span>
  	      <tt><span style="text-decoration:underline">-select</span></tt>
  	      <tt><span style="text-decoration:underline"><i><tt>channelName</tt></i></span></tt>
  	    </span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		selects <tt><span style="text-decoration:underline">channelName</span></tt> as new response
  		object. If the <tt><span style="text-decoration:underline">channelName</span></tt> is
  		prepended by a #, it refers to a global variable named
  		<tt><span style="text-decoration:underline">channelName</span></tt>.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::response</b></span></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		returns the name of the currently selected response object.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::response</b></span>
  	      <tt><span style="text-decoration:underline">-select</span></tt>
  	      ?#?<tt><span style="text-decoration:underline"><i><tt>channel</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		makes <tt><span style="text-decoration:underline">channel</span></tt> the new default
  		response object and returns the old default response
  		object. The optional hash (&quot;#&quot;) denotes that output should be sent to a global variable named <tt><span style="text-decoration:underline"><i><tt>channel</tt></i></span></tt> instead of a Tcl channel.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::response</b></span>
  	      <tt><span style="text-decoration:underline">-set</span></tt> <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		sets property <tt><span style="text-decoration:underline">key</span></tt> to
  		<tt><span style="text-decoration:underline">value</span></tt>, or returns current value if
  		<tt><span style="text-decoration:underline">value</span></tt> is omitted.  The
  		<tt><span style="text-decoration:underline">keys</span></tt> are names of HTTP header fields
  		(do not include ':' at the end of the header field
  		name) and <tt><span style="text-decoration:underline">value</span></tt> the corresponding
  		value of the field (like Content-Type) and their
  		values (like text/html).</div><div style="margin-bottom:6">
  		Example:</div><div style="margin-bottom:6"> <tt>web::response -set Status 200</tt>.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::response</b></span>
  	      <tt><span style="text-decoration:underline">-names</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		returns the list of known keys.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::response</b></span>
  	      <tt><span style="text-decoration:underline">-count</span></tt> <tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		returns number of items in list of <tt><span style="text-decoration:underline">key</span></tt>.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::response</b></span>
  	      <tt><span style="text-decoration:underline">-unset</span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>key</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		delete the value of <tt><span style="text-decoration:underline">key</span></tt>, if
  		<tt><span style="text-decoration:underline">key</span></tt> is given, or all keys.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::response</b></span>
  	      <tt><span style="text-decoration:underline">-sendheader</span></tt>
  	      ?<tt><span style="text-decoration:underline">boolean</span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		Sets the sendheader flag which indicates and controls
  		whether the HTTP headers have been or should be sent.
  		It is initially set to 1 and set to 0 after the first
  		call of <span style="font-family:monospace"><b>web::put</b></span> or
  		<span style="font-family:monospace"><b>web::putx</b></span>. If
  		<tt><span style="text-decoration:underline">boolean</span></tt> is omitted, returns the
  		current value.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::response</b></span>
  	      <tt><span style="text-decoration:underline">-httpresponse</span></tt>
  	      ?<tt><span style="text-decoration:underline"><i><tt>value</tt></i></span></tt>?</span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		Sets the HTTP response like &quot;HTTP/1.0 200
  		OK&quot; for the given (or default) channel. If no
  		<tt><span style="text-decoration:underline">value</span></tt> given, returns the the current
  		HTTP response set. In the case of the Apache module
  		mod_websh, Apache replaces the protocol
  		&quot;HTTP/??&quot; in the reponse with
  		&quot;HTTP/1.1&quot;.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::response</b></span>
  	      <tt><span style="text-decoration:underline">-bytessent</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		returns the number of bytes that have already been sent to this
  		channel.
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::response</b></span>
  	      <tt><span style="text-decoration:underline">-reset</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		resets the 'sendheader' flag for the channel to true,
  		the HTTP response to the default &quot;HTTP/?? 200
  		OK&quot;, removes any HTTP headers set, and resets the
  		names of the query string parameters for the timestamp
  		and the command to their default values (&quot;t&quot;
  		and &quot;cmd&quot;, respectively).
  	      </div></div></dd><dt><span style="background:#bbbbff"><span class="term"><span style="font-family:monospace"><b>web::response</b></span>
  	      <tt><span style="text-decoration:underline">-resetall</span></tt></span></span></dt><dd><div style="padding:4 ; margin-top:3 ;  margin-bottom:3 ; width:75%"><div style="margin-bottom:6">
  		performs a 'web::response -reset' on all registered channels.
  	      </div></div></dd></dl></div><p style="width:90%">
  	</p><div class="example"><p class="title"><b>Example 6. web::response</b></p><pre style="background:#bbffbb ; width:75%" class="programlisting">
  	    % web::response
  	    stdout
  	    % web::response -select stderr
  	    stdout
  	    % web::response
  	    stderr
  	    % web::response -sendheader
  	    1
  	    % web::response -names
  	    Content-Type Generator
  	    % web::response Content-Type
  	    text/html
  	    % web::response -bytessent
  	    0
  	    % web::response -set Set-Cookie &quot;my cookie that contains data&quot;
  	    % web::put &quot;Hello, world\n&quot;
  	    Content-Type: text/html
  	    Set-Cookie: my cookie that contains data
  	    Generator: websh3.00 (c) Netcetera AG, http://netcetera.ch
  
  	    Hello, world
  	    %
  	  </pre></div><p style="width:90%">
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::put"></a>web::put</h3></div></div><p style="width:90%">
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::put</tt></span> ?<tt><span style="text-decoration:underline">#?<tt><span style="text-decoration:underline"><i><tt>channel</tt></i></span></tt>?</span></tt>? <tt><span style="text-decoration:underline"><i><tt>text</tt></i></span></tt></span></div><p style="width:90%">
  	Send output to a Tcl channel. No newline is added to output. If ?<tt><span style="text-decoration:underline"><i><tt>channel</tt></i></span></tt>? is ommitted, output is sent to the current default channel. The default channel can be changed with <span style="font-family:monospace"><b>web::response -select ?<tt><span style="text-decoration:underline">#?<tt><span style="text-decoration:underline"><i><tt>channel</tt></i></span></tt>?</span></tt>?</b></span>. The optional hash (&quot;#&quot;) denotes that output should be sent to a global variable named <tt><span style="text-decoration:underline"><i><tt>channel</tt></i></span></tt> instead of a Tcl channel.
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::putx"></a>web::putx</h3></div></div><p style="width:90%">
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::putx</tt></span> ?<tt><span style="text-decoration:underline">#?<tt><span style="text-decoration:underline"><i><tt>channel</tt></i></span></tt>?</span></tt>? <tt><span style="text-decoration:underline"><i><tt>text</tt></i></span></tt></span></div><p style="width:90%">
  
  	Writes <tt><span style="text-decoration:underline">text</span></tt> to the specified channel. Code in
  	curly brackets is eval'd, unless the brackets are escaped by
  	&quot;\&quot;. These markup characters '{...}' can be changed
  	to '&lt;? ... ?&gt;' with 'web::config putxmarkup tag'. The optional hash (&quot;#&quot;) denotes that output should be sent to a global variable named <tt><span style="text-decoration:underline"><i><tt>channel</tt></i></span></tt> instead of a Tcl channel.
  
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::putxfile"></a>web::putxfile</h3></div></div><p style="width:90%">
  
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::putxfile</tt></span> ?<tt><span style="text-decoration:underline">#?<tt><span style="text-decoration:underline"><i><tt>channel</tt></i></span></tt>?</span></tt>?<tt><span style="text-decoration:underline"><i><tt>file</tt></i></span></tt>?<tt><span style="text-decoration:underline"><i><tt>msg</tt></i></span></tt>?</span></div><p style="width:90%">
  	Like web::putx, but takes input from a file.
        </p><p style="width:90%">
  	Returns 0 on success, 1 otherwise. If an error occurs, an
  	error message is written to <tt><span style="text-decoration:underline">msg</span></tt>. If only two
  	arguments are passed, then <tt><span style="text-decoration:underline">channel</span></tt> takes
  	precedence. The optional hash (&quot;#&quot;) denotes that output should be sent to a global variable named <tt><span style="text-decoration:underline"><i><tt>channel</tt></i></span></tt> instead of a Tcl channel.
        </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="request_data_handling.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="logging.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Request data handling�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Logging</td></tr></table></div></body></html>
  
  
  
  1.1                  tcl-site/websh/quickref/uri-html-_en-decoding.html
  
  Index: uri-html-_en-decoding.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>Uri-/html- en-/decoding</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="index.html" title="Websh Reference"><link rel="up" href="index.html" title="Websh Reference"><link rel="previous" href="data_encryption.html" title="Data encryption"><link rel="next" href="inter-process_and_-system_communication.html" title="Inter-process/-system communication"></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">Uri-/html- en-/decoding</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="data_encryption.html">Prev</a>�</td><th width="60%" align="center">�</th><td width="20%" align="right">�<a accesskey="n" href="inter-process_and_-system_communication.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><hr><h2 class="title" style="clear: both"><a name="uri-html-_en-decoding"></a>Uri-/html- en-/decoding</h2></div></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::htmlify"></a>web::htmlify</h3></div></div><p style="width:90%">
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::htmlify</tt></span>  ?<tt><span style="text-decoration:underline"><tt><span style="text-decoration:underline">-options</span></tt></span></tt>? <tt><span style="text-decoration:underline"><i><tt>text</tt></i></span></tt>.
        </span></div><p style="width:90%">
        </p><p style="width:90%">
  	Options: <tt><span style="text-decoration:underline">-numeric</span></tt>.
        </p><p style="width:90%">
  	Return HTML-compliant <tt><span style="text-decoration:underline">text</span></tt> with HTML
  	encoded entities in mnemonic form (e.g. &amp;auml;) or in numeric form (e.g. &amp;#228;) if the option <tt><span style="text-decoration:underline">-numeric</span></tt> is specified.
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::dehtmlify"></a>web::dehtmlify</h3></div></div><p style="width:90%">
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::dehtmlify</tt></span>  <tt><span style="text-decoration:underline"><i><tt>text</tt></i></span></tt></span></div><p style="width:90%">
        </p><p style="width:90%">
  	Remove all HTML-tags from <tt><span style="text-decoration:underline">text</span></tt> and translates all HTML entities to their corresponding ISO-8859-1 characters.
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::uriencode"></a>web::uriencode</h3></div></div><p style="width:90%">
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::uriencode</tt></span>  <tt><span style="text-decoration:underline"><i><tt>text</tt></i></span></tt></span></div><p style="width:90%">
        </p><p style="width:90%">
  	Return URI-compliant <tt><span style="text-decoration:underline">text</span></tt>.
        </p></div><div class="section"><div class="titlepage"><div><h3 class="title"><a name="web::uridecode"></a>web::uridecode</h3></div></div><p style="width:90%">
  	</p><div class="cmdsynopsis"><span style="background:#bbbbff"><span style="font-weight:bold"><tt>web::uridecode</tt></span>  <tt><span style="text-decoration:underline"><i><tt>text</tt></i></span></tt></span></div><p style="width:90%">
        </p><p style="width:90%">Decode URI-compliant <tt><span style="text-decoration:underline">text</span></tt>.
        </p></div><div class="section"><div class="titlepage"></div><div class="example"><p class="title"><b>Example 12. web::htmlify</b></p><pre style="background:#bbffbb ; width:75%" class="programlisting">
  	  % web::htmlify &lt;
  	  &amp;lt;
  	  % web::htmlify -numeric &lt;
  	  &amp;#60;
  	  % web::dehtmlify &quot;&amp;lt; &amp;#60;&quot;
  	  &lt; &lt;
  	  % web::uriencode &quot;Hello, world!&quot;
  	  Hello%2c+world%21
  	  % web::uridecode &quot;Hello%2c+world%21&quot;
  	  Hello, world!
  	  %
  	</pre></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="data_encryption.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="inter-process_and_-system_communication.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Data encryption�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Inter-process/-system communication</td></tr></table></div></body></html>
  
  
  

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