i see ssrx and jsrx are for including javascript / css in document. I will also need access to pictures stored in the jar, is there some way to access those? Or will i have to create both a jar (code) + a xar (images attached to a document) ----- Mail original ----- De: "Sergiu Dumitriu" <sergiu@xwiki.com> À: "XWiki Developers" <devs@xwiki.org> Envoyé: Mercredi 13 Juin 2012 00:48:25 Objet: Re: [xwiki-devs] Some quesiton regarding development of xwiki macro / extensions / plugins On 06/12/2012 09:46 AM, David Delbecq wrote:
Hello,
To customize our entreprise wiki, we have identified a few plugins / macros that we need to develop. I have checked the online xwiki documentation / tutorial, but i find them quite uncomplete, so here i am with my questions :)
1) It is my understanding that, if my macro need some specific javascript (eg jquery.js) and css, i must use xwiki skin extension. While i can find easily how to create xwiki velocity code that use those extension, i found no explanation on how to do this in java from within "public List<Block> execute(T parameters, String content, MacroTransformationContext context)"? Where can i find example of embedding javascript/css inside a java macro jar or xar?
You declare a dependency on the org.xwiki.platform:xwiki-platform-skin-api module in your project, and you declare a dependency on one or more org.xwiki.skinx.SkinExtension fields with the right hint. For example: @Inject @Named("jsrx") private SkinExtension jsrx; Then you can call jsrx.use("jquery.js") if that file is packaged as a resource whenever your macro is used. If you'r