com.xpn.xwiki.plugin.watchlist
Class WatchListEvent

java.lang.Object
  extended by com.xpn.xwiki.plugin.watchlist.WatchListEvent
All Implemented Interfaces:
java.lang.Comparable<WatchListEvent>

public class WatchListEvent
extends java.lang.Object
implements java.lang.Comparable<WatchListEvent>

The class representing an event in the WatchList. The current implementation is a wrapper for one or more ActivityEvent.

Version:
$Id: WatchListEvent.java 24760 2009-10-29 13:33:49Z jvdrean $

Constructor Summary
WatchListEvent(com.xpn.xwiki.plugin.activitystream.api.ActivityEvent activityEvent, com.xpn.xwiki.XWikiContext context)
          Constructor.
 
Method Summary
 void addEvent(WatchListEvent event)
          Add another event associated to this event.
 int compareTo(WatchListEvent event)
          Perform a string comparison on the prefixed fullName of the source document.
 boolean equals(java.lang.Object obj)
          Overriding of the default equals method.
 java.lang.String getAuthor()
           
 java.util.List<java.lang.String> getAuthors()
           
 java.util.Date getDate()
           
 java.util.List<java.util.Date> getDates()
           
 java.lang.String getFullName()
           
 java.lang.String getHTMLDiff()
           
 java.lang.String getPrefixedFullName()
           
 java.lang.String getPrefixedSpace()
           
 java.lang.String getPreviousVersion()
           
 java.lang.String getSpace()
           
 java.lang.String getType()
           
 java.lang.String getUrl()
           
 java.lang.String getVersion()
           
 java.util.List<java.lang.String> getVersions()
           
 java.lang.String getWiki()
           
 int hashCode()
          
 boolean isComposite()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WatchListEvent

public WatchListEvent(com.xpn.xwiki.plugin.activitystream.api.ActivityEvent activityEvent,
                      com.xpn.xwiki.XWikiContext context)
Constructor.

Parameters:
activityEvent - activity stream event to wrap
context - the XWiki context
Method Detail

addEvent

public void addEvent(WatchListEvent event)
Add another event associated to this event.

Parameters:
event - The event to add.

getWiki

public java.lang.String getWiki()
Returns:
The wiki in which the event happened.

getSpace

public java.lang.String getSpace()
Returns:
The space in which the event happened.

getPrefixedSpace

public java.lang.String getPrefixedSpace()
Returns:
The space, prefixed with the wiki name, in which the event happened (example: "xwiki:Main").

getFullName

public java.lang.String getFullName()
Returns:
The fullName of the document which has generated this event (example: "Main.WebHome").

getPrefixedFullName

public java.lang.String getPrefixedFullName()
Returns:
The fullName of the document which has generated this event, prefixed with the wiki name. Example: "xwiki:Main.WebHome".

getUrl

public java.lang.String getUrl()
Returns:
The URL of the document which has fired the event

getDate

public java.util.Date getDate()
Returns:
The date when the event occurred.

getDates

public java.util.List<java.util.Date> getDates()
Returns:
Get all the dates of a composite event, if this event is not a composite this list will contain single entry.

getType

public java.lang.String getType()
Returns:
The type of this event (example: "update", "delete").

getAuthor

public java.lang.String getAuthor()
Returns:
The user who generated the event.

getAuthors

public java.util.List<java.lang.String> getAuthors()
Returns:
Get all the authors of a composite event, if this event is not a composite this list will contain single entry.

getVersion

public java.lang.String getVersion()
Returns:
The version of the document at the time it has generated the event.

getVersions

public java.util.List<java.lang.String> getVersions()
Returns:
All the versions from a composite event, if the event is not a composite the list will contain a single entry

getPreviousVersion

public java.lang.String getPreviousVersion()
Returns:
The version of the document which has generated the event, before the actual event.

isComposite

public boolean isComposite()
Returns:
True if the event is made of multiple events.

getHTMLDiff

public java.lang.String getHTMLDiff()
Returns:
The diff, formated in HTML, to display to the user when a document has been updated

compareTo

public int compareTo(WatchListEvent event)
Perform a string comparison on the prefixed fullName of the source document.

Specified by:
compareTo in interface java.lang.Comparable<WatchListEvent>
Parameters:
event - event to compare with
Returns:
the result of the string comparison

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overriding of the default equals method.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the ActivityEvent to be compared with
Returns:
True if the two events have been generated by the same document and are equals or conflicting


Copyright © 2004-2010 XWiki. All Rights Reserved.