Author: jvdrean
Date: 2007-10-24 14:52:16 +0200 (Wed, 24 Oct 2007)
New Revision: 5487
Modified:
xwiki-platform/xwiki-plugins/trunk/watchlist/
xwiki-platform/xwiki-plugins/trunk/watchlist/src/main/java/com/xpn/xwiki/plugin/watchlist/WatchListJob.java
xwiki-platform/xwiki-plugins/trunk/watchlist/src/main/java/com/xpn/xwiki/plugin/watchlist/WatchListPlugin.java
Log:
Code style fixes
Property changes on: xwiki-platform/xwiki-plugins/trunk/watchlist
___________________________________________________________________
Name: svn:ignore
+ target
*.iml
Modified:
xwiki-platform/xwiki-plugins/trunk/watchlist/src/main/java/com/xpn/xwiki/plugin/watchlist/WatchListJob.java
===================================================================
---
xwiki-platform/xwiki-plugins/trunk/watchlist/src/main/java/com/xpn/xwiki/plugin/watchlist/WatchListJob.java
2007-10-24 10:32:59 UTC (rev 5486)
+++
xwiki-platform/xwiki-plugins/trunk/watchlist/src/main/java/com/xpn/xwiki/plugin/watchlist/WatchListJob.java
2007-10-24 12:52:16 UTC (rev 5487)
@@ -197,9 +197,9 @@
* @return a collection of document names pointing to the XWikiUsers
wishing to get notified.
* @throws XWikiException
*/
- protected Collection retrieveNotificationSubscribers() throws
XWikiException
+ protected List retrieveNotificationSubscribers() throws XWikiException
{
- Collection userDocs =
+ List userDocs =
xwiki.searchDocuments(
", BaseObject as obj, StringProperty as prop where
obj.name=doc.fullName and obj.className='"
+ WatchListPlugin.WATCHLIST_CLASS + "' and
prop.id.id=obj.id and prop.name='interval' " +
@@ -235,7 +235,7 @@
break;
}
updatedDocumentRequest += " order by doc.date desc";
- return xwiki.searchDocuments(updatedDocumentRequest);
+ return xwiki.searchDocuments(updatedDocumentRequest);
}
// TODO :
Modified:
xwiki-platform/xwiki-plugins/trunk/watchlist/src/main/java/com/xpn/xwiki/plugin/watchlist/WatchListPlugin.java
===================================================================
---
xwiki-platform/xwiki-plugins/trunk/watchlist/src/main/java/com/xpn/xwiki/plugin/watchlist/WatchListPlugin.java
2007-10-24 10:32:59 UTC (rev 5486)
+++
xwiki-platform/xwiki-plugins/trunk/watchlist/src/main/java/com/xpn/xwiki/plugin/watchlist/WatchListPlugin.java
2007-10-24 12:52:16 UTC (rev 5487)
@@ -17,7 +17,6 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-
package com.xpn.xwiki.plugin.watchlist;
import com.xpn.xwiki.XWiki;
@@ -39,22 +38,29 @@
import java.util.List;
/**
- * Plugin that offers WatchList features to XWiki. These feature allow users
to build lists of pages and spaces they
- * want to follow. At a frequency choosen by the user XWiki will send an email
notification to him with a list of the
- * elements that has been modified since the last notification.
+ * Plugin that offers WatchList features to XWiki. These feature allow users
to build lists of pages
+ * and spaces they want to follow. At a frequency choosen by the user XWiki
will send an email
+ * notification to him with a list of the elements that has been modified
since the last
+ * notification.
*
* @version $Id: $
*/
-public class WatchListPlugin extends XWikiDefaultPlugin implements
XWikiPluginInterface {
+public class WatchListPlugin extends XWikiDefaultPlugin implements
XWikiPluginInterface
+{
+ public static String WATCHLIST_EMAIL_TEMPLATE = "XWiki.WatchListMessage";
- public static String WATCHLIST_EMAIL_TEMPLATE = "XWiki.WatchListMessage";
public static String WATCHLIST_EMAIL_JOB_COMMON_NAME =
"Scheduler.WatchListJob";
+
public static String WATCHLIST_CLASS = "XWiki.WatchListClass";
public static final int WATCHLIST_INTERVAL_NEVER = 0;
+
public static final int WATCHLIST_INTERVAL_HOUR = 1;
+
public static final int WATCHLIST_INTERVAL_DAY = 2;
+
public static final int WATCHLIST_INTERVAL_WEEK = 3;
+
public static final int WATCHLIST_INTERVAL_MONTH = 4;
public static final String ID = "watchlist";
@@ -66,7 +72,8 @@
*
* @see
XWikiDefaultPlugin#XWikiDefaultPlugin(String,String,com.xpn.xwiki.XWikiContext)
*/
- public WatchListPlugin(String name, String className, XWikiContext
context) {
+ public WatchListPlugin(String name, String className, XWikiContext context)
+ {
super(name, className, context);
}
@@ -75,7 +82,8 @@
*
* @see com.xpn.xwiki.plugin.XWikiDefaultPlugin#getName()
*/
- public String getName() {
+ public String getName()
+ {
return ID;
}
@@ -84,7 +92,8 @@
*
* @see com.xpn.xwiki.plugin.XWikiDefaultPlugin#virtualInit(XWikiContext)
*/
- public void virtualInit(XWikiContext context) {
+ public void virtualInit(XWikiContext context)
+ {
super.virtualInit(context);
try {
initWatchListClass(context);
@@ -94,15 +103,15 @@
log.error("virtualInit", e);
e.printStackTrace();
}
-
}
- /**
+ /**
* [EMAIL PROTECTED]
*
* @see com.xpn.xwiki.plugin.XWikiDefaultPlugin#init(XWikiContext)
*/
- public void init(XWikiContext context) {
+ public void init(XWikiContext context)
+ {
super.init(context);
try {
initWatchListClass(context);
@@ -112,22 +121,24 @@
log.error("virtualInit", e);
e.printStackTrace();
}
-
}
/**
* [EMAIL PROTECTED]
*
- * @see
com.xpn.xwiki.plugin.XWikiDefaultPlugin#getPluginApi(XWikiPluginInterface,
XWikiContext)
+ * @see
com.xpn.xwiki.plugin.XWikiDefaultPlugin#getPluginApi(XWikiPluginInterface,
+ *XWikiContext)
*/
- public Api getPluginApi(XWikiPluginInterface plugin, XWikiContext context)
{
+ public Api getPluginApi(XWikiPluginInterface plugin, XWikiContext context)
+ {
return new WatchListPluginApi((WatchListPlugin) plugin, context);
}
/**
* @return log Log interface
*/
- protected Log getLogger() {
+ protected Log getLogger()
+ {
return log;
}
@@ -135,10 +146,11 @@
* Creates the WatchList xwiki class
*
* @param context Context of the request
- * @throws XWikiException if class fields cannot be created
* @return the WatchList XWiki Class
+ * @throws XWikiException if class fields cannot be created
*/
- protected BaseClass initWatchListClass(XWikiContext context) throws
XWikiException {
+ protected BaseClass initWatchListClass(XWikiContext context) throws
XWikiException
+ {
XWikiDocument doc;
XWiki xwiki = context.getWiki();
boolean needsUpdate = false;
@@ -156,16 +168,16 @@
BaseClass bclass = doc.getxWikiClass();
bclass.setName(WATCHLIST_CLASS);
needsUpdate |=
- bclass.addStaticListField("interval", "Email notifications
interval", +
- WATCHLIST_INTERVAL_NEVER + "=never|" +
- WATCHLIST_INTERVAL_HOUR + "=hourly|" +
- WATCHLIST_INTERVAL_DAY + "=daily|" +
- WATCHLIST_INTERVAL_WEEK + "=weekly|" +
- WATCHLIST_INTERVAL_MONTH + "=monthly");
+ bclass.addStaticListField("interval", "Email notifications
interval", +
+ WATCHLIST_INTERVAL_NEVER + "=never|" +
+ WATCHLIST_INTERVAL_HOUR + "=hourly|" +
+ WATCHLIST_INTERVAL_DAY + "=daily|" +
+ WATCHLIST_INTERVAL_WEEK + "=weekly|" +
+ WATCHLIST_INTERVAL_MONTH + "=monthly");
needsUpdate |=
- bclass.addTextAreaField("spaces", "Space list, separated by
commas", 40, 5);
+ bclass.addTextAreaField("spaces", "Space list, separated by
commas", 40, 5);
needsUpdate |=
- bclass.addTextAreaField("documents", "Document list, separated
by commas", 40, 5);
+ bclass.addTextAreaField("documents", "Document list, separated by
commas", 40, 5);
needsUpdate |= bclass.addTextAreaField("query", "Query (HQL)", 40, 5);
String content = doc.getContent();
@@ -174,8 +186,9 @@
doc.setContent("1 NotificationRule");
}
- if (needsUpdate)
+ if (needsUpdate) {
xwiki.saveDocument(doc, context);
+ }
return bclass;
}
@@ -188,7 +201,9 @@
* @param cron CRON expression (see quartz CRON expressions)
* @param context Context of the request
*/
- protected void initWatchListJob(int interval, String name, String
description, String cron, XWikiContext context) throws XWikiException {
+ protected void initWatchListJob(int interval, String name, String
description, String cron,
+ XWikiContext context) throws XWikiException
+ {
XWikiDocument doc;
XWiki xwiki = context.getWiki();
boolean needsUpdate = false;
@@ -198,8 +213,9 @@
try {
doc = xwiki.getDocument(docName, context);
BaseObject obj = doc.getObject(SchedulerPlugin.XWIKI_JOB_CLASS);
- if (obj == null)
+ if (obj == null) {
needsUpdate = true;
+ }
} catch (Exception e) {
doc = new XWikiDocument();
String[] spaceAndName = docName.split(".");
@@ -225,7 +241,7 @@
rights.setStringValue("levels", "edit,delete");
rights.setIntValue("allow", 1);
xwiki.saveDocument(doc, context);
- ((SchedulerPlugin)context.getWiki().getPlugin("scheduler",
context))
+ ((SchedulerPlugin) context.getWiki().getPlugin("scheduler",
context))
.scheduleJob(job, context);
}
}
@@ -236,28 +252,27 @@
* @param context Context of the request
* @throws XWikiException When a job creation fails
*/
- protected void initWatchlistJobs(XWikiContext context) throws
XWikiException {
+ protected void initWatchlistJobs(XWikiContext context) throws
XWikiException
+ {
// Every hour at 00
initWatchListJob(WATCHLIST_INTERVAL_HOUR, "WatchList hourly
notifications",
- "WatchList hourly email watchlist job", "0 0 * * * ?",
context);
+ "WatchList hourly email watchlist job", "0 0 * * * ?", context);
// Every day at 00:00
initWatchListJob(WATCHLIST_INTERVAL_DAY, "WatchList daily
notifications",
- "WatchList daily email watchlist job", "0 0 0 * * ?", context);
+ "WatchList daily email watchlist job", "0 0 0 * * ?", context);
// Every monday at 00:00
initWatchListJob(WATCHLIST_INTERVAL_WEEK, "WatchList weekly
notifications",
- "WatchList weekly email watchlist job", "0 0 0 ? * SUN",
context);
+ "WatchList weekly email watchlist job", "0 0 0 ? * SUN", context);
// First day of every month at 00:00
initWatchListJob(WATCHLIST_INTERVAL_MONTH, "WatchList monthly
notifications",
- "WatchList monthly email watchlist job", "0 0 0 ? * L",
context);
+ "WatchList monthly email watchlist job", "0 0 0 ? * L", context);
}
/**
* Creates the email notification template (XWiki Object)
- *
- * @param context
- * @throws XWikiException
*/
- protected void initEmailTemplate(XWikiContext context) throws
XWikiException {
+ protected void initEmailTemplate(XWikiContext context) throws
XWikiException
+ {
XWikiDocument doc;
XWiki xwiki = context.getWiki();
boolean needsUpdate = false;
@@ -265,8 +280,9 @@
try {
doc = xwiki.getDocument(WATCHLIST_EMAIL_TEMPLATE, context);
BaseObject obj =
doc.getObject(MailSenderPlugin.EMAIL_XWIKI_CLASS_NAME);
- if (obj == null)
+ if (obj == null) {
needsUpdate = true;
+ }
} catch (Exception e) {
doc = new XWikiDocument();
String[] spaceAndName = WATCHLIST_EMAIL_TEMPLATE.split(".");
@@ -280,43 +296,41 @@
int index =
doc.createNewObject(MailSenderPlugin.EMAIL_XWIKI_CLASS_NAME, context);
BaseObject mail =
doc.getObject(MailSenderPlugin.EMAIL_XWIKI_CLASS_NAME, index);
mail.setStringValue("language", "en");
- mail.setStringValue("subject", "XWiki : Watchlist Updates,
#set($format=\"dd/MM/yyyy\")" +
- "#if ($interval == 1)#set($format=\"${format}
hh:mm\")#end$xwiki.formatDate($xwiki.date, $format)");
+ mail.setStringValue("subject",
+ "XWiki : Watchlist Updates, #set($format=\"dd/MM/yyyy\")#if
($interval == 1)" +
+ "#set($format=\"${format}
hh:mm\")#end$xwiki.formatDate($xwiki.date, $format)");
mail.setLargeStringValue("text", "Hello $pseudo,\n" +
- "This message is sent by XWiki. Here are the documents in
your watchlist that have been created " +
- "or updated since the last notification :\n" +
- "\n" +
- "#foreach ($udocname in $documents)\n" +
- "#set ($udoc = $xwiki.getDocument($udocname))" +
- "$udoc.getDisplayTitle() : ${udoc.getExternalURL()}\n" +
- "#end");
+ "This message is sent by XWiki. Here are the documents in your
watchlist that have been created or updated since the last notification :\n" +
+ "\n" +
+ "#foreach ($udocname in $documents)\n" +
+ "#set ($udoc =
$xwiki.getDocument($udocname))$udoc.getDisplayTitle() :
${udoc.getExternalURL()}\n" +
+ "#end");
mail.setLargeStringValue("html", "<b>Hello $pseudo,</b><br/>\n" +
- "<i>This message is sent by XWiki. Here are the documents
in your watchlist that have been " +
- "created or updated since the last notification
:</i><br/>\n" +
- "<br/>\n" +
- "<table width=\"100%\">\n" +
- "<tr
style=\"background-color:#EFEFEF;font-weight:bold;\">\n" +
- "<td>Name</td><td>Space</td><td>Modified
by</td><td>Comment</td><td>Modified on</td>\n" +
- "</tr>\n" +
- "#foreach ($udoc in $documents)\n" +
- "#if ($velocityCount % 2 == 0)\n" +
- " #set ($color = \"#E5F0FE\")\n" +
- "#else\n" +
- " #set ($color = \"#FFF\")\n" +
- "#end\n" +
- "<tr style=\"background-color:${color};\">\n" +
- "<td><a
href=\"${udoc.getExternalURL()}\">$udoc.getDisplayTitle()</a></td>\n" +
- "<td>$udoc.web</td>\n" +
- "<td>$xwiki.getLocalUserName($udoc.author, true)</td>\n" +
- "<td>$udoc.getComment()</td>\n" +
- "<td>$xwiki.formatDate($udoc.date)</td>\n" +
- "</tr>\n" +
- "#end\n" +
- "</table>");
+ "<i>This message is sent by XWiki. Here are the documents in
your watchlist that have been created or updated since the last notification
:</i><br/>\n" +
+ "<br/>\n" +
+ "<table width=\"100%\">\n" +
+ "<tr style=\"background-color:#EFEFEF;font-weight:bold;\">\n" +
+ "<td>Name</td><td>Space</td><td>Modified
by</td><td>Comment</td><td>Modified on</td>\n" +
+ "</tr>\n" +
+ "#foreach ($udocname in $documents)\n" +
+ "#set ($udoc = $xwiki.getDocument($udocname))\n" +
+ "#if ($velocityCount % 2 == 0)\n" +
+ " #set ($color = \"#E5F0FE\")\n" +
+ "#else\n" +
+ " #set ($color = \"#FFF\")\n" +
+ "#end\n" +
+ "<tr style=\"background-color:${color};\">\n" +
+ "<td><a
href=\"${udoc.getExternalURL()}\">$udoc.getDisplayTitle()</a></td>\n" +
+ "<td>$udoc.web</td>\n" +
+ "<td>$xwiki.getLocalUserName($udoc.author, true)</td>\n" +
+ "<td>$udoc.getComment()</td>\n" +
+ "<td>$xwiki.formatDate($udoc.date)</td>\n" +
+ "</tr>\n" +
+ "#end\n" +
+ "</table>");
String content = doc.getContent();
if ((content == null) || (content.equals(""))) {
doc.setContent("1 Notification message");
-
}
xwiki.saveDocument(doc, context);
}
@@ -329,11 +343,12 @@
* @param watchedElement XWiki Document name
* @param context Context of the request
* @return True if the page is watched by user
- * @throws XWikiException
*/
- public boolean isWatched(String localUser, String watchedElement,
XWikiContext context) throws XWikiException {
+ public boolean isWatched(String localUser, String watchedElement,
XWikiContext context)
+ throws XWikiException
+ {
return this.getWatchedDocuments(localUser,
context).contains(watchedElement) |
- this.getWatchedSpaces(localUser,
context).contains(watchedElement);
+ this.getWatchedSpaces(localUser, context).contains(watchedElement);
}
/**
@@ -343,7 +358,8 @@
* @param context Context of the request
* @throws XWikiException if the document cannot be saved
*/
- public void createWatchListObject(String localUser, XWikiContext context)
throws XWikiException {
+ public void createWatchListObject(String localUser, XWikiContext context)
throws XWikiException
+ {
XWiki wiki = context.getWiki();
XWikiDocument userDocument = wiki.getDocument(localUser, context);
int nb = userDocument.createNewObject(WATCHLIST_CLASS, context);
@@ -361,7 +377,9 @@
* @return the WatchList XWiki BaseObject
* @throws XWikiException if BaseObject creation fails
*/
- private BaseObject getWatchListObject(String localUser, XWikiContext
context) throws XWikiException {
+ private BaseObject getWatchListObject(String localUser, XWikiContext
context)
+ throws XWikiException
+ {
XWikiDocument userDocument = context.getWiki().getDocument(localUser,
context);
if (userDocument.getObjectNumbers(WATCHLIST_CLASS) == 0) {
this.createWatchListObject(localUser, context);
@@ -371,7 +389,8 @@
}
/**
- * Sets a largeString property in the localUser's WatchList Object, then
saves the localUser's profile
+ * Sets a largeString property in the localUser's WatchList Object, then
saves the localUser's
+ * profile
*
* @param localUser XWiki User
* @param prop Property name (documents,spaces,query)
@@ -379,7 +398,9 @@
* @param context Context of the request
* @throws XWikiException if the user's profile cannot be saved
*/
- private void setWatchListLargeStringProperty(String localUser, String
prop, String value, XWikiContext context) throws XWikiException {
+ private void setWatchListLargeStringProperty(String localUser, String
prop, String value,
+ XWikiContext context) throws XWikiException
+ {
XWikiDocument userDocument = context.getWiki().getDocument(localUser,
context);
userDocument.setLargeStringValue(WATCHLIST_CLASS, prop, value);
userDocument.isMinorEdit();
@@ -395,7 +416,8 @@
* @return List of watched documents
* @throws XWikiException if the WatchList Object cannot be retreived
*/
- public List getWatchedDocuments(String localUser, XWikiContext context)
throws XWikiException {
+ public List getWatchedDocuments(String localUser, XWikiContext context)
throws XWikiException
+ {
BaseObject watchListObject = this.getWatchListObject(localUser,
context);
String watchedItems =
watchListObject.getLargeStringValue("documents").trim();
return Arrays.asList(watchedItems.split(","));
@@ -409,14 +431,16 @@
* @return List of watched space
* @throws XWikiException if the WatchList Object cannot be retreived
*/
- public List getWatchedSpaces(String localUser, XWikiContext context)
throws XWikiException {
+ public List getWatchedSpaces(String localUser, XWikiContext context)
throws XWikiException
+ {
BaseObject watchListObject = this.getWatchListObject(localUser,
context);
String watchedItems =
watchListObject.getLargeStringValue("spaces").trim();
return Arrays.asList(watchedItems.split(","));
}
/**
- * Add the specified element (document or space) to the corresponding list
in the localUser's WatchList
+ * Add the specified element (document or space) to the corresponding list
in the localUser's
+ * WatchList
*
* @param localUser XWikiUser
* @param newWatchedElement The name of the element to add (document of
space)
@@ -426,77 +450,93 @@
* @throws XWikiException if the modification hasn't been saved
*/
public boolean addWatchedElement(String localUser, String
newWatchedElement,
- boolean isSpace, XWikiContext context)
throws XWikiException {
+ boolean isSpace, XWikiContext context) throws XWikiException
+ {
if (this.isWatched(localUser, newWatchedElement, context)) {
return false;
}
String prop = isSpace ? "spaces" : "documents";
List watchedItems = isSpace ?
- this.getWatchedSpaces(localUser, context) :
this.getWatchedDocuments(localUser, context);
+ this.getWatchedSpaces(localUser, context) :
+ this.getWatchedDocuments(localUser, context);
StringBuffer updatedWatchedElements = new StringBuffer();
for (int i = 0; i < watchedItems.size(); i++) {
- if (i > 0)
+ if (i > 0) {
updatedWatchedElements.append(",");
+ }
updatedWatchedElements.append(watchedItems.get(i));
}
- if (watchedItems.size() > 0)
+ if (watchedItems.size() > 0) {
updatedWatchedElements.append(",");
+ }
updatedWatchedElements.append(newWatchedElement);
- this.setWatchListLargeStringProperty(localUser, prop,
updatedWatchedElements.toString(), context);
+ this.setWatchListLargeStringProperty(localUser, prop,
updatedWatchedElements.toString(),
+ context);
return true;
}
/**
- * Remove the specified element (document or space) from the corresponding
list in the localUser's WatchList
+ * Remove the specified element (document or space) from the corresponding
list in the
+ * localUser's WatchList
*
* @param localUser XWiki User
* @param watchedElement The name of the element to remove (document or
space)
* @param isSpace True if the element is a space, false if it's a document
* @param context Context of the request
- * @return True if the element was in list and has been removed, false if
the element was'nt in the list
- * @throws XWikiException If the WatchList Object cannot be retreived or
if the localUser's profile cannot be saved
+ * @return True if the element was in list and has been removed, false if
the element was'nt in
+ * the list
+ * @throws XWikiException If the WatchList Object cannot be retreived or
if the localUser's
+ * profile cannot be saved
*/
public boolean removeWatchedElement(String localUser, String
watchedElement,
- boolean isSpace, XWikiContext context)
throws XWikiException {
+ boolean isSpace, XWikiContext context) throws XWikiException
+ {
if (!this.isWatched(localUser, watchedElement, context)) {
return false;
}
String prop = isSpace ? "spaces" : "documents";
List watchedItems = isSpace ?
- this.getWatchedSpaces(localUser, context) :
this.getWatchedDocuments(localUser, context);
+ this.getWatchedSpaces(localUser, context) :
+ this.getWatchedDocuments(localUser, context);
StringBuffer updatedWatchedElements = new StringBuffer();
for (int i = 0; i < watchedItems.size(); i++) {
if (!watchedItems.get(i).equals(watchedElement)) {
- if (i > 0)
+ if (i > 0) {
updatedWatchedElements.append(",");
+ }
updatedWatchedElements.append(watchedItems.get(i));
}
}
- this.setWatchListLargeStringProperty(localUser, prop,
updatedWatchedElements.toString(), context);
+ this.setWatchListLargeStringProperty(localUser, prop,
updatedWatchedElements.toString(),
+ context);
return true;
}
/**
- * Get the list of the elements watched by localUser ordered by last
modification date, descending
+ * Get the list of the elements watched by localUser ordered by last
modification date,
+ * descending
*
* @param localUser XWiki User
* @param context Context of the request
* @return The list of the watched elements ordered by last modification
date, descending
* @throws XWikiException If the search request fails
*/
- public List getWatchListWhatsNew(String localUser, XWikiContext context)
throws XWikiException {
+ public List getWatchListWhatsNew(String localUser, XWikiContext context)
throws XWikiException
+ {
BaseObject watchListObject = this.getWatchListObject(localUser,
context);
- String watchedDocuments =
watchListObject.getLargeStringValue("documents").trim().replaceFirst("^,", "")
+ String watchedDocuments =
+
watchListObject.getLargeStringValue("documents").trim().replaceFirst("^,", "")
.replaceAll(",", "','");
- String watchedSpaces =
watchListObject.getLargeStringValue("spaces").trim().replaceFirst("^,", "")
+ String watchedSpaces =
+
watchListObject.getLargeStringValue("spaces").trim().replaceFirst("^,", "")
.replaceAll(",", "','");
String request = "select doc.fullName from XWikiDocument as doc where
doc.web in ('" +
- watchedSpaces + "') or doc.fullName in ('" +
watchedDocuments + "') " +
- "order by doc.date desc";
+ watchedSpaces + "') or doc.fullName in ('" + watchedDocuments +
"') " +
+ "order by doc.date desc";
return context.getWiki().getStore().search(request, 20, 0, context);
}
}
_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications