/** * @param event * @return a valid context for the event (based on the site/course) OR null if one cannot be determined */ private LRS_Context getEventContext(Event event) { LRS_Context context = null; if (event != null && event.getContext() != null) { String eventContext = event.getContext(); String e = StringUtils.lowerCase(event.getEvent()); // NOTE: wiki puts /site/ in front of the context, others are just the site_id if (StringUtils.startsWith(e, "wiki")) { eventContext = StringUtils.replace(eventContext, "/site/", ""); } // the site is the parent for all event activities context = new LRS_Context("parent", serverConfigurationService.getPortalUrl()+"/site/"+eventContext); } return context; }
fields[3] = reportId; fields[4] = (event.getModify() ? "m" : "a"); fields[5] = event.getContext() != null && event.getContext().length() > 255 ? event.getContext().substring(0, 255) : event.getContext();
/** Method called whenever an new event is generated from EventTrackingService: do not call this method! */ public void update(Observable obs, Object o) { // At the moment this isn't threadsafe, but as sakai event handling is single threaded this shoudn't be a problem, // but it's not a formal contract. if(o instanceof Event){ Event e = (Event) o; Event eventWithPreciseDate = buildEvent(getToday(), e.getEvent(), e.getResource(), e.getContext(), e.getUserId(), e.getSessionId()); collectThreadQueue.add(eventWithPreciseDate); } }
String eventContext = event.getContext(); if (eventContext != null) { props = prefs.getProperties(NotificationService.PREFS_TYPE + type + NotificationService.NOTI_OVERRIDE_EXTENSION);
case SiteService.SECURE_UPDATE_GROUP_MEMBERSHIP: case SiteService.SECURE_UPDATE_SITE: notifySiteParticipant("/gradebook/" + event.getContext() + "/"); break; case EVENT_SITE_USER_INVALIDATE:
/** * Constructor * * Converts an Event object into a SimpleEvent object * in order to be serializable for distribution * * @param event the event object * @param serverId the server id this event originated from */ public SimpleEvent(Event event, String serverId) { if (event == null) { throw new IllegalArgumentException("The SimpleEvent event cannot be null."); } if (serverId == null) { throw new IllegalArgumentException("The SimpleEvent serverId cannot be null."); } setEvent(event.getEvent()); setResource(event.getResource()); setSessionId(event.getSessionId()); setUserId(event.getUserId()); setContext(event.getContext()); setModify(event.getModify()); setPriority(event.getPriority()); setEventTime(event.getEventTime()); setServerId(serverId); setLRSStatement(event.getLrsStatement()); }
/** * Constructor * * Converts an Event object into a SimpleEvent object * in order to be serializable for distribution * * @param event the event object * @param serverId the server id this event originated from */ public SimpleEvent(Event event, String serverId) { if (event == null) { throw new IllegalArgumentException("The SimpleEvent event cannot be null."); } if (serverId == null) { throw new IllegalArgumentException("The SimpleEvent serverId cannot be null."); } setEvent(event.getEvent()); setResource(event.getResource()); setSessionId(event.getSessionId()); setUserId(event.getUserId()); setContext(event.getContext()); setModify(event.getModify()); setPriority(event.getPriority()); setEventTime(event.getEventTime()); setServerId(serverId); setLRSStatement(event.getLrsStatement()); }