On Thu, 8 Nov 2001, Piroumian, Konstantin wrote:

> Hi, C2ers!
>
> I've already asked this question and it seems that nobody could answer it.
> The question is: why the Environment interface has getAction() method which
> returns the value of 'cocoon-action' (hard-coded) parameter from the
> request. It would be much better to be able to set the action name (or a
> filter/pattern expression) in the sitemap. E.g.:
>
> <!-- For a registration process we have three actions: start, user input
> processing, cancel -->
> <map:actions>
>     <map:action name="start-process" src="regtest.StartProcessAction"/>
>     <map:action name="input-process" src="regtest.InputAction"/>
>     <map:action name="cancel-process" src="regtest.CancelProcessAction"/>
> </map:actions>
>
> <!-- The action set for the registration process -->
>  <map:action-sets>
>       <map:action-set name="registration-process">
>            <map:act type="start-process" action="Start"/>
>            <map:act type="input-process" action="Input"/>
>            <map:act type="cancel-process" action="Cancel"/>
>         </map:action-set>
>  </map:action-sets>
>
> <!-- Entry point for all registration requests -->
> <map:match pattern="registration/*">
>     <map:act-set type="registration-process" action="{1}">
>          <map:read type="jsp" src="jsp/{current-page}.jsp"
>      </map:act>
>     <map:read src="html/error.htm"/>
> </map:match>
>
> So, requests will be of this form:
>     /registration/Start - the StartProcessAction will be called
>     /registration/Input - InputAction
>     /registration/Cancel - CancelProcessAction

Of course this is a way to go. Can you give an example if the actual
action request is comming from a html button in a form (is encoded as a
parameter instead of URI-path)?

And, yes, patches are welcome.

Giacomo

>
> As you can see there is no need to use any '?cocoon-action=Start' or so in
> the request and IMO using 'registration/Start' is much better - you have
> clean separation of posted data and the action. I think, it will be easy to
> implement, but requires changes to Environment interface (remove or
> deprecate getAction()).
>
> The document that pushed me to this idea is related to Struts, but it can
> apply also to C2 application development as well:
> http://husted.com/about/scaffolding/catalog.htm . Many good
> advice/hints/tricks from it could be used in C2 too.
>
> Are there any comments on this or other ideas?
>
> Btw, comparing Struts and Cocoon, I must admit, that Struts has much more
> clear concepts and it's much easier in use and installation than Cocoon. The
> only thing that keeps me with C2 is that Struts has no XML/XSP/XSLT
> capabilities and almost all its features are only a subset of Cocoon's and
> can be easily implemented with C2.
>
> Best regards,
>
> Konstantin Piroumian
> Program Leader
>
> Protek Flagship LLC
> Phone: + 7 095 795 0520 (add. 1288)
> Fax: + 7 095 795 0525
> E-mail: [EMAIL PROTECTED]
> http://www.protek.com
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>
>
>


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

Reply via email to