Author: vmassol
Date: 2008-02-04 14:38:10 +0100 (Mon, 04 Feb 2008)
New Revision: 7287
Added:
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/compatibility/
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/compatibility/com/
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/compatibility/com/xpn/
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/compatibility/com/xpn/xwiki/
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/compatibility/com/xpn/xwiki/aspect/
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/compatibility/com/xpn/xwiki/aspect/compatibility/
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/compatibility/com/xpn/xwiki/aspect/compatibility/XWikiCompatibilityAspect.aj
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/debug/
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/debug/com/
Removed:
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/com/
Modified:
xwiki-platform/core/trunk/xwiki-core/pom.xml
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/debug/com/xpn/xwiki/aspect/log/LogAspect.aj
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/XWiki.java
xwiki-platform/pom/trunk/pom.xml
Log:
XWIKI-2059: Move deprecated methods in XWiki class into a
backward-compatibility Aspect
Modified: xwiki-platform/core/trunk/xwiki-core/pom.xml
===================================================================
--- xwiki-platform/core/trunk/xwiki-core/pom.xml 2008-02-04 00:23:20 UTC
(rev 7286)
+++ xwiki-platform/core/trunk/xwiki-core/pom.xml 2008-02-04 13:38:10 UTC
(rev 7287)
@@ -516,10 +516,33 @@
<artifactId>fop</artifactId>
<version>0.93</version>
</dependency>
+ <!-- Needed for backward compatibility Aspects -->
+ <dependency>
+ <groupId>aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>1.5.2a</version>
+ </dependency>
</dependencies>
<build>
<plugins>
+ <!-- Apply Backward compatibility Aspects using the strategy described at
+ http://blogs.sonatype.com/john/2007/11/09/1194630418546.html -->
<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>aspectj-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>backward-compatibility-aspects</id>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <aspectDirectory>src/main/aspect/compatibility</aspectDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<!-- Generate Javadoc only for the Public API -->
@@ -554,19 +577,19 @@
**/doc/rcs/*.java,
**/api/RevisionInfo.java,
**/web/DeleteVersions*.java,
- **/migration/**.java,
- **/*RecycleBin*.java,
- **/*DeletedDocument.java,
- **/UndeleteAction.java,
+ **/migration/**.java,
+ **/*RecycleBin*.java,
+ **/*DeletedDocument.java,
+ **/UndeleteAction.java,
**/rightsmanager/**/*.java
</includes>
<excludes>
**/RenamePageReplaceLinkHandler.java,
<!-- these files are clean, but failed in checkstyle
because http://jira.codehaus.org/browse/MCHECKSTYLE-54 : -->
**/XWikiPatchUtils.java,
- **/XWikiRCSArchive.java,
+ **/XWikiRCSArchive.java,
**/XWikiHibernateRecycleBinStore.java,
- **/migration/AbstractXWikiMigrationManager.java
+ **/migration/AbstractXWikiMigrationManager.java
</excludes>
</configuration>
</plugin>
@@ -581,13 +604,6 @@
everything you'll need to control what is logged by tuning the
Log4J configuration file
to log only what you want. -->
<id>debug</id>
- <dependencies>
- <dependency>
- <groupId>aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>1.5.2a</version>
- </dependency>
- </dependencies>
<build>
<plugins>
<plugin>
@@ -595,9 +611,15 @@
<artifactId>aspectj-maven-plugin</artifactId>
<executions>
<execution>
+ <id>debug</id>
<goals>
<goal>compile</goal>
</goals>
+ <configuration>
+ <configuration>
+ <aspectDirectory>src/main/aspect/debug</aspectDirectory>
+ </configuration>
+ </configuration>
</execution>
</executions>
</plugin>
Added:
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/compatibility/com/xpn/xwiki/aspect/compatibility/XWikiCompatibilityAspect.aj
===================================================================
---
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/compatibility/com/xpn/xwiki/aspect/compatibility/XWikiCompatibilityAspect.aj
(rev 0)
+++
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/compatibility/com/xpn/xwiki/aspect/compatibility/XWikiCompatibilityAspect.aj
2008-02-04 13:38:10 UTC (rev 7287)
@@ -0,0 +1,465 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * 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.aspect.compatibility;
+
+import com.xpn.xwiki.api.XWiki;
+import com.xpn.xwiki.api.Util;
+import com.xpn.xwiki.XWikiException;
+import com.xpn.xwiki.stats.api.XWikiStatsService;
+
+import java.io.IOException;
+import java.awt.image.BufferedImage;
+import java.util.*;
+
+/**
+ * Add a backwrad compatibility layer to the [EMAIL PROTECTED]
com.xpn.xwiki.api.XWiki} class.
+ *
+ * @version $Id: $
+ */
+public privileged aspect XWikiCompatibilityAspect
+{
+ /**
+ * Utility methods have been moved in version 1.3 Milestone 2 to the
[EMAIL PROTECTED] Util} class.
+ * However to preserve backward compatibility we have deprecated them in
this class and
+ * not removed them yet. All calls are funnelled through this class
variable.
+ */
+ private Util XWiki.util;
+
+ /**
+ * Capture the api.XWiki constructor so that we can initialize this.util.
+ */
+ private pointcut xwikiCreation(XWiki x): this(x) && execution( public
XWiki.new(..) );
+
+ after(XWiki x): xwikiCreation(x)
+ {
+ x.util = new Util(x.xwiki, x.context);
+ }
+
+ /**
+ * API to protect Text from Wiki transformation
+ * @param text
+ * @return escaped text
+ * @deprecated replaced by Util#escapeText since 1.3M2
+ */
+ public String XWiki.escapeText(String text)
+ {
+ return this.util.escapeText(text);
+ }
+
+ /**
+ * API to protect URLs from Wiki transformation
+ * @param url
+ * @return encoded URL
+ * @deprecated replaced by Util#escapeURL since 1.3M2
+ */
+ public String XWiki.escapeURL(String url)
+ {
+ return this.util.escapeURL(url);
+ }
+
+ /**
+ * @deprecated use [EMAIL PROTECTED] #getLanguagePreference()} instead
+ */
+ public String XWiki.getDocLanguagePreference()
+ {
+ return xwiki.getDocLanguagePreference(getXWikiContext());
+ }
+
+ /**
+ * Privileged API to send a message to an email address
+ *
+ * @param sender email of the sender of the message
+ * @param recipient email of the recipient of the message
+ * @param message Message to send
+ * @throws XWikiException if the mail was not send successfully
+ * @deprecated replaced by the
+ * <a
href="http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin">Mail Sender
+ * Plugin</a> since 1.3M2
+ */
+ public void XWiki.sendMessage(String sender, String recipient, String
message)
+ throws XWikiException
+ {
+ if (hasProgrammingRights())
+ xwiki.sendMessage(sender, recipient, message, getXWikiContext());
+ }
+
+ /**
+ * Privileged API to send a message to an email address
+ *
+ * @param sender email of the sender of the message
+ * @param recipient emails of the recipients of the message
+ * @param message Message to send
+ * @throws XWikiException if the mail was not send successfully
+ * @deprecated replaced by the
+ * <a
href="http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin">Mail Sender
+ * Plugin</a> since 1.3M2
+ */
+ public void XWiki.sendMessage(String sender, String[] recipient, String
message)
+ throws XWikiException
+ {
+ if (hasProgrammingRights())
+ xwiki.sendMessage(sender, recipient, message, getXWikiContext());
+ }
+
+ /**
+ * @return the current date
+ * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#getDate()} since 1.3M2
+ */
+ public Date XWiki.getCurrentDate()
+ {
+ return this.util.getDate();
+ }
+
+ /**
+ * @return the current date
+ * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#getDate()} since 1.3M2
+ */
+ public Date XWiki.getDate()
+ {
+ return this.util.getDate();
+ }
+
+ /**
+ * @param time the time in milliseconds
+ * @return the time delta in milliseconds between the current date and the
time passed
+ * as parameter
+ * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#getTimeDelta(long)} since 1.3M2
+ */
+ public int XWiki.getTimeDelta(long time)
+ {
+ return this.util.getTimeDelta(time);
+ }
+
+ /**
+ * @param time time in milliseconds since 1970, 00:00:00 GMT
+ * @return Date a date from a time in milliseconds since 01/01/1970 as a
+ * Java [EMAIL PROTECTED] Date} Object
+ * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#getDate(long)} since 1.3M2
+ */
+ public Date XWiki.getDate(long time)
+ {
+ return this.util.getDate(time);
+ }
+
+ /**
+ * Split a text to an array of texts, according to a separator.
+ *
+ * @param text the original text
+ * @param sep the separator characters. The separator is one or more of the
+ * separator characters
+ * @return An array containing the split text
+ * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#split(String, String)} since 1.3M2
+ */
+ public String[] XWiki.split(String text, String sep)
+ {
+ return this.util.split(text, sep);
+ }
+
+ /**
+ * Get a stack trace as a String
+ *
+ * @param e the exception to convert to a String
+ * @return the exception stack trace as a String
+ * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#printStrackTrace(Throwable)}
+ since 1.3M2
+ */
+ public String XWiki.printStrackTrace(Throwable e)
+ {
+ return this.util.printStrackTrace(e);
+ }
+
+ /**
+ * Get a Null object. This is useful in Velocity where there is no real
null object
+ * for comparaisons.
+ *
+ * @return a Null Object
+ * @deprecated replaced by [EMAIL PROTECTED] Util#getNull()} since 1.3M2
+ */
+ public Object XWiki.getNull()
+ {
+ return this.util.getNull();
+ }
+
+ /**
+ * Get a New Line character. This is useful in Velocity where there is no
real new
+ * line character for inclusion in texts.
+ *
+ * @return a new line character
+ * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#getNewline()} since 1.3M2
+ */
+ public String XWiki.getNl()
+ {
+ return this.util.getNewline();
+ }
+
+ /**
+ * @see #getExoService(String)
+ * @deprecated use [EMAIL PROTECTED] #getExoService(String)} instead
+ */
+ public java.lang.Object XWiki.getService(String className) throws
XWikiException
+ {
+ return getExoService(className);
+ }
+
+ /**
+ * @see #getExoPortalService(String)
+ * @deprecated use [EMAIL PROTECTED] #getExoPortalService(String)} instead
+ */
+ public java.lang.Object XWiki.getPortalService(String className) throws
XWikiException
+ {
+ return getExoPortalService(className);
+ }
+
+ /**
+ * Creates an Array List. This is useful from Velocity since you cannot
+ * create Object from Velocity with our secure uberspector.
+ *
+ * @return a [EMAIL PROTECTED] ArrayList} object
+ * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#getArrayList()} since 1.3M2
+ */
+ public List XWiki.getArrayList()
+ {
+ return this.util.getArrayList();
+ }
+
+ /**
+ * Creates a Hash Map. This is useful from Velocity since you cannot
+ * create Object from Velocity with our secure uberspector.
+ *
+ * @return a [EMAIL PROTECTED] HashMap} object
+ * @deprecated replaced by [EMAIL PROTECTED] Util#getHashMap()} since 1.3M2
+ */
+ public Map XWiki.getHashMap()
+ {
+ return this.util.getHashMap();
+ }
+
+ /**
+ * Creates a Tree Map. This is useful from Velocity since you cannot
+ * create Object from Velocity with our secure uberspector.
+ *
+ * @return a [EMAIL PROTECTED] TreeMap} object
+ * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#getTreeMap()} since 1.3M2
+ */
+ public Map XWiki.getTreeMap()
+ {
+ return this.util.getTreeMap();
+ }
+
+ /**
+ * Sort a list using a standard comparator. Elements need to be mutally
comparable and
+ * implement the Comparable interface.
+ *
+ * @param list the list to sort
+ * @return the sorted list (as the same oject reference)
+ * @see [EMAIL PROTECTED] java.util.Collections#sort(java.util.List)}
+ * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#sort(java.util.List)} since 1.3M2
+ */
+ public List XWiki.sort(List list)
+ {
+ return this.util.sort(list);
+ }
+
+ /**
+ * Convert an Object to a number and return null if the object is not a
Number.
+ *
+ * @param object the object to convert
+ * @return the object as a [EMAIL PROTECTED] Number}
+ * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#toNumber(Object)} since 1.3M2
+ */
+ public Number XWiki.toNumber(Object object)
+ {
+ return this.util.toNumber(object);
+ }
+
+ /**
+ * Generate a random string.
+ *
+ * @param size the desired size of the string
+ * @return the randomly generated string
+ * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#generateRandomString(int)}
+ since 1.3M2
+ */
+ public String XWiki.generateRandomString(int size)
+ {
+ return this.util.generateRandomString(size);
+ }
+
+ /**
+ * Output a BufferedImage object into the response outputstream.
+ * Once this method has been called, not further action is possible.
+ * Users should set $context.setFinished(true) to
+ * avoid template output The image is outpout as image/jpeg.
+ *
+ * @param image the BufferedImage to output
+ * @throws java.io.IOException if the output fails
+ * @deprecated replaced by
+ * [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#outputImage(java.awt.image.BufferedImage)}
+ * since 1.3M2
+ */
+ public void XWiki.outputImage(BufferedImage image) throws IOException
+ {
+ this.util.outputImage(image);
+ }
+
+ /**
+ * Returns the recently visited pages for a specific action
+ *
+ * @param action ("view" or "edit")
+ * @param size how many recent actions to retrieve
+ * @return a ArrayList of document names
+ * @deprecated use [EMAIL PROTECTED] #getStatsService()} instead
+ */
+ public java.util.Collection XWiki.getRecentActions(String action, int size)
+ {
+ XWikiStatsService stats =
getXWikiContext().getWiki().getStatsService(getXWikiContext());
+ if (stats == null)
+ return Collections.EMPTY_LIST;
+ return stats.getRecentActions(action, size, getXWikiContext());
+ }
+
+ /**
+ * @param str the String to convert to an integer
+ * @return the parsed integer or zero in case of exception
+ * @deprecated replaced by [EMAIL PROTECTED] Util#parseInt(String)} since
1.3M2
+ */
+ public int XWiki.parseInt(String str)
+ {
+ return this.util.parseInt(str);
+ }
+
+ /**
+ * @param str the String to convert to an Integer Object
+ * @return the parsed integer or zero in case of exception
+ * @deprecated replaced by [EMAIL PROTECTED] Util#parseInteger(String)}
since 1.3M2
+ */
+ public Integer XWiki.parseInteger(String str)
+ {
+ return this.util.parseInteger(str);
+ }
+
+ /**
+ * @param str the String to convert to a long
+ * @return the parsed long or zero in case of exception
+ * @deprecated replaced by [EMAIL PROTECTED] Util#parseLong(String)} since
1.3M2
+ */
+ public long XWiki.parseLong(String str)
+ {
+ return this.util.parseLong(str);
+ }
+
+ /**
+ * @param str the String to convert to a float
+ * @return the parsed float or zero in case of exception
+ * @deprecated replaced by [EMAIL PROTECTED] Util#parseFloat(String)}
since 1.3M2
+ */
+ public float XWiki.parseFloat(String str)
+ {
+ return this.util.parseFloat(str);
+ }
+
+ /**
+ * @param str the String to convert to a double
+ * @return the parsed double or zero in case of exception
+ * @deprecated replaced by [EMAIL PROTECTED] Util#parseDouble(String)}
since 1.3M2
+ */
+ public double XWiki.parseDouble(String str)
+ {
+ return this.util.parseDouble(str);
+ }
+
+ /**
+ * Escape text so that it can be used in a like clause or in a test for
equality clause.
+ * For example it escapes single quote characters.
+ *
+ * @param text the text to escape
+ * @return filtered text
+ * @deprecated replaced by [EMAIL PROTECTED] Util#escapeSQL(String)} since
1.3M2
+ */
+ public String XWiki.sqlfilter(String text)
+ {
+ return this.util.escapeSQL(text);
+ }
+
+ /**
+ * Cleans up the passed text by removing all accents and special
characters to make it
+ * a valid page name.
+ *
+ * @param name the page name to normalize
+ * @return the valid page name
+ * @deprecated replaced by [EMAIL PROTECTED] Util#clearName(String)} since
1.3M2
+ */
+ public String XWiki.clearName(String name)
+ {
+ return this.util.clearName(name);
+ }
+
+ /**
+ * Replace all accents by their alpha equivalent.
+ *
+ * @param text the text to parse
+ * @return a string with accents replaced with their alpha equivalent
+ * @deprecated replaced by [EMAIL PROTECTED] Util#clearAccents(String)}
since 1.3M2
+ */
+ public String XWiki.clearAccents(String text)
+ {
+ return this.util.clearAccents(text);
+ }
+
+ /**
+ * Add a and b because Velocity operations are not always working.
+ *
+ * @param a an integer to add
+ * @param b an integer to add
+ * @return the sum of a and b
+ * @deprecated replaced by [EMAIL PROTECTED] Util#add(int, int)} since
1.3M2
+ */
+ public int XWiki.add(int a, int b)
+ {
+ return this.util.add(a, b);
+ }
+
+ /**
+ * Add a and b because Velocity operations are not working with longs.
+ *
+ * @param a a long to add
+ * @param b a long to add
+ * @return the sum of a and b
+ * @deprecated replaced by [EMAIL PROTECTED] Util#add(long, long)} since
1.3M2
+ */
+ public long XWiki.add(long a, long b)
+ {
+ return this.util.add(a, b);
+ }
+
+ /**
+ * Add a and b where a and b are non decimal numbers specified as Strings.
+ *
+ * @param a a string representing a non decimal number
+ * @param b a string representing a non decimal number
+ * @return the sum of a and b as a String
+ * @deprecated replaced by [EMAIL PROTECTED] Util#add(String, String)}
since 1.3M2
+ */
+ public String XWiki.add(String a, String b)
+ {
+ return this.util.add(a, b);
+ }
+}
\ No newline at end of file
Copied: xwiki-platform/core/trunk/xwiki-core/src/main/aspect/debug/com (from
rev 7286, xwiki-platform/core/trunk/xwiki-core/src/main/aspect/com)
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/debug/com/xpn/xwiki/aspect/log/LogAspect.aj
===================================================================
---
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/com/xpn/xwiki/aspect/log/LogAspect.aj
2008-02-04 00:23:20 UTC (rev 7286)
+++
xwiki-platform/core/trunk/xwiki-core/src/main/aspect/debug/com/xpn/xwiki/aspect/log/LogAspect.aj
2008-02-04 13:38:10 UTC (rev 7287)
@@ -1,6 +1,6 @@
/*
- * Copyright 2007, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
@@ -16,6 +16,7 @@
* License along with this software; if not, write to the Free
* 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.aspect.log;
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/XWiki.java
===================================================================
---
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/XWiki.java
2008-02-04 00:23:20 UTC (rev 7286)
+++
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/XWiki.java
2008-02-04 13:38:10 UTC (rev 7287)
@@ -28,14 +28,12 @@
import com.xpn.xwiki.doc.XWikiDeletedDocument;
import com.xpn.xwiki.doc.XWikiDocument;
import com.xpn.xwiki.objects.meta.MetaClass;
-import com.xpn.xwiki.stats.api.XWikiStatsService;
import com.xpn.xwiki.stats.impl.DocumentStats;
import com.xpn.xwiki.web.XWikiEngineContext;
import org.suigeneris.jrcs.diff.delta.Chunk;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.awt.image.BufferedImage;
import java.io.IOException;
import java.lang.Object;
import java.util.*;
@@ -44,13 +42,6 @@
{
protected static final Log LOG = LogFactory.getLog(XWiki.class);
- /**
- * Utility methods have been moved in version 1.3 Milestone 2 to the
[EMAIL PROTECTED] Util} class.
- * However to preserve backward compatibility we have deprecated them in
this class and
- * not removed them yet. All calls are funnelled through this class
variable.
- */
- private Util util;
-
private com.xpn.xwiki.XWiki xwiki;
/**
@@ -69,7 +60,6 @@
super(context);
this.xwiki = xwiki;
this.statsService = new StatsService(context);
- this.util = new Util(xwiki, context);
}
/**
@@ -271,28 +261,6 @@
}
/**
- * API to protect Text from Wiki transformation
- * @param text
- * @return escaped text
- * @deprecated replaced by Util#escapeText
- */
- public String escapeText(String text)
- {
- return this.util.escapeText(text);
- }
-
- /**
- * API to protect URLs from Wiki transformation
- * @param url
- * @return encoded URL
- * @deprecated replaced by Util#escapeURL
- */
- public String escapeURL(String url)
- {
- return this.util.escapeURL(url);
- }
-
- /**
* Output content in the edit content textarea
*
* @param content content to output
@@ -962,14 +930,6 @@
}
/**
- * @deprecated use [EMAIL PROTECTED] #getLanguagePreference()} instead
- */
- public String getDocLanguagePreference()
- {
- return xwiki.getDocLanguagePreference(getXWikiContext());
- }
-
- /**
* API to access the interface language preference for the request Order
of evaluation is:
* Language of the wiki in mono-lingual mode language request paramater
language in context
* language user preference language in cookie language accepted by the
navigator
@@ -1216,42 +1176,6 @@
}
/**
- * Privileged API to send a message to an email address
- *
- * @param sender email of the sender of the message
- * @param recipient email of the recipient of the message
- * @param message Message to send
- * @throws XWikiException if the mail was not send successfully
- * @deprecated replaced by the
- * <a
href="http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin">Mail Sender
- * Plugin</a>
- */
- public void sendMessage(String sender, String recipient, String message)
- throws XWikiException
- {
- if (hasProgrammingRights())
- xwiki.sendMessage(sender, recipient, message, getXWikiContext());
- }
-
- /**
- * Privileged API to send a message to an email address
- *
- * @param sender email of the sender of the message
- * @param recipient emails of the recipients of the message
- * @param message Message to send
- * @throws XWikiException if the mail was not send successfully
- * @deprecated replaced by the
- * <a
href="http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin">Mail Sender
- * Plugin</a>
- */
- public void sendMessage(String sender, String[] recipient, String message)
- throws XWikiException
- {
- if (hasProgrammingRights())
- xwiki.sendMessage(sender, recipient, message, getXWikiContext());
- }
-
- /**
* Privileged API to copy a document to another document in the same wiki
*
* @param docname source document
@@ -1529,72 +1453,6 @@
}
/**
- * @return the current date
- * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#getDate()}
- */
- public Date getCurrentDate()
- {
- return this.util.getDate();
- }
-
- /**
- * @return the current date
- * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#getDate()}
- */
- public Date getDate()
- {
- return this.util.getDate();
- }
-
- /**
- * @param time the time in milliseconds
- * @return the time delta in milliseconds between the current date and the
time passed
- * as parameter
- * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#getTimeDelta(long)}
- */
- public int getTimeDelta(long time)
- {
- return this.util.getTimeDelta(time);
- }
-
- /**
- * @param time time in milliseconds since 1970, 00:00:00 GMT
- * @return Date a date from a time in milliseconds since 01/01/1970 as a
- * Java [EMAIL PROTECTED] Date} Object
- * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#getDate(long)}
- */
- public Date getDate(long time)
- {
- return this.util.getDate(time);
- }
-
- /**
- * Split a text to an array of texts, according to a separator.
- *
- * @param text the original text
- * @param sep the separator characters. The separator is one or more of the
- * separator characters
- * @return An array containing the split text
- * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#split(String, String)}
- */
- public String[] split(String text, String sep)
- {
- return this.util.split(text, sep);
- }
-
- /**
- * Get a stack trace as a String
- *
- * @param e the exception to convert to a String
- * @return the exception stack trace as a String
- * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#printStrackTrace(Throwable)}
- */
- public String printStrackTrace(Throwable e)
- {
- return this.util.printStrackTrace(e);
- }
-
- /**
* API to retrieve the current encoding of the wiki engine The encoding is
stored in xwiki.cfg
* Default encoding is ISO-8891-1
*
@@ -1606,30 +1464,6 @@
}
/**
- * Get a Null object. This is useful in Velocity where there is no real
null object
- * for comparaisons.
- *
- * @return a Null Object
- * @deprecated replaced by [EMAIL PROTECTED] Util#getNull()}
- */
- public Object getNull()
- {
- return this.util.getNull();
- }
-
- /**
- * Get a New Line character. This is useful in Velocity where there is no
real new
- * line character for inclusion in texts.
- *
- * @return a new line character
- * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#getNewline()}
- */
- public String getNl()
- {
- return this.util.getNewline();
- }
-
- /**
* API to retrieve the URL of an attached file in a Wiki Document The URL
is generated
* differently depending on the environement (Servlet, Portlet, PDF,
etc..) The URL generation
* can be modified by implementing a new XWikiURLFactory object For
compatibility with any
@@ -1703,15 +1537,6 @@
}
/**
- * @see #getExoService(String)
- * @deprecated use [EMAIL PROTECTED] #getExoService(String)} instead
- */
- public java.lang.Object getService(String className) throws XWikiException
- {
- return getExoService(className);
- }
-
- /**
* Privileged API to access an eXo Platform service from the Wiki Engine
*
* @param className eXo classname to retrieve the service from
@@ -1732,15 +1557,6 @@
}
/**
- * @see #getExoPortalService(String)
- * @deprecated use [EMAIL PROTECTED] #getExoPortalService(String)} instead
- */
- public java.lang.Object getPortalService(String className) throws
XWikiException
- {
- return getExoPortalService(className);
- }
-
- /**
* Privileged API to access an eXo Platform Portal service from the Wiki
Engine
*
* @param className eXo classname to retrieve the service from
@@ -1761,95 +1577,6 @@
}
/**
- * Creates an Array List. This is useful from Velocity since you cannot
- * create Object from Velocity with our secure uberspector.
- *
- * @return a [EMAIL PROTECTED] ArrayList} object
- * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#getArrayList()}
- */
- public List getArrayList()
- {
- return this.util.getArrayList();
- }
-
- /**
- * Creates a Hash Map. This is useful from Velocity since you cannot
- * create Object from Velocity with our secure uberspector.
- *
- * @return a [EMAIL PROTECTED] HashMap} object
- * @deprecated replaced by [EMAIL PROTECTED] Util#getHashMap()} ()}
- */
- public Map getHashMap()
- {
- return this.util.getHashMap();
- }
-
- /**
- * Creates a Tree Map. This is useful from Velocity since you cannot
- * create Object from Velocity with our secure uberspector.
- *
- * @return a [EMAIL PROTECTED] TreeMap} object
- * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#getTreeMap()} ()}
- */
- public Map getTreeMap()
- {
- return this.util.getTreeMap();
- }
-
- /**
- * Sort a list using a standard comparator. Elements need to be mutally
comparable and
- * implement the Comparable interface.
- *
- * @param list the list to sort
- * @return the sorted list (as the same oject reference)
- * @see [EMAIL PROTECTED] java.util.Collections#sort(java.util.List)}
- * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#sort(java.util.List)}
- */
- public List sort(List list)
- {
- return this.util.sort(list);
- }
-
- /**
- * Convert an Object to a number and return null if the object is not a
Number.
- *
- * @param object the object to convert
- * @return the object as a [EMAIL PROTECTED] Number}
- * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#toNumber(Object)}
- */
- public Number toNumber(Object object)
- {
- return this.util.toNumber(object);
- }
-
- /**
- * Generate a random string.
- *
- * @param size the desired size of the string
- * @return the randomly generated string
- * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#generateRandomString(int)}
- */
- public String generateRandomString(int size)
- {
- return this.util.generateRandomString(size);
- }
-
- /**
- * Output a BufferedImage object into the response outputstream.
- * Once this method has been called, not further action is possible.
- * Users should set $context.setFinished(true) to
- * avoid template output The image is outpout as image/jpeg.
- *
- * @param image the BufferedImage to output
- * @throws java.io.IOException if the output fails
- * @deprecated replaced by [EMAIL PROTECTED]
com.xpn.xwiki.api.Util#outputImage(java.awt.image.BufferedImage)}
- */
- public void outputImage(BufferedImage image) throws IOException
- {
- this.util.outputImage(image);
- }
-
- /**
* API to access the current starts for the Wiki for a specific action It
retrieves the number
* of times the action was performed for the whole wiki The statistics
module need to be
* activated (xwiki.stats=1 in xwiki.cfg)
@@ -2131,22 +1858,6 @@
}
/**
- * Returns the recently visited pages for a specific action
- *
- * @param action ("view" or "edit")
- * @param size how many recent actions to retrieve
- * @return a ArrayList of document names
- * @deprecated use [EMAIL PROTECTED] #getStatsService()} instead
- */
- public java.util.Collection getRecentActions(String action, int size)
- {
- XWikiStatsService stats =
getXWikiContext().getWiki().getStatsService(getXWikiContext());
- if (stats == null)
- return Collections.EMPTY_LIST;
- return stats.getRecentActions(action, size, getXWikiContext());
- }
-
- /**
* Returns the Advertisement system from the preferences
*
* @return "google" or "none"
@@ -2167,56 +1878,6 @@
}
/**
- * @param str the String to convert to an integer
- * @return the parsed integer or zero in case of exception
- * @deprecated replaced by [EMAIL PROTECTED] Util#parseInt(String)}
- */
- public int parseInt(String str)
- {
- return this.util.parseInt(str);
- }
-
- /**
- * @param str the String to convert to an Integer Object
- * @return the parsed integer or zero in case of exception
- * @deprecated replaced by [EMAIL PROTECTED] Util#parseInteger(String)}
- */
- public Integer parseInteger(String str)
- {
- return this.util.parseInteger(str);
- }
-
- /**
- * @param str the String to convert to a long
- * @return the parsed long or zero in case of exception
- * @deprecated replaced by [EMAIL PROTECTED] Util#parseLong(String)}
- */
- public long parseLong(String str)
- {
- return this.util.parseLong(str);
- }
-
- /**
- * @param str the String to convert to a float
- * @return the parsed float or zero in case of exception
- * @deprecated replaced by [EMAIL PROTECTED] Util#parseFloat(String)}
- */
- public float parseFloat(String str)
- {
- return this.util.parseFloat(str);
- }
-
- /**
- * @param str the String to convert to a double
- * @return the parsed double or zero in case of exception
- * @deprecated replaced by [EMAIL PROTECTED] Util#parseDouble(String)}
- */
- public double parseDouble(String str)
- {
- return this.util.parseDouble(str);
- }
-
- /**
* Returns the content of an HTTP/HTTPS URL protected using Basic
Authentication
*
* @param surl url to retrieve
@@ -2325,19 +1986,6 @@
}
/**
- * Escape text so that it can be used in a like clause or in a test for
equality clause.
- * For example it escapes single quote characters.
- *
- * @param text the text to escape
- * @return filtered text
- * @deprecated replaced by [EMAIL PROTECTED] Util#escapeSQL(String)}
- */
- public String sqlfilter(String text)
- {
- return this.util.escapeSQL(text);
- }
-
- /**
* Returns the list of Macros documents in the specified content
*
* @param defaultweb Default Web to use for relative path names
@@ -2797,19 +2445,6 @@
}
/**
- * Cleans up the passed text by removing all accents and special
characters to make it
- * a valid page name.
- *
- * @param name the page name to normalize
- * @return the valid page name
- * @deprecated replaced by [EMAIL PROTECTED] Util#clearName(String)}
- */
- public String clearName(String name)
- {
- return this.util.clearName(name);
- }
-
- /**
* Inserts a tooltip using toolTip.js
*
* @param html HTML viewed
@@ -2853,18 +2488,6 @@
}
/**
- * Replace all accents by their alpha equivalent.
- *
- * @param text the text to parse
- * @return a string with accents replaced with their alpha equivalent
- * @deprecated replaced by [EMAIL PROTECTED] Util#clearAccents(String)}
- */
- public String clearAccents(String text)
- {
- return this.util.clearAccents(text);
- }
-
- /**
* Get the XWiki Class object defined in the passed Document name.
*
* <p>Note: This method doesn't require any rights for accessing the
passed Document (as
@@ -2931,45 +2554,6 @@
}
/**
- * Add a and b because Velocity operations are not always working.
- *
- * @param a an integer to add
- * @param b an integer to add
- * @return the sum of a and b
- * @deprecated replaced by [EMAIL PROTECTED] Util#add(int, int)}
- */
- public int add(int a, int b)
- {
- return this.util.add(a, b);
- }
-
- /**
- * Add a and b because Velocity operations are not working with longs.
- *
- * @param a a long to add
- * @param b a long to add
- * @return the sum of a and b
- * @deprecated replaced by [EMAIL PROTECTED] Util#add(long, long)}
- */
- public long add(long a, long b)
- {
- return this.util.add(a, b);
- }
-
- /**
- * Add a and b where a and b are non decimal numbers specified as Strings.
- *
- * @param a a string representing a non decimal number
- * @param b a string representing a non decimal number
- * @return the sum of a and b as a String
- * @deprecated replaced by [EMAIL PROTECTED] Util#add(String, String)}
- */
- public String add(String a, String b)
- {
- return this.util.add(a, b);
- }
-
- /**
* Access statistics api
*
* @return a StatsService instance that can be used to retrieve different
xwiki statistics
Modified: xwiki-platform/pom/trunk/pom.xml
===================================================================
--- xwiki-platform/pom/trunk/pom.xml 2008-02-04 00:23:20 UTC (rev 7286)
+++ xwiki-platform/pom/trunk/pom.xml 2008-02-04 13:38:10 UTC (rev 7287)
@@ -220,6 +220,12 @@
<!-- Lock down plugin version for build reproducibility -->
<version>2.3</version>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>aspectj-maven-plugin</artifactId>
+ <!-- Lock down plugin version for build reproducibility -->
+ <version>1.0-beta-2</version>
+ </plugin>
</plugins>
</pluginManagement>
</build>
_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications