02-23-2012 07:24 AM
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
02-27-2012 07:06 AM
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.
03-24-2025 07:00 AM - edited 03-24-2025 07:04 AM
Implement a custom 'documentDeleted' event and create a listener for it to look at this:
@Component
public class DocumentService {
@Autowired private ApplicationEventPublisher publisher;
public void deleteDocument() {
// Delete logic
publisher.publishEvent(new DocumentDeletedEvent(this));
}
}
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.