org.sakaiproject.event.api.Event.getContext()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中org.sakaiproject.event.api.Event.getContext()方法的一些代码示例,展示了Event.getContext()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.getContext()方法的具体详情如下:
包路径:org.sakaiproject.event.api.Event
类名称:Event
方法名:getContext

Event.getContext介绍

[英]Access the event context
[中]访问事件上下文

代码示例

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

/**
 * @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;
}

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

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();

代码示例来源:origin: org.sakaiproject.sitestats/sitestats-impl

/** 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);
  }
}

代码示例来源:origin: sakaiproject/sakai

String eventContext = event.getContext();
if (eventContext != null) {
  props = prefs.getProperties(NotificationService.PREFS_TYPE + type + NotificationService.NOTI_OVERRIDE_EXTENSION);

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

case SiteService.SECURE_UPDATE_GROUP_MEMBERSHIP:
case SiteService.SECURE_UPDATE_SITE:
  notifySiteParticipant("/gradebook/" + event.getContext() + "/");
  break;
case EVENT_SITE_USER_INVALIDATE:

代码示例来源:origin: sakaiproject/sakai

/**
 * 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());
}

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-api

/**
 * 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());
}

相关文章