cancel
Showing results for 
Search instead for 
Did you mean: 

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

Laurent_Doguin
Star Collaborator
Star Collaborator

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

1 ACCEPTED ANSWER

Clément_Lardeur
Confirmed Champ
Confirmed Champ

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>

View answer in original post

2 REPLIES 2

Laurent_Doguin
Star Collaborator
Star Collaborator

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.

Clément_Lardeur
Confirmed Champ
Confirmed Champ

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>
Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.