Just thought I would chime in to the whole actions debate. Essentially we were finding preAction and postAction pretty difficult to use, and ended up doing two things. First we extended page to include modified version of pre and post action along with a bunch of other "dynamic" functions that would let us change the title, header and a bunch of other things dynamically depending on which action we called. This worked well, however was very complicated. Now we have moved much of our actual html out of the servlets and into templates, so we really don't need all the pre and post action stuff, actions are no different then the initial writeContent now, if an action needs to write a page it outputs content to a template otherwise we just either redirect to another page or call the default page at the end of the action. We've also modified the _request function so that servlet.py?do_action will invoke the action (note that do_action is not set to anything so it never ends up in fieldStorage)
Hope this makes sense Jose -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ian Bicking Sent: Tuesday, April 20, 2004 1:53 PM To: Matt Feifarek Cc: [EMAIL PROTECTED] Subject: Re: [Webware-discuss] Changing actions Matt Feifarek wrote: > There's a diagram in the docs for our FormKit that may help clarify > the > situation: > > http://dalchemy.com/opensource/formkit/architecture.html > > About half way down. > > For form processing, we changed pre-action and post-action to merge > the > lifecycle more closely back into the normal respond; basically, we call > writeHTML from post-action, which effectively inserts actions in > *before* the output, rather than doing "some" of the output in pre/post. Yes, that's pretty much what I was thinking too -- I was putting writeHTML in respond, but it fits more cleanly in postAction. Another option would be to require the action author to call writeHTML manually. When you are creating non-HTML content based on an action this can be convenience -- specifically, external editor support in the wiki does this for one action, but all the other actions do normal HTML processing. The way I do it there is with the special view attribute, where writeHTML is entirely suppressed if ``not self.view``. But requiring an explicit call to writeHTML would also work, and wouldn't require any very dramatic changes to Page (really, just a change to convention). Ian ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
