The foswiki svn repository will become read-only on Friday 8/8. Developers should register for a http://github.com/ account for commit access to foswiki.

Item442: Throwing a OopsException can now be done with an message by argument

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Enhancement Closed Engine OopsException  
Adding the possibility to pass the massage to be shown by a OopsException as a parameter. This is useful, because the other way around, every plugin has to define its own template ( which the user has to use.. ) to be able to show a message, because message.tmpl needs a "additional" string which can only be "added" this way.

So i added a parameter, showmessage, which expands %MESSAGEASPARAMETER% in the oops.tmpl.

Now, the plugin can use def to use a predefined message(cool for translations) or simply use a message which is passed by argument. This message can still include %PARAM1% ..., they get expanded properly

Important: Its still backwards compatible, so all OopsExceptions which have been thrown yet are working properly and do not get influenced. Its only a addition to the current bit unhandy system

I also think about adding a default "back" button to the default oops.tmpl, because yet, casua users are simply lost in space then
There is an existing generic oops message.

throw OopsException('attention', def => 'generic', params => [ 'Your parameters' ]);

No new parameters are required. Nor does any plugin have to define it's own template.

Or am I missing what you are trying to say?


After a short discussion in the IRC Crawford just showed me how users can post such messages : throw OopsException('attention', def => 'generic', params => [ 'your message $var with $foo' ], "annother part of the massage");

that one gets displayed by :

oopsattention->generic is defined as: %TMPL:DEF{"generic"}% %PARAM1% %PARAM2% %PARAM3% %PARAM4% %TMPL:END%

Conclusion: Reverting changes, looking up the docs where it is / could be documentated

Imporved the doc. See DevelopingPlugins and follow the link to Foswiki::OopsException

ItemTemplate edit

Summary Throwing a OopsException can now be done with an message by argument
ReportedBy Foswiki:Main.EugenMayer
Codebase trunk
SVN Range TWiki-4.2.3, Wed, 06 Aug 2008, build 17396
AppliesTo Engine
Component OopsException
Priority Enhancement
CurrentState Closed
WaitingFor
Checkins Foswikirev:1293 Foswikirev:1298 Foswikirev:1299 Foswikirev:1300 Foswikirev:1310
TargetRelease patch
ReleasedIn 1.0.0
Topic revision: r11 - 22 Feb 2009, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License