public class ActivityEventImpl extends Object implements ActivityEvent
Modifier and Type | Field and Description |
---|---|
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 (local serialized reference) in which the event occurred, example: "Main", "A.B", "A.B.C", etc.
|
protected String |
stream
Stream the event belongs to.
|
protected Set<String> |
target |
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 and Description |
---|
ActivityEventImpl() |
Modifier and Type | Method and Description |
---|---|
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(XWikiContext context)
Get a more user-friendly, or a localized version of the
event body . |
String |
getDisplayDate(XWikiContext context)
Get a formatted, localized version of the
event date . |
String |
getDisplayTitle(XWikiContext context)
Get a more user-friendly, or a localized version of the
event title . |
String |
getDisplayUser(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 full 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.
|
Set<String> |
getTarget() |
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 |
setTarget(Set<String> target) |
void |
setTitle(String title) |
void |
setType(String type) |
void |
setUrl(String url) |
void |
setUser(String user) |
void |
setVersion(String version) |
void |
setWiki(String wiki) |
protected String eventId
protected String requestId
protected int priority
protected Date date
protected String stream
protected String application
protected String type
ActivityEventType
.protected String user
protected String wiki
protected String space
protected String page
protected String url
protected String title
protected String body
protected String version
protected String param1
protected String param2
protected String param3
protected String param4
protected String param5
protected boolean hidden
public String getDisplayTitle(XWikiContext context)
ActivityEvent
event title
.getDisplayTitle
in interface ActivityEvent
context
- the XWiki contextActivityEvent.getTitle()
public String getDisplayBody(XWikiContext context)
ActivityEvent
event body
.getDisplayBody
in interface ActivityEvent
context
- the XWiki contextActivityEvent.getBody()
public String getDisplayDate(XWikiContext context)
ActivityEvent
event date
.getDisplayDate
in interface ActivityEvent
context
- the XWiki contextActivityEvent.getDate()
public String getDisplayUser(XWikiContext context)
ActivityEvent
user name
as a HTML link.getDisplayUser
in interface ActivityEvent
context
- the XWiki contextpublic void setParams(List<String> params)
ActivityEvent
setParams
in interface ActivityEvent
params
- parameters to set, a list of at most 5 entriespublic String getEventId()
ActivityEvent
getEventId
in interface ActivityEvent
public void setEventId(String eventId)
setEventId
in interface ActivityEvent
eventId
- the unique ID of the event to setActivityEvent.getEventId()
public String getRequestId()
ActivityEvent
getRequestId
in interface ActivityEvent
public void setRequestId(String requestId)
setRequestId
in interface ActivityEvent
requestId
- the event group IDActivityEvent.getRequestId()
public int getPriority()
ActivityEvent
getPriority
in interface ActivityEvent
public void setPriority(int priority)
setPriority
in interface ActivityEvent
priority
- the priority of the eventActivityEvent.getPriority()
public String getApplication()
ActivityEvent
getApplication
in interface ActivityEvent
public void setStream(String stream)
setStream
in interface ActivityEvent
stream
- the stream NameActivityEvent.getStream()
public String getVersion()
ActivityEvent
getVersion
in interface ActivityEvent
public void setVersion(String version)
setVersion
in interface ActivityEvent
version
- the document version when the event occurredActivityEvent.getVersion()
public String getParam1()
ActivityEvent
getParam1
in interface ActivityEvent
public void setParam1(String param1)
setParam1
in interface ActivityEvent
param1
- the first parameter associated with the eventActivityEvent.getParam1()
public String getParam2()
ActivityEvent
getParam2
in interface ActivityEvent
public void setParam2(String param2)
setParam2
in interface ActivityEvent
param2
- the second parameter associated with the eventActivityEvent.getParam2()
public String getParam3()
ActivityEvent
getParam3
in interface ActivityEvent
public void setParam3(String param3)
setParam3
in interface ActivityEvent
param3
- the third parameter associated with the eventActivityEvent.getParam3()
public String getParam4()
ActivityEvent
getParam4
in interface ActivityEvent
public void setParam4(String param4)
setParam4
in interface ActivityEvent
param4
- the fourth parameter associated with the eventActivityEvent.getParam4()
public String getParam5()
ActivityEvent
getParam5
in interface ActivityEvent
public void setParam5(String param5)
setParam5
in interface ActivityEvent
param5
- the fifth parameter associated with the eventActivityEvent.getParam5()
public String getWiki()
ActivityEvent
getWiki
in interface ActivityEvent
public void setWiki(String wiki)
setWiki
in interface ActivityEvent
wiki
- the wiki name in which the event was createdActivityEvent.getWiki()
public String getType()
getType
in interface ActivityEvent
public void setType(String type)
setType
in interface ActivityEvent
type
- The type of the eventActivityEvent.getType()
public String getUser()
ActivityEvent
getUser
in interface ActivityEvent
public void setUser(String user)
setUser
in interface ActivityEvent
user
- the wiki name of the user creating the eventActivityEvent.getUser()
public String getSpace()
ActivityEvent
getSpace
in interface ActivityEvent
public void setSpace(String space)
setSpace
in interface ActivityEvent
space
- the local serialized reference of the space in which the event was createdActivityEvent.getSpace()
public String getPage()
ActivityEvent
getPage
in interface ActivityEvent
public void setPage(String page)
setPage
in interface ActivityEvent
page
- the full name of the page of the eventActivityEvent.getPage()
public String getUrl()
ActivityEvent
getUrl
in interface ActivityEvent
public void setUrl(String url)
setUrl
in interface ActivityEvent
url
- the URL related to the eventActivityEvent.getUrl()
public String getTitle()
ActivityEvent
getTitle
in interface ActivityEvent
public void setTitle(String title)
setTitle
in interface ActivityEvent
title
- the title of the eventActivityEvent.getTitle()
public String getBody()
ActivityEvent
getBody
in interface ActivityEvent
public void setBody(String body)
setBody
in interface ActivityEvent
body
- the body of the eventActivityEvent.getBody()
public Date getDate()
ActivityEvent
getDate
in interface ActivityEvent
public void setDate(Date date)
setDate
in interface ActivityEvent
date
- the event dateActivityEvent.getDate()
public String getStream()
ActivityEvent
getStream
in interface ActivityEvent
public void setApplication(String application)
setApplication
in interface ActivityEvent
application
- the application NameActivityEvent.getApplication()
public void setParameters(Map<String,String> parameters)
ActivityEvent
setParameters
in interface ActivityEvent
parameters
- the parameters to associatepublic Map<String,String> getParameters()
getParameters
in interface ActivityEvent
public boolean isHidden()
public void setHidden(Boolean hidden)
hidden
- the event hidden flag.isHidden()
public void setTarget(Set<String> target)
setTarget
in interface ActivityEvent
target
- a list of entities (users, groups) that are interested by this eventpublic Set<String> getTarget()
getTarget
in interface ActivityEvent
Copyright © 2004–2019 XWiki. All rights reserved.