cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject Re: Question on Woody flow internals...
Date Thu, 04 Sep 2003 08:35:35 GMT
On Wed, 2003-09-03 at 00:02, jcplerm wrote:
> I've been taking a look at the following function found in file
> "woody.js".
> What I would like to understand is exactly how the form would be
> displayed to the user and, upon (re-)submission, the execution return
> to where the comment reads:
>     
>     "_show creates a continuation, the invocation of which will return
> right here".

See the bottom of this message on the dev list for an explanation of the
continuations involved:
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=105850306916270&w=2

>  
> Digging through code appears to be encouraged by the Cocoon community
> (and actually in many instances the only way of understanding how
> things work).
> So, I guess you would not mind this question...
>  
> Thanks,
>  
> jlerm
>  
> Form.prototype.show = function(uri, validator, locale) {
>     var lastWebCont = this.lastWebContinuation;
>     // create a continuation, the invocation of which will resend
>     // the page: this will be used to implement automated "back"
>     // navigation
>     var wk = this.start(lastWebCont);
>  
>     if (locale == null)
>         locale = java.util.Locale.getDefault();
>  
>     while (true) {
>         if (cocoon.request == null) {
>             // this continuation has been invalidated
>             this.dead = true;
>             handleInvalidContinuation();
>             Woody.suicide();
>         }
>         var thisWebCont = this._show(uri, locale, wk);
>         // _show creates a continuation, the invocation of which
>         // will return right here: it is used to implement 
>         // automated "next" navigation
>         if (this.dead ||  cocoon.request == null) {
>             // this continuation has been invalidated
>             handleInvalidContinuation();
>             suicide();
>         }
>  
>         var formContext = 
>             new
> Packages.org.apache.cocoon.woody.FormContext(this.woody.request,
> locale);
>         var finished = this.form.process(formContext);
>         var evt = formContext.getActionEvent();
>         if (evt != null) {
>             this.submitId = String(evt.getActionCommand());
>         } else {
>             this.submitId = undefined;
>         }
>         if (validator != undefined) {
>             finished = validator(this) && finished;
>         }
>         if (finished) {
>             break;
>         }
>     }
> }
-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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


Mime
View raw message