A document has been updated: http://cocoon.zones.apache.org/daisy/documentation/1493.html
Document ID: 1493 Branch: main Language: default Name: EventAwareGenerator (unchanged) Document Type: Sitemap Component (unchanged) Updated on: 8/17/08 4:02:16 PM Updated by: Lukas Lang A new version has been created, state: draft Parts ===== Short description ----------------- This part has been added. Mime type: text/xml File name: null Size: 220 bytes Content: <html> <body> <p>EventAwareGenerator is a <em>JXTemplateGenerator</em>, used in the sample. The generator can be used to serve any content, using events, identified by keys for content invalidation.</p> </body> </html> Long description ---------------- This part has been added. Mime type: text/xml File name: null Size: 1576 bytes Content: <html> <body> <h3>Example</h3> <p>In this sample, a the EventAwareGenerator is used to serve the date and time of first page generation, which becomes cached content. Furthermore, it slows down page generation by two seconds. Cached content is identified by the <em>pageKey</em>.</p> <pre> <map:pipelines type="event-aware"> <map:pipeline> <map:match pattern="*"> <map:generate src="eventcache.xml" type="EventCacheSample"> <map:parameter name="DELAY_SECS" value="2" /> <map:parameter name="DATE" value="{date:date}" /> <map:parameter name="KEY" value="{request-param:pageKey}" /> </map:generate> <!-- Make use of servlet services --> <map:serialize type="servletService"> <map:parameter name="service" value="servlet:style-default:/service/blocks/dynamic-page2html"/> </map:serialize> </map:match> </map:pipeline> </map:pipelines></pre> <h3>Configuration</h3> <p>The generator can be defined as a Spring bean, without meeting special demands.</p> <pre> <!-- Event aware generator bean inherits from the jx generator --> <bean name="org.apache.cocoon.generation.Generator/EventCacheSample" class="org.apache.cocoon.samples.EventAwareGenerator" scope="prototype" parent="org.apache.cocoon.generation.Generator/jx" /></pre> </body> </html> Fields ====== CocoonComponentReference: Generator (new field) CocoonBlock: eventcache (new field) Cacheability info (DO NOT EDIT): Yes (new field) FQ Java class: org.apache.cocoon.samples.EventAwareGenerator (new field)