user information roles and groups

View: New views
5 Messages — Rating Filter:   Alert me  

user information roles and groups

by jeremie garcia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi community ,

I am currently writting a portlet, the main interface will be adapted
according to the user.
consequently I need to know how to get information from the current user,
I need to know how exoplatform manages user's information , user's
groups,etc..

does someone have informations or any direction to look at?

thanks



--
You receive this message as a subscriber of the exoplatform@... mailing list.
To unsubscribe: mailto:exoplatform-unsubscribe@...
For general help: mailto:sympa@...?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

Re: user information roles and groups

by Laurent Laudinet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

First you get the user login :

String login = portletRequest.getRemoteUser();

Then you ask the OrganizationService about it

OrganizationService aOrgService = (OrganizationService)
                PortalContainer.getInstance().getComponentInstanceOfType
(OrganizationService.class);
UserHandler aUsrHdler = aOrgService.getUserHandler();
User myUser = aUsrHdler.findUserByName(login);

Best regards,


On Tue, 2007-05-22 at 15:58 +0200, jeremie garcia wrote:

> hi community ,
>
> I am currently writting a portlet, the main interface will be adapted
> according to the user.
> consequently I need to know how to get information from the current user,
> I need to know how exoplatform manages user's information , user's
> groups,etc..
>
> does someone have informations or any direction to look at?
>
> thanks
>
> plain text document attachment (message-footer.txt)
> --
> You receive this message as a subscriber of the exoplatform@... mailing list.
> To unsubscribe: mailto:exoplatform-unsubscribe@...
> For general help: mailto:sympa@...?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Laurent Laudinet
Open Source Software Architect - ThereSIS
THALES
RD 128;Palaiseau Cedex 91767
Phone : 33169415905
laurent.laudinet@...




--
You receive this message as a subscriber of the exoplatform@... mailing list.
To unsubscribe: mailto:exoplatform-unsubscribe@...
For general help: mailto:sympa@...?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

Re: user information roles and groups

by alamut :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Firends,

For the same need, with the session of the user, how could I have the group and groupId, knowing that User does not contain the method getGroup or getGroupId.

Thank's...

Re: user information roles and groups

by Hoa.Pham :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

alamut wrote:

> Hi Firends,
>
> For the same need, with the session of the user, how could I have the group
> and groupId, knowing that User does not contain the method getGroup or
> getGroupId.
>
> Thank's...
>  
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the exoplatform@... mailing list.
> To unsubscribe: mailto:exoplatform-unsubscribe@...
> For general help: mailto:sympa@...?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>  
Use GroupHandler like that,
String userId = portletRequest.getRemoteUser();

OrganizationService aOrgService = (OrganizationService)
                PortalContainer.getInstance().getComponentInstanceOfType
(OrganizationService.class);

GroupHandler groupHandler = aOrgService.getGroupHandler()
Collection groupCol = groupHandler.findGroupsOfUser(userId);
for(Group g:groupCol) {
//To do something
}

Please check GroupHandler's API for more information

--
Best regard,
Hoa Pham - eXoplatform Viet Nam's team
Ha Noi - Viet Nam.

Email:hoa.pham@...
YM: phamvuxuanhoa
Skype:phamvuxuanhoa




--
You receive this message as a subscriber of the exoplatform@... mailing list.
To unsubscribe: mailto:exoplatform-unsubscribe@...
For general help: mailto:sympa@...?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

Re: user information roles and groups

by alamut :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank's a Lot  Pham. It's works now.