- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2011 05:41 PM
Hi,
I am trying to configure Nuxeo to use a custom template when sending "Modification alert" email notification. Here is what i done so far..
From a working installation (meaning that i subscribed on Modification alert and if i modify a folder i correctly get a modification notification email)
STEP 1: Removing the default modification notification
In the nuxeo-platform-notification-core-5.4.2
i modified notification-contribution.xml to disable the Modification notification by setting enabled="false"
The result was that the Modification option disapeared from the Alert interface as expected, and i stoped receiving notification email on modification of the folder. So far so good...
STEP 2: Adding a custom modification notification
1-i added in my own custom .jar (which i use to expose custom services) a copy of
/>
OSGI-INF/notification-contribution.xml (with Modification enable="true")
2-i added a custom src/templates/modif.ftl
3-i added in the MANIFEST.FM a Nuxeo-Component: OSGI-INF/notification-contrib.xml
4-Restart.....
The result is that i now have the Modification option back in the interface, and if i modify the folder i get a notification email, except that i am not getting the custom modif.ftl template but still the default one.
Can someone indicates to me what is missing so i can get a custom email notification ?
Thanks Michel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2011 05:58 PM
ARrrrrglll !!! Did you modify the file into the nuxeo-platform-notification-core-5.4.2 ? Bad, really bad 😄
In fact Nuxeo is extensible and you can override easily with your own bundle (Nuxeo jar) the Nuxeo ones. This is the philosophy of the platform. We provide a Framework and some Modules (DM, DAM, Social-Collaboration, ...) that can be a starting point for you. And you can override each part of the module.
So for your point you are near:
- DON'T TOUCH INTO THE NUXEO JAR ! I insist
- Do your step 2 but in your notification.xml file you must check that
- the name of the component at the beginning of your XML file is different of the nuxeo ones. For instance
<component name="com.yourcomapny.yourprojectname.ecm.platform.notification.service.NotificationContrib">
- you must add this
<require>org.nuxeo.ecm.platform.notification.service.NotificationContrib</require>
(this is the name of the component that contains the contribution you want to override. - you must disable the default contribution as https://jira.nuxeo.com/browse/NXP-8105
With the require you ask to the runtime to deploy your contribution AFTER the Nuxeo one. As you give the same name of the notification, the service will override with yours.
So your contribution must be something like:
<?xml version="1.0" encoding="UTF-8"?>
<component name="com.caristix.nuxeo.ecm.platform.notification.service.NotificationContrib">
<require>org.nuxeo.ecm.platform.notification.service.NotificationContrib</require>
<extension target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService" point="notifications">
<notification name="Modification" enabled="false"></notification>
<notification name="Modification" channel="email" availablein="Workspace" autosubscribed="true"
template="yourtemplate" subject="Document modified"
label="label.nuxeo.notifications.modif">
<event name="documentModified"/>
</notification>
Last point, you can use the new Nuxeo version, Nuxeo 5.5 that brings really cool features..
Hope this will be the solution 😄
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2011 05:58 PM
ARrrrrglll !!! Did you modify the file into the nuxeo-platform-notification-core-5.4.2 ? Bad, really bad 😄
In fact Nuxeo is extensible and you can override easily with your own bundle (Nuxeo jar) the Nuxeo ones. This is the philosophy of the platform. We provide a Framework and some Modules (DM, DAM, Social-Collaboration, ...) that can be a starting point for you. And you can override each part of the module.
So for your point you are near:
- DON'T TOUCH INTO THE NUXEO JAR ! I insist
- Do your step 2 but in your notification.xml file you must check that
- the name of the component at the beginning of your XML file is different of the nuxeo ones. For instance
<component name="com.yourcomapny.yourprojectname.ecm.platform.notification.service.NotificationContrib">
- you must add this
<require>org.nuxeo.ecm.platform.notification.service.NotificationContrib</require>
(this is the name of the component that contains the contribution you want to override. - you must disable the default contribution as https://jira.nuxeo.com/browse/NXP-8105
With the require you ask to the runtime to deploy your contribution AFTER the Nuxeo one. As you give the same name of the notification, the service will override with yours.
So your contribution must be something like:
<?xml version="1.0" encoding="UTF-8"?>
<component name="com.caristix.nuxeo.ecm.platform.notification.service.NotificationContrib">
<require>org.nuxeo.ecm.platform.notification.service.NotificationContrib</require>
<extension target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService" point="notifications">
<notification name="Modification" enabled="false"></notification>
<notification name="Modification" channel="email" availablein="Workspace" autosubscribed="true"
template="yourtemplate" subject="Document modified"
label="label.nuxeo.notifications.modif">
<event name="documentModified"/>
</notification>
Last point, you can use the new Nuxeo version, Nuxeo 5.5 that brings really cool features..
Hope this will be the solution 😄
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2011 06:50 PM
Hi bjalon , tx for your quick answer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2011 05:59 PM
I finally got it working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2011 01:00 PM
First:
If i put
Here is what i just tried; 1- I disable the <notification name="Modification" 2- I created a new <notification name="Modification2" with a different name but using the same event.
The only problem remaining is to use the custom .ftl file i put in my own src/templates folder in my .jar. I am still receiving the default modification email template.
So i guess i need something in the NotificationService extension so that points to the src/templates folder in my .jar and not in the default templates folder
Any hint on this ?
<notification name="Subscriptions updated" channel="email" enabled="true" availableIn="Workspace"
autoSubscribed="true" template="subscriptionsUpdated" subject="New subscription" label="label.nuxeo.notifications.subscriptions.updated">
<event name="subscriptionAssigned"/>
</notification>
<notification name="Modification" channel="email" enabled="false" availableIn="Workspace"
autoSubscribed="false" template="modif" subject="Document modified" label="label.nuxeo.notifications.modif">
<event name="documentModified"/>
</notification>
<notification name="Modification2" channel="email" enabled="true" availableIn="Workspace"
autoSubscribed="false" template="modif" subject="Document modified" label="label.nuxeo.notifications.modif">
<event name="documentModified"/>
</notification>
<template name="subscriptionsUpdated" src="templates/subscriptionsUpdated.ftl" />
<template name="modif" src="templates/modif.ftl" />
<template name="defaultNotifTemplate" src="templates/defaultNotifTemplate.ftl" />
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2012 01:15 PM
If your are using maven, you need to put your templates in src/main/resources/templates
