Ross Gardler wrote:
Johannes Schaefer wrote:

Ross Gardler wrote:

...

Configurable behaviour
----------------------

Make the behaviour configurable using forrest.properties.xml

WARNING: This new property definition method is not officially part of Forrest, so use this technique at your own risk. However, it is used within a number of plugins at allready and appears to be a far superior configuration system than the current "official" method.

forrest.properties.xml allows you to expose configuration options for a plugin in the forrest configuration files. Plugins can provide default settings for each property, then projects, users or even site customisations can be provided. It is used extensively in the Daisy plugin.

It is largely undocumented at present, but there are plenty of notes in the issue tracker [1]

Resource Overriding
-------------------

If you simply want to replace a resource provided by the plugin, for example, substitute your own images for those supplied by the plugin you should be able to use the locationmap.

A correctly designed plugin will resolve all resources via the locationmap. Furthermore it will conform to the naming convention defined for locationmaps [2]

A well documented plugin will clearly identify what resources it exposes via its locationmap.

Taking these two things into account we can replace any resource by simply adding a match to our project locationamp for the relevant item. For example, if a pluiging provides a set of button images that are exposed in the locationmap as "fooPlugin.button.bar.gif" we can add a match like this:

<match src="fooPlugin.button.**">
  <location src="{project.home}/xdocs/images/buttons/{1}"/>
</match>

It's also worth noting that if you add a <select> tag around the <location> tag then processing will fall back to the standard plugin provided resources if no suitable project resource is provided.

Ross

[1] http://forrest.apache.org/docs_0_80/locationmap.html#namingConvention

[2] http://issues.apache.org/jira/browse/FOR-588