0 Replies Latest reply on Dec 6, 2012 5:12 AM by terry.lin

    How can i get users by group id in gatein?

    terry.lin

      Hi all, i'm a newbie into Gatein. I'm trying to develop a portlet and get the logined user information , i find the way and my code as below

       

       

      public static User getLonginUser() throws Exception {

                          User portletUser = null;

                          PortalRequestContext portalRequestContext = Util.getPortalRequestContext();

                          String remoteUserName = portalRequestContext.getRemoteUser();

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

                          if (remoteUserName != null) {

                                    portletUser = organizationService.getUserHandler().findUserByName(remoteUserName);

                          }

                          portletUser.getOrganizationId();

                return portletUser;

      }

       

       

      now i want to get users in a  specific group, ex: /platform group,

      Is there any way that i can get user list?

      thank you.