[albatross-users] Exception: set_page() passing wrong number of parameters to page_enter()?

Sheila King sheila at thinkspot.net
Wed May 21 05:28:12 EST 2003


--On Tuesday, May 20, 2003 8:25 PM +1000 Dave Cole 
<djc at object-craft.com.au> wrote:

>>>>>> "Sheila" == Sheila King <sheila at thinkspot.net> writes:

>
> I see where you are coming from.  The problem is that the set_page()
> pretends that the server is in control of the transition from one page
> to another.
>
> What might make more sense is to do something like this in every page
> module.  Place all of the application logic in the display function.
> Let a common module check the state of the session and have it force
> global behaviour if necessary.
>
> Something as simple as this should do the trick.

...<code examples snipped>...

Dave, thank you *very* much for the additional clarifications and examples. 
Much appreciated and I'm ready to take another whack at the whole thing and 
try molding my brain to fit around Albatross a bit better.

>
> Sheila> I thought I understood that page_display() was what got called
> Sheila> when a page was simply requested in the URL, and
> Sheila> page_process() was used when a cgi form was submitted. But it
> Sheila> doesn't seem to be working that way for me.
>
> It is really up to you where you place your code.  They page_enter(),
> page_process(), and page_display() are just convenient hooks in the
> Application.run() processing sequence.
>
>     ctx = self.create_context()
>     ctx.set_request(req)
>     self.load_session(ctx)
>     self.load_page(ctx)                 # calls page_enter()
>     if self.validate_request(ctx):
>         self.merge_request(ctx)
>         self.process_request(ctx)       # calls page_process()
>     self.display_response(ctx)          # calls page_display()
>     self.save_session(ctx)
>
> The sequence is described here:
>
>
> http://www.object-craft.com.au/projects/albatross/albatross/fig-presimpex
> ec.html
>

You know, I have read pages 36 and 37 of the pdf manual several times, but 
the comments you added above do not appear there (nor on the html doc page 
you linked). I find them QUITE helpful, and have hand-notated them into my 
printed copy of the docs. Although the comment information is presented 
elsewhere in the manual, cross-correlating is quite a chore for the newbie 
attempting to just familiarize themselves with and use the package.

I've printed the entire 138 page manual, bound it in a report cover, and 
read it several times, it sometimes helps to have someone more familiar 
with the documentation rub your nose on a particular page or snippet. 
Seriously.

Thanks,

-- 
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org




More information about the Albatross-users mailing list