Re: [xwiki-users] Getting user name with a Java Component

2015-07-31 Thread Bryn Jeffries
I wrote: Fair enough. For some reason I'm really struggling to include the right repository for Platform. What details should I be using in my settings.xml? I've included everything from the example in http://dev.xwiki.org/xwiki/bin/view/Community/Building but I still can't resolve the

Re: [xwiki-users] Getting user name with a Java Component

2015-07-31 Thread Thomas Mortagne
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

Re: [xwiki-users] Getting user name with a Java Component

2015-07-31 Thread Bryn Jeffries
Thomas Mortagne wrote: 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

Re: [xwiki-users] Getting user name with a Java Component

2015-07-31 Thread Thomas Mortagne
On Fri, Jul 31, 2015 at 9:47 AM, Bryn Jeffries bryn.jeffr...@sydney.edu.au wrote: Thomas Mortagne wrote: 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

Re: [xwiki-users] Getting user name with a Java Component

2014-11-28 Thread vinc...@massol.net
  On 28 Nov 2014 at 07:00:26, Marius Dumitru Florea (mariusdumitru.flo...@xwiki.com(mailto:mariusdumitru.flo...@xwiki.com)) wrote: On Nov 28, 2014 12:33 AM, Bryn Jeffries wrote: I wrote: What's the right way to get the current user from the execution context within a Java

Re: [xwiki-users] Getting user name with a Java Component

2014-11-28 Thread Bryn Jeffries
From: vinc...@massol.net [vinc...@massol.net] OK, so I should not use ExecutionContext at all? You’re right, our goal is to have all context information (including the user) be put in the Execution Context. However, currently, we’re in a transition phase, trying to move from the old

Re: [xwiki-users] Getting user name with a Java Component

2014-11-28 Thread Bryn Jeffries
From Marius: 3) Presumably the document reference captures the full location of the user's profile page. The DocumentReference API doesn't appear to have a page name accessor, so presumably to extract the user name I need to pull it out of userDoc.toString(). What information do you need

Re: [xwiki-users] Getting user name with a Java Component

2014-11-27 Thread Bryn Jeffries
I wrote: What's the right way to get the current user from the execution context within a Java component? Thomas Mortagne replied: For what you need the simplest in a component is usually to use org.xwiki.bridge.DocumentAccessBridge component (from xwiki-platform-bridge module) until a

Re: [xwiki-users] Getting user name with a Java Component

2014-11-27 Thread Marius Dumitru Florea
On Nov 28, 2014 12:33 AM, Bryn Jeffries bryn.jeffr...@sydney.edu.au wrote: I wrote: What's the right way to get the current user from the execution context within a Java component? Thomas Mortagne replied: For what you need the simplest in a component is usually to use

[xwiki-users] Getting user name with a Java Component

2014-11-26 Thread Bryn Jeffries
What's the right way to get the current user from the execution context within a Java component? Taking the example from the guide (http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents) I thought it would be something like the following, which won't compile for me due to the

Re: [xwiki-users] Getting user name with a Java Component

2014-11-26 Thread Thomas Mortagne
Looks like you did not read http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents#HTheXWikicontext fully and are mixing ExecutionContext and XWikiContext, ExecutionContext does not have any typed methods, it's just a map basically and most of the time you don't really use it directly