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

Charles Hedrick hedrick at rutgers.edu
Tue May 12 12:46:49 PDT 2009


ok, that makes sense. Then my fix should be ok, and probably the watch  
on EVENT_RESOURCE_ADD should be removed. (Of course you probably don't  
do future releases in drop boxes, but the code is the same.)

On May 12, 2009, at 3:40 PM, Stephen Marquard wrote:

> I haven't looked at the Dropbox case, but for normal events (e.g.  
> files in Resources), the notification is no longer be associated  
> with content.new (as it is in 2-5-x) because in the case of a  
> resource created with a future release date, the content.new event  
> is posted immediately, and the content.available event is posted  
> when the event actually becomes available. The notification is  
> therefore triggered by content.available rather than content.new.
>
> Regards
> Stephen
>
>>>> Charles Hedrick <hedrick at rutgers.edu> 05/12/09 9:19 PM >>>
> 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?
>
>



More information about the sakai-dev mailing list