haul 01/11/26 01:52:08 Modified: webapp Tag: cocoon_20_branch sitemap.xmap Log: Fixed stateful examples + re-enabled them Revision Changes Path No revision No revision 1.11.2.41 +29 -14 xml-cocoon2/webapp/sitemap.xmap Index: sitemap.xmap =================================================================== RCS file: /home/cvs/xml-cocoon2/webapp/sitemap.xmap,v retrieving revision 1.11.2.40 retrieving revision 1.11.2.41 diff -u -r1.11.2.40 -r1.11.2.41 --- sitemap.xmap 2001/11/23 13:51:59 1.11.2.40 +++ sitemap.xmap 2001/11/26 09:52:07 1.11.2.41 @@ -142,7 +142,7 @@ necessity, matchers can be nested while chaining does not work. Related concepts are selectors and actions. - Since this is important, let me repeat it: Selectors are executed + Since this is important, let me repeat it: Matchers are executed during pipeline setup. --> @@ -202,7 +202,11 @@ pipelines. Use them to update databases, check external resources etc. The execution may fail or complete successfully. Only if the execution was successful, the pipeline fragment contained inside is - used within the pipeline. + used within the pipeline. Related concepts are matchers and + selectors. + + Since this is important, let me repeat it: Actions are executed + during pipeline setup. --> <map:actions> @@ -267,9 +271,20 @@ </map:resource> <map:resource name="dynamic-page1"> + <map:dump-parameters/> + <!-- print all current sitemap parameters to log --> <map:act type="session-state"> - <map:parameter name="new-state" value="{../next-state}"/> - <map:redirect-to resource="dynamic-page" target="{../target}/state{../../../org.apache.cocoon.SessionState}{../../next-state}"/> + <map:parameter name="new-state" value="{../0}"/> + <!-- + use the complete string that was matched as a parameter. Compare + this with @target below. There the third sitemap parameter refers to + the very same string. Very this by looking at the log. This + irritating effect stems from the fact, that the above map:parameter + belongs conceptually still to the parent element while all other + nested tags are, well, nested. + --> + <map:dump-parameters/> + <map:redirect-to resource="dynamic-page" target="{../target}/state{../../../0}{../../0}"/> </map:act> </map:resource> @@ -331,7 +346,7 @@ You may have as many pipelines in your sitemap as you like. However, it seems that the only purposes would be to specify different error - handlers or mount subsitemaps. + handlers. --> <map:pipelines> @@ -746,6 +761,7 @@ <!-- =========================== Dynamic ================================ --> <map:match pattern="xsp/*"> + <map:dump-parameters/> <map:generate type="serverpages" src="docs/samples/xsp/{1}.xsp"/> <map:transform src="stylesheets/dynamic-page2html.xsl"> <map:parameter name="view-source" value="docs/samples/xsp/{1}.xsp"/> @@ -842,32 +858,31 @@ <!-- This example like the next one show, that matches can be nested and don't need to match on URIs alone. By using a - session attribute or the referer header for matches it is + session attribute or the referer header for matches it is easy to model a state machine with the sitemap. - There are user documents on this. + There are user documents on this. --> <map:act type="session-isvalid"> <!-- if session is valid ... --> <map:match type="sessionstate" pattern="1"> - <!-- if a specific session attribute matches pattern "1" --> + <!-- if a specific session attribute matches pattern "1" --> <map:match type="next-page" pattern="1"> - <map:redirect-to resource="dynamic-page1" target="docs/samples/session-state"/> - <!-- by redirecting to this resource, the rest - of this fragment here is irrelevant --> + <map:redirect-to resource="dynamic-page1" target="docs/samples/session-state"/> + <!-- by redirecting to this resource, the rest of this fragment here is irrelevant --> </map:match> <map:match type="next-page" pattern="2"> - <map:redirect-to resource="dynamic-page1" target="docs/samples/session-state"/> + <map:redirect-to resource="dynamic-page1" target="docs/samples/session-state"/> </map:match> </map:match> <map:match type="sessionstate" pattern="2"> <map:match type="next-page" pattern="1"> - <map:redirect-to resource="dynamic-page1" target="docs/samples/session-state"/> + <map:redirect-to resource="dynamic-page1" target="docs/samples/session-state"/> </map:match> <map:match type="next-page" pattern="2"> - <map:redirect-to resource="dynamic-page1" target="docs/samples/session-state"/> + <map:redirect-to resource="dynamic-page1" target="docs/samples/session-state"/> </map:match> </map:match>
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]