Expand my Community achievements bar.

SOLVED

Get group members with LiveCycle Java API

Avatar

Level 2

I'm working with the LiveCycle Java API (LiveCycle 8.2) and I'm looking for


an example how to read the members of a group.

I'm able to get a Group (Type GroupImpl) using the PrincipalSearchFilter.


But how can I get the members of this group. I checked the
DirectoryManagerServiceClient and the different search filter classes
without success?

As a workaround I could retrieve all users of my application domain and
check their memberships to see if they are in the concerned group. But this
is a dirty hack I don't really want to use.

Any ideas?
1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Hi!

I know you mentioned that you looked into this without success, but it should really work.

First make a GroupMemebershipSearchFilter, setting the GroupOid to be ID of the group itself.  Using the DirectoryManagerServiceClient you can then call findGroupMembers using the searchFilter which returns a List<User>, as follows:


DirectoryManagerServiceClient directoryManager = new DirectoryManagerServiceClient(serviceConnection.getFactory());

List<User> userList = new ArrayList<User>();

try
{
userList = directoryManager.findGroupMembers(searchFilter);
}
catch (Exception e)
{

    // Error stuffs
}

return userList;

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

Hi!

I know you mentioned that you looked into this without success, but it should really work.

First make a GroupMemebershipSearchFilter, setting the GroupOid to be ID of the group itself.  Using the DirectoryManagerServiceClient you can then call findGroupMembers using the searchFilter which returns a List<User>, as follows:


DirectoryManagerServiceClient directoryManager = new DirectoryManagerServiceClient(serviceConnection.getFactory());

List<User> userList = new ArrayList<User>();

try
{
userList = directoryManager.findGroupMembers(searchFilter);
}
catch (Exception e)
{

    // Error stuffs
}

return userList;

Avatar

Level 2

Thanks a lot, fine!

Although the method findGroups() is deprecated and there should be another way to get the members of the groups. But for now it works for me.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----