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?