You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joakim Verona <jo...@verona.se> on 2003/11/19 16:04:34 UTC

cocoon woody/flow question

Hello list,

I'm trying to build a very simple woody/flow example, and have a 
question on how the woody/flow interaction works.

1) If I look at the "guess a number game" in the cocoon wiki, it doesn't 
use woody forms, just flow, and is pretty straightforward.

2) If I look at the woody/flow sample it uses the woody js function to 
start up the form. That starts up a form, loops it until it validates, 
and then shows an answer page. Pretty straightforward too.


Now, in my own exampe, I would like to jump between several different 
forms with the flow function.
I cant then initialize the forms with the woody function. Some wiki 
examples indicate that this isnt necessary either,
and I cant find the actual purpose of it either.

So I have tried making a woody form this way, and it behaves oddly:

A) If I use a "<input type=submit>" tag directly in the template, 
validation works, but it never leaves the validation loop.
The same form is just iterated all the time.

B) If I use a wd:submit tag (with validation=true) the validation loop 
isnt done, but its possible to see the value of the validation parameter:

cocoon.load("resource://org/apache/cocoon/woody/flow/javascript/woody2.js");

the little flow function looks like below.

function makereport() {
    var form = new Form("forms/form1.xml");
    print("before showform"); 
    form.showForm("form1-display-pipeline");
    print("after showform");   //never gets here in case A
   //gets here immediately regardless of validation in case B
    var model = form.getModel();
    if (form.isValid) {
    print("d1=" + model.startdate); 
    print("d2=" + model.enddate); 
    } else {
    print("Form is not valid");
    }
    cocoon.sendPageAndWait("ok.html");
}

How is this supposed to be done? Must each form be initialized with the 
woody function?
Doesn't this limit the possibilities of the flowscript to use only one form?
Have I missed something?


(please reply also to me if possible)
Regards,
Joakim


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


Re: cocoon woody/flow question

Posted by Joakim Verona <jo...@verona.se>.
Ok, it works as expected in 2.1.3 without calling the woody function!


/Joakim

Joe Latty wrote:

>The form object is passed to your makereport function from the woody2.js
>this is due to the lines:
>
><map:call function="woody">
>    <map:parameter name="function" value="makereport"/>
>    <!--using the following element for its form definition-->
>   <map:parameter name="form-definition" value="forms/form1.xml"/>
></map:call>
>
>Therefore your function definition would look like this
>function makereport(form) {
>        print("before showform");
>        form.showForm("form1-display-pipeline");
>        ...
>
>
>Joe
>
>----- Original Message ----- 
>From: "Joakim Verona" <jo...@verona.se>
>To: <us...@cocoon.apache.org>
>Sent: Thursday, November 20, 2003 2:04 AM
>Subject: cocoon woody/flow question
>
>
>  
>
>>Hello list,
>>
>>I'm trying to build a very simple woody/flow example, and have a
>>question on how the woody/flow interaction works.
>>
>>1) If I look at the "guess a number game" in the cocoon wiki, it doesn't
>>use woody forms, just flow, and is pretty straightforward.
>>
>>2) If I look at the woody/flow sample it uses the woody js function to
>>start up the form. That starts up a form, loops it until it validates,
>>and then shows an answer page. Pretty straightforward too.
>>
>>
>>Now, in my own exampe, I would like to jump between several different
>>forms with the flow function.
>>I cant then initialize the forms with the woody function. Some wiki
>>examples indicate that this isnt necessary either,
>>and I cant find the actual purpose of it either.
>>
>>So I have tried making a woody form this way, and it behaves oddly:
>>
>>A) If I use a "<input type=submit>" tag directly in the template,
>>validation works, but it never leaves the validation loop.
>>The same form is just iterated all the time.
>>
>>B) If I use a wd:submit tag (with validation=true) the validation loop
>>isnt done, but its possible to see the value of the validation parameter:
>>
>>
>>    
>>
>cocoon.load("resource://org/apache/cocoon/woody/flow/javascript/woody2.js");
>  
>
>>the little flow function looks like below.
>>
>>function makereport() {
>>    var form = new Form("forms/form1.xml");
>>    print("before showform");
>>    form.showForm("form1-display-pipeline");
>>    print("after showform");   //never gets here in case A
>>   //gets here immediately regardless of validation in case B
>>    var model = form.getModel();
>>    if (form.isValid) {
>>    print("d1=" + model.startdate);
>>    print("d2=" + model.enddate);
>>    } else {
>>    print("Form is not valid");
>>    }
>>    cocoon.sendPageAndWait("ok.html");
>>}
>>
>>How is this supposed to be done? Must each form be initialized with the
>>woody function?
>>Doesn't this limit the possibilities of the flowscript to use only one
>>    
>>
>form?
>  
>
>>Have I missed something?
>>
>>
>>(please reply also to me if possible)
>>Regards,
>>Joakim
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>  
>



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


Re: cocoon woody/flow question

Posted by Bruno Dumon <br...@outerthought.org>.
On Thu, 2003-11-20 at 10:19, Sylvain Wallez wrote:
> Joakim Verona wrote:
> 
> > Thanks Joe,
> >
> > I understand this, but doesn't this mean that a woody flow function 
> > can display only one form?
> >
> > The few examples I've seen also seem to imply this. The examples 
> > generally show one woody form the proceed to some jxt template to show 
> > results. Thats fine, but what if I'd like to build a wizard like GUI 
> > which proceeds between several different forms?
> >
> > If each form needs to be initialized with the woody function, this 
> > wouldn't work very well.
> >
> > I've been running cocoon 2.1.2, and I noticed that some of the woody 
> > examples changed in 2.1.3. The "registration" example works the way 
> > that seems logical to me, that is, a flow function is called and that 
> > function creates the forms without the woody(f,f) function.
> 
> 
> The "woody" function is a convenience function that basically creates a 
> new Form and calls another function. You can easily avoid using it and 
> directly call your own function. That's personally the way I do it.

yep, and I'm thinking of adjusting the samples to do it this way too. I
think the other way of using the woody function was only introduced to
be similar to the actions we already had.

-- 
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


Re: cocoon woody/flow question

Posted by Sylvain Wallez <sy...@apache.org>.
Joakim Verona wrote:

> Thanks Joe,
>
> I understand this, but doesn't this mean that a woody flow function 
> can display only one form?
>
> The few examples I've seen also seem to imply this. The examples 
> generally show one woody form the proceed to some jxt template to show 
> results. Thats fine, but what if I'd like to build a wizard like GUI 
> which proceeds between several different forms?
>
> If each form needs to be initialized with the woody function, this 
> wouldn't work very well.
>
> I've been running cocoon 2.1.2, and I noticed that some of the woody 
> examples changed in 2.1.3. The "registration" example works the way 
> that seems logical to me, that is, a flow function is called and that 
> function creates the forms without the woody(f,f) function.


The "woody" function is a convenience function that basically creates a 
new Form and calls another function. You can easily avoid using it and 
directly call your own function. That's personally the way I do it.

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com



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


Re: cocoon woody/flow question

Posted by Joakim Verona <jo...@verona.se>.
Thanks Joe,

I understand this, but doesn't this mean that a woody flow function can 
display only one form?

The few examples I've seen also seem to imply this. The examples 
generally show one woody form the proceed to some jxt template to show 
results. Thats fine, but what if I'd like to build a wizard like GUI 
which proceeds between several different forms?

If each form needs to be initialized with the woody function, this 
wouldn't work very well.

I've been running cocoon 2.1.2, and I noticed that some of the woody 
examples changed in 2.1.3. The "registration" example works the way that 
seems logical to me, that is, a flow function is called and that 
function creates the forms without the woody(f,f) function.


I'll try to build my example in 2.1.3 and see if theres a difference.

Regards,
/Joakim


Joe Latty wrote:

>The form object is passed to your makereport function from the woody2.js
>this is due to the lines:
>
><map:call function="woody">
>    <map:parameter name="function" value="makereport"/>
>    <!--using the following element for its form definition-->
>   <map:parameter name="form-definition" value="forms/form1.xml"/>
></map:call>
>
>Therefore your function definition would look like this
>function makereport(form) {
>        print("before showform");
>        form.showForm("form1-display-pipeline");
>        ...
>
>
>Joe
>
>----- Original Message ----- 
>From: "Joakim Verona" <jo...@verona.se>
>To: <us...@cocoon.apache.org>
>Sent: Thursday, November 20, 2003 2:04 AM
>Subject: cocoon woody/flow question
>
>
>  
>
>>Hello list,
>>
>>I'm trying to build a very simple woody/flow example, and have a
>>question on how the woody/flow interaction works.
>>
>>1) If I look at the "guess a number game" in the cocoon wiki, it doesn't
>>use woody forms, just flow, and is pretty straightforward.
>>
>>2) If I look at the woody/flow sample it uses the woody js function to
>>start up the form. That starts up a form, loops it until it validates,
>>and then shows an answer page. Pretty straightforward too.
>>
>>
>>Now, in my own exampe, I would like to jump between several different
>>forms with the flow function.
>>I cant then initialize the forms with the woody function. Some wiki
>>examples indicate that this isnt necessary either,
>>and I cant find the actual purpose of it either.
>>
>>So I have tried making a woody form this way, and it behaves oddly:
>>
>>A) If I use a "<input type=submit>" tag directly in the template,
>>validation works, but it never leaves the validation loop.
>>The same form is just iterated all the time.
>>
>>B) If I use a wd:submit tag (with validation=true) the validation loop
>>isnt done, but its possible to see the value of the validation parameter:
>>
>>
>>    
>>
>cocoon.load("resource://org/apache/cocoon/woody/flow/javascript/woody2.js");
>  
>
>>the little flow function looks like below.
>>
>>function makereport() {
>>    var form = new Form("forms/form1.xml");
>>    print("before showform");
>>    form.showForm("form1-display-pipeline");
>>    print("after showform");   //never gets here in case A
>>   //gets here immediately regardless of validation in case B
>>    var model = form.getModel();
>>    if (form.isValid) {
>>    print("d1=" + model.startdate);
>>    print("d2=" + model.enddate);
>>    } else {
>>    print("Form is not valid");
>>    }
>>    cocoon.sendPageAndWait("ok.html");
>>}
>>
>>How is this supposed to be done? Must each form be initialized with the
>>woody function?
>>Doesn't this limit the possibilities of the flowscript to use only one
>>    
>>
>form?
>  
>
>>Have I missed something?
>>
>>
>>(please reply also to me if possible)
>>Regards,
>>Joakim
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>  
>



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


Re: XSLT Reference Book

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.

apurva zaveri dijo:> Hello Everyone,
>
> Can anyone suggest a good XSLT reference book.

XSLT : Programmer's Reference
by Michael Kay (Author)

Another good thing from Michael is that he is an active player in the XSL
mail list:

xsl-list@lists.mulberrytech.com

So you can post questions there and maybe Michael will answer you
directly! :-D

Best Regards,

Antonio Gallardo

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


Re: XSLT Reference Book

Posted by Tony Culshaw <to...@cultech.com.au>.
The one by Michael Kay (2nd edition) is pretty full on, but I reckon the
best for completeness.

The best website I reckon is www.dpawson.co.uk

----- Original Message ----- 
From: "apurva zaveri" <az...@yahoo.com>
To: <us...@cocoon.apache.org>
Sent: Thursday, November 20, 2003 7:44 AM
Subject: XSLT Reference Book


> Hello Everyone,
>
> Can anyone suggest a good XSLT reference book.
>
>
> -Apurva Zaveri
> 201-982-0102
>
> __________________________________
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
> http://companion.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>



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


RE: XSLT Reference Book

Posted by Chris Morgan <ch...@atomicdog.com>.
I find that O'Reilly's Learning XML book by Erik T. Ray is a great, simple
reference.  The section on XSLT and XPath is relatively small, but well
written with great examples.

-----Original Message-----
From: apurva zaveri [mailto:azaveri@yahoo.com]
Sent: Thursday, November 20, 2003 10:44 AM
To: users@cocoon.apache.org
Subject: XSLT Reference Book


Hello Everyone,

Can anyone suggest a good XSLT reference book.


-Apurva Zaveri
201-982-0102

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


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


RE: XSLT Reference Book

Posted by Reinhard Poetz <re...@apache.org>.
XSLT Programmer's Reference by Michael Kay
(IMO the best book about XSLT available)

--
Reinhard

> -----Original Message-----
> From: apurva zaveri [mailto:azaveri@yahoo.com] 
> Sent: Thursday, November 20, 2003 4:44 PM
> To: users@cocoon.apache.org
> Subject: XSLT Reference Book
> 
> 
> Hello Everyone,
> 
> Can anyone suggest a good XSLT reference book.
> 
> 
> -Apurva Zaveri
> 201-982-0102
> 
> __________________________________
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
> http://companion.yahoo.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


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


Re: XSLT Reference Book

Posted by Alex Romayev <ro...@yahoo.com>.
XSLT : Programmer's Reference
by Michael Kay (Author) 

http://www.amazon.com/exec/obidos/ASIN/0764543814/qid=1069343433/sr=2-1/ref=sr_2_1/102-6892818-8473745

--- apurva zaveri <az...@yahoo.com> wrote:
> Hello Everyone,
> 
> Can anyone suggest a good XSLT reference book.
> 
> 
> -Apurva Zaveri
> 201-982-0102
> 
> __________________________________
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
> http://companion.yahoo.com/
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail:
> users-help@cocoon.apache.org
> 


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


XSLT Reference Book

Posted by apurva zaveri <az...@yahoo.com>.
Hello Everyone,

Can anyone suggest a good XSLT reference book.


-Apurva Zaveri
201-982-0102

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


Re: cocoon woody/flow question

Posted by Joe Latty <jo...@tias.com.au>.
The form object is passed to your makereport function from the woody2.js
this is due to the lines:

<map:call function="woody">
    <map:parameter name="function" value="makereport"/>
    <!--using the following element for its form definition-->
   <map:parameter name="form-definition" value="forms/form1.xml"/>
</map:call>

Therefore your function definition would look like this
function makereport(form) {
        print("before showform");
        form.showForm("form1-display-pipeline");
        ...


Joe

----- Original Message ----- 
From: "Joakim Verona" <jo...@verona.se>
To: <us...@cocoon.apache.org>
Sent: Thursday, November 20, 2003 2:04 AM
Subject: cocoon woody/flow question


> Hello list,
>
> I'm trying to build a very simple woody/flow example, and have a
> question on how the woody/flow interaction works.
>
> 1) If I look at the "guess a number game" in the cocoon wiki, it doesn't
> use woody forms, just flow, and is pretty straightforward.
>
> 2) If I look at the woody/flow sample it uses the woody js function to
> start up the form. That starts up a form, loops it until it validates,
> and then shows an answer page. Pretty straightforward too.
>
>
> Now, in my own exampe, I would like to jump between several different
> forms with the flow function.
> I cant then initialize the forms with the woody function. Some wiki
> examples indicate that this isnt necessary either,
> and I cant find the actual purpose of it either.
>
> So I have tried making a woody form this way, and it behaves oddly:
>
> A) If I use a "<input type=submit>" tag directly in the template,
> validation works, but it never leaves the validation loop.
> The same form is just iterated all the time.
>
> B) If I use a wd:submit tag (with validation=true) the validation loop
> isnt done, but its possible to see the value of the validation parameter:
>
>
cocoon.load("resource://org/apache/cocoon/woody/flow/javascript/woody2.js");
>
> the little flow function looks like below.
>
> function makereport() {
>     var form = new Form("forms/form1.xml");
>     print("before showform");
>     form.showForm("form1-display-pipeline");
>     print("after showform");   //never gets here in case A
>    //gets here immediately regardless of validation in case B
>     var model = form.getModel();
>     if (form.isValid) {
>     print("d1=" + model.startdate);
>     print("d2=" + model.enddate);
>     } else {
>     print("Form is not valid");
>     }
>     cocoon.sendPageAndWait("ok.html");
> }
>
> How is this supposed to be done? Must each form be initialized with the
> woody function?
> Doesn't this limit the possibilities of the flowscript to use only one
form?
> Have I missed something?
>
>
> (please reply also to me if possible)
> Regards,
> Joakim
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


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