[Maypole] "Redirect, Get Missing Params, Return with Params" problem

From: Peter Speltz (peterspeltz at yahoo.com)
Date: Tue Dec 14 2004 - 15:31:17 GMT


Is there a general solution to the problem of getting to a form, missing some
parameters, redirecting to another page to get the parameters and then
returning to original page with those parameters?

It seems i saw a sub built into Maypole (NOT cpan module Maypole::Redirect)
would do the something of an internal redirect but Maypole style. It would
set up request object (model_class, template, etc) as if you went to that page.

Here's a description of what i'm thinking about (trying to code):

 $r->redirect('customer/create_new') -->
           1. stores current $r or just path somehow (in pnotes if modperl and
whatever for cgi (i've never used plain cgi) )
           2. process new path : (maybe call $r->parse_path to do this)
               setup $r for new path,
               call model_class->action
           3. Is get/set operator -- $r->redirect() returns what's in session
           
                       
 $r->return_from_redirect({param1 => 1, ...})
           1. restore $r from session or whatever
           2. delete the redirect from session
           3. put arg in $r->params
           4. call model_class->action

Then in the code,

EmailAccnt::create_new {
      ..
      $r->redirect('customer/create_new') if not $r->params->{cstmr_id};
      ...
}

Customer::do_edit {
     # create object
     ...
     $r->return_from_redirect({cstmr_id => $obj->id}) if $r->redirect;
      .. .
}

If this exists already, let me know Else, I ask the Maypole Workflow experts if
a general solution to this is feasible? Maybe a Maypole::InternalRedirect
module?

                               
                         

=====
pjs

                
__________________________________
Do you Yahoo!?
Yahoo! Mail - 250MB free storage. Do more. Manage less.
http://info.mail.yahoo.com/mail_250

_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:57 GMT