On 9/27/05, Aaron Trevena <[EMAIL PROTECTED]> wrote:
> On 9/27/05, Dave Howorth <[EMAIL PROTECTED]> wrote:
> > David Baird wrote:
> > > On 9/27/05, Dave Howorth <[EMAIL PROTECTED]> wrote:
> > >>This is one of those moments where I haven't got a clue about the issue!
> > >>  I don't understand what the done flag is for, and even less what the
> > >>requirements for _run_workflow and all its friends are. So to me it all
> > >>just seems to complicate things :(
> > >
> > > The main thing I wanted it for was internal redirects -
> > > internal_redirect() is like a super-template switcheroo, where you can
> > > switcheroo the action as well. If you've completed the entire
> > > workflow, but not yet processed the template, and something calls
> > > internal_redirect(), internal_redirect() needs some way of knowing
> > > whether we're still inside the workflow (in which case, just resetting
> > > the sequence is enough to re-run a new request), or if the workflow
> > > has been completed (in which case, internal_redirect() needs to rerun
> > > the workflow itself).
> > >
> > > I'm sure similar things would be possible with the current setup as well.
> >
> > Well, Aaron said he wanted the done flag before the workflow changes,
> > but your explanation seems to be that the done flag is a detail of your
> > workflow implementation, so I'm still confused.
>
> Yes - I'd want the done flag for a bunch of situations such as :
>
> * generated xml, no need to look at templates just send it back already
> * fetch static page/image/etc and serve it straight out
> * redirect to ssl of this page, don't process data, don't do anything else
> * custom 404
> * zillions of other things.

I hadn't thought much about what it would be used for, Aaron's clearly
got a bunch of ideas already. I'm coming more from the angle of
removing implicit behaviour. Then it's easier to know what's a bug and
what's a feature. For instance, at the moment, the view isn't
processed if there's already some content. I'd prefer to  make an
explicit call that switches the view off. Similarly, the model isn't
processed if there's already a template set. I'd prefer to switch the
model off explicitly. So for that kind of thing, you need flags to
manipulate.

The done flag isn't related to my implementation, it can go into Maypole now.

>
> > Are you talking about something like the ability to rerun handler_guts?
> > Something like this in handler?
> >
> >      my $status;
> >      do { $status = $r->handler_guts() }
> >      while $status == Maypole::Constants::REDIRECT;

Kind of, but that only gives you an internal redirect from inside
handler_guts(). If you want to redirect from before (e.g. during
authentication) or after (maybe to handle an exception thrown during
view processing), you need some flags to tell you how to start over,
in particular, whether you need to call handler_guts again (because
it's already run), or not (because it's not yet run).

d.


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Maypole-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-devel

Reply via email to