com.xpn.xwiki.plugin.activitystream.impl
Class ActivityEventImpl

java.lang.Object
  extended by com.xpn.xwiki.plugin.activitystream.impl.ActivityEventImpl
All Implemented Interfaces:
ActivityEvent

public class ActivityEventImpl
extends Object
implements ActivityEvent

Version:
$Id: 76980f103e9e13e21b0619496edee8c3517e77c5 $

Field Summary
protected  String application
          Application which fired the event (as of august 2009 this application is always "xwiki").
protected  String body
          Body message of the event.
protected  Date date
          Date the event occured.
protected  String eventId
          ID.
protected  boolean hidden
          True if the page which fired the event is marked as hidden, false otherwise.
protected  String page
          Name of the document which fired the event, example: "Main.WebHome".
protected  String param1
          Free param 1.
protected  String param2
          Free param 2.
protected  String param3
          Free param 3.
protected  String param4
          Free param 4.
protected  String param5
          Free param 5.
protected  Map<String,String> parameters
          Named parameters.
protected  int priority
          Priority.
protected  String requestId
          Request ID.
protected  String space
          Space in which the event occured, example: "Main".
protected  String stream
          Stream the event belongs to.
protected  String title
          Title of the event.
protected  String type
          Type of the event, see ActivityEventType.
protected  String url
          URL of the document which fired the event, example: "/xwiki/bin/view/Main/WebHome".
protected  String user
          Context user at the time the event has been fired.
protected  String version
          Version of the document at the time the event occured.
protected  String wiki
          Wiki in which the event occured, example: "xwiki".
 
Constructor Summary
ActivityEventImpl()
           
 
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()
           
 List<String> getParams()
           
 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.
 boolean isHidden()
           
 void setApplication(String application)
           
 void setBody(String body)
           
 void setDate(Date date)
           
 void setEventId(String eventId)
           
 void setHidden(Boolean hidden)
           
 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 requestId)
           
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

eventId

protected String eventId
ID.


requestId

protected String requestId
Request ID.


priority

protected int priority
Priority.


date

protected Date date
Date the event occured.


stream

protected String stream
Stream the event belongs to.


application

protected String application
Application which fired the event (as of august 2009 this application is always "xwiki").


type

protected String type
Type of the event, see ActivityEventType.


user

protected String user
Context user at the time the event has been fired.


wiki

protected String wiki
Wiki in which the event occured, example: "xwiki".


space

protected String space
Space in which the event occured, example: "Main".


page

protected String page
Name of the document which fired the event, example: "Main.WebHome".


url

protected String url
URL of the document which fired the event, example: "/xwiki/bin/view/Main/WebHome".


title

protected String title
Title of the event.


body

protected String body
Body message of the event.


version

protected String version
Version of the document at the time the event occured.


param1

protected String param1
Free param 1.


param2

protected String param2
Free param 2.


param3

protected String param3
Free param 3.


param4

protected String param4
Free param 4.


param5

protected String param5
Free param 5.


hidden

protected boolean hidden
True if the page which fired the event is marked as hidden, false otherwise.


parameters

protected Map<String,String> parameters
Named parameters.

Constructor Detail

ActivityEventImpl

public ActivityEventImpl()
Method Detail

getDisplayTitle

public String getDisplayTitle(com.xpn.xwiki.XWikiContext context)
Description copied from interface: ActivityEvent
Get a more user-friendly, or a localized version of the event title.

Specified by:
getDisplayTitle in interface ActivityEvent
Parameters:
context - the XWiki context
Returns:
the event title in a human readable format
See Also:
ActivityEvent.getTitle()

getDisplayBody

public String getDisplayBody(com.xpn.xwiki.XWikiContext context)
Description copied from interface: ActivityEvent
Get a more user-friendly, or a localized version of the event body.

Specified by:
getDisplayBody in interface ActivityEvent
Parameters:
context - the XWiki context
Returns:
the event body in a human readable format
See Also:
ActivityEvent.getBody()

getDisplayDate

public String getDisplayDate(com.xpn.xwiki.XWikiContext context)
Description copied from interface: ActivityEvent
Get a formatted, localized version of the event date.

Specified by:
getDisplayDate in interface ActivityEvent
Parameters:
context - the XWiki context
Returns:
the event date in a human readable format
See Also:
ActivityEvent.getDate()

getDisplayUser

public String getDisplayUser(com.xpn.xwiki.XWikiContext context)
Description copied from interface: ActivityEvent
Get the user name as a HTML link.

Specified by:
getDisplayUser in interface ActivityEvent
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

public void setParams(List<String> params)
Description copied from interface: ActivityEvent
Set all parameters at once.

Specified by:
setParams in interface ActivityEvent
Parameters:
params - parameters to set, a list of at most 5 entries

getParams

public List<String> getParams()
Returns:
the parameters of the event

getEventId

public String getEventId()
Description copied from interface: ActivityEvent
Each event has a unique ID.

Specified by:
getEventId in interface ActivityEvent
Returns:
the unique ID of the event

setEventId

public void setEventId(String eventId)
Specified by:
setEventId in interface ActivityEvent
Parameters:
eventId - the unique ID of the event to set
See Also:
ActivityEvent.getEventId()

getRequestId

public String getRequestId()
Description copied from interface: ActivityEvent
Multiple events can correspond to the same activity, so events can be grouped under the same request ID.

Specified by:
getRequestId in interface ActivityEvent
Returns:
the event group ID

setRequestId

public void setRequestId(String requestId)
Specified by:
setRequestId in interface ActivityEvent
Parameters:
requestId - the event group ID
See Also:
ActivityEvent.getRequestId()

getPriority

public int getPriority()
Description copied from interface: ActivityEvent
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.

Specified by:
getPriority in interface ActivityEvent
Returns:
the priority of the event

setPriority

public void setPriority(int priority)
Specified by:
setPriority in interface ActivityEvent
Parameters:
priority - the priority of the event
See Also:
ActivityEvent.getPriority()

getApplication

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

Specified by:
getApplication in interface ActivityEvent
Returns:
the application name

setStream

public void setStream(String stream)
Specified by:
setStream in interface ActivityEvent
Parameters:
stream - the stream Name
See Also:
ActivityEvent.getStream()

getVersion

public String getVersion()
Description copied from interface: ActivityEvent
For events related to documents, this field records the version of the document at the time when the event occurred.

Specified by:
getVersion in interface ActivityEvent
Returns:
the document version when the event occurred

setVersion

public void setVersion(String version)
Specified by:
setVersion in interface ActivityEvent
Parameters:
version - the document version when the event occurred
See Also:
ActivityEvent.getVersion()

getParam1

public String getParam1()
Description copied from interface: ActivityEvent
Free form parameter to be used by the event consumer.

Specified by:
getParam1 in interface ActivityEvent
Returns:
the first parameter associated with the event

setParam1

public void setParam1(String param1)
Specified by:
setParam1 in interface ActivityEvent
Parameters:
param1 - the first parameter associated with the event
See Also:
ActivityEvent.getParam1()

getParam2

public String getParam2()
Description copied from interface: ActivityEvent
Free form parameter to be used by the event consumer.

Specified by:
getParam2 in interface ActivityEvent
Returns:
the second parameter associated with the event

setParam2

public void setParam2(String param2)
Specified by:
setParam2 in interface ActivityEvent
Parameters:
param2 - the second parameter associated with the event
See Also:
ActivityEvent.getParam2()

getParam3

public String getParam3()
Description copied from interface: ActivityEvent
Free form parameter to be used by the event consumer.

Specified by:
getParam3 in interface ActivityEvent
Returns:
the third parameter associated with the event

setParam3

public void setParam3(String param3)
Specified by:
setParam3 in interface ActivityEvent
Parameters:
param3 - the third parameter associated with the event
See Also:
ActivityEvent.getParam3()

getParam4

public String getParam4()
Description copied from interface: ActivityEvent
Free form parameter to be used by the event consumer.

Specified by:
getParam4 in interface ActivityEvent
Returns:
the fourth parameter associated with the event

setParam4

public void setParam4(String param4)
Specified by:
setParam4 in interface ActivityEvent
Parameters:
param4 - the fourth parameter associated with the event
See Also:
ActivityEvent.getParam4()

getParam5

public String getParam5()
Description copied from interface: ActivityEvent
Free form parameter to be used by the event consumer.

Specified by:
getParam5 in interface ActivityEvent
Returns:
the fifth parameter associated with the event

setParam5

public void setParam5(String param5)
Specified by:
setParam5 in interface ActivityEvent
Parameters:
param5 - the fifth parameter associated with the event
See Also:
ActivityEvent.getParam5()

getWiki

public String getWiki()
Description copied from interface: ActivityEvent
In a wiki farm, each event happens in one of the wikis.

Specified by:
getWiki in interface ActivityEvent
Returns:
the wiki name in which the event was created

setWiki

public void setWiki(String wiki)
Specified by:
setWiki in interface ActivityEvent
Parameters:
wiki - the wiki name in which the event was created
See Also:
ActivityEvent.getWiki()

getType

public String getType()
Specified by:
getType in interface ActivityEvent
Returns:
The type of the event

setType

public void setType(String type)
Specified by:
setType in interface ActivityEvent
Parameters:
type - The type of the event
See Also:
ActivityEvent.getType()

getUser

public String getUser()
Description copied from interface: ActivityEvent
Event usually occur as the result of a registered user activity.

Specified by:
getUser in interface ActivityEvent
Returns:
the wiki name of the user creating the event

setUser

public void setUser(String user)
Specified by:
setUser in interface ActivityEvent
Parameters:
user - the wiki name of the user creating the event
See Also:
ActivityEvent.getUser()

getSpace

public String getSpace()
Description copied from interface: ActivityEvent
Document-related events target a certain document, and documents belong to a space; this is the space of the target document.

Specified by:
getSpace in interface ActivityEvent
Returns:
the space name in which the event was created

setSpace

public void setSpace(String space)
Specified by:
setSpace in interface ActivityEvent
Parameters:
space - the space name in which the event was created
See Also:
ActivityEvent.getSpace()

getPage

public String getPage()
Description copied from interface: ActivityEvent
Document-related events target a certain document, and documents have a name; this is the name of the target document.

Specified by:
getPage in interface ActivityEvent
Returns:
the page of the event

setPage

public void setPage(String page)
Specified by:
setPage in interface ActivityEvent
Parameters:
page - the page of the event
See Also:
ActivityEvent.getPage()

getUrl

public String getUrl()
Description copied from interface: ActivityEvent
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.

Specified by:
getUrl in interface ActivityEvent
Returns:
the URL related to the event

setUrl

public void setUrl(String url)
Specified by:
setUrl in interface ActivityEvent
Parameters:
url - the URL related to the event
See Also:
ActivityEvent.getUrl()

getTitle

public String getTitle()
Description copied from interface: ActivityEvent
A name for the event.

Specified by:
getTitle in interface ActivityEvent
Returns:
the title of the event

setTitle

public void setTitle(String title)
Specified by:
setTitle in interface ActivityEvent
Parameters:
title - the title of the event
See Also:
ActivityEvent.getTitle()

getBody

public String getBody()
Description copied from interface: ActivityEvent
A larger section of text where the event can store some data.

Specified by:
getBody in interface ActivityEvent
Returns:
the body of the event

setBody

public void setBody(String body)
Specified by:
setBody in interface ActivityEvent
Parameters:
body - the body of the event
See Also:
ActivityEvent.getBody()

getDate

public Date getDate()
Description copied from interface: ActivityEvent
An event happens at a precise date.

Specified by:
getDate in interface ActivityEvent
Returns:
the event date

setDate

public void setDate(Date date)
Specified by:
setDate in interface ActivityEvent
Parameters:
date - the event date
See Also:
ActivityEvent.getDate()

getStream

public String getStream()
Description copied from interface: ActivityEvent
Events can happen in different contexts; for example, wiki activity events happen in different spaces, user statuses are targeted to different groups.

Specified by:
getStream in interface ActivityEvent
Returns:
the stream name

setApplication

public void setApplication(String application)
Specified by:
setApplication in interface ActivityEvent
Parameters:
application - the application Name
See Also:
ActivityEvent.getApplication()

setParameters

public void setParameters(Map<String,String> parameters)
Description copied from interface: ActivityEvent
Associates name-value pair parameters with this event.

Specified by:
setParameters in interface ActivityEvent
Parameters:
parameters - the parameters to associate

getParameters

public Map<String,String> getParameters()
Specified by:
getParameters in interface ActivityEvent
Returns:
name-value pair parameters associated with this event.

isHidden

public boolean isHidden()
Returns:
True if the event has been triggered by an action performed on a document marked as hidden.

setHidden

public void setHidden(Boolean hidden)
Parameters:
hidden - the event hidden flag.
See Also:
isHidden()


Copyright © 2004-2013 XWiki. All Rights Reserved.