OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | exoplatform List | April 2007 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [exoplatform] Identify the user from inside the portlet


Mickael.Lecoq@xxxxxxxx wrote:
> Hello,
>       I am trying to developp a portlet which uses the info of the users
> (name, firstname and mail).
> I have tryed the method with USER_INFO:
>
>
> PortletSession session = portletRequest.getPortletSession();
> Object userInfo = portletRequest.getAttribute(RenderRequest.USER_INFO);
>
>  But userInfo is an empty HashMap.
>
> What is the method to get the user informations?
>
> Best Regards,
> Mickael Lecoq.
>
>
>
>   
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the exoplatform@xxxxxxxxxxxxx 
> mailing list.
> To unsubscribe: mailto:exoplatform-unsubscribe@xxxxxxxxxxxxx
> For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>   
In eXo's product suite, user management system is managed by a service
call OrganizationService. You can use the one to get all organization's
infomation like: user's info, group's info, membership's info.
In your case, you can use this service to get user's infomation like that:
  /  String currentUser = portletRequest.getRemoteUser() ;
    ExoContainer container = ExoContainerContext.getCurrentContainer() ;
    OrganizationService orservice =
(OrganizationService)container.getComponentAdaptersOfType(OrganizationService.class)
;  
    User user = service.getUserHandler().findUserByName(currentUser)
;      
    String email = user.getEmail() ;
/   ....

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

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




<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.