cancel
Showing results for 
Search instead for 
Did you mean: 

How to get users belonging to a group using API.

Former Member
0 Kudos

Hi,

How to do a user search based on a UME group using UME API. I could search a user based on user login Id, but how to get all the users who belong to a group with the group unique name as input.

Thanks

Srinivas

Accepted Solutions (1)

Accepted Solutions (1)

former_member192434
Active Contributor
0 Kudos

Hi

try to use IGroup or IGroupFactory interface.....to get all the details of user in group..

// Get a Group

String groupid1 = "<unique-id of group1>";

IGroup grp = UMFactory.getGroupFactory().getGroup(grpid1);

String grpDesc = grp.getDescription();

IUser user = request.getUser();

if (grp.isUserMember(user.getUniqueID()) {

response.write(user.getFirstName() +

" is a member of " + grpDesc);

}

thanks

Former Member
0 Kudos

Hi Anup,

I am actually trying to get all the users by giving unique name of the group as input.

Thanks a lot for your response

Srinivas

former_member192434
Active Contributor
0 Kudos

Sirinivas,

what you mean by group input....

if you get the unique ID(As mention in above code) of user then you can get name of that user.......base on that you can manupulate it further... ..

i hope its clear to u ..

Thanks

Former Member
0 Kudos

My requirement.

The user should enter group name (unique name) in the "input text field" and click "search" button.

The result should show all those users that belong to this group(that he just entered in the input text field).

Hope am clear.

Thanks a lot for your response.

Srinivas

former_member192434
Active Contributor
0 Kudos

try this

boolean b =false;

String name = null;

IGroup grp = UMFactory.getGroupFactory().getGroupByUniqueName("inputValue as GroupName Enterd by User");

if(grp.equals("GroupName")){

Iterator i = grp.getUserMembers(true);

grp.getGroupMembers(true);

for (int a= 0; i.hasNext(); a++){

name = i.next().getClass().getName();

// Once you get your user name then print it on view

}

}

thanks

Answers (0)