cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira>
Subject Re: using actions in flow
Date Thu, 27 Nov 2003 12:38:24 GMT
Michael Wolf wrote:

> Hello,
> after I searched the net for three days, asked a developer and posted 
> in the cocoon-user mailing list all I found for my problem is the same 
> unanswered question.
> So I decided to post in this mailing list, because this seems to be a 
> problem no one besides the developers is able to solve.
> -----------------------------------------------------------
> I want to use a modular Database Action in my flowscript.
> I tried this approach:
> myAction = cocoon.getComponent(???);
> result = myAction.act("mod-db-sel","",{"table-set" : "login_check"});
> cocoon.release(myAction);

I'm no expert at all here, but have you tried:
myAction = cocoon.getComponent("mod-db-sel");

(ie. using the 'name' as specified in the sitemap?)

I'm not sure if the cocoon.getComponent() method will allow for loading 
components defined in the sitemap.

If not, then you'll have to add your compoent to cocoon.roles, and then 
you'll be able to do cocoon.getComponent() on it.

cocoon.roles is in the cocoon jar file, but there are ways to create 
your own, rather than having to edit the core Cocoon one.

<disclaimer>I haven't done any of this, I'm just repeating what I've 
heard, and assume to be the case. Others can correct me.</disclaimer>

Hope this helps.

Regards, Upayavira

> The cocoon.getComponent method expects a component id, but how do I 
> get this id?
> I tried
> myAction = 
> cocoon.getComponent(;

> but that didn't work.
> For completeness here is the action description in the 
> sitemap/components/actions section:
> <map:action name="mod-db-sel" 
> src="org.apache.cocoon.acting.modular.DatabaseSelectAction">
>    <descriptor>descriptors/database.xml</descriptor>
>    <throw-exception>false</throw-exception>
> </map:action>
> So please tell me how this action is called from the flowscript.
> Thanks for your help,
> Michael

View raw message