cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piroumian, Konstantin" <KPiroum...@flagship.ru>
Subject [C2] Environment.getAction() method
Date Mon, 01 Oct 2001 09:21:27 GMT
Hi, C2ers!

Can anybody explain me why the getAction() method is in Environment
interface? Why the action param name (cocoon-action) is hard-coded and
cannot be configured? I'd like to have a possibility to select (filter)
actions to be performed by a more flexible way. I'd propose to make the
action selection mechanism configurable in sitemap. E.g.:

<map:action-sets>
  <map:action-set name="authentication" selector="url-selector">
    <map:act type="session-invalidator" action="logoff"/>
    <map:act type="session-validator"/>
    <map:act type="session-create" action="authenticate"/>
  </map:action-set>
  <map:action-set name="shop-actions" selector="url-param-selector">
    <map:act type="cart-add" action="addItem"/>
    <map:act type="cart-remove" action="removeItem"/>
    <map:act type="cart-remove-all" action="removeAll"/>
    <map:act type="cart-update" action="updateQty"/>
  </map:action-set>
</map:action-sets>

So, there could be different ways of determining if the action matches the
current request. Example:
1. URL: http://host/login - uses the URL itself to determine the action and
matches the <map:act type="session-create" action="authenticate"/>
2. URL: http://host/cart?action=addItem - uses URL param to select an action
and matches <map:act type="cart-add" action="addItem"/>

More complicated behavior is also possible (matching actions by wildcards,
regular expressions, etc.).

Are there any comments, future plans or something related to actions? Design
patterns of developing complicated sitemaps with a lot of actions or so
would be fine.

Best regards,

Konstantin Piroumian
Sr. Software engineer

Protek Flagship LLC
Phone: + 7 095 795 0520 (add. 1288)
Fax: + 7 095 795 0525
E-mail: kpiroumian@flagship.ru
http://www.protek.com











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


Mime
View raw message