[Building Sakai] NotificationService

Adrian Fish a.fish at lancaster.ac.uk
Mon Nov 14 01:44:12 PST 2011


I ended up doing it as Chris suggested, but it does seem as though the 
NotificationService should query the PresenceService directly so we 
don't have to do that. I'll have a play around with priorities and 
report back, although I'm pretty sure I've done that already and it was 
the same.

Cheers,
Adrian.

On 12/11/2011 00:34, Noah Botimer wrote:
> Having just ported the OSP notifications to 2.7 (SAK-20832), I was dubious of this pattern but didn't change it in my port. OSP should probably be cleaned up unless I'm missing something. The tool should fire off a notification to a person or list of people and their preferences should take effect. Having the tool interrogate the PreferencesService and choose between DigestService.digest() and EmailService.send() smells bad.
>
> The fire and forget pattern is what the NotificationService and EmailNotification are set up to do. Maybe the Event's priority is always NOTI_REQUIRED? If not, can you debug to see if EmailNotification.getOption() is consulting the preferences properly for immediateRecipients() and digestRecipients()? Maybe site specificity isn't applying? There have only been a couple of changes to this code in the past few years, so I'd suspect the Event priority, but the preferences have generally been global -- so anything's possible.
>
> Thanks,
> -Noah
>
> On Nov 11, 2011, at 12:35 PM, Maurer, Christopher Wayne wrote:
>
>> Adrian,
>> You still have to control that yourself in your code.
>> Take a look at this diff:
>> http://source.sakaiproject.org/viewsvn/osp/trunk/matrix/api-impl/src/java/o
>> rg/theospi/portfolio/matrix/HibernateMatrixManagerImpl.java?p2=%2Fosp%2Ftru
>> nk%2Fmatrix%2Fapi-impl%2Fsrc%2Fjava%2Forg%2Ftheospi%2Fportfolio%2Fmatrix%2F
>> HibernateMatrixManagerImpl.java&p1=%2Fosp%2Ftrunk%2Fmatrix%2Fapi-impl%2Fsrc
>> %2Fjava%2Forg%2Ftheospi%2Fportfolio%2Fmatrix%2FHibernateMatrixManagerImpl.j
>> ava&r1=82737&r2=82736&view=diff&pathrev=82737
>>
>> Line 3660 is where all the good stuff is.  You'll see that the
>> notification prefs are looked up, then based on that result, the message
>> is either sent via digest, immediately or skipped.
>>
>> Chris
>>
>> On 11/11/11 8:25 AM, "Adrian Fish"<a.fish at lancaster.ac.uk>  wrote:
>>
>>> Hi Chris,
>>>
>>> I'm in the middle of integrating YAFT with the NS and have hit a
>>> problem. I've implemented a SiteEmailNotification for each event, and
>>> these work. I've implemented a
>>> UserNotificationPreferencesRegistrationImpl subclass, which injects the
>>> appropriate gui into preferences. The problem is that the notification
>>> preferences are ignored, the emails always go out regardless.
>>>
>>> I'm sure I've missed something obvious. How do you tell the
>>> UserNotificationPreferencesRegistrationImpl which notification events to
>>> filter?
>>>
>>> Any help appreciated.
>>>
>>> Cheers,
>>> Adrian.
>>>
>>> -- 
>>> ==================================
>>> Adrian Fish
>>> Software Engineer
>>> B66 Management School
>>> Lancaster University
>>> Lancaster
>>> LA1 4YW
>>>
>>> http://www.sakaiproject.org
>>> http://confluence.sakaiproject.org/display/YAFT/Yaft
>>> http://confluence.sakaiproject.org/display/CLOG/Home
>>> http://confluence.sakaiproject.org/display/BBB/Home
>>>
>> _______________________________________________
>> 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"
>>
>>

-- 
==================================
Adrian Fish
Software Engineer
B66 Management School
Lancaster University
Lancaster
LA1 4YW

http://www.sakaiproject.org
http://confluence.sakaiproject.org/display/YAFT/Yaft
http://confluence.sakaiproject.org/display/CLOG/Home
http://confluence.sakaiproject.org/display/BBB/Home



More information about the sakai-dev mailing list