[Building Sakai] notifications not being sent for drop box changes

Charles Hedrick hedrick at rutgers.edu
Tue May 12 12:19:23 PDT 2009


In 2.6, and possibly also 2.5, users aren't getting email  
notifications when files are added to the dropbox. I have a fix, but  
I'd like to ask whether I've fixed it the right way.

In BaseContentService.java, where the system is setting up to watch  
for events, it watches for EVENT_RESOURCE_AVAILABLE and  
EVENT_RESOURCE_WRITE for normal resources and EVENT_RESOURCE_ADD and  
EVENT_RESOURCE_WRITE for drop boxes.

This sounds right, except that the events get transmogrified. In  
commitResourceEdit, the original event is sent out only for REVISE  
events. Other events are sent through, but with notifications off. The  
real notification occurs as a result of postAvailableEvent. This  
checks to see whether the resource is available. If so it does the  
real notification. If not, it schedules a delayed event. The  
postAvailableEvent ignores the original event type, and always uses  
EVENT_RESOURCE_AVAILABLE. Thus the drop box notification code must  
watch for EVENT_RESOURCE_AVAILABLE. It's likely that it doesn't need  
to watch for EVENT_RESOURCE_ADD, since adds will probably get changed  
to available. However for the moment I'm simply adding

  dbNoti.setFunction(EVENT_RESOURCE_AVAILABLE);

to BaseContentService.java, at the same place as the other calls to  
dbNoti.setFunction.

I believe that fixes the problem.

However the question is why postAvailableEvent changes the event type.  
Is that really necessary?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090512/ebe25b1b/attachment.html 


More information about the sakai-dev mailing list