Andrzej Jan Taramina wrote:

Is it possible to write a custom serializer that accepts sitemap parameters?

For example, if I had a serializer set to the type "mySerializer", I want to do this in a sitemap:

<map:serializer type="mySerializer">
        <map:parameter name="someName" value="someValue"/>
<map:serializer>

I've tried to make my custom serializer class implement Parameterizable, and the parameterize() method is called, but then when I try to get a parameter using:

parameters.getParameter( "someName" );

it throws a ParameterException which says: "The parameter 'someName' does not contain a value".



The Parameterizable interface is equivalent to Configurable for flat configurations in the *map:components* section (component definition).


Request-time parameters (the <map:parameter> in <map:serializer>) are available to Serializers by implementing SitemapModelComponent which provides them through the setup() method.

However, the ability for serializers to implement this interface was added recently and isn't functional in the latest released version.

Hope this helps,
Sylvain

--
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to