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 2005/10/05 14:02:50 UTC

[DAISY] Created: Cocoon 2.2 Sitemap internals

A new document has been created.

http://cocoon.zones.apache.org/daisy/documentation/732.html

Document ID: 732
Branch: main
Language: default
Name: Cocoon 2.2 Sitemap internals
Document Type: Document
Created: 10/5/05 12:02:40 PM
Creator (owner): Helma van der Linden
State: publish

Parts
=====

Content
-------
Mime type: text/xml
Size: 2377 bytes
Content:
<html>
<body>

<p class="note">This information pertains to Cocoon 2.2!</p>

<h1>Sitemap processing</h1>

<p>Sitemap processing is done in three phases:</p>

<ol>
<li>building an internal representation of the sitemap</li>
<li>generating a pipeline that matches an incoming request</li>
<li>executing the pipeline</li>
</ol>

<h2>Phase 1: Build the sitemap tree</h2>

<p>In Cocoon 2.2 the sitemap is internally represented by a tree that contains a
node for each matcher, generator, transformer, serializer and other modules used
in the sitemap. This process is executed each time the sitemap is changed and
needs to be reloaded.<br/>
The actual process is done by the TreeProcessor. It builds an sitemap object
tree and creates a ServiceManager. This is done for each sitemap and subsitemap.
</p>

<p class="note">Subsitemaps are only converted into a tree when they are needed.
</p>

<h2>Phase 2: Generate the pipeline</h2>

<p>When a request comes in, the tree is executed. This means that each matcher
is called with a request, until a matcher returns true. From that point the
underlying subtree is executed. All actions and selectors are resolved against
the current request. This means in effect that the subtree will revert to a
single path through the tree with only a generator, transformers and a
serializer as components.</p>

<h2>Phase 3: Executing the pipeline</h2>

<p>Once the pipeline is built in the previous phase, its execution is invoked by
calling generator.generate().</p>

<h1>The simple process</h1>

<p>Assume a simple site which contains only one sitemap. In that case the phases
are executed in order. When the sitemap is changed, Cocoon is triggered to
reload the sitemap. The reloading is executed when a new request comes in. At
that point, the current sitemap tree is marked for deletion. All the previous
requests are still handled by the old version of the sitemap and a counter
counts down the requests until all requests are handled. Then the old version of
the sitemap is actually deleted.<br/>
In the meantime a new tree is built and a new version of the ServiceManager is
setup. During the build process, all requests (i.e. the request that triggered
the reload and all subsequent requests) are suspended until the build phase is
completed. Then all suspended requests are matched against the new version of
the tree.</p>

</body>
</html>

Collections
===========
The document belongs to the following collections: documentation