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 2008/08/17 21:09:14 UTC

[DAISY] Updated: Introduction

A document has been updated:

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

Document ID: 1501
Branch: main
Language: default
Name: Introduction (unchanged)
Document Type: Cocoon Document (unchanged)
Updated on: 8/17/08 7:09:07 PM
Updated by: Lukas Lang

A new version has been created, state: draft

Parts
=====

Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name:  (unchanged)
Size: 2831 bytes (previous version: 37 bytes)
Content diff:
--- <html><body><p>TODO</p></body></html>
+++ <html>
+++ <body>
+++ 
+++ <h1>Summary</h1>
+++ 
+++ <p>The cocoon-jms-sample block uses simple JMS text messages for invalidation of
+++ EventAware cached content. This page should give you a basic overview, of what's
+++ going on, when running the sample.</p>
+++ 
+++ <h1>Documentation</h1>
+++ 
+++ <p>The sample makes use of EventAware capabilities and consists of the following
+++ components:</p>
+++ 
+++ <ul>
+++ <li>one EventAwareGenerator</li>
+++ <li>an embedded ActiveMQ message broker</li>
+++ <li>a message topic</li>
+++ <li>a JMSEventMessageListener</li>
+++ <li>JMSPublisherActions</li>
+++ </ul>
+++ 
+++ <p>Assuming, that our sample runs the following sitemap, defining a
+++ CachingProcessingPipeline:</p>
+++ 
+++ <pre>&lt;map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"&gt;
+++   &lt;map:components&gt;
+++     &lt;map:pipes default="caching"&gt;
+++       &lt;map:pipe logger="core.sitemap" name="event-aware" src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline"&gt;
+++         &lt;parameter name="cache-role" value="org.apache.cocoon.caching.Cache/EventAware" /&gt;
+++       &lt;/map:pipe&gt;
+++     &lt;/map:pipes&gt;
+++   &lt;/map:components&gt;
+++   &lt;map:pipelines&gt;
+++     &lt;map:pipeline type="event-aware"&gt;
+++       &lt;map:match pattern="action"&gt;
+++         &lt;map:act type="JMSPublisherAction"&gt;
+++           &lt;map:parameter name="message" value="{request-param:event}" /&gt;
+++         &lt;/map:act&gt;
+++         &lt;map:redirect-to uri="demo?pageKey={request-param:pageKey}&amp;amp;rand={random:x}" /&gt;
+++       &lt;/map:match&gt;
+++       &lt;map:match pattern="*"&gt;
+++         &lt;map:generate src="eventcache.xml" type="EventCacheSample"&gt;
+++           &lt;map:parameter name="KEY" value="{request-param:pageKey}" /&gt;
+++           ...
+++         &lt;/map:generate&gt;
+++         &lt;map:serialize /&gt;
+++       &lt;/map:match&gt;
+++     &lt;/map:pipeline&gt;
+++   &lt;/map:pipelines&gt;
+++ &lt;/map:sitemap&gt;</pre>
+++ 
+++ <p>As a request is sent to the webapplication and matches the wildcard pattern,
+++ a page, including date and time of generation is being generated and stored in
+++ an EventAware cache. The request must contain a <em>pageKey </em>parameter,
+++ identifying cached content. As an example,</p>
+++ 
+++ <pre>http://localhost:8080/cocoon-jms-sample/eventcache/demo?pageKey=one</pre>
+++ 
+++ <p>would generate a site, associated with the key <em>one</em>. The
+++ EventAwareGenerator would responde the same page, as long as it is not
+++ invalidated manually by invoking an action, which sends a JMS notification to
+++ the JMSEventMessageListener:</p>
+++ 
+++ <pre>http://localhost:8080/cocoon-jms-sample/eventcache/action?event=one</pre>
+++ 
+++ <h1>Further reading</h1>
+++ 
+++ <p>If you want to lean more about events and EventAware cache, please have a
+++ look at the <a href="daisy:1478">cocoon-eventcache</a> block.</p>
+++ 
+++ </body>
+++ </html>


Fields
======
CocoonBlock: jms (new field)