Search in sources :

Example 1 with EventGroup

use of org.xwiki.eventstream.EventGroup in project xwiki-platform by xwiki.

the class BridgeEventStream method getRelatedEvents.

@Override
public EventGroup getRelatedEvents(Event e) {
    XWikiContext context = getXWikiContext();
    ActivityStreamPlugin plugin = getPlugin(context);
    EventGroup result = new EventGroup();
    try {
        result.addEvents(convertActivitiesToEvents(plugin.getActivityStream().getRelatedEvents(eventConverter.convertEventToActivity(e), context)).toArray(new Event[0]));
    } catch (ActivityStreamException ex) {
    // Should not happen, and the eventual error was already reported downstream
    }
    return result;
}
Also used : XWikiContext(com.xpn.xwiki.XWikiContext) EventStreamDeletedEvent(org.xwiki.eventstream.events.EventStreamDeletedEvent) ActivityEvent(com.xpn.xwiki.plugin.activitystream.api.ActivityEvent) Event(org.xwiki.eventstream.Event) EventStreamAddedEvent(org.xwiki.eventstream.events.EventStreamAddedEvent) ActivityStreamException(com.xpn.xwiki.plugin.activitystream.api.ActivityStreamException) EventGroup(org.xwiki.eventstream.EventGroup) ActivityStreamPlugin(com.xpn.xwiki.plugin.activitystream.plugin.ActivityStreamPlugin)

Aggregations

XWikiContext (com.xpn.xwiki.XWikiContext)1 ActivityEvent (com.xpn.xwiki.plugin.activitystream.api.ActivityEvent)1 ActivityStreamException (com.xpn.xwiki.plugin.activitystream.api.ActivityStreamException)1 ActivityStreamPlugin (com.xpn.xwiki.plugin.activitystream.plugin.ActivityStreamPlugin)1 Event (org.xwiki.eventstream.Event)1 EventGroup (org.xwiki.eventstream.EventGroup)1 EventStreamAddedEvent (org.xwiki.eventstream.events.EventStreamAddedEvent)1 EventStreamDeletedEvent (org.xwiki.eventstream.events.EventStreamDeletedEvent)1