cancel
Showing results for 
Search instead for 
Did you mean: 

Different Events

riadhazzouz
Confirmed Champ
Confirmed Champ

Are there java functions that can detect if someone added a comment or like to your uploaded file ?
If not is there a way to.

5 REPLIES 5

kintu_barot
Star Collaborator
Star Collaborator

There is OOTB property 'cm:likesRatingSchemeCount' to fetch the number of likes per document.

You can fetch the value of this property to get the number of likes for that document.

You can also check with 'cm:likesRatingSchemeTotal' property for total.

Regards

Kintu

ContCentric

Regards,
Kintu

Thanks Kintu.

binduwavell
Star Contributor
Star Contributor

Riadh, is your question about checking if a specific node has comments or is favorited or that you want a “web hook” to be notified each time anything is commented upon or favorited?

Yes, I asked if there is a function to check if a specific node has comments or is favorited so I can implement a behaviour following that event. 
For example, if someone add a comment to a file, a notification should appear to other users.

You should be able to create a behavior on the type used for comments and then follow them back to the docs being commented upon and then determine if you want to send a notification.

Favorites are a little more tricky. They are stored in a JSON preferences file per user. As such you could create a behavior that monitors for changes in these, but it likely would be challenging to know what changed unless you cache the previous state somehow. For example you make a copy of each user profile and then when a profile is updated you compare it to the copy. Perform your business logic and then replace the copy with the current profile.

So I think you can acheive what you want, but I don't think there is a per-baked way to do either of these things.