|
[
Permlink
| « Hide
]
Dan M added a comment - 21/Jan/09 16:37
This patch includes both the error and the warning macros plus the appropriate tests.
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,
This patch is not good. You are forcing the macro being always inline, this is wrong. Jerome. 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) 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
PS: So far, I took care of the toucan skin only, I haven't checked the avalon skin yet. 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. 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. It's also typically the kind of things which could be asked on the mailing list with a proposal.
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, Applied patch from Dan Miron (changing component descriptor for the new one)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||