-
1. Re: Getting user and group information from withing a portle
peterj Mar 22, 2007 12:34 PM (in response to kreilly)Do either RenderRequest.getRemoteUser() or RenderRequest.getUserPrincipal() get you the information you need? There is also RenderRequest.isUserInRole().
-
2. Re: Getting user and group information from withing a portle
kreilly Mar 22, 2007 5:14 PM (in response to kreilly)Hi Peter,
Thanks for the reply.
Unfortunately, RenderRequest.getRemoteUser and RenderRequest.getUserPrinciple wont do the job. I need the user's ID so I can look up information tied to that user (such as orders).
I'm comfortable using JBossPortlet, but I was hoping there was a better way that would not cause me to access the JBoss specific classes. -
3. Re: Getting user and group information from withing a portle
bvogt Mar 23, 2007 3:42 AM (in response to kreilly)The information provided by RenderRequest.getRemoteUser is unique too, so if you just intend to identify related data, why not using this? Of course, it's not a number but this shouldn't matter.
Burkhard -
4. Re: Getting user and group information from withing a portle
kreilly Mar 23, 2007 8:21 AM (in response to kreilly)Yes, your right. I hadn't thought of that.
But my question is more along the lines of what is the best practice? Is it possible to confine myself to the javax.portlet interfaces and get a user object. If not why? Is this a shortcoming of the portlet API or am I missing something?
Thanks -
5. Re: Getting user and group information from withing a portle
theute Mar 23, 2007 8:37 AM (in response to kreilly)If you want to go the JSR 168 way and being independent of any portal you have no choice but going with bvogt solution.
There is no User object that is defined by the spec. As he said, the username can act as an id.
In theory you could have a portal vendor that doesn't associate that username with an id number. (without talking about performance) -
6. Re: Getting user and group information from withing a portle
kreilly Mar 23, 2007 11:16 AM (in response to kreilly)Thanks, that answers my question. I'm wondering why there is no user object in the Portlet spec. I guess that would then lead to a group object and so on.
But I think this is a question for another forum.
Thanks for the help!