com.xpn.xwiki.plugin.activitystream.api
Interface ActivityEvent

All Known Implementing Classes:
ActivityEventImpl

public interface ActivityEvent

An Activity Event represents an event done by a user in a certain context.

Version:
$Id: 3bd5df799afa1ddbf1d6d4dcbab24073ff471715 $

Method Summary
 String getApplication()
          Events can be triggered by different applications, not only the main wiki update events: user statuses, blog pingbacks, new extension added...
 String getBody()
          A larger section of text where the event can store some data.
 Date getDate()
          An event happens at a precise date.
 String getDisplayBody(com.xpn.xwiki.XWikiContext context)
          Get a more user-friendly, or a localized version of the event body.
 String getDisplayDate(com.xpn.xwiki.XWikiContext context)
          Get a formatted, localized version of the event date.
 String getDisplayTitle(com.xpn.xwiki.XWikiContext context)
          Get a more user-friendly, or a localized version of the event title.
 String getDisplayUser(com.xpn.xwiki.XWikiContext context)
          Get the user name as a HTML link.
 String getEventId()
          Each event has a unique ID.
 String getPage()
          Document-related events target a certain document, and documents have a name; this is the name of the target document.
 String getParam1()
          Free form parameter to be used by the event consumer.
 String getParam2()
          Free form parameter to be used by the event consumer.
 String getParam3()
          Free form parameter to be used by the event consumer.
 String getParam4()
          Free form parameter to be used by the event consumer.
 String getParam5()
          Free form parameter to be used by the event consumer.
 Map<String,String> getParameters()
           
 int getPriority()
          Different events can have a different priority.
 String getRequestId()
          Multiple events can correspond to the same activity, so events can be grouped under the same request ID.
 String getSpace()
          Document-related events target a certain document, and documents belong to a space; this is the space of the target document.
 String getStream()
          Events can happen in different contexts; for example, wiki activity events happen in different spaces, user statuses are targeted to different groups.
 String getTitle()
          A name for the event.
 String getType()
           
 String getUrl()
          If an event happens in an URL-accessible location (a document), or if the event itself can be seen at a given URL, this field stores that URL.
 String getUser()
          Event usually occur as the result of a registered user activity.
 String getVersion()
          For events related to documents, this field records the version of the document at the time when the event occurred.
 String getWiki()
          In a wiki farm, each event happens in one of the wikis.
 void setApplication(String application)
           
 void setBody(String body)
           
 void setDate(Date date)
           
 void setEventId(String id)
           
 void setPage(String page)
           
 void setParam1(String param1)
           
 void setParam2(String param2)
           
 void setParam3(String param3)
           
 void setParam4(String param4)
           
 void setParam5(String param5)
           
 void setParameters(Map<String,String> parameters)
          Associates name-value pair parameters with this event.
 void setParams(List<String> params)
          Set all parameters at once.
 void setPriority(int priority)
           
 void setRequestId(String id)
           
 void setSpace(String space)
           
 void setStream(String stream)
           
 void setTitle(String title)
           
 void setType(String type)
           
 void setUrl(String url)
           
 void setUser(String user)
           
 void setVersion(String version)
           
 void setWiki(String wiki)
           
 

Method Detail

getEventId

String getEventId()
Each event has a unique ID.

Returns:
the unique ID of the event

setEventId

void setEventId(String id)
Parameters:
id - the unique ID of the event to set
See Also:
getEventId()

getRequestId

String getRequestId()
Multiple events can correspond to the same activity, so events can be grouped under the same request ID.

Returns:
the event group ID

setRequestId

void setRequestId(String id)
Parameters:
id - the event group ID
See Also:
getRequestId()

getPriority

int getPriority()
Different events can have a different priority. This allows to determine which events are more or less important in the same request, or which events are important in the stream. For example, annotation automatic updates are less important in a group of changes triggered by a document update, while a major version is more important than a minor version.

Returns:
the priority of the event

setPriority

void setPriority(int priority)
Parameters:
priority - the priority of the event
See Also:
getPriority()

getType

String getType()
Returns:
The type of the event

setType

void setType(String type)
Parameters:
type - The type of the event
See Also:
getType()

getApplication

String getApplication()
Events can be triggered by different applications, not only the main wiki update events: user statuses, blog pingbacks, new extension added...

Returns:
the application name

setApplication

void setApplication(String application)
Parameters:
application - the application Name
See Also:
getApplication()

getStream

String getStream()
Events can happen in different contexts; for example, wiki activity events happen in different spaces, user statuses are targeted to different groups.

Returns:
the stream name

setStream

void setStream(String stream)
Parameters:
stream - the stream Name
See Also:
getStream()

getDate

Date getDate()
An event happens at a precise date.

Returns:
the event date

setDate

void setDate(Date date)
Parameters:
date - the event date
See Also:
getDate()

getUser

String getUser()
Event usually occur as the result of a registered user activity.

Returns:
the wiki name of the user creating the event

setUser

void setUser(String user)
Parameters:
user - the wiki name of the user creating the event
See Also:
getUser()

getWiki

String getWiki()
In a wiki farm, each event happens in one of the wikis.

Returns:
the wiki name in which the event was created

setWiki

void setWiki(String wiki)
Parameters:
wiki - the wiki name in which the event was created
See Also:
getWiki()

getSpace

String getSpace()
Document-related events target a certain document, and documents belong to a space; this is the space of the target document.

Returns:
the space name in which the event was created

setSpace

void setSpace(String space)
Parameters:
space - the space name in which the event was created
See Also:
getSpace()

getPage

String getPage()
Document-related events target a certain document, and documents have a name; this is the name of the target document.

Returns:
the page of the event

setPage

void setPage(String page)
Parameters:
page - the page of the event
See Also:
getPage()

getUrl

String getUrl()
If an event happens in an URL-accessible location (a document), or if the event itself can be seen at a given URL, this field stores that URL.

Returns:
the URL related to the event

setUrl

void setUrl(String url)
Parameters:
url - the URL related to the event
See Also:
getUrl()

getTitle

String getTitle()
A name for the event.

Returns:
the title of the event

setTitle

void setTitle(String title)
Parameters:
title - the title of the event
See Also:
getTitle()

getBody

String getBody()
A larger section of text where the event can store some data.

Returns:
the body of the event

setBody

void setBody(String body)
Parameters:
body - the body of the event
See Also:
getBody()

getVersion

String getVersion()
For events related to documents, this field records the version of the document at the time when the event occurred.

Returns:
the document version when the event occurred

setVersion

void setVersion(String version)
Parameters:
version - the document version when the event occurred
See Also:
getVersion()

getParam1

String getParam1()
Free form parameter to be used by the event consumer.

Returns:
the first parameter associated with the event

setParam1

void setParam1(String param1)
Parameters:
param1 - the first parameter associated with the event
See Also:
getParam1()

getParam2

String getParam2()
Free form parameter to be used by the event consumer.

Returns:
the second parameter associated with the event

setParam2

void setParam2(String param2)
Parameters:
param2 - the second parameter associated with the event
See Also:
getParam2()

getParam3

String getParam3()
Free form parameter to be used by the event consumer.

Returns:
the third parameter associated with the event

setParam3

void setParam3(String param3)
Parameters:
param3 - the third parameter associated with the event
See Also:
getParam3()

getParam4

String getParam4()
Free form parameter to be used by the event consumer.

Returns:
the fourth parameter associated with the event

setParam4

void setParam4(String param4)
Parameters:
param4 - the fourth parameter associated with the event
See Also:
getParam4()

getParam5

String getParam5()
Free form parameter to be used by the event consumer.

Returns:
the fifth parameter associated with the event

setParam5

void setParam5(String param5)
Parameters:
param5 - the fifth parameter associated with the event
See Also:
getParam5()

getDisplayTitle

String getDisplayTitle(com.xpn.xwiki.XWikiContext context)
Get a more user-friendly, or a localized version of the event title.

Parameters:
context - the XWiki context
Returns:
the event title in a human readable format
See Also:
getTitle()

getDisplayBody

String getDisplayBody(com.xpn.xwiki.XWikiContext context)
Get a more user-friendly, or a localized version of the event body.

Parameters:
context - the XWiki context
Returns:
the event body in a human readable format
See Also:
getBody()

getDisplayDate

String getDisplayDate(com.xpn.xwiki.XWikiContext context)
Get a formatted, localized version of the event date.

Parameters:
context - the XWiki context
Returns:
the event date in a human readable format
See Also:
getDate()

getDisplayUser

String getDisplayUser(com.xpn.xwiki.XWikiContext context)
Get the user name as a HTML link.

Parameters:
context - the XWiki context
Returns:
the event user in a human readable format (example: Administrator instead of XWiki.Admin), as a HTML fragment

setParams

void setParams(List<String> params)
Set all parameters at once.

Parameters:
params - parameters to set, a list of at most 5 entries

setParameters

void setParameters(Map<String,String> parameters)
Associates name-value pair parameters with this event.

Parameters:
parameters - the parameters to associate

getParameters

Map<String,String> getParameters()
Returns:
name-value pair parameters associated with this event.


Copyright © 2004-2012 XWiki. All Rights Reserved.