1.1 --- a/docs/paths-filesystem.html Sun Nov 20 23:37:12 2005 +0000
1.2 +++ b/docs/paths-filesystem.html Sun Nov 20 23:37:51 2005 +0000
1.3 @@ -3,7 +3,6 @@
1.4
1.5 <title>Treating the Path Like a Filesystem</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 <body>
1.9 <h1>Treating the Path Like a
1.10 Filesystem</h1>
1.11 @@ -96,11 +95,10 @@
1.12 <div class="WebStack">
1.13 <h3>WebStack API - Predefining
1.14 Resource Hierarchies in Adapter Code</h3>
1.15 -<p>WebStack provides a resource
1.16 -class for convenient mapping of path
1.17 -components (ie. names) to resource objects:
1.18 -<code>WebStack.Resources.ResourceMap.MapResource</code></p>
1.19 -<p>This class can be used in <a href="deploying.html">adapter code</a>
1.20 +
1.21 +<p>WebStack provides the <code>MapResource</code>
1.22 +class (in the <code>WebStack.Resources.ResourceMap</code> module) for convenient mapping of path
1.23 +components to resource objects<code></code>. See the <a href="resource-map.html">"ResourceMap - Simple Mappings from Names to Resources"</a> document for a more detailed description of the <code>MapResource</code> class.</p><p>This class can be used in <a href="deploying.html">adapter code</a>
1.24 to initialise an
1.25 application as follows:</p>
1.26 <pre>from WebStack.Resources.ResourceMap import MapResource<br />from MyApplication import FileResource # import some resource class<br /><br />article_resource = FileResource(...) # make a resource representing the article<br />document_resource = FileResource(...) # make a resource representing the document<br />year_2004_resource = MapResource({"document.html" : document_resource})<br />year_2005_resource = MapResource({"article.html" : article_resource})<br />news_resource = MapResource({"2005" : year_2005_resource, "2004" : year_2004_resource})<br />documents_resource = MapResource({"news" : news_resource})<br />top_resource = MapResource({"documents" : documents_resource})</pre>