On Mar 15, 2012, at 12:34 PM, Jerome Velociter wrote:
> On Thu, Mar 15, 2012 at 9:23 AM, Vincent Massol <[email protected]> wrote:
>> Hi devs,
>>
>> I see that in several pages we have a use the following:
>>
>> {{error}}
>> $error.message
>> {{/error}}
>>
>> Where error is an Exception returned by a script service.
>>
>> This is done in the Scheduler, in the Extension Manager and in the my new
>> IRC Bot application.
>>
>> The problem is that this will only show the message but not the full stack
>> trace which contains the real problem…
>>
>> So here's what I propose:
>>
>> 1) Create an internal helper WrappingTextBlockGenerator.generate() class
>> (I'd locate it in the Macro Transformation module for lack of a better
>> place, see point 4 below) and method which returns the XDOM Blocks to do
>> this. Namely two divs with the proper "class" set.
>> 2) Introduce a VelocityTool to help deal with Exceptions. I propose to make
>> ExceptionUtils from commons-lang available as a Velocity Tool:
>> http://commons.apache.org/lang/api/org/apache/commons/lang3/exception/ExceptionUtils.html
>> 3) Modify the Message Macro to support the feature of displaying only the
>> first line of text and hiding subsequent lines and when the user clicks on
>> the text, the rest unrolls.
>
> A "Show details" link/button would be more explicit. Or you mean to
> have a visual clue there is more text somewhere ?
This proposal is not about improving the current visual but yes we should
improve it to provide a cue that the message can be clicked.
Current = what is displayed when a rendering macro throws an Exception.
Thanks
-Vincent
> Jerome.
>
>> I propose to do this by introducing a new "format" parameter that you would
>> use like this: {{info|warning|error
>> format="compact|normal"}}….{{/info|warning|error}}. By default format would
>> be "normal" which means everything displayed. This feature would use
>> WrappingTextBlockGenerator.generate for the implementation.
>> 4) Update MacroTransformation.generateError() to use
>> WrappingTextBlockGenerator.generate
>> 5) Modify Scheduler, Extension Manager, IRC Bot application to use this new
>> feature.
>>
>> For example for the IRC Bot application:
>>
>> #set ($error = $botManager.getLastError())
>> #if ("$!error" != "")
>> {{error format="compact"}}
>> $error.message
>> $exceptiontool.getMessage($error)
>> {{/error}}
>> #end
>>
>> WWDYT?
>>
>> Thanks
>> -Vincent
>> _______________________________________________
>> devs mailing list
>> [email protected]
>> http://lists.xwiki.org/mailman/listinfo/devs
>
>
>
> --
> Jérôme Velociter
> Winesquare
> http://www.winesquare.net/
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs