On Feb 16, 2011, at 11:10 AM, Maxime Sinclair wrote:
@Vincent My question is about a groovy wiki macro,
sorry for the lack
of precision. I will read the suggested page about the Configuration
module. Thank you for the link.
ok we have not done this yet. I can see 2 solutions:
1) You create an XClass and an XObject with the config data and you access that XObject
from the macro
2) You lookup the ConfigurationSource using Utils.getComponent()
IMO the best is 1).
Thanks
-Vincent
@Guillaume Yes I already read it and I didn't find
anything about this
concern. But it's a very good tutorial and a "must read" for anyone
who want to create a macro.
2011/2/15 Guillaume Lerouge <guillaume(a)xwiki.com>om>:
> Hi Maxime,
>
> On Tue, Feb 15, 2011 at 12:30, Maxime Sinclair
<maxime.sinclair(a)gmail.com>wrote;wrote:
>
>> Hello,
>>
>> What is the best way to create a configurable macro ?
>> For example, a macro uses an external resource (like the address of a
>> server). The administrator of the wiki must configure this resource
>> during the installation of the macro (just after the import). Of
>> course, he can update the source code of the macro but it is not very
>> user friendly.
>
>
>> Do you have any suggestions ? Thank for your help.
>>
>
> Have you looked at
>
http://platform.xwiki.org/xwiki/bin/view/DevGuide/WikiMacroTutorial ?
>
> Guillaume
>
>
>> Maxime Sinclair