| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <html> |
| <head> |
| <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>Velocity Generator</title> |
| <link href="http://purl.org/DC/elements/1.0/" rel="schema.DC"> |
| <meta content="in @doctitle@" name="DC.Subject"> |
| <meta content="Carsten Ziegeler" name="DC.Creator"> |
| <meta content="This document describes the Velocity template generator." name="DC.Description"> |
| </head> |
| <body> |
| |
| <h1>Velocity Generator</h1> |
| |
| <p> |
| Allows Velocity template to be used as a generator. |
| Builds upon the Velocity servlet functionality - overrides |
| the output method in order to pipe the results into SAX events. |
| </p> |
| |
| |
| <ul> |
| |
| <li>Name : velocity</li> |
| |
| <li>Class: org.apache.cocoon.generation.VelocityGenerator</li> |
| |
| <li>Cacheable: ????.</li> |
| |
| </ul> |
| |
| <pre class="code"> |
| |
| <map:generate type="velocity"/> |
| |
| </pre> |
| |
| |
| <p> |
| Cocoon Generator that produces dynamic XML SAX events |
| from a Velocity template file. |
| </p> |
| |
| |
| <h2>Sitemap Configuration</h2> |
| <p> |
| Attributes: |
| </p> |
| <dl> |
| |
| <dt>usecache (optional; default: 'false')</dt> |
| |
| <dd> |
| set to 'true' to enable template caching on the 'cocoon' |
| resource loader |
| </dd> |
| |
| |
| <dt>checkInterval (optional; default: '0')</dt> |
| |
| <dd> |
| This is the number of seconds between modification checks when |
| caching is turned on. When this is an integer > 0, this represents |
| the number of seconds between checks to see if the template was |
| modified. If the template has been modified since last check, then |
| it is reloaded and reparsed. Otherwise nothing is done. When <= 0, |
| no modification checks will take place, and assuming that the |
| property cache (above) is true, once a template is loaded and |
| parsed the first time it is used, it will not be checked or |
| reloaded after that until the application or servlet engine is |
| restarted. |
| </dd> |
| |
| </dl> |
| <p> |
| Child Elements: |
| </p> |
| <dl> |
| |
| <dt><property name="propertyName" value="propertyValue"/> |
| (optional; 0..n)</dt> |
| |
| <dd> |
| An additional property to pass along to the Velocity template |
| engine during initialization |
| </dd> |
| |
| |
| <dt><resource-loader name="loaderName" class="javaClassName"/> |
| (optional; 0..n; children: property*)</dt> |
| |
| <dd> |
| The default configuration uses the 'cocoon' resource loader |
| which resolves resources via the Cocoon SourceResolver. Additional |
| resource loaders can be added with this configuration |
| element. Configuration properties for the resource loader can be |
| specified by adding a child property element of the resource-loader |
| element. The prefix '<name>.resource.loader.' is |
| automatically added to the property name. |
| </dd> |
| |
| |
| <dt><export-object key="objectMapKey" name="velocityContextName"/> |
| (optional; 0..n)</dt> |
| |
| <dd> |
| Export the object specified by <em>key</em> from the Cocoon |
| object map to the Velocity context of the template. The object can |
| be accessed from the template as <em>name</em>. Be careful to use a |
| valid VTL variable name. |
| </dd> |
| |
| </dl> |
| <p> |
| Default Java objects exported to the Velocity context: |
| </p> |
| <dl> |
| |
| <dt>request (org.apache.cocoon.environment.Request)</dt> |
| |
| <dd>The Cocoon current request</dd> |
| |
| |
| <dt>template (java.lang.String)</dt> |
| |
| <dd>The path of the template file currently being evaluated</dd> |
| |
| |
| <dt>response (org.apache.cocoon.environment.Response)</dt> |
| |
| <dd>The Cocoon response associated with the current request</dd> |
| |
| |
| <dt>context (org.apache.cocoon.environment.Context)</dt> |
| |
| <dd>The Cocoon context associated with the current request</dd> |
| |
| |
| <dt>parameters (org.apache.avalon.framework.parameters.Parameters)</dt> |
| |
| <dd>Any parameters passed to the generator in the pipeline</dd> |
| |
| </dl> |
| |
| |
| </body> |
| </html> |