Michael Wolf wrote:
Hello,
two weeks ago I was very motivated to implement a web-project with cocoon. Now I'm really frustrated with cocoon.


I was very impressed by cocoons control flow, where in my first cocoon project (using cocoon 2.1 dev), I was using the sendPageAndWait and act methods.

Now the act method doesn't work anymore. In the documentation it is still recommended to use the modular database actions from the flow, but nowhere is explained how it is done.

As a general piece of advice, if you are going to work with a dev version of an OS project, you ought to monitor the dev list for any discussions which may impact you. The deprecation of act in flow and the redesign of the flow object model was discussed heavily here at the time and you probably could have saved yourself a lot of headache.


I've found pages in the documentation talking about a legacy script that allows to still use the act method from the flow.

Then I've found mails where someone states that there is no need for the legacy script and one should be able to use the actions via the getComponent method.

But, of course, nowhere in the documentation is explained how to do it.
After posting in this mailing-list I got a hint how to access the action using the getComponent method.

Be aware that the subject of actions in flow has a lot of history. You are not seeing the documentation or getting a lot of info because it is really not seen as a good direction by most (possibly all). That's the reason the act method is gone. It's still technically possible (probably - to my knowledge no one has done much of anything with it) but discouraged.


Now, your particular case is really about out of the box database components accessible in flow - the fact that this historically was only available in actions is coincidence. There are a lot of different opinions here about what Cocoon should provide. There is a lot of movement toward providing easy integration with O/R projects like OJB. I personally feel it will also be important to have something like the modular database actions (perhaps even keeping much of its code) as standard components accessible from the flow. I don't have time to work on that, and don't know if others have the same view, but I see it as a need.

But now there is the act method of the action with its parameters. Again, there is no information how to do this.

Now, if you really want to try to get those actions working under flow you'll need to be aware that the subset of people interested in helping with that is much smaller than with other issues - you'll probably need to post specific questions with good analysis (at least a good stacktrace/log trail).


Now, about calling the act method - you should be able to come up with all the objects it needs and call it right from flow. In fact, you may be able to pass in null as some of the objects if you're sure it the mod-db actions don't use them. Come to think of it, a quick and dirty way to find out what they (the actions) need is to pass in all parameters as null and fix each specific problem as it arises. It won't get you a PhD in Computer Science but it's crazy enough that it just may work.

For two weeks I tried to get the modular database actions running from the flowscript as it is recommended in the modular database action sample shipped with the 2.1.2 cocoon version.

I've not seen that recommendation personally - as discussed many would not recommend it. Your other options are really to
- refactor the actions to run as standalone components,
- write your own jdbc code in components,
- totally switch your design to work with the (still experimental?) ojb block
- don't use flow in that part of your project.


Given those options, I'd say you'll probably have the best luck with the path you've been trying but that's just my quick opinion.

Is this recommendation wrong?
If not, how is it done?

I am really grateful for any help you can provide.

Well, it's not much but I hope that helps,


Geoff



Reply via email to