On Fri, Oct 3, 2014 at 8:52 AM, [email protected] <[email protected]> wrote:
> Hi Bryn,
>
> On 2 Oct 2014 at 22:23:35, Bryn Jeffries 
> ([email protected](mailto:[email protected])) wrote:
>
>> Guillaume "Louis-Marie" said:
>> > You can either:
>> > - write a new component indeed, and a script service to expose it to the
>> > scripting languages that we have on XWiki:
>> > http://extensions.xwiki.org/xwiki/bin/view/Extension/Script+Module
>> >
>> > - write it directly in Groovy inside the wiki:
>> > http://platform.xwiki.org/xwiki/bin/view/DevGuide/Scripting
>> > My extension already does something similar, see:
>> > http://extensions.xwiki.org/xwiki/bin/view/Extension/SQL+Tools
>>
>> Looking at this approach more carefully, it looks as though Groovy requires 
>> programming privileges, but Velocity does not. So is it possible to write 
>> the more sensitive parts in Groovy and then call it from a velocity page 
>> with lower privileges?
>
> I haven’t followed this thread but I’ll reply to this point only: yes it’s 
> possible.
>
> See 
> http://platform.xwiki.org/xwiki/bin/view/DevGuide/Scripting#HSharevariablebetweenlanguages

Except that you need PR in
http://platform.xwiki.org/xwiki/bin/view/DevGuide/Scripting#HSharevariablebetweenlanguages
use case since you are going to execute both groovy and velocity.

Script service is the best to provide reusable APIs.

An alternative not listed by Guillaume depending on what is your need
is to put your groovy code in a wiki macro which is then used from any
wiki code (in that case only the wiki macro document require
programming right). There is several kinds of "macros" in XWiki, wiki
macros as in http://platform.xwiki.org/xwiki/bin/view/DevGuide/WikiMacroTutorial
as not deprecated, on the contrary (they actually are components).

>
> Thanks
> -Vincent
>
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs



-- 
Thomas Mortagne
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to