1.1 --- a/docs/Web-resource.html Tue Jul 19 14:49:29 2005 +0000
1.2 +++ b/docs/Web-resource.html Tue Jul 19 16:00:54 2005 +0000
1.3 @@ -116,6 +116,25 @@
1.4 <pre> # Complete the response.<br /><br /> self.send_output(trans, [trans_xsl], structure)</pre>
1.5 <p>At this point, the user should receive their edited form and be able
1.6 to make more modifications.</p>
1.7 +<h3>Deployment Details</h3>
1.8 +<p>Some additional code is required to deploy this example application
1.9 +using WebStack. We have chosen to expose the above resource class using
1.10 +a special function which can be called from outside the package to
1.11 +obtain an instance of the class:</p>
1.12 +<pre># Site map initialisation.<br /><br />def get_site():<br /><br /> "Return a simple Web site resource."<br /><br /> return VerySimpleResource()</pre>
1.13 +<p>To actually deploy the application, we could choose one of many
1.14 +server environments supported by WebStack. For clarity, we choose here
1.15 +to write the following separate program which we can save under the
1.16 +name <code>VerySimpleApp.py</code> (for example):</p>
1.17 +<pre>#!/usr/bin/env python<br /><br />from WebStack.Adapters.BaseHTTPRequestHandler import deploy<br />import VerySimple<br /><br /># Get a simple Web site.<br /><br />resource = VerySimple.get_site()<br /><br /># Special magic incantation.<br /><br />print "Serving..."<br />deploy(resource, handle_errors=0)</pre>
1.18 +<p>Ensuring that the example application's package (which we
1.19 +called <code>VerySimple</code> in the directory structure
1.20 +document), WebStack, libxml2dom and XSLForms are available to the above
1.21 +program, we may now run this program:</p>
1.22 +<pre>python VerySimpleApp.py</pre>
1.23 +<p>It should then be possible to visit the URL <code>http://localhost:8080/</code>
1.24 +and edit the form in your Web browser.<br />
1.25 +</p>
1.26 <h2>Further Enhancements</h2>
1.27 <p>We should now have an application which can be deployed and tested
1.28 using the usual WebStack techniques. However, more advanced templates