You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Michael Wirz <mi...@abs.de> on 2005/11/25 17:28:54 UTC
passing arguments from sitemap to a serializer
Hello Cocoon-Users,
I am currently writing a customized serializer (a binding for the
Antenna House XSL Formatter). For each serializer instance
I need some customized parameters, it might look like:
<map:serialize type="html" myparam1="value1" myparam2="value2"/>
I am relatively new to the component framework. Can anyone point
my out how to get the attributes from the component context?
It might also be possible to have nested elements instead of attributes:
<map:serialize type="html">
<myparam1>value1</myparam1>
<myparam2>value2</myparam2>
</map:serialize>
or just like in a transformer:
<map:transform src="context://stylesheets/system/status2html.xslt">
<map:parameter name="myparam1" value="value1"/>
<map:parameter name="myparam2" value="value2"/>
</map:transform>
I read lots of code, but I didnt find a clue. I liked the setup-method
used in the interface for
generator and transformer which provides access to a Map of Parameters,
but Serializer
doesnt have it.
Thank you very much,
Michael Wirz
--
abs IT Service GmbH
abs gruppe
Michael Wirz
Entwicklung
Landsberger Straße 57
82266 Stegen am Ammersee
Telefon: +49 (0)8143 999 43
Telefax: +49 (0)8143 999 49
Michael.Wirz@abs.de
www.eFonds24.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: passing arguments from sitemap to a serializer
Posted by Michael Wirz <mi...@abs.de>.
Thank you, guys!
In fact, I didn't need to get further setup-Parameters than "static"
ones passed
in configuration().
But it's nice to know what is possible -- for there will be a future setup
where one can use it.
Bye,
Michael Wirz
>Sylvain Wallez wrote:
>
>
>
>>Hmmm... this *used* to be the contract. Now for a long time [1],
>>Serializers can implement SitemapModelComponent, and the pipeline object
>>then calls the setup() method.
>>
>>We should fix the docs and state this in the Serializer interface javadoc.
>>
>>
>>
>
>I'm speechless.
>
>(but fixed the javadoc)
>
>
>Jorg
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
--
abs IT Service GmbH
abs gruppe
Michael Wirz
Entwicklung
Landsberger Straße 57
82266 Stegen am Ammersee
Telefon: +49 (0)8143 999 43
Telefax: +49 (0)8143 999 49
Michael.Wirz@abs.de
www.eFonds24.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: passing arguments from sitemap to a serializer
Posted by Jorg Heymans <jh...@domek.be>.
Sylvain Wallez wrote:
> Hmmm... this *used* to be the contract. Now for a long time [1],
> Serializers can implement SitemapModelComponent, and the pipeline object
> then calls the setup() method.
>
> We should fix the docs and state this in the Serializer interface javadoc.
>
I'm speechless.
(but fixed the javadoc)
Jorg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: passing arguments from sitemap to a serializer
Posted by Sylvain Wallez <sy...@apache.org>.
Jorg Heymans wrote:
> Michael Wirz wrote:
>
>
>> Former question in short: Why does Serializer not implement
>> SiteMapModelComponent?
>> Generator, Reader, Transformer do, Serialzer should!
>>
>>
>
> It's part of the design contract of a serializer. Have a look at
> http://cocoon.zones.apache.org/daisy/documentation/writing/corecontracts/674.html
>
Hmmm... this *used* to be the contract. Now for a long time [1],
Serializers can implement SitemapModelComponent, and the pipeline object
then calls the setup() method.
We should fix the docs and state this in the Serializer interface javadoc.
Sylvain
[1] http://svn.apache.org/viewcvs.cgi?rev=26195&view=rev
--
Sylvain Wallez Anyware Technologies
http://bluxte.net http://www.anyware-tech.com
Apache Software Foundation Member Research & Technology Director
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: passing arguments from sitemap to a serializer
Posted by Michael Wirz <mi...@abs.de>.
Thanks, Jorg!
I got the point:
It should be noted that there is no way to access any of the request,
response,
or context objects within a component that just implements this
interface like
the Serializer. The idea is to keep things simple. All your response
attributes
should have been already set, and the only responsibility at this point
in time
is to give the user what he wants--the rendered object (page/image/etc.).
What I have to do is prepare the SAX Stream in such a way (using a
customized
Transformer) that it holds all information that is necessary for the
Serializer to
work. I dont quite like that idea because it forces me to mix up
document data
with additional information in the xml which is only needed for
processing the
document data.
Hm, I have to rethink the Serializer Design I think.
--> I could pass the parameters during the Serializer configuration..
Drawback would be having multiple instances of the same Serializer
with different parameters...
Might work though. And would keep things explicit and simple.
I'm gonna think about that,
if you have further suggestions, I really liked to hear/read them!
Michael
>Michael Wirz wrote:
>
>
>
>>Former question in short: Why does Serializer not implement
>>SiteMapModelComponent?
>>Generator, Reader, Transformer do, Serialzer should!
>>
>>
>>
>
>It's part of the design contract of a serializer. Have a look at
>http://cocoon.zones.apache.org/daisy/documentation/writing/corecontracts/674.html
>
>
>Jorg
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
--
abs IT Service GmbH
abs gruppe
Michael Wirz
Entwicklung
Landsberger Straße 57
82266 Stegen am Ammersee
Telefon: +49 (0)8143 999 43
Telefax: +49 (0)8143 999 49
Michael.Wirz@abs.de
www.eFonds24.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: passing arguments from sitemap to a serializer
Posted by Jorg Heymans <jh...@domek.be>.
Michael Wirz wrote:
>
> Former question in short: Why does Serializer not implement
> SiteMapModelComponent?
> Generator, Reader, Transformer do, Serialzer should!
>
It's part of the design contract of a serializer. Have a look at
http://cocoon.zones.apache.org/daisy/documentation/writing/corecontracts/674.html
Jorg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: passing arguments from sitemap to a serializer
Posted by Michael Wirz <mi...@abs.de>.
Hello again,
>I read lots of code, but I didnt find a clue. I liked the setup-method
>used in the interface for
>generator and transformer which provides access to a Map of Parameters,
>but Serializer
>doesnt have it.
>
>
Former question in short: Why does Serializer not implement
SiteMapModelComponent?
Generator, Reader, Transformer do, Serialzer should!
Should I switch to the cocoon-dev list?
Thanks,
Michael
--
abs IT Service GmbH
abs gruppe
Michael Wirz
Entwicklung
Landsberger Straße 57
82266 Stegen am Ammersee
Telefon: +49 (0)8143 999 43
Telefax: +49 (0)8143 999 49
Michael.Wirz@abs.de
www.eFonds24.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org