hi cocoon-users

i was wondering that the thread i began (woody/flowscript and URI-problem), gets a little bit philosophic :-) in the meantime i redo the whole thing again and it works! must be a stupid typo-error or something like this.

anyway, here's the whole step-by-step-example how to do the woody-registration-example from the cocoon-wiki with a locale-subdirectory in the URI (for example "/en/..."). this is a great way to handle i18n.

1. first of all, i "register" my flow-script in the sitemap:
<map:script src="data/int/contactform_flow.js"/>

2. then, i call the link to request the form (note that i'm staying here in a subfolder with the locale-name, for example "/en/links.xml"):
therefore, the link "contact.diverses.form" is "/en/contact.diverses.form" from the application-root


3. and catch this request in the sitemap that calls the flow-function (i also pass the locale to the function):
<map:match pattern="*/contact.*.form">
<map:call function="contactform">
<map:parameter name="pLocale" value="{1}"/>


4. the flow-function creates the form-instance and calls the effective form-display (showForm). i use the passed locale to complete the request-URI, because it seems that flowscript calls this URI from the application-root
function contactform(pLocale) {
var form = new Form("data/int/contactform.xml");
form.showForm(pLocale + "/contact-diverses-form");


5. in the sitemap i catch the request and render the whole page with the form
<map:match pattern="*/contact-*-form">
<map:aggregate element="seite">
...


6. the form displays, i fill it out and submit it. the form-action is:
#{$continuation/id}.continue
and this translates in something like:
<form action="476e4d25543f6970591a14438b786f5451501d37.continue" method="POST">


7. i catch this in the sitemap and call the continuation (note that i'm still in my locale-subdirectory)
<map:match pattern="*/*.continue">
<map:call continuation="{2}"/>


8. the flow-function continues at the last point it stops and calls the next page (still in my locale-subdirectory):
cocoon.sendPage("contact-success-form");


9. and this again, i catch in the sitemap to render the whole answer-page:
<map:match pattern="*/contact-success-form">

greetings
stefan



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



Reply via email to