Return-Path:
--- <xsp:logic> +++<xsp:logic> // handle the previous page's values. String name = <xsp-request:get-parameter name="name"/>; String password = <xsp-request:get-parameter name="password"/>; (48 equal lines skipped) performing something very simple here, but you can get more complex examples from the Cocoon code-base. ------ package test; +++package test; import org.apache.avalon.framework.parameters.Parameters; import org.apache.cocoon.acting.AbstractAction; (30 equal lines skipped)Defining the Action
------ <map:actions> +++<map:actions> <map:action name="hello-world" src="test.HelloWorldAction"/> </map:actions>Using the Action
------ <map:match pattern="file"> +++<map:match pattern="file"> <map:act type="hello-world"> <map:generate type="serverpages" src="{world}_world.xsp"/> </map:act> (6 equal lines skipped) Also, the file hello_world.xsp can use the request attribute hello to produce the value world. ------ <para>Hello <xsp-request:get-attribute name="hello"/>.</para> +++<para>Hello <xsp-request:get-attribute name="hello"/>.</para>Communication between Sitemap and Action
(3 equal lines skipped) Action and the Action can return a Map object with new values which can be used in the sitemap. ------ <map:match pattern="file"> +++<map:match pattern="file"> <map:act type="hello-world" src="optional src"> <!-- and here come the parameters: --> <map:parameter name="first parameter" value="test"/> (8 equal lines skipped) top of it. The other Map objects are still accessible through a path expression. ------ <map:match pattern="*"> +++<map:match pattern="*"> <map:act type="validate-session"> <map:generate type="serverpages" src="{../1}.xsp"/> </map:act> (26 equal lines skipped) parameter. The Environment looks for a request parameter with a prefix "cocoon-action-" followed by an action name. ------ <input type="submit" name="cocoon-action-ACTIONNAME" value="click here to do something"> +++<input type="submit" name="cocoon-action-ACTIONNAME" value="click here to do something">The orginal "cocoon-action" syntax is deprecated but still (8 equal lines skipped)
So far let's have a look at at possible action set definition:
------ <map:action-sets> +++<map:action-sets> <map:action-set name="shop-actions"> <map:act type="session-invalidator" action="logoff"/> <map:act type="session-validator"/> (10 equal lines skipped)And this is a possible pipeline snipped which uses this action set:
------ <map:match pattern="*"> +++<map:match pattern="*"> <map:act set="shop-actions"> <--- HERE --> <map:generate type="serverpages" src="docs/xsp/{nextpage}.xsp"/> <map:transform src="stylesheets/page2html.xsl"/> (34 equal lines skipped) Fields ====== no changes Links ===== no changes Custom Fields ============= no changes Collections =========== no changes