cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivelin Ivanov" <ive...@apache.org>
Subject Re: continuation fear (was Re: [status & RT] design challenges)
Date Thu, 11 Apr 2002 12:33:30 GMT

----- Original Message -----
From: "Ovidiu Predescu" <ovidiu@apache.org>
To: "Jason Foster" <jafoster@uwaterloo.ca>
Cc: <cocoon-dev@xml.apache.org>
Sent: Thursday, April 11, 2002 1:04 AM
Subject: Re: continuation fear (was Re: [status & RT] design challenges)


> Jason,
>
> On Wed, 10 Apr 2002 22:08:00 -0400, Jason Foster <jafoster@uwaterloo.ca>
wrote:
>
> > Since I'm curious...
> >
> > > In this flow, how do you implement a jump from page1 to 2 or 3
depending
> > > on
> > > the user selection.
> > > To reuse Konstantin's example, say on the first page the user checks a
box
> > > whether s/he has a car or not.
> > > Then page 2 collects information about the car, but its optional
depending
> > > on the selection in 1.
> >
> > function transaction()
> > {
> >    sendPage("start");
> >
> >    beginTransaction();
> >
> >    var carInfoDOM = null;
> >    var personInfoDOM = sendPage("GatherPersonInfo");
> >    var hasCar = personInfoDOM.XPathQuery("//parameters/has-car");
> >
> >    if ( hasCar )
> >    {
> >      carInfoDOM = sendPage("page2");
> >    }
> >
> >    var otherInfoDOM = sendPage("page3");
> >
> >    WriteInfoToDatabase( personInfo, otherInfo, carInfo );
> >
> >    commitTransaction();
> >    ...
> >    sendPage("finish");
> > }
>
> The sendPage() function actually returns a continuation. You can
> certainly write your own wrapper function around it, to have it return
> the arguments as an XML document, but this is not how it works today.
>
> But you captured very good how a flow script works!
>
> For Ivelin: WriteInfoToDatabase could be a JavaScript function which
> invokes the Java code to do the actual writing to the database.

Thank you both for the clarification.


A random thought:


<map:pipeline>
  <map:match test="mywizard">
    <map:fetch src="page1"/>

    <map:select>
      <map:when test="hasCar">
        <map:fetch src="carInfo"/>
      </map:when>
    </map:select>

    <map:fetch src="confirmData"/>

    <map:select>
      <map:when test="confirmed">
        <map:call src="cocoon://commitAction"/>
      </map:when>
      <map:otherwise>
        <map:call src="cocoon://home"/>
      </map:otherwise>
     </map:select>

  </map:match>



>
> Regards,
> --
> Ovidiu Predescu <ovidiu@apache.org>
> http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other
stuff)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>


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


Mime
View raw message