1.1 --- a/docs/writing-adapters.html Tue Apr 19 22:32:46 2005 +0000
1.2 +++ b/docs/writing-adapters.html Sun Apr 24 15:43:10 2005 +0000
1.3 @@ -1,36 +1,29 @@
1.4 -<?xml version="1.0" encoding="iso-8859-1"?>
1.5 -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
1.6 - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1.7 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1.8 <html xmlns="http://www.w3.org/1999/xhtml">
1.9 <head>
1.10 <title>Writing Adapters</title>
1.11 - <meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/" />
1.12 + <meta name="generator"
1.13 + content="amaya 8.1a, see http://www.w3.org/Amaya/" />
1.14 <link href="styles.css" rel="stylesheet" type="text/css" />
1.15 </head>
1.16 -
1.17 <body>
1.18 <h1>Writing Adapters</h1>
1.19 -
1.20 -<p>Depending on how "simple" the adapter code is allowed to be for a given
1.21 -server environment (see the <a href="deploying.html">table</a> for a
1.22 +<p>Depending on how "simple" the adapter code is allowed to be for a
1.23 +given
1.24 +server environment (see the <a href="#table">table</a> for a
1.25 summary), you will either need to write a small piece of code which
1.26 -initialises and deploys your application, or to produce a more complicated
1.27 +initialises and deploys your application, or to produce a more
1.28 +complicated
1.29 piece of code which satisfies some more demanding server requirements.</p>
1.30 -
1.31 <h2>Simple Adapters - Using the deploy Function</h2>
1.32 -
1.33 -<p>When deploying an application, it is possible to use a one-shot deployment
1.34 +<p>When deploying an application, it is possible to use a one-shot
1.35 +deployment
1.36 function for BaseHTTPRequestServer, CGI, Twisted and WSGI. The
1.37 <code>deploy</code> function is called as follows:</p>
1.38 -<pre>deploy(resource)
1.39 -deploy(resource, authenticator) # where authenticators are used</pre>
1.40 -
1.41 +<pre>deploy(resource)<br />deploy(resource, authenticator) # where authenticators are used</pre>
1.42 <p>For some frameworks, an address may be specified:</p>
1.43 -<pre>deploy(resource, address=(host_string, port_integer))
1.44 -deploy(resource, authenticator, address=(host_string, port_integer))</pre>
1.45 -
1.46 +<pre>deploy(resource, address=(host_string, port_integer))<br />deploy(resource, authenticator, address=(host_string, port_integer))</pre>
1.47 <p>Here is a summary of which frameworks require address information:</p>
1.48 -
1.49 <table border="1" cellpadding="5" cellspacing="0">
1.50 <tbody>
1.51 <tr>
1.52 @@ -55,13 +48,72 @@
1.53 </tr>
1.54 </tbody>
1.55 </table>
1.56 -
1.57 -<h2>Complicated Adapters - Providing Framework-Specific Objects</h2>
1.58 -
1.59 -<p>The remaining frameworks (Java Servlet, mod_python, Webware and Zope) do
1.60 -not support the <code>deploy</code> function due to the way applications are
1.61 -typically integrated into the various server mechanisms. In these cases, it
1.62 -may be worth investigating the examples provided and using their adapter code
1.63 -as a template for the code for your own applications.</p>
1.64 +<h2><a name="table" />Complicated Adapters - Providing
1.65 +Framework-Specific Objects</h2>
1.66 +<p>The remaining frameworks (Java Servlet, mod_python, Webware and
1.67 +Zope) do
1.68 +not support the <code>deploy</code> function due to the way
1.69 +applications are
1.70 +typically integrated into the various server mechanisms. In these
1.71 +cases, it
1.72 +may be worth investigating the examples provided and using their
1.73 +adapter code
1.74 +as a template for the code for your own applications. Here is a summary
1.75 +which
1.76 +indicates the server environments or frameworks which need most work:</p>
1.77 +<table border="1" cellpadding="5" cellspacing="0">
1.78 + <tbody>
1.79 + <tr>
1.80 + <th>Framework</th>
1.81 + <th>Adapter Code Requirements</th>
1.82 + <th>Deployment Process</th>
1.83 + </tr>
1.84 + <tr>
1.85 + <td>BaseHTTPRequestHandler</td>
1.86 + <td>Simple - see above</td>
1.87 + <td>Run the adapter code directly</td>
1.88 + </tr>
1.89 + <tr>
1.90 + <td>CGI</td>
1.91 + <td>Simple - see above</td>
1.92 + <td>Web server runs the adapter code</td>
1.93 + </tr>
1.94 + <tr>
1.95 + <td>Java Servlet</td>
1.96 + <td>Must subclass <code>HttpServlet</code></td>
1.97 + <td>Application must be deployed using supplied tools</td>
1.98 + </tr>
1.99 + <tr>
1.100 + <td>mod_python</td>
1.101 + <td>Must implement <code>handler</code> function</td>
1.102 + <td>Web server runs the adapter code (which must be declared
1.103 +within Apache)</td>
1.104 + </tr>
1.105 + <tr>
1.106 + <td>Twisted</td>
1.107 + <td>Simple - see above</td>
1.108 + <td>Run the adapter code directly</td>
1.109 + </tr>
1.110 + <tr>
1.111 + <td>Webware</td>
1.112 + <td><= 0.8.1: Must implement <code>InstallInWebKit</code>
1.113 +function<br />
1.114 +> 0.8.1: Simple, but must provide a <code>urlParser</code> object</td>
1.115 + <td>Application must be deployed within WebKit</td>
1.116 + </tr>
1.117 + <tr>
1.118 + <td>WSGI</td>
1.119 + <td>Simple - see above</td>
1.120 + <td>Web server runs the adapter code</td>
1.121 + </tr>
1.122 + <tr>
1.123 + <td>Zope</td>
1.124 + <td>Must provide lots of Zope administative classes and functions</td>
1.125 + <td>Application must be deployed within Zope</td>
1.126 + </tr>
1.127 + </tbody>
1.128 +</table>
1.129 +<p>See <a href="deploying-applications.html">"Deploying an Application"</a>
1.130 +for more details of the deployment process for each environment.</p>
1.131 </body>
1.132 </html>