Generators
Generators form the start of a pipeline and there should always be one present (but see aggregate, mount and read). Currently supported generators are:
Component Declaration
Generators are defined in the component declaration part of the Sitemap.
<map:generators default="file">
<map:generator name="file" src="resource://lib/generation/FileGenerator"/>
<map:generator name="directory" src="resource://lib/generation/DirectoryGenerator"/>
<map:generator name="px" src="resource://lib/generation/PXTemplateGenerator"/>
</map:generators>
The default attribute specifies the type of generator to use if none is specified in a pipeline.
Using generators
Generators should always be placed first in a pipeline. The only exception to this is an aggregator (which will have an implied generator as part of its use),
and the mount and read components. For example (using the
above component declaration) the following is a simple pipeline extract:
<map:match pattern="*.xml">
<map:generate src="context://content/{1}.xml" label="xml-content" cachable="no" type="px"/>
<-- Some transforms -->
<map:serialize type="xhtml"/>
</map:match>
where
- type — the type of generator to be used (defined in the component declaration by the name
attribute). If this is omitted then the default type from the component declaration is used.
- src — the file to be input into the pipeline.
- cachable — should this component use caching (yes|no). The default is ``no''
- label — the label used by the views
facility
Copyright 2006 – 2024 Hugh Field-Richards. All Rights Reserved.