/** * Record in database the given {@link com.xpn.xwiki.plugin.activitystream.api.ActivityEvent} event. * * @param event the event to record in databases * @throws ActivityStreamException if the event addition fails */ public void addActivityEvent(com.xpn.xwiki.plugin.activitystream.api.ActivityEvent event) throws ActivityStreamException { if (hasProgrammingRights()) { getActivityStream().addActivityEvent(event, this.context); } }
/** * Records in database the a event built upon the passed parameters. * * @param streamName the name of the stream to record the event for * @param type the type of event. The type can be a value picked from the list of values defined in * {@link com.xpn.xwiki.plugin.activitystream.api.ActivityEventType} or any other String * @param title the event title * @throws ActivityStreamException if the event addition fails */ public void addActivityEvent(String streamName, String type, String title) throws ActivityStreamException { if (hasProgrammingRights()) { getActivityStream().addActivityEvent(streamName, type, title, this.context); } }
/** * Records in database an event built upon the passed document and other parameters. The passed document is used to * retrieve document-related data for the event : date, page name, database. * * @param streamName name of the stream to use for the addition * @param type type of the event * @param title title of the event * @param params parameters of the event * @throws ActivityStreamException if the addition to the stream fails */ public void addActivityEvent(String streamName, String type, String title, List<String> params) throws ActivityStreamException { if (hasProgrammingRights()) { getActivityStream().addActivityEvent(streamName, type, title, params, this.context); } }
/** * {@inheritDoc} * * @see EventStream#addEvent(Event) */ public void addEvent(Event e) { try { XWikiContext context = getXWikiContext(); ActivityStreamPlugin plugin = getPlugin(context); plugin.getActivityStream().addActivityEvent(convertEventToActivity(e), context); } catch (ActivityStreamException ex) { // Unlikely; nothing we can do } }