You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Andrzej Jan Taramina <an...@chaeron.com> on 2003/12/12 22:26:04 UTC
Writing custom Serializer that accepts parameters?
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".
Help!
Thanks!
Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com
Re: Writing custom Serializer that accepts parameters?
Posted by Sylvain Wallez <sy...@apache.org>.
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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: AW: Writing custom Serializer that accepts parameters?
Posted by Upayavira <uv...@upaya.co.uk>.
Marco Rolappe wrote:
>>-----Ursprungliche Nachricht-----
>>Von: users-return-59869-m_rolappe=web.de@cocoon.apache.org
>>[mailto:users-return-59869-m_rolappe=web.de@cocoon.apache.org]Im Auftrag
>>von Andrzej Jan Taramina
>>Gesendet: Samstag, 13. Dezember 2003 02:43
>>An: Marco Rolappe
>>Cc: users@cocoon.apache.org
>>Betreff: Re: AW: Writing custom Serializer that accepts parameters?
>>
>>
>>Marco:
>>
>>
>>
>>>sitemap parameters are only provided to SiteMapModel
>>>
>>>
>>implementing sitemap
>>
>>
>>>components, which AFAIK is not supported for Reader's prior to
>>>
>>>
>>cocoon 2.1.
>>
>>
>
>that should of course read SitemapModelComponent, Serializer's and cocoon
>2.1.3. time to go to bed... ;-p
>
>
To paraphrase: recently, I believe, Serializers were given the capacity
to receive sitemap parameters.Either in 2.1.3, or in the CVS version.
I know something changed in this area with serializers recently, and I
think it was this.
Upayavira
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
AW: Writing custom Serializer that accepts parameters?
Posted by Marco Rolappe <m_...@web.de>.
> -----Ursprungliche Nachricht-----
> Von: users-return-59869-m_rolappe=web.de@cocoon.apache.org
> [mailto:users-return-59869-m_rolappe=web.de@cocoon.apache.org]Im Auftrag
> von Andrzej Jan Taramina
> Gesendet: Samstag, 13. Dezember 2003 02:43
> An: Marco Rolappe
> Cc: users@cocoon.apache.org
> Betreff: Re: AW: Writing custom Serializer that accepts parameters?
>
>
> Marco:
>
> > sitemap parameters are only provided to SiteMapModel
> implementing sitemap
> > components, which AFAIK is not supported for Reader's prior to
> cocoon 2.1.
that should of course read SitemapModelComponent, Serializer's and cocoon
2.1.3. time to go to bed... ;-p
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: AW: Writing custom Serializer that accepts parameters?
Posted by Andrzej Jan Taramina <an...@chaeron.com>.
Marco:
> it is not possible to obtain sitemap (pipeline) parameters via
> Parameterizable. the latter is only an alternative to Configurable; you're
> provided with the configuration (from the map:components section), in this
> case in form of Parameters.
OK...that explains why it's not working for me.
> sitemap parameters are only provided to SiteMapModel implementing sitemap
> components, which AFAIK is not supported for Reader's prior to cocoon 2.1.
I'm using a custom Serializer (not a Reader) and am on Cocoon 2.1.2 right
now. So does that mean I should be able to get ahold of sitemap parameters
somehow? If so, any ideas on how?
Thanks!
Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
SOLVED: Writing custom Serializer that accepts parameters?
Posted by Andrzej Jan Taramina <an...@chaeron.com>.
> Is it possible to write a custom serializer that accepts sitemap parameters?
Turns out that you can't really do this till 2.1.2, but the capability exists
with 2.1.3.
With some help from Marco Rolappe, I patched some of the 2.1.2 classes
(AbstractProcessingPipeline and SerializeNode), made my custom serializer
implement SitemapModelComponent and voila! A serializer that accepts sitemap
parameters.
Many thanks to Marco for his patience and advice on this! Moving to 2.1.3
was just not an option at this time, unfortunately.
Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com
AW: Writing custom Serializer that accepts parameters?
Posted by Marco Rolappe <m_...@web.de>.
hi andrzej,
it is not possible to obtain sitemap (pipeline) parameters via
Parameterizable. the latter is only an alternative to Configurable; you're
provided with the configuration (from the map:components section), in this
case in form of Parameters.
sitemap parameters are only provided to SiteMapModel implementing sitemap
components, which AFAIK is not supported for Reader's prior to cocoon 2.1.
> -----Ursprungliche Nachricht-----
> Von: users-return-59867-m_rolappe=web.de@cocoon.apache.org
> [mailto:users-return-59867-m_rolappe=web.de@cocoon.apache.org]Im Auftrag
> von Andrzej Jan Taramina
> Gesendet: Freitag, 12. Dezember 2003 22:26
> An: users@cocoon.apache.org
> Cc: dev@cocoon.apache.org
> Betreff: Writing custom Serializer that accepts parameters?
>
>
> 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".
>
> Help!
>
> Thanks!
>
>
> Andrzej Jan Taramina
> Chaeron Corporation: Enterprise System Solutions
> http://www.chaeron.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
SOLVED: Writing custom Serializer that accepts parameters?
Posted by Andrzej Jan Taramina <an...@chaeron.com>.
> Is it possible to write a custom serializer that accepts sitemap parameters?
Turns out that you can't really do this till 2.1.2, but the capability exists
with 2.1.3.
With some help from Marco Rolappe, I patched some of the 2.1.2 classes
(AbstractProcessingPipeline and SerializeNode), made my custom serializer
implement SitemapModelComponent and voila! A serializer that accepts sitemap
parameters.
Many thanks to Marco for his patience and advice on this! Moving to 2.1.3
was just not an option at this time, unfortunately.
Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org