Hi All,
I have a requirement to get all groups name stored in CQ and displaying them in a dropdown.
PLease help
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Gayane,
In CQ you can retrieve groups by calling
out.print("<select>"); Iterator<Group> groups = resolver.adaptTo(UserManager.class).getGroups(); while(groups.hasNext()) { Group group = groups.next(); out.print("<option>" + group.getName() + "</option>"); } out.print("</select>");
Later in your code your could iterate through the Groups to display the neccessary information in your dropdown. resolver variable is ResourceResolver with admin permissions
Usefull links:
https://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/security/UserManager.html
https://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/security/Group.html
Views
Replies
Total Likes
If you are doing this is a dialog and you want to save a reference to the group you can also make use of the authselector xtype with the displayField property set to principle and the filter property set to groups.
Views
Replies
Total Likes
Hi Gayane,
In CQ you can retrieve groups by calling
out.print("<select>"); Iterator<Group> groups = resolver.adaptTo(UserManager.class).getGroups(); while(groups.hasNext()) { Group group = groups.next(); out.print("<option>" + group.getName() + "</option>"); } out.print("</select>");
Later in your code your could iterate through the Groups to display the neccessary information in your dropdown. resolver variable is ResourceResolver with admin permissions
Usefull links:
https://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/security/UserManager.html
https://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/security/Group.html
Views
Replies
Total Likes
Hi,
check this article where a list of users are fetched from CQ.
You can use the same concept but modify it to fetch groups instead.
http://blogs.adobe.com/mtg/2011/11/building-components-in-adobe-cq5-part-2-a-tutorial-on-jquery-ajax...
Good Luck
/Johan
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies