1.1 --- a/docs/deploying-applications.html Mon Nov 06 23:38:12 2006 +0000
1.2 +++ b/docs/deploying-applications.html Mon Nov 06 23:39:49 2006 +0000
1.3 @@ -3,8 +3,6 @@
1.4
1.5 <title>Deploying an Application</title><meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/" />
1.6 <link href="styles.css" rel="stylesheet" type="text/css" /></head>
1.7 -
1.8 -
1.9 <body>
1.10 <h1>Deploying an Application</h1>
1.11
1.12 @@ -54,7 +52,7 @@
1.13 <td>(Follow the instructions for CGI - this may change in future.)</td>
1.14 </tr>
1.15 <tr>
1.16 - <td>Zope</td>
1.17 + <td>Zope 2</td>
1.18 <td>Copy or symbolically link your application code directory to reside
1.19 in the Zope <code>Products</code> directory<br />
1.20 Configure <code>etc/zope.conf</code><br />
1.21 @@ -77,6 +75,6 @@
1.22 <li><a href="Twisted/NOTES.txt">Twisted</a></li>
1.23 <li><a href="Webware/NOTES.txt">Webware</a></li>
1.24 <li><a href="WSGI/NOTES.txt">WSGI</a></li>
1.25 - <li><a href="Zope/NOTES.txt">Zope</a></li>
1.26 + <li><a href="Zope/NOTES.txt">Zope 2</a></li>
1.27 </ul>
1.28 </body></html>
1.29 \ No newline at end of file
2.1 --- a/docs/developing.html Mon Nov 06 23:38:12 2006 +0000
2.2 +++ b/docs/developing.html Mon Nov 06 23:39:49 2006 +0000
2.3 @@ -77,9 +77,9 @@
2.4 </ul><p>The following topic is referenced in many locations and should
2.5 be reviewed when encountering problems with input and output text:</p>
2.6 <ul><li><a href="encodings.html">Character Encodings</a></li></ul>
2.7 -<h2>Deployment</h2><p>The following topics (illustrated by the programs found in the other subdirectories of the <code>examples</code> directory) describe how WebStack applications may be deployed in server environments:</p><ul><li><a href="deploying.html">Deploying a WebStack Application</a></li><ul><li><a href="writing-adapters.html">Writing Adapters</a></li><li><a href="pythonpath.html">Getting PYTHONPATH Right</a></li><li><a href="deploying-applications.html">Deploying an Application</a></li><ul><li><a href="BaseHTTPRequestHandler/NOTES.txt">BaseHTTPRequestHandler</a> (see <code>examples/BaseHTTPRequestHandler</code>)</li><li><a href="CGI/NOTES.txt">CGI</a> (see <code>examples/CGI</code>)</li><li><a href="Django/NOTES.txt">Django</a> (see <code>examples/Django</code>)</li><li><a href="JavaServlet/NOTES.txt">Java Servlet</a> (see <code>examples/JavaServlet</code>)</li><li><a href="ModPython/NOTES.txt">mod_python</a> (see <code>examples/ModPython</code>)</li><li><a href="Twisted/NOTES.txt">Twisted</a> (see <code>examples/Twisted</code>)</li><li><a href="Webware/NOTES.txt">Webware</a> (see <code>examples/Webware</code>)</li><li><a href="WSGI/NOTES.txt">WSGI</a> (see <code>examples/WSGI</code>)</li><li><a href="Zope/NOTES.txt">Zope</a> (see <code>examples/Zope</code>)</li></ul></ul><li>Technical note: <a href="features.html">Support for WebStack
2.8 +<h2>Deployment</h2><p>The following topics (illustrated by the programs found in the other subdirectories of the <code>examples</code> directory) describe how WebStack applications may be deployed in server environments:</p><ul><li><a href="supported-frameworks.html">Supported Frameworks</a></li><li><a href="deploying.html">Deploying a WebStack Application</a></li><ul><li><a href="writing-adapters.html">Writing Adapters</a></li><li><a href="pythonpath.html">Getting PYTHONPATH Right</a></li><li><a href="deploying-applications.html">Deploying an Application</a></li><ul><li><a href="BaseHTTPRequestHandler/NOTES.txt">BaseHTTPRequestHandler</a> (see <code>examples/BaseHTTPRequestHandler</code>)</li><li><a href="CGI/NOTES.txt">CGI</a> (see <code>examples/CGI</code>)</li><li><a href="Django/NOTES.txt">Django</a> (see <code>examples/Django</code>)</li><li><a href="JavaServlet/NOTES.txt">Java Servlet</a> (see <code>examples/JavaServlet</code>)</li><li><a href="ModPython/NOTES.txt">mod_python</a> (see <code>examples/ModPython</code>)</li><li><a href="Twisted/NOTES.txt">Twisted</a> (see <code>examples/Twisted</code>)</li><li><a href="Webware/NOTES.txt">Webware</a> (see <code>examples/Webware</code>)</li><li><a href="WSGI/NOTES.txt">WSGI</a> (see <code>examples/WSGI</code>)</li><li><a href="Zope/NOTES.txt">Zope</a> (see <code>examples/Zope</code>)</li></ul></ul><li>Technical note: <a href="features.html">Support for WebStack
2.9 Features in Server Environments</a></li></ul><h2>Useful Additions</h2><p>WebStack
2.10 provides a number of potentially useful modules either providing
2.11 resource classes for direct use in applications, or providing other
2.12 kinds of classes and functions which may be used to perform particular
2.13 -activities.</p><p>The following resources are provided for direct use in applications:</p><ul><li><a href="login-redirect.html">LoginRedirect and Login Modules</a></li><li><a href="resource-map.html">ResourceMap - Simple Mappings from Names to Resources</a></li><li><a href="directory-resource.html">DirectoryResource - Serving Static Content</a></li></ul><p>WebStack also provides modules which provide session-like access to different kinds of repositories:</p><ul><li><a href="directory-repository.html">DirectoryRepository - Simple Access to Files in a Directory</a></li></ul></body></html>
2.14 \ No newline at end of file
2.15 +activities.</p><p>The following resources are provided for direct use in applications:</p><ul><li><a href="login-redirect.html">LoginRedirect and Login Modules</a></li><li><a href="resource-map.html">ResourceMap - Simple Mappings from Names to Resources</a></li><li><a href="directory-resource.html">DirectoryResource - Serving Static Content</a></li><li><a href="file-resource.html">FileResource - Serving Individual Files</a></li></ul><p>WebStack also provides modules which provide session-like access to different kinds of repositories:</p><ul><li><a href="directory-repository.html">DirectoryRepository - Simple Access to Files in a Directory</a></li></ul></body></html>
2.16 \ No newline at end of file
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/docs/file-resource.html Mon Nov 06 23:39:49 2006 +0000
3.3 @@ -0,0 +1,15 @@
3.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3.5 +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type" />
3.6 +
3.7 + <title>DirectoryResource - Serving Static Content</title><meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/" />
3.8 + <link href="styles.css" rel="stylesheet" type="text/css" /></head>
3.9 +<body>
3.10 +<h1>FileResource - Serving Individual Files</h1>
3.11 +<p>The <code>FileResource</code> class provides a means to
3.12 +serve individual static files from the
3.13 +filesystem. Although a <a href="directory-resource.html"><code>DirectoryResource</code></a>
3.14 +object may serve files having specific filename extensions as
3.15 +particular types from a filesystem directory, we sometimes need to
3.16 +select individual files from special locations and serve their
3.17 +contents as part of a response.</p><div class="WebStack"><h3>WebStack API - FileResource Initialisation</h3><p>The <span style="font-family: monospace;">File</span><code>Resource</code> class (found in the <code>WebStack.Resources.Static</code> module) accepts the following parameters when being initialised:</p>
3.18 +<dl><dt><code>filename</code></dt><dd>The full path to the particular static file being served.</dd><dt><code>content_type</code></dt><dd>A content type object (such as <code>WebStack.Generic.ContentType</code>) providing sufficient information for user agents to interpret the file's contents.</dd></dl></div><h2>Combining MapResource with FileResource</h2><p>One might combine <code>MapResource</code> with <code>FileResource</code> to provide a <code>favicon.ico</code> image for an application as follows:</p><pre>from WebStack.Resources.ResourceMap import MapResource<br />from WebStack.Resources.Static import FileResource<br /><br /># This is where the application's resources would be obtained.<br /><br />app_resource = ...<br /><br /># Here is where we combine MapResource and FileResource.<br /># Note that one would not necessarily hard-code directory paths into the application.<br /><br />top_resource = MapResource({<br /> "favicon.ico" : FileResource("/usr/share/apps/MyApp/images/py.ico"), ContentType("image/x-icon")),<br /> "" : app_resource<br /> })</pre><p>In the above example, the <code>favicon.ico</code> file in the <code>images</code> directory is served as <code>image/x-icon</code>.</p></body></html>
3.19 \ No newline at end of file
4.1 --- a/docs/index.html Mon Nov 06 23:38:12 2006 +0000
4.2 +++ b/docs/index.html Mon Nov 06 23:39:49 2006 +0000
4.3 @@ -24,7 +24,10 @@
4.4 sure
4.5 that the <code>WebStack-1.2</code> directory sits on your
4.6 <code>PYTHONPATH</code>.</p>
4.7 -<h2>Viewing the API Documentation</h2>
4.8 +<h2>Supported Frameworks</h2><p>With the help of Python's built-in
4.9 +standard library, WebStack can run without any additional software, but
4.10 +you may wish to investigate the other supported frameworks in order to
4.11 +run WebStack applications in other environments.</p><ul><li><a href="supported-frameworks.html">Supported Frameworks</a></li></ul><h2>Viewing the API Documentation</h2>
4.12 <p>The API documentation for use in conjunction with this
4.13 guide can be found inside the <a href="../apidocs/index.html"><code>apidocs</code></a>
4.14 directory within the <code>WebStack-1.2</code> directory. Of course,
4.15 @@ -34,4 +37,4 @@
4.16 <h2>About WebStack Applications</h2>
4.17 <ul>
4.18 <li><a href="anatomy.html">Anatomy of a WebStack Application</a></li><li><a href="developing.html">Developing a WebStack Application</a></li></ul>
4.19 -</body></html>
4.20 +</body></html>
4.21 \ No newline at end of file
5.1 --- a/docs/login-redirect.html Mon Nov 06 23:38:12 2006 +0000
5.2 +++ b/docs/login-redirect.html Mon Nov 06 23:39:49 2006 +0000
5.3 @@ -1,11 +1,9 @@
5.4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5.5 -<html xmlns="http://www.w3.org/1999/xhtml">
5.6 -<head>
5.7 - <title>LoginRedirect and Login Modules</title>
5.8 - <meta name="generator"
5.9 - content="amaya 8.1a, see http://www.w3.org/Amaya/" />
5.10 - <link href="styles.css" rel="stylesheet" type="text/css" />
5.11 -</head>
5.12 +<html xmlns="http://www.w3.org/1999/xhtml"><head>
5.13 +
5.14 + <title>LoginRedirect and Login Modules</title><meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/" />
5.15 + <link href="styles.css" rel="stylesheet" type="text/css" /></head>
5.16 +
5.17 <body>
5.18 <h1>LoginRedirect and Login Modules</h1>
5.19 <p>The <code>LoginRedirect</code> and <code>Login</code> modules
5.20 @@ -39,8 +37,7 @@
5.21 <h2>Introducing LoginRedirectResource</h2>
5.22 <p>The easiest way of introducing <code>LoginRedirectResource</code>
5.23 objects
5.24 -is to do so in the adapter code, as described in <a
5.25 - href="writing-adapters.html">"Writing Adapters"</a>. The most
5.26 +is to do so in the adapter code, as described in <a href="writing-adapters.html">"Writing Adapters"</a>. The most
5.27 significant
5.28 difference between deploying normal resources and
5.29 <code>LoginRedirectResource</code> objects is the special way in which
5.30 @@ -195,5 +192,4 @@
5.31 out. A
5.32 special logout confirmation URL may also be configured (see
5.33 <code>logout_url</code> and <code>use_logout_redirect</code> above).</p>
5.34 -</body>
5.35 -</html>
5.36 +</body></html>
5.37 \ No newline at end of file
6.1 --- a/docs/path-info-support.html Mon Nov 06 23:38:12 2006 +0000
6.2 +++ b/docs/path-info-support.html Mon Nov 06 23:39:49 2006 +0000
6.3 @@ -1,19 +1,16 @@
6.4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6.5 -<html xmlns="http://www.w3.org/1999/xhtml">
6.6 -<head>
6.7 +<html xmlns="http://www.w3.org/1999/xhtml"><head>
6.8 <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type" />
6.9 - <title>Path Info Support in Server Environments</title>
6.10 - <meta name="generator"
6.11 - content="amaya 8.1a, see http://www.w3.org/Amaya/" />
6.12 - <link href="styles.css" rel="stylesheet" type="text/css" />
6.13 -</head>
6.14 +
6.15 + <title>Path Info Support in Server Environments</title><meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/" />
6.16 + <link href="styles.css" rel="stylesheet" type="text/css" /></head>
6.17 +
6.18 <body>
6.19 <h1>Path Info Support in Server Environments</h1>
6.20 <p>The following table summarises the support for "path info" within
6.21 applications
6.22 amongst the supported server environments or frameworks within WebStack:</p>
6.23 -<table align="center" border="1" cellpadding="5" cellspacing="0"
6.24 - width="80%">
6.25 +<table align="center" border="1" cellpadding="5" cellspacing="0" width="80%">
6.26 <tbody>
6.27 <tr>
6.28 <th>Framework</th>
6.29 @@ -27,7 +24,7 @@
6.30 <td>CGI</td>
6.31 <td>Path beyond resource (correct)</td>
6.32 </tr>
6.33 - <tr>
6.34 + <tr><td align="undefined" valign="undefined">Django</td><td align="undefined" valign="undefined">Path beyond context (correct)</td></tr><tr>
6.35 <td>Java Servlet API</td>
6.36 <td>Path beyond context (correct)</td>
6.37 </tr>
6.38 @@ -55,5 +52,4 @@
6.39 </tr>
6.40 </tbody>
6.41 </table>
6.42 -</body>
6.43 -</html>
6.44 +</body></html>
6.45 \ No newline at end of file
7.1 --- a/docs/path-info.html Mon Nov 06 23:38:12 2006 +0000
7.2 +++ b/docs/path-info.html Mon Nov 06 23:39:49 2006 +0000
7.3 @@ -1,22 +1,20 @@
7.4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7.5 -<html xmlns="http://www.w3.org/1999/xhtml"><head>
7.6 - <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type" />
7.7 -
7.8 - <title>Paths To and Within Applications</title><meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/" />
7.9 - <link href="styles.css" rel="stylesheet" type="text/css" /></head>
7.10 -<body>
7.11 -<h1>Paths To and
7.12 +<html xmlns="http://www.w3.org/1999/xhtml"><head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type" /><title>Paths To and Within Applications</title>
7.13 +<meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/" /> <link href="styles.css" rel="stylesheet" type="text/css" /></head>
7.14 +<body><h1>Paths
7.15 +To and
7.16 Within Applications</h1>
7.17 <p>One thing to be aware of, in the
7.18 code of an application, is which part
7.19 of
7.20 a
7.21 -path refers to the location of the application in a server environment, and
7.22 +path refers to the location of the application in a server environment,
7.23 +and
7.24 which refers to some resource within the application itself. Consider
7.25 this
7.26 path:</p>
7.27 -<pre>/folder/application/resource</pre>
7.28 -<p>Let us say that the application
7.29 +<pre>/folder/application/resource/operation</pre><p>Let us say
7.30 +that the application
7.31 was deployed in a Zope server
7.32 instance
7.33 inside
7.34 @@ -25,48 +23,50 @@
7.35 We may
7.36 then
7.37 say that the path to the application is this:
7.38 -</p>
7.39 -<pre>/folder/application</pre>
7.40 -<p>Meanwhile, the path <span style="font-style: italic;">within</span> the
7.41 +</p><pre>/folder/application</pre><p>Meanwhile,
7.42 +the path <span style="font-style: italic;">within</span>
7.43 +the
7.44 application is just this:
7.45 -</p>
7.46 -<pre>/resource</pre>
7.47 -<p>In WebStack, we refer to this latter case - the path within the
7.48 +</p><pre>/resource/operation</pre><p>In WebStack, we
7.49 +refer to this latter case - the path within
7.50 +the
7.51 application - as the "path info".</p>
7.52 -<div class="WebStack">
7.53 -<h3>WebStack API - Paths To
7.54 +<div class="WebStack"><h3>WebStack API - Paths To
7.55 Resources Within Applications</h3>
7.56 <p>On transaction objects, the
7.57 following methods exist to inspect paths
7.58 to
7.59 resources within applications.</p>
7.60 -<dl>
7.61 - <dt><code>get_path_info</code></dt>
7.62 - <dd>This gets the path of a
7.63 +<dl> <dt><code>get_path_info</code></dt>
7.64 +<dd>This gets the path of a
7.65 resource within an application. The path should always contain a
7.66 leading <code>/</code> character at the very least.<br />
7.67 -An optional <code>encoding</code> parameter may be used to assist the process of converting the path to a Unicode object - see <a href="encodings.html">"Character Encodings"</a> for more information.</dd>
7.68 - <dt><code>get_virtual_path_info</code></dt>
7.69 - <dd>This gets the path of a
7.70 +An optional <code>encoding</code> parameter may be
7.71 +used to assist the process of converting the path to a Unicode object -
7.72 +see <a href="encodings.html">"Character Encodings"</a>
7.73 +for more information.</dd> <dt><code>get_virtual_path_info</code></dt>
7.74 +<dd>This gets the path of a
7.75 resource within a part of an application
7.76 - the application itself decides the scope of the path and can set the
7.77 "virtual path info" using the <code>set_virtual_path_info</code>
7.78 method. The path should either contain a leading <code>/</code>
7.79 character optionally followed by other characters, or an empty string.<br />
7.80 -
7.81 -An optional <code>encoding</code> parameter may be used to assist the process of converting the path to a Unicode object - see <a href="encodings.html">"Character Encodings"</a> for more information.</dd><dt><code>get_processed_virtual_path_info</code></dt>
7.82 - <dd>This gets the virtual path information which is considered to
7.83 +An optional <code>encoding</code> parameter may be
7.84 +used to assist the process of converting the path to a Unicode object -
7.85 +see <a href="encodings.html">"Character Encodings"</a>
7.86 +for more information.</dd><dt><code>get_processed_virtual_path_info</code></dt>
7.87 +<dd>This gets the virtual path information which is considered to
7.88 have been processed or traversed, and consists of the part of the path
7.89 info which does not appear in the virtual path info. In other words,
7.90 when components at the start of the virtual path info are removed, such
7.91 components will appear at the end of the processed virtual path info.<br />
7.92 -
7.93 -An optional <code>encoding</code> parameter may be used to assist the process of converting the path to a Unicode object - see <a href="encodings.html">"Character Encodings"</a> for more information.</dd>
7.94 -
7.95 -</dl>
7.96 -</div>
7.97 -<h2>Choosing the Right Path Value</h2>
7.98 -<p>Given that the path may change depending on where an
7.99 +An optional <code>encoding</code> parameter may be
7.100 +used to assist the process of converting the path to a Unicode object -
7.101 +see <a href="encodings.html">"Character Encodings"</a>
7.102 +for more information.</dd>
7.103 +</dl></div><h2>Choosing the Right Path Value</h2>
7.104 +<p>Given that the path may change depending on
7.105 +where an
7.106 application is deployed in a server environment, it may not be very
7.107 easy to use when determining which resources are being requested or
7.108 accessed within your application. Conversely, given that the "path
7.109 @@ -74,33 +74,27 @@
7.110 it may be difficult to use that to provide references or links to those
7.111 resources. Here is a summary of how you might use the different path
7.112 values:</p>
7.113 -<table style="text-align: left; width: 80%;" align="center" border="1" cellpadding="5" cellspacing="0" width="80%">
7.114 - <tbody>
7.115 - <tr>
7.116 - <th style="text-align: center;">Type of information</th>
7.117 - <th style="text-align: center;">Possible uses</th>
7.118 - </tr>
7.119 - <tr>
7.120 - <td align="undefined" valign="undefined">Path</td>
7.121 - <td align="undefined" valign="undefined">Building links to
7.122 -resources within an application.</td>
7.123 - </tr>
7.124 - <tr><td align="undefined" valign="undefined">Path without path info</td><td align="undefined" valign="undefined">Finding the location of the application in a server environment. (This is the path with the "path info" subtracted from
7.125 -the end.)</td></tr><tr>
7.126 - <td align="undefined" valign="undefined">Path info</td>
7.127 - <td align="undefined" valign="undefined">Determining which
7.128 -resources are being accessed within an application.</td>
7.129 - </tr>
7.130 - <tr>
7.131 - <td align="undefined" valign="undefined">Virtual path info</td>
7.132 - <td align="undefined" valign="undefined">This is an
7.133 +<table style="text-align: left; width: 80%;" align="center" border="1" cellpadding="5" cellspacing="0" width="80%"> <tbody> <tr> <th style="text-align: center;">Type of information</th> <th style="text-align: center;">Possible uses</th> </tr>
7.134 +<tr> <td align="undefined" valign="undefined">Path</td>
7.135 +<td align="undefined" valign="undefined">Building
7.136 +links to
7.137 +resources within an application.</td> </tr> <tr><td align="undefined" valign="undefined">Path without
7.138 +path info</td><td align="undefined" valign="undefined">Finding
7.139 +the location of the application in a server environment. (This is the
7.140 +path with the "path info" subtracted from
7.141 +the end.)</td></tr><tr> <td align="undefined" valign="undefined">Path info</td> <td align="undefined" valign="undefined">Determining
7.142 +which
7.143 +resources are being accessed within an application.</td> </tr>
7.144 +<tr> <td align="undefined" valign="undefined">Virtual
7.145 +path info</td> <td align="undefined" valign="undefined">This
7.146 +is an
7.147 application-defined version of "path info" and is discussed below.</td>
7.148 - </tr>
7.149 - </tbody>
7.150 -</table>
7.151 -<h2>Using the Virtual Path</h2>
7.152 -<p>Although WebStack sets the "path info" so that applications
7.153 -know which part of themselves are being accessed, you may decide
7.154 +</tr> </tbody></table><h2>Using the Virtual
7.155 +Path</h2>
7.156 +<p>Although WebStack sets the "path info" so that
7.157 +applications
7.158 +know which part of themselves are being accessed, you may
7.159 +decide
7.160 that upon
7.161 processing the request, these different parts of your application
7.162 should be
7.163 @@ -112,19 +106,22 @@
7.164 part they used, passing on a modified path to the other resources. For
7.165 such approaches, the "virtual path info" may be used instead, since it
7.166 permits modification within an application.</p>
7.167 -<p>So starting with a virtual path like this (which would be the same
7.168 +<p>So starting with a virtual path like this (which would be the
7.169 +same
7.170 as the "path info")...</p>
7.171 -<pre>/company/department/employee</pre>
7.172 -<p>...a resource might extract <code>company</code> from the start
7.173 +<pre>/company/department/employee</pre><p>...a
7.174 +resource might extract <code>company</code> from
7.175 +the start
7.176 of the path as follows:</p>
7.177 -<pre> # Inside a respond method...<br /> path = trans.get_virtual_path_info() # get the virtual path<br /> parts = path.split("/") # split the path into components - the first will be empty</pre>
7.178 -<p>Then, having processed the first non-empty part (remembering that
7.179 +<pre> # Inside a respond method...<br /> path = trans.get_virtual_path_info() # get the virtual path<br /> parts = path.split("/") # split the path into components - the first will be empty</pre><p>Then,
7.180 +having processed the first non-empty part (remembering that
7.181 the first part will be an empty string)...</p>
7.182 -<pre> if len(parts) > 1: # check to see how deep we are in the path<br /> process_something(parts[1]) # process the first non-empty part</pre>
7.183 -<p>...it will reconstruct the path, removing the processed part (but
7.184 -remembering to preserve a leading <code>/</code> character)...</p>
7.185 -<pre> trans.set_virtual_path_info("/" + "/".join(parts[2:]))</pre>
7.186 -<p>...and hand over control to another resource which would do the same
7.187 +<pre> if len(parts) > 1: # check to see how deep we are in the path<br /> process_something(parts[1]) # process the first non-empty part</pre><p>...it
7.188 +will reconstruct the path, removing the processed part (but
7.189 +remembering to preserve a leading <code>/</code>
7.190 +character)...</p>
7.191 +<pre> trans.set_virtual_path_info("/" + "/".join(parts[2:]))</pre><p>...and
7.192 +hand over control to another resource which would do the same
7.193 thing with the first of the other path components (<code>department</code>
7.194 and <code>employee</code>), and so on.</p>
7.195 <p>The compelling thing about this strategy is the way that each
7.196 @@ -133,17 +130,46 @@
7.197 independently from any "parent" resource. Moreover, such resources
7.198 could be deployed independently and still operate in the same way
7.199 without being "hardcoded" into assuming that they always reside at a
7.200 -particular level in a resource hierarchy.</p>
7.201 -<div class="WebStack">
7.202 +particular level in a resource hierarchy.</p><div class="WebStack">
7.203 <h3>WebStack API - Paths To
7.204 Resources Within Applications</h3>
7.205 <p>On transaction objects, the
7.206 following method exists to set virtual paths within applications.</p>
7.207 -<dl>
7.208 - <dt><code>set_virtual_path_info</code></dt>
7.209 - <dd>This sets the virtual path, affecting subsequent calls to the <code>get_virtual_path_info</code>
7.210 +<dl><dt><code>set_virtual_path_info</code></dt><dd>This
7.211 +sets the virtual path, affecting subsequent calls to the <code>get_virtual_path_info</code>
7.212 method. The path should either contain a leading <code>/</code>
7.213 -character optionally followed by other characters, or an empty string.</dd>
7.214 -</dl>
7.215 -</div>
7.216 +character optionally followed by other characters, or an empty string.</dd></dl>
7.217 +</div><h2>Summary</h2><p>The following illustration hopefully provides a more memorable way of representing the structure of paths:</p>
7.218 +<table style="text-align: left; width: 80%;" align="center" border="1" cellpadding="5" cellspacing="0" width="80%">
7.219 + <tbody>
7.220 + <tr>
7.221 + <th colspan="6" rowspan="1">URL</th>
7.222 + </tr>
7.223 + <tr>
7.224 + <th colspan="1" rowspan="4">Protocol, host, port</th>
7.225 + <th colspan="5" rowspan="1">Path</th>
7.226 + </tr>
7.227 + <tr>
7.228 + <th colspan="3" rowspan="1">Path without query</th>
7.229 + <th rowspan="3"></th>
7.230 + <th colspan="1" rowspan="3">Query</th>
7.231 + </tr>
7.232 + <tr>
7.233 + <th colspan="1" rowspan="2">Path without path info</th>
7.234 + <th colspan="2">Path info</th>
7.235 + </tr>
7.236 + <tr>
7.237 + <th>Processed virtual path info</th>
7.238 + <th>Virtual path info</th>
7.239 + </tr>
7.240 + <tr>
7.241 + <td>http://www.python.org</td>
7.242 + <td>/folder/application</td>
7.243 + <td>/resource</td>
7.244 + <td>/operation</td>
7.245 + <td>?</td>
7.246 + <td>a=1&b=2</td>
7.247 + </tr>
7.248 + </tbody>
7.249 +</table>
7.250 </body></html>
7.251 \ No newline at end of file
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/docs/supported-frameworks.html Mon Nov 06 23:39:49 2006 +0000
8.3 @@ -0,0 +1,58 @@
8.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
8.5 +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type" />
8.6 +
8.7 + <title>Supported Frameworks</title><meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/" />
8.8 + <link href="styles.css" rel="stylesheet" type="text/css" /></head>
8.9 +<body>
8.10 +<h1>Supported Frameworks</h1>
8.11 +
8.12 +<p>The server environments or frameworks supported by WebStack are as follows:</p>
8.13 +
8.14 +<table border="1" cellpadding="5" cellspacing="0">
8.15 + <tbody>
8.16 + <tr>
8.17 + <th>Framework</th>
8.18 + <th>Versions Tested</th><th>Availability</th><th>Also Required</th>
8.19 + </tr>
8.20 + <tr>
8.21 + <td>BaseHTTPRequestHandler</td>
8.22 + <td align="undefined" valign="undefined">Python 2.2.2<br />Python 2.3.3<br />Python 2.4.1</td><td>Found in Python's standard library - no additional software required</td><td align="undefined" valign="undefined"></td>
8.23 + </tr>
8.24 + <tr>
8.25 + <td>CGI</td>
8.26 + <td align="undefined" valign="undefined">Apache 2.0.44<br />Apache 2.0.53<br /> AOLserver 4.0.10<br />lighttpd 1.3.15</td><td><br /></td><td align="undefined" valign="undefined">Web server with CGI support:<br /><br /> Apache httpd (<a href="http://httpd.apache.org/">http://httpd.apache.org/</a>) AOLserver (<a href="http://aolserver.com/">http://aolserver.com/</a>)<br />lighttpd (<a href="http://www.lighttpd.net/">http://www.lighttpd.net/</a>)</td>
8.27 + </tr>
8.28 + <tr><td align="undefined" valign="undefined">Django</td><td align="undefined" valign="undefined">Django 0.95</td><td align="undefined" valign="undefined"><a href="http://www.djangoproject.com/">http://www.djangoproject.com/</a><br /></td><td align="undefined" valign="undefined"></td></tr><tr>
8.29 + <td>Jython/Java Servlet</td>
8.30 + <td align="undefined" valign="undefined">Jython 2.1, Java JDK 1.3.1_02, Tomcat 4.1.31 (Servlet 2.3)</td><td><br /></td><td align="undefined" valign="undefined">Jython (<a href="http://www.jython.org/">http://www.jython.org/</a>)<br /><br /> Java Servlet container:<br />Apache Tomcat (<a href="http://tomcat.apache.org/">http://tomcat.apache.org/</a>)</td>
8.31 + </tr>
8.32 + <tr>
8.33 + <td>mod_python</td>
8.34 + <td align="undefined" valign="undefined">3.0.3 (3.1.3 for <a href="features.html">framework cookie and session support</a>)</td><td><a href="http://www.modpython.org/">http://www.modpython.org/</a><br /></td><td align="undefined" valign="undefined">Apache httpd (<a href="http://httpd.apache.org/">http://httpd.apache.org/</a>)</td>
8.35 + </tr>
8.36 + <tr>
8.37 + <td>Twisted</td>
8.38 + <td align="undefined" valign="undefined">Twisted 1.0.5<br />Twisted 1.3.0</td><td><a href="http://www.twistedmatrix.com/">http://www.twistedmatrix.com/</a><br /></td><td align="undefined" valign="undefined"></td>
8.39 + </tr>
8.40 + <tr>
8.41 + <td>Webware</td>
8.42 + <td align="undefined" valign="undefined">0.8.1<br />CVS (2004-02-06)<br />0.9b2</td><td><a href="http://www.webwareforpython.org/">http://www.webwareforpython.org/</a></td><td align="undefined" valign="undefined">Web server supporting CGI (see above)</td>
8.43 + </tr>
8.44 + <tr>
8.45 + <td>WSGI</td>
8.46 + <td align="undefined" valign="undefined">run_with_cgi (PEP 333)</td><td><br /></td><td align="undefined" valign="undefined">Web server supporting CGI (see above)</td>
8.47 + </tr>
8.48 + <tr>
8.49 + <td>Zope 2</td>
8.50 + <td align="undefined" valign="undefined">2.7.2-0<br />2.8.0-final</td><td><a href="http://www.zope.org/">http://www.zope.org/</a><br /></td><td align="undefined" valign="undefined"></td>
8.51 + </tr>
8.52 + </tbody>
8.53 +</table>
8.54 +
8.55 +<p>Each framework has its own set of strengths and weaknesses, but the
8.56 +idea is that deployment concerns can be considered separately from the
8.57 +implementation of application functionality.<br /></p><h2>More Information</h2>
8.58 +
8.59 +<p>See the <a href="deploying-applications.html">"Deploying Applications"</a> document for information on exact deployment procedures for each of the above frameworks.</p>
8.60 +<ul></ul>
8.61 +</body></html>
8.62 \ No newline at end of file