Different Events

cancel
Showing results for 
Search instead for 
Did you mean: 
riadhazzouz
Active Member

Different Events

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
kintu_barot
Senior Member

Re: Different Events

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
ContCentric
riadhazzouz
Active Member

Re: Different Events

Thanks Kintu.

binduwavell
Established Member

Re: Different Events

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?

riadhazzouz
Active Member

Re: Different Events

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.

binduwavell
Established Member

Re: Different Events

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.