You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by da...@cocoon.zones.apache.org on 2007/04/29 14:24:57 UTC
[DAISY] Updated: Block convertions
A document has been updated:
http://cocoon.zones.apache.org/daisy/documentation/1345.html
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
Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name: (unchanged)
Size: 3107 bytes (previous version: 1218 bytes)
Content diff:
<html>
<body>
+++ <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>
</ul>
--- <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>
<ul>
<li>resource/external/**</li>
(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><block's context>
+++ * 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><map:pipeline id="external-resource">
+++ <map:match pattern="resource/external/legacy/**">
+++ <map:read src="legacy/location/{1}"/>
+++ </map:match>
+++ <map:match pattern="resource/external/javascript/**">
+++ <!-- Usage of this reader guarantees that all possible links in JS are properly handled -->
+++ <map:read src="resource/external/javascript/{1}" type="servletLinkRewriter">
+++ </map:match>
+++ <map:match pattern="resource/external/**">
+++ <map:read src="resource/external/{1}"/>
+++ </map:match>
+++ </map:pipeline>
+++ </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 are
+++ 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="http://article.gmane.org/gmane.text.xml.cocoon.devel/67487">Daniel's
+++ proposal</a>.</p>
+++
</body>
</html>