hi roman,

AFAIR all objects returned from actions are treated as strings by the
sitemap. so this approach wouldn't work anyway. another thing, which you
already realized is the missing syntax for component property access
({foo.bar}). it would be useful, though ;-)

input modules could help here, though; in your action, instead of returning
it in the map, you assign the result (your custom object) to a
request/session attribute (e.g. 'foo'). then you can either use a custom
InputModule or the JXPathMetaModule in combination with the
RequestAttributeModule/SessionAttributeModel to get at your stuff.

jxpath allows you to access your 'bean properties' eurPrice and usPrice via
an XPath expression.

this is how it should work (I'm using cocoon 2.0.4):
 - in cocoon.xconf, configure a JXPathMetaModule instance (name it e.g.
'jx-my-custom') to use a RequestAttributeModule/SessionAttributeModule and
supply the (request/session) attribute name (e.g. 'my-custom')

now you should be able to access your custom object like:
        ...
        <map:parameter name="par-to-transf" value="{jx-my-custom:usPrice}"/>
        ...

-----Urspr�ngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Auftrag von
Roman Hrivik
Gesendet: Freitag, 21. November 2003 13:52
An: [EMAIL PROTECTED]
Betreff: Custom Action - return custom object in Map


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

Can you please direct me to the right solution ?

Thank you


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

Reply via email to