02-20-2019 01:39 AM
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.
02-20-2019 02:09 AM
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
02-20-2019 02:21 AM
Thanks Kintu.
02-21-2019 10:47 AM
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?
02-21-2019 10:54 AM
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.
02-28-2019 11:23 AM
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.
Explore our Alfresco products with the links below. Use labels to filter content by product module.