<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: not able to fetch the members of the group in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/not-able-to-fetch-the-members-of-the-group/m-p/317895#M4896</link>
    <description>&lt;P&gt;You may need to wait for the next transaction, see TransactionalFeature nextTransaction()&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2020 16:24:09 GMT</pubDate>
    <dc:creator>Jackie_A</dc:creator>
    <dc:date>2020-01-21T16:24:09Z</dc:date>
    <item>
      <title>not able to fetch the members of the group</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/not-able-to-fetch-the-members-of-the-group/m-p/317893#M4894</link>
      <description>&lt;P&gt;Hi Nuxeo&lt;/P&gt;
&lt;P&gt;i was trying to get  the member of the group but it is not working it is returning null in all cases
code is&lt;/P&gt;
&lt;P&gt;Group group = new Group();
group.setGroupName(groupRequest.GroupName);
group.setGroupLabel(groupRequest.GroupLable);
group.setMemberUsers(groupRequest.userNameList);
// group.setParentGroups(parentGroups);
//group.setParentGroups(Arrays.asList("members"));
Group groupnew = client.userManager().createGroup(group);
groupnew = client.userManager().fetchGroup("New");	
System.out.println(groupnew.getGroupName());
List&lt;STRING&gt; a = groupnew.getMemberUsers();
if (a != null) {
for (String item : a) {
System.out.println(item);
}
}&lt;/STRING&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;	another way which i was trying is 
	
	Groups g = client.userManager().searchGroup("*");
	System.out.println("size " + g.getTotalSize());
	for (Group Gelement : g.getGroups()) {
		System.out.println("lable " + Gelement.getGroupLabel());
		System.out.println("Name " + Gelement.getGroupName());

		System.out.println("ParentGroups");
		for (Group iterable_element : Gelement.fetchMemberGroups().getGroups()) { // Returns null 
			System.out.println("lable " + iterable_element.getGroupLabel());
			System.out.println("Name " + iterable_element.getGroupName());
		}

		System.out.println("MemberGroups");
		Groups mg = Gelement.fetchMemberGroups(); // Returns null 
		for (Group iterable_element : mg.getGroups()) {
			System.out.println("lable " + iterable_element.getGroupLabel());
			System.out.println("Name " + iterable_element.getGroupName());
		}
	  
	  }
	
	
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jan 2020 06:03:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/not-able-to-fetch-the-members-of-the-group/m-p/317893#M4894</guid>
      <dc:creator>Bhagat__Singh</dc:creator>
      <dc:date>2020-01-15T06:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: not able to fetch the members of the group</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/not-able-to-fetch-the-members-of-the-group/m-p/317894#M4895</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;why aren't you using the &lt;STRONG&gt;fetchMemberUsers()&lt;/STRONG&gt; method as explained here: &lt;A href="https://doc.nuxeo.com/client-java/3.2/user-group/#fetch"&gt;https://doc.nuxeo.com/client-java/3.2/user-group/#fetch&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This is a very simple example, but it worked:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;NuxeoClient nuxeoClient = new NuxeoClient.Builder()
	.url(url)
       .authentication(username, password)
       .connect();
	
UserManager userManager = nuxeoClient.userManager();
Group group = userManager.fetchGroup("administrators");
String label = group.getGroupLabel();
System.out.println("Group: " + label);
Users users = group.fetchMemberUsers();
for(User u: users.getEntries()) {
	System.out.println("User: " + u.getUserName() + "\n");
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Group: Administrators group
User: Administrator
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 17:05:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/not-able-to-fetch-the-members-of-the-group/m-p/317894#M4895</guid>
      <dc:creator>Rodri_</dc:creator>
      <dc:date>2020-01-16T17:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: not able to fetch the members of the group</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/not-able-to-fetch-the-members-of-the-group/m-p/317895#M4896</link>
      <description>&lt;P&gt;You may need to wait for the next transaction, see TransactionalFeature nextTransaction()&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 16:24:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/not-able-to-fetch-the-members-of-the-group/m-p/317895#M4896</guid>
      <dc:creator>Jackie_A</dc:creator>
      <dc:date>2020-01-21T16:24:09Z</dc:date>
    </item>
  </channel>
</rss>

