Great advice, thanks. I'll give it a try. At present there's a lot that's
easiest to do and maintain in Groovy, so probably I can factor out the sensitive core code
and call that with another Groovy script.
As for Java, yes, that's probably the way to go in the long run but I've had real
problems getting Java components added to XWiki, to the point where nothing runs just
because there's something wrong with the added jar file. That's too volatile for
my system so I'm steering clear for now...
Thomas Mortagne wrote:
It's also a lot better for performance since it
means you groovy code
is built only once when it's registered.
> If you want to stay with Groovy the cleanest is probably to register
> your groovy code logic and data as a script service component and then
> call that script service (probably using Velocity) in the page where
> the user have view right. The script service is registered once and
> the user does not need to have view right of the page that contains it
> for it to be executed (once registered it's just a Java Object from
> XWiki point of view) so you can restrict access to that page.
>
> See
http://extensions.xwiki.org/xwiki/bin/view/Extension/Create+a+component+usiā¦.
>
> I would recommand to write this script service in Java since it's
> easier to regsiter it (it's automatically registered) and also a lot
> eaier to test and maintain but your choice.