public class ActivityStreamPluginApi extends PluginApi<ActivityStreamPlugin>
ActivityStreamPlugin
.Constructor and Description |
---|
ActivityStreamPluginApi(ActivityStreamPlugin plugin,
XWikiContext context)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addActivityEvent(ActivityEvent event)
Record in database the given
ActivityEvent event. |
void |
addActivityEvent(String streamName,
String type,
String title)
Records in database the a event built upon the passed parameters.
|
void |
addActivityEvent(String streamName,
String type,
String title,
List<String> params)
Records in database an event built upon the passed document and other parameters.
|
void |
addDocumentActivityEvent(String streamName,
Document doc,
String type,
int priority,
String title)
Records in database an event built upon the passed document and other parameters.
|
void |
addDocumentActivityEvent(String streamName,
Document doc,
String type,
int priority,
String title,
List<String> params)
Records in database an event built upon the passed document and other parameters.
|
void |
addDocumentActivityEvent(String streamName,
Document doc,
String type,
String title)
Records in database an event built upon the passed document and other parameters.
|
void |
addDocumentActivityEvent(String streamName,
Document doc,
String type,
String title,
List<String> params)
Records in database an event built upon the passed document and other parameters.
|
void |
deleteActivityEvent(ActivityEvent event)
Delete the passed event form the database.
|
void |
deleteActivityEvents(List<ActivityEvent> evs)
Delete the passed events from the database.
|
protected ActivityStream |
getActivityStream() |
List<ActivityEvent> |
getEvents(boolean filter,
int nb,
int start)
Return the latest recorded events.
|
List<ActivityEvent> |
getEvents(String streamName,
boolean filter,
int nb,
int start)
Return the latest events recorded for the given stream name.
|
List<ActivityEvent> |
getEventsForSpace(String space,
boolean filter,
int nb,
int start)
Return the latest recorded events for the given wiki space.
|
List<ActivityEvent> |
getEventsForSpace(String streamName,
String space,
boolean filter,
int nb,
int start)
Return the latest events recorded for the given stream name in the given space.
|
List<ActivityEvent> |
getEventsForUser(String user,
boolean filter,
int nb,
int start)
Return the latest recorded events triggered by the given user.
|
List<ActivityEvent> |
getEventsForUser(String streamName,
String user,
boolean filter,
int nb,
int start)
Return the latest events recorded for the given stream name and the given user.
|
com.sun.syndication.feed.synd.SyndFeed |
getFeed(List<ActivityEvent> events)
Get a feed from the given events.
|
com.sun.syndication.feed.synd.SyndFeed |
getFeed(List<ActivityEvent> events,
String suffix)
Get a feed from the given events.
|
com.sun.syndication.feed.synd.SyndFeed |
getFeed(List<ActivityEvent> events,
String author,
String title,
String description,
String copyright,
String encoding,
String url)
Get a feed from the given events.
|
com.sun.syndication.feed.synd.SyndFeed |
getFeed(List<ActivityEvent> events,
String author,
String title,
String description,
String copyright,
String encoding,
String url,
String suffix)
Get a feed from the given events.
|
com.sun.syndication.feed.synd.SyndEntry |
getFeedEntry(ActivityEvent event)
Get the feed entry for the given event.
|
com.sun.syndication.feed.synd.SyndEntry |
getFeedEntry(ActivityEvent event,
String suffix)
Get the feed entry for the given event.
|
String |
getFeedOutput(List<ActivityEvent> events,
String author,
String title,
String description,
String copyright,
String encoding,
String url,
String type)
Get the string representation of a feed from the given events.
|
String |
getFeedOutput(List<ActivityEvent> events,
String author,
String title,
String description,
String copyright,
String encoding,
String url,
String type,
String suffix)
Get the string representation of a feed from the given events.
|
String |
getFeedOutput(com.sun.syndication.feed.synd.SyndFeed feed,
String type)
Get the string representation of a feed from the given feed.
|
List<ActivityEvent> |
getRelatedEvents(ActivityEvent event)
Get events that have the same requestId as the event passed as parameter.
|
String |
getStreamName(String space) |
List<Object[]> |
searchDailyPages(String optionalWhereClause,
int maxItems,
int startAt)
Get unique pages with events sorted by date, grouped by days.
|
List<Object[]> |
searchDailyPages(String optionalWhereClause,
List<Object> parametersValues,
int maxItems,
int startAt)
Get unique pages with events sorted by date, grouped by days.
|
List<ActivityEvent> |
searchEvents(String hql,
boolean filter,
boolean globalSearch,
int nb,
int start)
Search in database activity events matching the given hql query.
|
List<ActivityEvent> |
searchEvents(String hql,
boolean filter,
boolean globalSearch,
int nb,
int start,
List<Object> parameterValues)
Search in database activity events matching the given hql query.
|
List<ActivityEvent> |
searchEvents(String hql,
boolean filter,
int nb,
int start)
Search in database activity events matching the given hql query.
|
List<ActivityEvent> |
searchEvents(String hql,
boolean filter,
int nb,
int start,
List<Object> parameterValues)
Search in database activity events matching the given hql query.
|
List<ActivityEvent> |
searchEvents(String fromHql,
String hql,
boolean filter,
boolean globalSearch,
int nb,
int start)
Search in database activity events matching the given hql query.
|
List<ActivityEvent> |
searchEvents(String fromHql,
String hql,
boolean filter,
boolean globalSearch,
int nb,
int start,
List<Object> parameterValues)
Search in database activity events matching the given hql query.
|
List<ActivityEvent> |
searchEvents(String fromHql,
String hql,
boolean filter,
int nb,
int start)
Search in database activity events matching the given hql query.
|
List<ActivityEvent> |
searchEvents(String fromHql,
String hql,
boolean filter,
int nb,
int start,
List<Object> parameterValues)
Search in database activity events matching the given hql query.
|
List<Object[]> |
searchUniquePages(String optionalWhereClause,
int maxItems,
int startAt)
Get unique pages with events sorted by date.
|
List<Object[]> |
searchUniquePages(String optionalWhereClause,
List<Object> parametersValues,
int maxItems,
int startAt)
Get unique pages with events sorted by date.
|
protected List<ActivityEvent> |
unwrapEvents(List<ActivityEvent> events)
Unwrap a list of events.
|
protected List<ActivityEvent> |
wrapEvents(List<ActivityEvent> events)
Wrap a list of events.
|
getInternalPlugin, getProtectedPlugin, setPlugin
convert, convert, convert, convertAttachments, getAuthorizationManager, getXWikiContext, hasAccess, hasAccessLevel, hasAdminRights, hasProgrammingRights, hasWikiAdminRights
public ActivityStreamPluginApi(ActivityStreamPlugin plugin, XWikiContext context)
plugin
- plugin to wrapcontext
- the XWiki contextPluginApi.PluginApi(XWikiPluginInterface, XWikiContext)
protected ActivityStream getActivityStream()
ActivityStream
component to use inside the APIpublic void addActivityEvent(ActivityEvent event) throws ActivityStreamException
ActivityEvent
event.event
- the event to record in databasesActivityStreamException
- if the event addition failspublic void addActivityEvent(String streamName, String type, String title) throws ActivityStreamException
streamName
- the name of the stream to record the event fortype
- the type of event. The type can be a value picked from the list of values defined in
ActivityEventType
or any other Stringtitle
- the event titleActivityStreamException
- if the event addition failspublic void addActivityEvent(String streamName, String type, String title, List<String> params) throws ActivityStreamException
streamName
- name of the stream to use for the additiontype
- type of the eventtitle
- title of the eventparams
- parameters of the eventActivityStreamException
- if the addition to the stream failspublic void addDocumentActivityEvent(String streamName, Document doc, String type, String title) throws ActivityStreamException
streamName
- the name of the stream to add the event todoc
- the document from which to retrieve document data for the eventtype
- the type of event. (see addActivityEvent(String, String, String)
title
- the title of the eventActivityStreamException
- if the event addition failspublic void addDocumentActivityEvent(String streamName, Document doc, String type, int priority, String title) throws ActivityStreamException
streamName
- name of the stream to use for the additiondoc
- which fired the eventtype
- type of the eventpriority
- priority of the eventtitle
- title of the eventActivityStreamException
- if the addition to the stream failspublic void deleteActivityEvents(List<ActivityEvent> evs) throws ActivityStreamException
evs
- the events to be deletedActivityStreamException
- if the event deletion failspublic void deleteActivityEvent(ActivityEvent event) throws ActivityStreamException
event
- the event to delete from databaseActivityStreamException
- if the event deletion failspublic void addDocumentActivityEvent(String streamName, Document doc, String type, String title, List<String> params) throws ActivityStreamException
streamName
- name of the stream to use for the additiondoc
- which fired the eventtype
- type of the eventtitle
- title of the eventparams
- parameters of the eventActivityStreamException
- if the addition to the stream failspublic void addDocumentActivityEvent(String streamName, Document doc, String type, int priority, String title, List<String> params) throws ActivityStreamException
streamName
- name of the stream to use for the additiondoc
- which fired the eventtype
- type of the eventpriority
- priority of the eventtitle
- title of the eventparams
- parameters of the eventActivityStreamException
- if the addition to the stream failspublic List<ActivityEvent> searchEvents(String hql, boolean filter, int nb, int start) throws ActivityStreamException
hql
- the "where" clause of the hql query to look events forfilter
- if true, group the matched events by prioritynb
- the number of events to retrievestart
- the offset to start retrieving event atActivityEvent
objects.ActivityStreamException
- if the search query failspublic List<ActivityEvent> searchEvents(String hql, boolean filter, boolean globalSearch, int nb, int start) throws ActivityStreamException
hql
- the "where" clause of the hql query to look events forfilter
- if true, group the matched events by priorityglobalSearch
- true if the request must be performed on the main databasenb
- the number of events to retrievestart
- the offset to start retrieving event atActivityEvent
objects.ActivityStreamException
- if the search query failspublic List<ActivityEvent> searchEvents(String hql, boolean filter, int nb, int start, List<Object> parameterValues) throws ActivityStreamException
hql
- the "where" clause of the hql query to look events forfilter
- if true, group the matched events by prioritynb
- the number of events to retrievestart
- the offset to start retrieving event atparameterValues
- list of parameters to insert in the queryActivityEvent
objects.ActivityStreamException
- if the search query failspublic List<ActivityEvent> searchEvents(String hql, boolean filter, boolean globalSearch, int nb, int start, List<Object> parameterValues) throws ActivityStreamException
hql
- the "where" clause of the hql query to look events forfilter
- if true, group the matched events by priorityglobalSearch
- true if the request must be performed on the main databasenb
- the number of events to retrievestart
- the offset to start retrieving event atparameterValues
- list of parameters to insert in the queryActivityEvent
objects.ActivityStreamException
- if the search query failspublic List<ActivityEvent> searchEvents(String fromHql, String hql, boolean filter, int nb, int start) throws ActivityStreamException
fromHql
- the "from" clause of the hql query to look events forhql
- the "where" clause of the hql query to look events forfilter
- if true, group the matched events by prioritynb
- the number of events to retrievestart
- the offset to start retrieving event atActivityEvent
objects.ActivityStreamException
- if the search query failspublic List<ActivityEvent> searchEvents(String fromHql, String hql, boolean filter, boolean globalSearch, int nb, int start) throws ActivityStreamException
fromHql
- the "from" clause of the hql query to look events forhql
- the "where" clause of the hql query to look events forfilter
- if true, group the matched events by priorityglobalSearch
- true if the request must be performed on the main databasenb
- the number of events to retrievestart
- the offset to start retrieving event atActivityEvent
objects.ActivityStreamException
- if the search query failspublic List<ActivityEvent> searchEvents(String fromHql, String hql, boolean filter, int nb, int start, List<Object> parameterValues) throws ActivityStreamException
fromHql
- the "from" clause of the hql query to look events forhql
- the "where" clause of the hql query to look events forfilter
- if true, group the matched events by prioritynb
- the number of events to retrievestart
- the offset to start retrieving event atparameterValues
- list of parameters to insert in the queryActivityEvent
objects.ActivityStreamException
- if the search query failspublic List<ActivityEvent> searchEvents(String fromHql, String hql, boolean filter, boolean globalSearch, int nb, int start, List<Object> parameterValues) throws ActivityStreamException
fromHql
- the "from" clause of the hql query to look events forhql
- the "where" clause of the hql query to look events forfilter
- if true, group the matched events by priorityglobalSearch
- true if the request must be performed on the main databasenb
- the number of events to retrievestart
- the offset to start retrieving event atparameterValues
- list of parameters to insert in the queryActivityEvent
objects.ActivityStreamException
- if the search query failspublic List<ActivityEvent> getEvents(boolean filter, int nb, int start) throws ActivityStreamException
filter
- if true, group the matched events by prioritynb
- the number of events to retrievestart
- the offset to start retrieving event atActivityStreamException
- if the search query failspublic List<ActivityEvent> getEventsForSpace(String space, boolean filter, int nb, int start) throws ActivityStreamException
space
- the local serialized reference of the space to retrieve latest events forfilter
- if true, group the matched events by prioritynb
- the number of events to retrievestart
- the offset to start retrieving event atActivityStreamException
- if the search query failsgetEvents(boolean, int, int)
public List<ActivityEvent> getEventsForUser(String user, boolean filter, int nb, int start) throws ActivityStreamException
user
- the user to retrieve latest events forfilter
- if true, group the matched events by prioritynb
- the number of events to retrievestart
- the offset to start retrieving event atActivityStreamException
- if the search query failsgetEvents(boolean, int, int)
public List<ActivityEvent> getEvents(String streamName, boolean filter, int nb, int start) throws ActivityStreamException
streamName
- the name of the stream to retrieve latest events forfilter
- if true, group the matched events by prioritynb
- the number of events to retrievestart
- the offset to start retrieving event atActivityStreamException
- if the search query failsgetEvents(boolean, int, int)
public List<ActivityEvent> getEventsForSpace(String streamName, String space, boolean filter, int nb, int start) throws ActivityStreamException
streamName
- the name of the stream to retrieve latest events forspace
- local serialized reference of the space in which the events have been firedfilter
- if true, group the matched events by prioritynb
- the number of events to retrievestart
- the offset to start retrieving event atActivityStreamException
- if the search query failspublic List<ActivityEvent> getEventsForUser(String streamName, String user, boolean filter, int nb, int start) throws ActivityStreamException
streamName
- the name of the stream to retrieve latest events foruser
- context user at the time the events were firedfilter
- if true, group the matched events by prioritynb
- the number of events to retrievestart
- the offset to start retrieving event atActivityStreamException
- if the search query failsprotected List<ActivityEvent> wrapEvents(List<ActivityEvent> events)
events
- events to wrapprotected List<ActivityEvent> unwrapEvents(List<ActivityEvent> events)
events
- events to unwrappublic com.sun.syndication.feed.synd.SyndEntry getFeedEntry(ActivityEvent event)
event
- event to get the entry forpublic com.sun.syndication.feed.synd.SyndEntry getFeedEntry(ActivityEvent event, String suffix)
event
- event to get the entry forsuffix
- suffix to add to entry title and body stringspublic com.sun.syndication.feed.synd.SyndFeed getFeed(List<ActivityEvent> events)
events
- events to create the feed frompublic com.sun.syndication.feed.synd.SyndFeed getFeed(List<ActivityEvent> events, String suffix)
events
- events to create the feed fromsuffix
- suffix to add to entries title and body stringspublic com.sun.syndication.feed.synd.SyndFeed getFeed(List<ActivityEvent> events, String author, String title, String description, String copyright, String encoding, String url)
events
- events to create the feed fromauthor
- author to set in the feed metadatatitle
- title to set in the feed metadatadescription
- description to set in the feed metadatacopyright
- copyright to set in the feed metadataencoding
- encoding to set in the feed metadataurl
- URL to set in the feed metadatapublic com.sun.syndication.feed.synd.SyndFeed getFeed(List<ActivityEvent> events, String author, String title, String description, String copyright, String encoding, String url, String suffix)
events
- events to create the feed fromauthor
- author to set in the feed metadatatitle
- title to set in the feed metadatadescription
- description to set in the feed metadatacopyright
- copyright to set in the feed metadataencoding
- encoding to set in the feed metadataurl
- URL to set in the feed metadatasuffix
- suffix to add to entries title and body stringspublic String getFeedOutput(List<ActivityEvent> events, String author, String title, String description, String copyright, String encoding, String url, String type)
events
- events to create the feed fromauthor
- author to set in the feed metadatatitle
- title to set in the feed metadatadescription
- description to set in the feed metadatacopyright
- copyright to set in the feed metadataencoding
- encoding to set in the feed metadataurl
- URL to set in the feed metadatatype
- the feed type (syntax) to use, null if none. It can be any version of RSS or Atom. Some
possible values are "rss_1.0", "rss_2.0" and "atom_1.0"public String getFeedOutput(List<ActivityEvent> events, String author, String title, String description, String copyright, String encoding, String url, String type, String suffix)
events
- events to create the feed fromauthor
- author to set in the feed metadatatitle
- title to set in the feed metadatadescription
- description to set in the feed metadatacopyright
- copyright to set in the feed metadataencoding
- encoding to set in the feed metadataurl
- URL to set in the feed metadatatype
- the feed type (syntax) to use, null if none. It can be any version of RSS or Atom. Some
possible values are "rss_1.0", "rss_2.0" and "atom_1.0"suffix
- suffix to add to entries title and body stringspublic String getFeedOutput(com.sun.syndication.feed.synd.SyndFeed feed, String type)
feed
- the feed to get the string representation fromtype
- the feed type (syntax) to use, null if none. It can be any version of RSS or Atom. Some
possible values are "rss_1.0", "rss_2.0" and "atom_1.0"public String getStreamName(String space)
space
- the space local serialized reference to transformpublic List<ActivityEvent> getRelatedEvents(ActivityEvent event) throws ActivityStreamException
event
- the event for which to look for related eventsActivityStreamException
- if the retrieval failsActivityStream.getRelatedEvents(com.xpn.xwiki.plugin.activitystream.api.ActivityEvent, XWikiContext)
public List<Object[]> searchUniquePages(String optionalWhereClause, int maxItems, int startAt)
optionalWhereClause
- HQL where query statementmaxItems
- number of events to retrievestartAt
- query offsetpublic List<Object[]> searchUniquePages(String optionalWhereClause, List<Object> parametersValues, int maxItems, int startAt)
optionalWhereClause
- HQL where query statementparametersValues
- values for the query parametersmaxItems
- number of events to retrievestartAt
- query offsetpublic List<Object[]> searchDailyPages(String optionalWhereClause, int maxItems, int startAt)
optionalWhereClause
- HQL where query statementmaxItems
- number of events to retrievestartAt
- query offsetpublic List<Object[]> searchDailyPages(String optionalWhereClause, List<Object> parametersValues, int maxItems, int startAt)
optionalWhereClause
- HQL where query statementparametersValues
- values for the query parametersmaxItems
- number of events to retrievestartAt
- query offsetCopyright © 2004–2019 XWiki. All rights reserved.