Guillaume "Louis-Marie" Delhumeau:
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
Yes, the Groovy stuff is very impressive. My preference for Java was to restrict access to
the code, as I still feel uneasy about the possibility that somebody could hijack the
code.
1) How
can I get the current user, so that I can use this contextual
information in my query?
You have this information in the XWikiContext object, that you can inject in your
component via a provider. (like this:
https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwi…
default/src/main/java/org/xwiki/wiki/internal/manager/DefaultWikiManager.java#L55
)
OK, so this is something that has got me thoroughly confused, since
http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents#HTheXWi… seems
to be saying you should not be using xwikicontext any more, but I couldn't see any
details about how to do something like get the user from the execution.getContext(). This
is one of those areas where the different revisions of various documentation have sent me
round in circles :-(
2) How
should I return the tabular data?
Maybe you should return a Map that you then display with some velocity code in a page.
OK, good advice, thanks.