cancel
Showing results for 
Search instead for 
Did you mean: 

get all groups in alfresco

alfdeveloper1
Champ in-the-making
Champ in-the-making
Hi,
I am trying to implement a admin console module for alfresco share 4.2.c community……..
I want to display a list of all groups in Alfresco…
I tried the following:

var myGroups = groups.getAllRootGroups();

but it says that "groups" is not defined….
Any idea what might the problem be..?
thank u!!
9 REPLIES 9

mitpatoliya
Star Collaborator
Star Collaborator
are you using java or alfrescojavascript?

I am using alfrescoJS..!

mitpatoliya
Star Collaborator
Star Collaborator
try this
groups.getGroupsInZone(shortNameFilter, zone, paging, sortBy)

shortNameFilter,paging,sortBy are optional parameters
If the optional sortBy parameter is given, then the results may be sorted. Possible values are "authorityName" (default), "shortName" and "displayName"


You can first try just this it should fetch all the root groups
groups.getGroupsInZone(true)

Hey Mits,
I tried what u told me to….this tym its not giving any error and no output as well..
For testing purposes this is wat i did…
var mygroups=groups.getGroupsInZone(true);
alert(mygroups);

but its not giving any alert boxes….

mrogers
Star Contributor
Star Contributor
Are you on the repo or share.   That groups object is only available on the repo.  And getGroupsInZone will need the zone name, not a value of true.   I suggest you look at how the share group admin console is implemented since its already doing this.

alfdeveloper1
Champ in-the-making
Champ in-the-making
I am doing the customization on share…If groups object is not available in share customization then how do I make use of person and authority service?

zladuric
Champ on-the-rise
Champ on-the-rise
That depends on your use case. What do you need it for, what are you trying to do?

alfdeveloper1
Champ in-the-making
Champ in-the-making
Hey zladuric,
All I am trying to do is…Create an admin console module in alfresco share that involves appointing a certain resource to a group users…The problem I am facing is that I can't use the Authority Service or the Person Service to fetch the list of users and groups.

rasm
Champ in-the-making
Champ in-the-making
In share you only have Surf root scoped objects in webscripts, if you need more you should make a repository webscript and then do a share-proxy call to repo webscript.