[Building Sakai] How to get user's notification preferences for Resources

Daniel Merino daniel.merino at unavarra.es
Mon Sep 22 05:31:36 PDT 2014


Dear community,

I am currently trying to develop email notifications for Drag and drop 
uploads.

I have managed to override SiteEmailNotification class and I can send 
emails to every site user (NotificationService.NOTI_REQUIRED) and no 
notification at all (NOTI_NONE).

However, I am not able to respect the preferences that users have 
configured for Resources tool. (NOTI_OPTIONAL). Every user receives the 
notification when I set this option.

Does somebody have some documentation or example of how could I achieve 
this?

Thanks in advance.
Best regards.

PD: I paste my current piece of code, in case something could be wrong.

Site site = 
SiteService.getSite(ToolManager.getCurrentPlacement().getContext());
NotificationEdit ne = notificationService.addTransientNotification();
ne.setFunction("content.read");
SiteEmailNotificationDragAndDrop sendnd = new 
SiteEmailNotificationDragAndDrop(site.getId());
ne.setAction(sendnd);
sendnd.notify(ne,eventTrackingService.newEvent("content.read", 
site.getReference(), true, NotificationService.NOTI_OPTIONAL));

-- 
Daniel Merino Echeverría
daniel.merino at unavarra.es
Gestor de E-learning - Centro Superior de Innovación Educativa.
Tfno: 948-168489 - Universidad Pública de Navarra.


More information about the sakai-dev mailing list