You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Christian Haul <ha...@informatik.tu-darmstadt.de> on 2003/11/21 15:00:47 UTC

Re: Custom Action - return custom object in Map

Roman Hrivik wrote:

> Hi there,
>  
> I'm trying to do my custom action.
> I want to return any other object to sitemap
>  
> For example I will do
> mymap.put("retparam", myCustomObject)
>  
> myCustomObject has few set/get methods for example getUsPrice(), 
> getEurPrice()
>  
> what I want to ask is - how can I access myCustomObject.getUsPrice() 
> and myCustomObject.getEurPrice()
> from sitemap.
>  
>  
> I was trying something like this:
>  
> <map:act type="my-custom-action">
>     <map:generate src="content/ok.xml"/>
>     <map:transform src="style/xsl/uploadinfo.xsl">
>         <map:parameter name="par-to-transf" value="{retparam.usPrice}"/>
>     </map:transform>
>     <map:serialize type="html"/>
> </map:act>
>  
>  
> but it does not work
> I can use only {retparam}
> and when I have implemented toString() method - it will set this to 
> that field

All values will be converted to String -- you can't pass any other type 
(you can, but
it will be converted). You may convert the action to an input module or 
store data
eg as request attributes and pass only the key (or use an existing input 
module to
extract the data).

HTH
    Chris.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org