getting list of subgroups

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2011 11:07 AM
It is like that:
GROUP1
SubGroup1
SubGroup2
SubGroup3
SubGroup4
GROUP2
SubGroup5
SubGroup6
SubGroup7
var activegroup = people.getGroup("GROUP_GROUP1");
and then my problem begins. I need a list of subgroups under GROUP1. How can I get that information?
Alfresco must have a way to do this.
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2011 12:55 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2011 04:21 AM
What exactly do you mean by saying groups api?
3.3 JavaScript Services API has some useful functions about this issue but when i use them i'm getting error.
3.3 JavaScript API has no function about that.
Where can i find groups api?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2011 12:26 PM
as always there is no answer…
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2011 01:15 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2011 04:40 AM
http://lmgtfy.com/?q=alfresco+javascript+%22groups+api%22
Is there anything named groups api? No..
Anyway, I'm using 3.0 Stable and this webscript was working 2 years ago:
var memberlist = new Array();var activegroup = people.getGroup("GROUP_ActiveUsers");var grouplist = activegroup.childAssocs["usr:member"];var agroup;for(i = 0; i<grouplist.length; i++){ agroup = people.getGroup(grouplist[i].properties["usr:authorityName"]); memberlist[i] = people.getMembers(agroup);}model.grouplist= grouplist;model.memberlist = memberlist;
I've tried to upgrade it to 3.3 and it didn't worked, I tried 3.2 and at last I tried 3.0 Stable again. But I couldn't manage to run it again.
grouplist is null whenever I run it.
I was getting the error I was talking about when I was trying 3.2 or 3.3, I couldn't remember.
The function was getAllGroups() from Javascript Services API. Also I don't know what is the difference between JS Services API and JS API.
But there is nothing about what I'm looking for in JS API.
So I tried to implement it in Java. I tried both:
authorityService.getContainedAuthorities(AuthorityType.GROUP, "ActiveUsers", true);authorityService.getContainedAuthorities(AuthorityType.GROUP, "GROUP_ActiveUsers", true);
One of these must return the subgroups, but they return nothing. They don't give error but they just return empty sets.
Does it make sense now?
If there is anything "vague", let me know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2018 08:00 AM
Hi,
By Using following Code, You can able to get all the subgroup and user of specific group.
Set<String> subGroup = serviceRegistory.getAuthorityService().getContainedAuthorities(AuthorityType.GROUP, "GROUP_ActiveUsers", true);
You have to register ServiceRegistory in your spring configuration.
Thanks,
Vidhi
