forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Re: [[use of a xconf variable]
Date Thu, 08 Jun 2006 14:20:39 GMT
Cyriaque Dupoirieux wrote:
>    I want to add a variable to configure the doctype.
> 
> At the moment we have in the dispatcher internal.xmap :
>      <map:serializer logger="sitemap.serializer.xhtml" 
> mime-type="text/html"
>        name="xhtml" pool-grow="2" pool-max="64" pool-min="2"
>        src="org.apache.cocoon.serialization.XMLSerializer">
>        <doctype-public> -//W3C//DTD XHTML 1.0 Strict//EN </doctype-public>
>        <doctype-system> http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
>          </doctype-system>
>        <encoding>UTF-8</encoding>
>        <indent>yes</indent>
>        <omit-xml-declaration>yes</omit-xml-declaration>
>      </map:serializer>
> 
> And I want to change it into :
>      <map:serializer logger="sitemap.serializer.xhtml" 
> mime-type="text/html"
>        name="xhtml" pool-grow="2" pool-max="64" pool-min="2"
>        src="org.apache.cocoon.serialization.XMLSerializer">
> *        <doctype-public>{project:doctype-public}</doctype-public>
>        <doctype-system>{project:doctype-system}
>          </doctype-system>*
>        <encoding>UTF-8</encoding>
>        <indent>yes</indent>
>        <omit-xml-declaration>yes</omit-xml-declaration>
>      </map:serializer>
> 
> The variables {project:doctype-public} and {project:doctype-system} have 
> been declared in the forrest-core.xconf :
>        <doctype-public>@project.doctype-public@</doctype-public>
>        <doctype-system>@project.doctype-system@</doctype-system>


This is not good. Dispatcher is a plugin and forrest-core.xconf is core. 
Therefore this entry cannot go in there. But all is not lost...

It is exactly this problem (with the Daisy plugin) that prompted me to 
write the new forrest.properties.xml config system. This is in 0.8-dev 
and works fully, but it is not documented yet, nor have we moved the 
samples over to using the new approach. This would require a vote and 
I've been delaying that until 0.8 is out the door, I don't want testing 
and design review to get in the way of the release.

The good news is that since the dispatcher is a whiteboard plugin 
scheduled for release sometime in the 0.9-dev cycle you can safely use 
it now. In fact, I would encourage you to do so as it will provide 
further user testing of the feature.

It's really easy to use. Just add your property to the plugins 
forrest.properties.xml file (see the Daisy plugin for examples), it will 
automatically be exposed in the sitemap, just use the usual 
{project:foo.bar} syntax.

Values can be overridden in the same way as normal property definitions 
(i.e. by providing a project or site specific forrest.properties.xml).

I'd recommend using a naming convention for properties to prevent name 
collisions. I've been using "pluginname.foo.bar"

For more info see [1]

Enjoy

Ross

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

Mime
View raw message