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

Matthew Jones matthew at longsight.com
Mon Sep 22 09:48:36 PDT 2014


Just throwing out some ideas as I'm not 100% sure how this process works.
If you're testing on 10 or trunk, it's "possible" you're seeing this
Unresolved issue where preferences are not being respected when copying
files.

https://jira.sakaiproject.org/browse/SAK-26000

Also why are you notifying on the content.read event? Shouldn't this maybe
be EVENT_RESOURCE_ADD (content.new?). Notifications aren't normally sent on
the read event and the preferences might not be having an affect on that.


On Mon, Sep 22, 2014 at 8:31 AM, Daniel Merino <daniel.merino at unavarra.es>
wrote:

> 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.
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20140922/baef5e85/attachment.html 


More information about the sakai-dev mailing list