|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.xpn.xwiki.plugin.watchlist.WatchListStore
public class WatchListStore
WatchList store class. Handles user subscription storage.
| Nested Class Summary | |
|---|---|
static class |
WatchListStore.ElementType
List of elements that can be watched. |
| Field Summary | |
|---|---|
static java.lang.String |
SCHEDULER_SPACE
Space of the scheduler application. |
static java.lang.String |
SPACE_PAGE_SEP
Character used to separated space and page in XWiki model. |
static java.lang.String |
WATCHLIST_ELEMENT_SEP
Character used to separated elements in Watchlist lists (pages, spaces, etc). |
static java.lang.String |
WIKI_SPACE_SEP
Character used to separated wiki and space in XWiki model. |
| Constructor Summary | |
|---|---|
WatchListStore()
|
|
| Method Summary | |
|---|---|
boolean |
addWatchedElement(java.lang.String user,
java.lang.String newWatchedElement,
WatchListStore.ElementType type,
com.xpn.xwiki.XWikiContext context)
Add the specified element (document or space) to the corresponding list in the user's WatchList. |
com.xpn.xwiki.objects.BaseObject |
createWatchListObject(java.lang.String user,
com.xpn.xwiki.XWikiContext context)
Creates a WatchList XWiki Object in the user's profile's page. |
java.util.List<org.xwiki.observation.event.Event> |
getEvents()
|
java.util.List<java.lang.String> |
getJobDocumentNames()
|
java.lang.String |
getName()
|
java.util.List<java.lang.String> |
getSubscribersForJob(java.lang.String jobId)
|
java.util.List<java.lang.String> |
getWatchedElements(java.lang.String user,
WatchListStore.ElementType type,
com.xpn.xwiki.XWikiContext context)
Get watched elements for the given element type and user. |
com.xpn.xwiki.objects.BaseObject |
getWatchListObject(java.lang.String user,
com.xpn.xwiki.XWikiContext context)
Gets the WatchList XWiki Object from user's profile's page. |
java.util.List<java.lang.String> |
globalSearchDocuments(java.lang.String request,
int nb,
int start,
java.util.List<java.lang.Object> values,
com.xpn.xwiki.XWikiContext context)
Search documents on all the wikis by passing HQL where clause values as parameters. |
void |
init(com.xpn.xwiki.XWikiContext context)
Init watchlist store. |
boolean |
isWatched(java.lang.String element,
java.lang.String user,
WatchListStore.ElementType type,
com.xpn.xwiki.XWikiContext context)
Is the element watched by the given user. |
void |
onEvent(org.xwiki.observation.event.Event event,
java.lang.Object source,
java.lang.Object data)
|
boolean |
removeWatchedElement(java.lang.String user,
java.lang.String watchedElement,
WatchListStore.ElementType type,
com.xpn.xwiki.XWikiContext context)
Remove the specified element (document or space) from the corresponding list in the user's WatchList. |
void |
virtualInit(com.xpn.xwiki.XWikiContext context)
Virtual init for watchlist store. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String WATCHLIST_ELEMENT_SEP
public static final java.lang.String WIKI_SPACE_SEP
public static final java.lang.String SPACE_PAGE_SEP
public static final java.lang.String SCHEDULER_SPACE
| Constructor Detail |
|---|
public WatchListStore()
| Method Detail |
|---|
public void init(com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
context - the XWiki context
com.xpn.xwiki.XWikiException - if the watchlist XWiki class creation fails
public void virtualInit(com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
context - the XWiki context
com.xpn.xwiki.XWikiException - if the watchlist XWiki class creation failspublic java.util.List<java.lang.String> getSubscribersForJob(java.lang.String jobId)
jobId - ID of the job.
public java.util.List<java.lang.String> getJobDocumentNames()
public java.util.List<java.lang.String> getWatchedElements(java.lang.String user,
WatchListStore.ElementType type,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
user - user to matchtype - element type to matchcontext - the XWiki context
com.xpn.xwiki.XWikiException - if retrieval of elements fails
public boolean isWatched(java.lang.String element,
java.lang.String user,
WatchListStore.ElementType type,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
element - the element to look foruser - user to checktype - type of the elementcontext - the XWiki context
com.xpn.xwiki.XWikiException - if the retrieval of watched elements fails
public boolean addWatchedElement(java.lang.String user,
java.lang.String newWatchedElement,
WatchListStore.ElementType type,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
user - XWikiUsernewWatchedElement - The name of the element to add (document of space)type - type of the element to removecontext - Context of the request
com.xpn.xwiki.XWikiException - if the modification hasn't been saved
public boolean removeWatchedElement(java.lang.String user,
java.lang.String watchedElement,
WatchListStore.ElementType type,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
user - XWiki UserwatchedElement - The name of the element to remove (document or space)type - type of the element to removecontext - Context of the request
com.xpn.xwiki.XWikiException - If the WatchList Object cannot be retreived or if the user's profile cannot be saved
public com.xpn.xwiki.objects.BaseObject createWatchListObject(java.lang.String user,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
user - XWiki Usercontext - Context of the request
com.xpn.xwiki.XWikiException - if the document cannot be saved
public com.xpn.xwiki.objects.BaseObject getWatchListObject(java.lang.String user,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
user - XWiki Usercontext - Context of the request
com.xpn.xwiki.XWikiException - if BaseObject creation fails
public java.util.List<java.lang.String> globalSearchDocuments(java.lang.String request,
int nb,
int start,
java.util.List<java.lang.Object> values,
com.xpn.xwiki.XWikiContext context)
request - The HQL where clause.nb - Number of results to retrievestart - Offset to use in the search queryvalues - The where clause values that replaces the question marks (?)context - The XWiki context
public void onEvent(org.xwiki.observation.event.Event event,
java.lang.Object source,
java.lang.Object data)
onEvent in interface org.xwiki.observation.EventListenerEventListener.onEvent(org.xwiki.observation.event.Event, java.lang.Object,
java.lang.Object)public java.util.List<org.xwiki.observation.event.Event> getEvents()
getEvents in interface org.xwiki.observation.EventListenerEventListener.getEvents()public java.lang.String getName()
getName in interface org.xwiki.observation.EventListenerEventListener.getName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||