Watchlist Plugin

Last modified by Eduard Moraru on 2021/03/17 22:07

cogLets the user add pages or spaces that he/she wants to monitor and for which he/she wants to receive email notifications
TypePlugin
Category
Developed by

XWiki Development Team

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Enterprise, XWiki Enterprise Manager, XWiki Watch

Description

Starting with XWiki 7.0RC1, this plugin is deprecated and was moved to legacy. Please use the new Watchlist API component-based implementation instead.

This plugin uses the Mail Sender Plugin.

Installation

To use, add the com.xpn.xwiki.plugin.watchlist.WatchListPlugin plugin definition to the xwiki.plugins property in your xwiki.cfg file (this definition is already there if you use XWiki Enterprise 1.2 Milestone 2 or above).

The API is the following:

public boolean isDocInWatchedSpaces() throws XWikiException;

    /**
     * Is current document watched by the current user
     *
     * @return True if the document is in the current user's WatchList
     * @throws XWikiException If the user's WatchList Object cannot be retreived nor created
     */
    public boolean isWatchedDocument() throws XWikiException;

    /**
     * Add the specified document to the current user's WatchList
     *
     * @param wDoc Document to add
     * @return True if the document wasn't already in the WatchList
     * @throws XWikiException If the user's WatchList Object cannot be retreived nor created
     */
    public boolean addDocument(String wDoc) throws XWikiException;

    /**
     * Allows Adminstrators to add the specified document in the specified user's WatchList
     *
     * @param localUser XWiki User
     * @param wDoc Document to add
     * @return True if the document wasn't already in the WatchList
     * @throws XWikiException If the user's WatchList Object cannot be retreived nor created
     */
    public boolean addDocumentForUser(String localUser, String wDoc) throws XWikiException;

    /**
     * Removed the specified document from the current user's WatchList
     *
     * @param wDoc Document to remove
     * @return True if the document was in the WatchList and has been removed
     * @throws XWikiException If the user's WatchList Object cannot be retreived nor created
     */
    public boolean removeDocument(String wDoc) throws XWikiException;

    /**
     * Allows Adminstrators to remove the specified document from the specified user's WatchList
     *
     * @param localUser XWiki User
     * @param wDoc Document to remove
     * @return True if the document was in the WatchList and has been removed
     * @throws XWikiException If the user's WatchList Object cannot be retreived nor created
     */
    public boolean removeDocumentForUser(String localUser, String wDoc) throws XWikiException;

    /**
     * Is the current space watched by the current user
     *
     * @return True if the document is in the current user's watchlist
     * @throws XWikiException If the user's WatchList Object cannot be retreived nor created
     */
    public boolean isWatchedSpace() throws XWikiException;

    /**
     * Add the current space to the current user's WatchList
     *
     * @param wSpace Space to add
     * @return True if the space wasn't already in the user's WatchList and has been added
     * @throws XWikiException If the user's WatchList Object cannot be retreived nor created
     */
    public boolean addSpace(String wSpace) throws XWikiException;

    /**
     * Allows Administrators to add the specified space to the specified user's WatchList
     *
     * @param localUser XWiki User
     * @param wSpace Space to add
     * @return True if the space wasn't already in the user's WatchList and has been added
     * @throws XWikiException If the user's WatchList Object cannot be retreived nor created
     */
    public boolean addSpaceForUser(String localUser, String wSpace) throws XWikiException;

    /**
     * Remove the specified space from the current user's WatchList
     *
     * @param wSpace Space to remove
     * @return True if the space was in the user's WatchList and has been removed
     * @throws XWikiException If the user's WatchList Object cannot be retreived nor created
     */
    public boolean removeSpace(String wSpace) throws XWikiException;

    /**
     * Allows Administrators to remove the specified space from the specified user's WatchList
     *
     * @param localUser XWiki User
     * @param wSpace Space to remove
     * @return True if the space was in the user's WatchList and has been removed
     * @throws XWikiException If the user's WatchList Object cannot be retreived nor created
     */
    public boolean removeSpaceForUser(String localUser, String wSpace) throws XWikiException;

    /**
     * Get the documents watched by the current user
     *
     * @return The list of the documents in the user's WatchList
     * @throws XWikiException If the user's WatchList Object cannot be retreived nor created
     */
    public List getWatchedDocuments() throws XWikiException;

    /**
     * Get the spaces watched by the current user
     *
     * @return The list of the spaces in the user's WatchList
     * @throws XWikiException If the user's WatchList Object cannot be retreived nor created
     */
    public List getWatchedSpaces() throws XWikiException;

    /**
     * Get the elements (documents + spaces) watched by the current user
     *
     * @return The list of the elements in the user's WatchList
     * @throws XWikiException If the user's WatchList Object cannot be retreived nor created
     */
    public List getWatchedElements() throws XWikiException;

    /**
     * Get the list of the elements watched by localUser ordered by last modification date, descending
     *
     * @param localUser XWiki User
     * @return the list of the elements watched by localUser ordered by last modification date, descending
     * @throws XWikiException If the search request fails
     */
    public List getWatchListWhatsNew(String localUser) throws XWikiException;

Example

A new "Watch" menu has been added to the top level menu of XWiki Enterprise in versions 1.2 milestone and above.

    

Get Connected