Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

How to find who(user) is connected (subscribed) to a specific collection node?

Avatar

Level 2

In my application users may have concurrent independent collaboration sessions. When a user starts a collaboration session, a new collection node is created, s/he subscribes to that collection node, sends invitation to participants (selective users) by a common collection node. My application needs to know which participants subscribed to this newly created collection node for collaboration session, because when subscribed user sends a message on this collection node, it needs to send notifications, over common collection node, to users which did not subscribe yet.

I looked at CollectionNode documentation and find userRoles property but it returns empty object. Then I tried getExplicitUserRoles() but again it returns same empty object that userRoles returns.

1 Reply

Avatar

Former Community Member

Hi ,

The object userRoles object is there only when you set the userRoles for an user on a collectionNode. Since in this case, you haven't set any role , you won't get any value for the object and using userRoles object for your case is not the correct way.

One way for solving your problem could be publishing item on that collectionNode by an user subscribed to it with itemID as his userID. If you want only the host to know who all are subscribed , you can make the accessModel = 100 for that node on which message items will be published. Thus, users can notify the host about their subscription to that collectionnode. I am just throwing some ideas.

Thanks

Hironmay Basu