Can I be notified when an annotation is added to a document?

I would like to be notified when someone adds an annotation to a document.

1 votes

2 answers

1897 views

ANSWER



I had already implement this feature for a project by adding a contribution to the notification extension point and it works fine. Below my contribution :

<extension target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService"
  point="notifications">
  <notification name="AnnotatedDocument" channel="email" enabled="true"
    availableIn="Workspace" autoSubscribed="false" 
    template="annotatedDocument" subject="Document annotated" 
    label="label.notification.annotations">
    <event name="annotationCreated" />
    <event name="annotationUpdated" />
    <event name="annotationDeleted" />
  </notification>    
</extension>

And don't forget to declare your template linked to the previous notification :

<extension target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService"
    point="templates">
    <template name="annotatedDocument" src="templates/annotatedDocument.ftl" />
</extension>
2 votes



There are sevral ways to do this. You could for instance had a listener to the 'annotationCreated' event and manage the mail sending yourself. Or you could add a contribution to the notification extension point . This will add a new possible subscription in the alert tab that anyone can subscribed to.

0 votes