Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

AEM Communities Get user's groups

Shubham_borole
Community Advisor
Community Advisor

Hello All, I am using AEM 6.5.8 communities and in a regular component looking to get logged in user's community groups which they are part of.

 

I am looking at https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/javadoc/co...  and looks like I can use getMembersOfGroups() to get the (Community only) groups the user is a member of.

 

If I am using an HTL component and Model, how can I invoke the CommunityMemberUserProfile interface with the logged in user's perspective? @kautuk_sahni any Adobe AEM communities dev/expert that can be tagged here? I can't find any that helped in communities regards before.

1 Reply
kautuk_sahni
Community Manager
Community Manager

I have asked the expert to assist you here.

abhishek06
Level 1
Level 1

Hi,

You can use [1] to get CommunityMemberUserProfile like below :

CommunityMemberUserProfile userProfile = (CommunityMemberUserProfile)this.getSocialComponentForUserProfile(resource, request, "social/members/components/hbs/userprofile");

and then use userProfile to invoke getMembersOfGroups.


[1]:https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/javadoc/co...

Shubham_borole
Community Advisor
Community Advisor
@abhishek06 - Thanks a lot for the reply. Do I need to extend my Model to some Social class? How do I get to "this" [CommunityMemberUserProfileOperations] interface? Also the resource can be any component resource or has to be some specific resourcetype?