Issue Details (XML | Word | Printable)

Key: XWIKI-2968
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dan M
Reporter: Vincent Massol
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XWiki Core

Implement info, warning and error macros

Created: 09/Dec/08 12:22   Updated: 23/Jun/09 18:11
Component/s: Rendering 2.0
Affects Version/s: 1.7 RC1
Fix Version/s: 2.0 M1

File Attachments: 1. Text File XWIKI-2968-1.patch (29 kB)
2. Text File XWIKI-2968-2.patch (15 kB)
3. Text File XWIKI-2968-3.patch (16 kB)
4. Text File XWIKI-2968-4-core.patch (0.8 kB)
5. Text File XWIKI-2968-4.patch (17 kB)
6. Text File XWIKI-2968-5.patch (18 kB)
7. Text File XWIKI-2968-6.patch (18 kB)
8. Text File XWIKI-2968-7.patch (16 kB)

Image Attachments:

1. Screenshot-wiki20 Main.wiki20 - XWiki - Mozilla Firefox.png
(278 kB)
Issue Links:
Dependency

keywords: patch
Date of First Response: 21/Jan/09 16:37
Resolution Date: 22/May/09 13:23
Tests: Unit


 Description  « Hide
Same as current velocity macros but implemented using the Box macro and XWIKI-2967

 All   Comments   Change History   FishEye      Sort Order: Ascending order - Click to sort in descending order
Dan M added a comment - 21/Jan/09 16:37
This patch includes both the error and the warning macros plus the appropriate tests.

Thomas Mortagne added a comment - 21/Jan/09 16:57
You should put warning, error and info macro in the same project based on the same AbstractMessageMacro or something like that because theses 3 macro have almost exactly the same code. You could even have only one java macro implementation and use the macro name to find the class name.

Dan M added a comment - 22/Jan/09 16:54
Made one single implementation for all the three macros.

Dan M added a comment - 25/Feb/09 16:17
This one fixes a couple of display issues and allows the macro to work in inline mode, as well.

Jerome Velociter added a comment - 10/Mar/09 09:13
Dan,

This patch is not good. You are forcing the macro being always inline, this is wrong.
Also, when applying this patch and XSTOUCAN-71 + XSALBATROSS-51 the styles are still not correct.
Some pom dependencies are missing (the one in core/xwiki-core for example that pulls the macro)

Jerome.


Dan M added a comment - 20/Mar/09 00:29
Fixed. It no longer forces the inline mode.

Dan M added a comment - 20/Mar/09 00:30
Adds xwiki-core/pom.xml dependency

Jerome Velociter added a comment - 26/Mar/09 14:43
You forgot to update the tests when fixing the forced inline mode. Also, the message macro is missing in xwiki-rendering-macros pom.xml build.
Last, it would be better if you could make only one patch with the different modules (rendering + xwiki-core)

Dan M added a comment - 26/Mar/09 17:41 - edited
Fixed the tests and all the other issues. What I get with these changes can be seen in the screenshot. But in order to get the expected results, it is required that the XSTOUCAN-71 patch to be applied first.

PS: So far, I took care of the toucan skin only, I haven't checked the avalon skin yet.


Dan M added a comment - 11/May/09 09:39
Because the box macro which the message macro depends on has changed, the tests were no longer working so they had to be adjusted.

Thomas Mortagne added a comment - 15/May/09 16:59 - edited
Dan why the content of the macro is in a parameter ? The content of the message is... well a content so you should use macro content instead of a parameter.

It's a lot easier to write

{{error}}
Failed to do this action. The correct possibility are:
* use another value
* you don't have right
* another possibility
{{/error}}

with macro content than with macro parameter. The velocity macro get this as parameter because it does not have much choice.


Dan M added a comment - 21/May/09 15:03
I'll take care for the macro to get its message from the content and not from the parameter. I initially chose this approach because I didn't find this detail so relevant and because the old velocity macro was designed like this.
But it would have been much better if I had been told about this problem long before (i.e. after releasing the first patch, which was... a couple of months ago). This would have helped me make this job right with less time spent on it.

Thomas Mortagne added a comment - 21/May/09 16:20
It's also typically the kind of things which could be asked on the mailing list with a proposal.

Dan M added a comment - 21/May/09 17:30 - edited
Done, fixed the problem. Now the message is taken from the content, like below:
{{error}}
Failed to do this action. The correct possibilities are:
* use another value
* you don't have right
* another possibility
{{/error}}

Tnx,
Dan


Thomas Mortagne added a comment - 22/May/09 13:23
Applied patch from Dan Miron (changing component descriptor for the new one)