cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [DAISY] Updated: Block convertions
Date Sun, 29 Apr 2007 12:24:57 GMT
A document has been updated:

Document ID: 1345
Branch: main
Language: default
Name: Block convertions (unchanged)
Document Type: Cocoon Document (unchanged)
Updated on: 4/29/07 12:24:40 PM
Updated by: Grzegorz Kossakowski

A new version has been created, state: publish


This part has been updated.
Mime type: text/xml (unchanged)
File name:  (unchanged)
Size: 3107 bytes (previous version: 1218 bytes)
Content diff:
+++ <h1>Introduction</h1>
    <p>After you <a href="daisy:1159">create</a> Cocoon's block you will
see some
    standard directory layout and some sitemap snippets already created. This
    document describes standard Cocoon block conventions that are advised to follow.
(14 equal lines skipped)
    <li>servlet services that can be called from other block</li>
--- <p>It's sensible to provide common way to do this. Proposed URI-spaces are:</p>
+++ <p>It's sensible to provide common way to do this. Proposed URI spaces are:</p>
(4 equal lines skipped)
    <p class="fixme">TODO: Describe above spaces, add info about mappings to
    directory layout and link to documents describing servlet services</p>
+++ <h1>Directory mapping</h1>
+++ <p>This URI-space is directly mapped to the following directory structure that
+++ is already created from block's archetype:</p>
+++ <pre>&lt;block's context&gt;
+++   * resource
+++       * external
+++       * internal
+++ </pre>
+++ <p>Mapping is performed by default block's pipelines that can be tweaked
+++ accordingly to your needs. For example, if you need to obtain some resources
+++ from legacy location your pipeline would look like this one:</p>
+++ <pre>&lt;map:pipeline id="external-resource"&gt;
+++   &lt;map:match pattern="resource/external/legacy/**"&gt;
+++     &lt;map:read src="legacy/location/{1}"/&gt;
+++   &lt;/map:match&gt;
+++   &lt;map:match pattern="resource/external/javascript/**"&gt;
+++     &lt;!-- Usage of this reader guarantees that all possible links in JS are properly
handled --&gt;
+++     &lt;map:read src="resource/external/javascript/{1}" type="servletLinkRewriter"&gt;
+++   &lt;/map:match&gt;
+++   &lt;map:match pattern="resource/external/**"&gt;
+++     &lt;map:read src="resource/external/{1}"/&gt;
+++   &lt;/map:match&gt;
+++ &lt;/map:pipeline&gt;
+++ </pre>
+++ <p class="note">It is important to put matcher on the beginning of the pipeline.
+++ Otherwise, generic (last in the example) pipeline would match all requests thus
+++ your legacy data would not be properly served. Consult
+++ <a href="daisy:853">sitemap documentation</a> for more information on this
+++ topic.</p>
+++ <h1>Services</h1>
+++ <p>Pipelines in <tt>servlet/**</tt> URI are special ones. In fact, they
+++ servlet services that manipulate POSTed data. You are free to name your services
+++ the way whatever you want but it's good idea to put all of them at
+++ <tt>servlet/** location.</tt></p>
+++ <p class="fixme">Provide links to the documents that discuss servlet services.
+++ As it's not documented yet I put link to the original
+++ <a href="">Daniel's
+++ proposal</a>.</p>

View raw message