On May 14, 2009, at 6:54 PM, Vincent Massol wrote:
On May 14, 2009, at 6:21 PM, <glenn_engel(a)agilent.com> <glenn_engel(a)agilent.com
wrote:
-----Original Message-----
From: devs-bounces(a)xwiki.org [mailto:devs-bounces@xwiki.org] On
Behalf
Of Vincent Massol
Sent: Thursday, May 14, 2009 8:46 AM
To: XWiki Developers
Subject: Re: [xwiki-devs] Macro requiring js/css
Hi Glenn,
The solution is to use a Javascript Extension (JSX).
See
http://platform.xwiki.org/xwiki/bin/view/DevGuide/SkinExtensionsTutoria
l
Then you put the $jsx.use in your java macro.
This looks promising. From the context of a java macro is there
any way to use the $jsx type references?
You'll need to create a MacroBlock with a name of velocity.
but in any case you'll need to put you Javascript extension object in
a wiki page.
-Vincent
-Vincent
> It looks like the only thing a macro can do is return a List<Block>
> instance so I'm not sure it can affect the system header includes?
> Using a velocity page could work but seems klunky to have a plugin
> import pages into the wiki just to get a macro.
>
>>
>> In the near future (2.0M1), you'll be able to write XWiki 2.0 syntax
>> macros in wiki pages so it'll be more easy to write very UI-oriented
>> macros.
>>
>> Of course you can also write your macro as a Velocity macro right
>> now
>> in a Wiki page and attach the JXS object to that page.
>>
>> -Vincent
>>
>> On May 14, 2009, at 5:31 PM, <glenn_engel(a)agilent.com>
>> <glenn_engel(a)agilent.com
>>> wrote:
>>
>>> I have a java macro that requires the page to include an external
>>> js
>>> (e.g. jQuery) that works best if included in the head section of
>>> the
>>> document. Is there a way for a macro to trigger inclusion of
>>> resources like this to be included in the page header? In
>>> confluence this was done by having a #requireResource statement
>>> in a
>>> velocity template included by the macro.
>>>
>>>
>>>
>>> How can this be done in xwiki?