- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2012 07:26 AM
Is it normal that you have spaces in your target?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2012 07:53 AM
I think that is a problem of formattation in the previous message...in orginal code there were not those spaces!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2012 08:18 AM
You need to precise a template for your notification :
<notification template="documentRemoved" autoSubscribed="false" availableIn="all" label="Delete" channel="email" enabled="true" name="Document Removed">
<event name="documentRemoved" />
</notification>
Moreover the template must be defined in an other contribution point :
<extension target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService"
point="templates">
<template name="documentRemoved" src="templates/documentRemoved.ftl" />
</extension>
You can see the template 'modif.ftl' to create your own template 'documentRemoved.ftl'.
I think it should work better!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2012 08:21 AM
Can you (by convention) use a name without space (this is the technical name, so my advice would be to use the Camel Case.
Have you defined your component into the Manifest ?
How did you generate your bundle. My piece of advice would be to use the Nuxeo IDE.
Or more easily you can use studio and copy you contribution (from <extension... to </extension>
) into Advanced setting > XML Extension.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2012 09:40 AM
The curious thing is that the code works with every other defined event (for example: documentModified or documentLocked or versionRemoved)... it doesn't work only with documentRemoved and I really don't understand why... (I try to add my own template...it works with other event too)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2012 05:18 AM
This is my new piece of code: this works with every event, except for documentRemoved and documentMoved...can anyone tell me why?
<extension target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService" point="templates">
<template name="remove" src="templates/documentRemoved.ftl" />
</extension>
<extension target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService" point="notifications">
<notification name="Cancellazione" channel="email" availableIn="all" autoSubscribed="false"
label="Cancellazione" template="remove">
<event name="documentRemoved"/>
</notification>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2012 05:27 AM
The event 'documentRemoved' is throwed when a document is permanently removed form the trash. What is your test case ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2012 05:36 AM
Where is the trash?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2012 06:25 AM
The trash is a sub-tab of the administration tab. When you press the button 'Delete' the 'documentRemoved' event is not fired, this is why the notification is not sended.
