[Pangloss] [RFC] OpenFrame AppKit ideas

Steve Purkis spurkis at quiup.com
Tue Apr 8 10:47:01 BST 2003


Hi,

I've kept this to the Pangloss list as I'm not sure it applies to the 
OpenFrame list.  Though it is arguably off-topic for Pangloss...

Anyways:

On Monday, April 7, 2003, at 04:03  pm, Jean-Michel Hiver wrote:

>>     +	make SessionLoader segment abstract, then subclass for
>> 	Cookies, URL's, and Form params.
>
> URLs? How are you going to get the URLs to be automagically
> appended with some kind of sessionIDs?

However you like, really.  Maybe you'd pass a URI generator in to the 
template?  But how isn't so important at this stage as recognizing the 
fact that someone may want to subclass the SessionLoader to do it is.


> Plus, I think a session model based on the user name (when you do
> authentication via HTTP authentication) would also be a good idea.

There's no reason you can't sub-class SessionLoader to load the user 
from $ENV{REMOTE_USER} as needed.  But I think working with users 
should be done by the app developer as they're bound to be different 
for each application.

Having said that, perhaps a generic suite of user tools for OpenFrame 
might come in handy?


> Actually I found a neat little trick for error handling.
>
> [snip: Error + ErrorCatcher]

I was thinking of using try/catch blocks from the Error module.  But 
both would achieve the same ends.

I like your idea of passing the error object to the template, but I'd 
change the name from 'self' to 'error'.  So I guess I got it wrong in 
saying the TemplateLoader should copy across all the error vars using 
the 'error.' prefix..

Also, instead of things like 'as_xhtml()', I prefer limiting the errors 
to simple flags that the template writer uses to decide what text to 
write:

	'error.name_required'	=> $flag

Some examples... Note that I've switched over to '_' as a delimiter as 
TT2 uses '.' for method invocation / hash keys.

Petal:
	<p petal:if="error/name_required">
		Your name is required!
	</p>

TT2:
	[% IF error.name_required %]
		Your name is required!
	[% END %]

Though, as Locale::Maketext discusses, this may not always be possible. 
  So in some cases $flag could be a string passed to Locale::Maketext.  
How that's done needs to be thought out.

-Steve



More information about the Pangloss mailing list