cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ovidiu Predescu <ovi...@cup.hp.com>
Subject Re: [RT] Forms and wizards (was: RE: HEADS UP - cocoon form handling (long!!))
Date Tue, 16 Apr 2002 19:23:47 GMT
On Tue, 16 Apr 2002 20:01:28 +0200, Mats Norén <mats@alma.nu> wrote:

> Ovidiu,
> 
> > I think actions should work fine if you put them right before
> > <map:call function="..."/> in a pipeline. Actions don't generate any
> > SAX events on the pipeline, so they should not interfere with the
> > later invocation of the sitemap via sendPage() or
> > sendPageAndContinue() functions.
> 
> I was more thinking about a way to dynamically plug them into the
> flow-scripts.. :)
> Since they don´t interfere with the pipelines...
> DatabaseActions in perticular could prove useful.
> I remember that there were some discussions about actions and their
> whereabouts but I don´t remember the conclusions (if there were any) :)

So how would you like to describe these actions? Have them be invoked
without you coding an explicit function call to them?

What you can do is call a trampoline function, which does the action
first, and then calls your function. Something like this:

  <map:match pattern="...">
    <map:call function="doAction">
      <map:parameter name="func" value="startFlow"/>
      // Arguments for the 'startFlow' function if any should go here
    </map:call>
  </map:match>

In your script you'd then have something like:

function doAction(func, args)
{
  // Do your action here
  ...

  // Now call the function that executes the control flow
  func.apply(this, args);
}


function startFlow(arg1, arg2, arg3 etc.)
{
  // Do your flow here
}

To also have the actions executed when continuations are restarted,
I'll add the ability to specify a different function that handles
them. You'll then be able to specify your own continuation restarting
function (currently that's hard-coded to
handleContinuation). Something like this:

function myContinuationHandler(kont, args)
{
  doAction(kont.continuation, args);
}

Is this the same thing you were looking for?


Greetings,
-- 
Ovidiu Predescu <ovidiu@cup.hp.com>
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


Mime
View raw message