A matcher that manages a "mount table", allowing to add subsitemaps to a Cocoon application without
modifying the main sitemap. This is especially useful for prototypes and demos where installing
a separate instance of Cocoon is overkill.
The mount table is an xml file which has a format similar to the map:mount syntax:
<mount-table>
<mount uri-prefix="foo" src="file://path/to/foo/directory/"/>
<mount uri-prefix="bar/baz" src="file://path/to/bar-baz/directory/"/>
</mount-table>
The matcher will scan the mount table for an "uri-prefix" value matching the beginning of the current
request URI, and if found, succeed and populate the "src" and "uri-prefix" sitemap variables.
Usage in the sitemap is therefore as follows:
<map:match type="mount-table" pattern="path/to/mount-table.xml">
<map:mount uri-prefix="{uri-prefix}" src="{src}"/>
</map:match>
This matcher accepts a single configuration parameter, indicating if missing mount tables should be
silently ignored (defaults is false , meaning "don't ignore"):
<map:matcher type="mount-table" src="org.apache.cocoon.matching.MountTableMatcher">
<map:parameter name="ignore-missing-tables" value="true"/>
</map:matcher>
This configuration is used in the main sitemap of Cocoon samples, to allow users to define their own mount
table, but not fail if it does not exist.
author: Sylvain Wallez version: $Id: MountTableMatcher.java 433543 2006-08-22 06:22:54Z crossley $ |