cancel
Showing results for 
Search instead for 
Did you mean: 

Notification for deleted document

Alice_
Star Contributor
Star Contributor

Hi, I'm a new user of Nuxeo. I'm wondering if it is possible to have notifications when a document is deleted. I write my extension point:

<component name="org.nuxeo.sample.notify">
    <extension point="notifications" target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService">
        <notification autoSubscribed="false" availableIn="all" label="Delete" channel="email" enabled="true" name="Document Removed">
        <event name="documentRemoved" />
        </notification>
    </extension>
</component>

I can subscribe an user to receive the Delete notifications, but they don't work: when I delete a document, user does not receive the notification.

What's wrong?

Thank you very much, and sorry for my bad English!

Alice

1 ACCEPTED ANSWER

Clément_Lardeur
Confirmed Champ
Confirmed Champ

There is no simply way to do that.

A solution would be to implement your own event 'documentDeleted' and to create a listener or by overriding the concerned bean to fired this event. See http://doc.nuxeo.com/display/NXDOC/Events+and+Listeners.

View answer in original post

20 REPLIES 20

selena
Champ in-the-making
Champ in-the-making

Implement a custom 'documentDeleted' event and create a listener for it to look at this:

Support For Instant Ink

@Component
public class DocumentService {
@Autowired private ApplicationEventPublisher publisher;

public void deleteDocument() {
// Delete logic
publisher.publishEvent(new DocumentDeletedEvent(this));
}
}