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

daniel.merino at unavarra.es daniel.merino at unavarra.es
Mon Sep 22 10:28:38 PDT 2014


Thanks, Matthew. Juan José Meroño has also pointed me to SAK-26000.
Tomorrow I will do a backport to 2.9.2 and I will see if it works there.

About content.read, I think that I have copypasted that code from
somewhere, but you are right, content.new is the event that must be
applied here. Maybe I have mixed up events and permissions.

Thanks a lot for the ideas.
Best regards.

El Lun, 22 de Septiembre de 2014, 18:48, Matthew Jones escribió:
> 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"
>




More information about the sakai-dev mailing list