cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Olsen <...@sanderman.com>
Subject RE: [C2]Action proposal (long)
Date Thu, 09 Nov 2000 11:07:48 GMT


> I'd like to thank you all for patiently waiting for this proposal.
> I know I was very ternse the last days. This is because I'm have 
> to finish some projects apart from Cocoon.

It wasn't such a long waiting. :-) But I'm also new to this list.

 
> Action proposal
........... General description of the sitemap
> boolean value representing the result of the test in the <when> tag.
> 


> But there is no component that deals with modifying the state of
> your application model. Using an XSP page because you can integrate
> logic in it is IMO wrong.

I couldn't agree more. In C1 producers where almost impossible to
use so XSP where the easiest way to imposse logic. C2 has the
mathers, selectors and soon actions to do the logic and XSP is then
reduced to mere dynamic content generation.

> Actions (like Matchers and Selectors in general) are used as an
> extension to the sitemap engine. They incorporating logic for
> event capturing, data validation, changing the state of the 
> underlying application model and passing data along to the 
> producing components in the environment objects (Request, 
> Response, Session, Context). From the sitemap point of view they 
> could be collected into action-chains to reduce verbosity if the
> same sequence of actions are used at several places in the sitemap 
> pipelines. Actions communicate with other sitemap component during 
> pipeline evaluation time through environment objects. 
> 
> We have seen in an earlier discussion that we can distinguish 
> between explicit and implicit action. Explicit actions are those 
> presented to the user in kinda control panels or alike (update 
> that, insert this, check those, etc.). 
> 
> Question: Is it suitable to implement some semantic directly into 
> the sitemap to select the right action out of an action-chain 
> because usually only one action gets posted by a client and 
> executed out of a set of explicit actions? Example:
> 
> 	<action-chain name="database-manipulation>
> 	 <act type="insert-action" action="insert"/>
> 	 <act type="delete-action" action="delete"/>
> 	 ...
> 	</action-chain>
> 
> The posted action is selected according to the action attribute and 
> by a TBD mechanism for the sitemap to aquire the posted action.

-1 This sematic is dbl. implementing things that is really a selector.
In it's essence the above is just a short for the action/selector sematic.
You still need some "Action" or "ActionChainParser" to extract the data to
be able to select the correct action.
I like the idea of an action chain for a stack of events but as an action
selector I simply don't see the need.
In your own example you demonstrate a case where the power of using a
selector instead of making an action chain selctor is shown. When you don't
JUST want an action but also a special generator or transformation applied.
>    <select type="action-result-checker">
>     <when test="kill-task">
>      <!-- this action kills a task that was initiated
>           previously by another action using data made
>           available by the Action above.
>      -->
>      <act type="task-killer"/>
>      <generate src="myapp/{theme}/task-killing-status-page"/>
>     </when>
>     <otherwise>
>      <generate src="myapp/deny"/>
>     </otherwise>
>    </select>

> 
> This way we don't need to add semantics to the sitemap itself and 
> we can put it into a resource instead of a action-chain to achieve 
> the same verbosity reduction if we need to use the same fragment 
> from several places. This construct will obsolete the need for 
 > action-chains.
> 
> Implicit actions are those which do processings not directly 
> choosable by clients like form data validation and session 
> management. 
> 
> The sitemap engine is only able to distinguish action-chains from
> actions but not explicit actions from implicit action. The sitemap
> engine will call ations in an action-chain in the order they are
> defined and thus leaving it to the action object itself to 
> determine if it should do something. In the case we implement the 
> semantics explained above with the action attribute to an <act> 
> element in a action-chain the sitemap engine will do this selection. 
> 
> 
>   <action-chain name="secure-data-entry">
>    <act type="session-validator"/>
>    <act type="admin-authorizer"/>
>    <act type="validate-form">
>     <parameter name="schema" 
>       value="my-path-to-schema-resource.xsd"/>
>    </act>
>    <act type="save-form"/>
>   </action-chain>

It is not just the action that generate state information. The chain itself
should also generate some information in case one of the actions in the
chain fail.
When the authorization fail I want the make one response if the form didn't
validate I want another one.


Looking forward to your response.
Brian

Brian Olsen
Management Supporter
SanderMan.com,
Røjelskær 11, DK-2840 Holte, Denmark
Mobile: +45 4070 2261, Tel.:+45 4546 9900, Fax.: +45 4546 9966
E-mail: bro@sanderman.com



-Disclaimer
The information in this e-mail message is intended only for the
addressee. Disclosure or use by others is prohibited. Due to the
electronic transmission of the message, no legal rights can be
obtained from the content.



Mime
View raw message