DocumentAccessBridge is still the current way to get the context user.
Now the way ExecutionContext has been designed it will always be
generic and you are supposed to use specialised API to access
something like the current user (you are not supposed to know how
exactly it's stored in the context) and user concept will probably
always be a XWiki Platform concept anyway. Now we would like to put
Platform in Maven central but we still have lots of dependencies that
are not there.
On Fri, Jul 31, 2015 at 9:06 AM, Bryn Jeffries
<bryn.jeffries(a)sydney.edu.au> wrote:
Some time last year I had to write a component for
XWiki 6.3 that required the current user name, which following the advice at the time
required injecting a DocumentAccessBridge:
@Inject
private DocumentAccessBridge documentAccessBridge;
and then calling documentAccessBridge.getCurrentUserReference().getName())
This has the consequence of having to pull in the xwiki-core-bridge module from the
XWiki Remote Maven repo, rather than just using the XWiki Commons code in Maven Central.
At the time, Vincent mentioned
(
http://xwiki.475771.n2.nabble.com/Getting-user-name-with-a-Java-Component-t…)
"You're right, our goal is to have all context information (including the user)
be put in the Execution Context."
I'm now having to rewrite some of this component, and I'm now using XWiki 7.1.1.
Has there been any development in shifting the user name over to the Execution Context so
that I can avoid using the bridge module?
Thanks,
Bryn
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
--
Thomas Mortagne