|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.wiki.plugin.InterWikiPlugin
public class InterWikiPlugin
Provides access to most of the XML-RPC features within a plugin. This currently also implements a RecentNearChanges feature. Because this potentially works across time zones, all times are processed as and displayed in UTC.
In the works is a plugin for synchronizing the contents of an external wiki with the current wiki via XML-RPC. The synchronization only happens in one direction (from the source wiki, which is not altered, to the wiki containing the page calling for synchronization). This plugin does not need to be installed on the source wiki, but XML-RPC must be enabled on both.Parameters:
Values for the timeformat and dateformat
parameters are specified using the syntax as described in
SimpleDateFormat
This currently produces only a synchronization list.
The following XML-RPC commands (case-insensitive) are supported:
| Nested Class Summary | |
|---|---|
protected class |
InterWikiPlugin.PageRecord
|
| Field Summary | |
|---|---|
static String |
CLASS_XMLRPC
The CSS style class used for the output <div> element. |
static String |
COMMAND_ALLPAGES
A user-entered command string. |
static String |
COMMAND_APPNAME
A user-entered command string. |
static String |
COMMAND_BASEURL
A user-entered command string. |
static String |
COMMAND_LISTLINKS
A user-entered command string. |
static String |
COMMAND_PAGE
A user-entered command string. |
static String |
COMMAND_PAGEHTML
A user-entered command string. |
static String |
COMMAND_PAGEINFO
A user-entered command string. |
static String |
COMMAND_RECENTCHANGES
A user-entered command string. |
static String |
COMMAND_TIMEZONE
A user-entered command string. |
static String |
COMMAND_VIEWURL
A user-entered command string. |
protected String |
default_dateformat
The default date format. |
static int |
DEFAULT_DAYS
How many days we show in recent changes lists by default. |
protected static int |
DEFAULT_MODE
Default mode, in absence of command parameter. |
protected String |
default_timeformat
The default time format. |
static String |
KEY_AUTHOR
A key used in the values returned by the XML-RPC command. |
static String |
KEY_HREF
A key used in the values returned by the XML-RPC command. |
static String |
KEY_LASTMODIFIED
A key used in the values returned by the XML-RPC command. |
static String |
KEY_NAME
A key used in the values returned by the XML-RPC command. |
static String |
KEY_PAGE
A key used in the values returned by the XML-RPC command. |
static String |
KEY_TYPE
A key used in the values returned by the XML-RPC command. |
static String |
KEY_VERSION
A key used in the values returned by the XML-RPC command. |
static boolean |
linkBack
When true, creates a link back to the origin of the transcluded content. |
protected int |
m_cellpadding
The value used for the amount of cell padding in generated tables. |
protected boolean |
m_compact
|
protected boolean |
m_debug
When true, generates debugging (noisy) output. |
protected DateFormat |
m_dfmt
A DateFormat used to format times and dates in generated output. |
protected WikiEngine |
m_engine
|
protected DateFormat |
m_rem_tfmt
A DateFormat used to format times and dates in generated output. |
protected DateFormat |
m_utc_tfmt
A DateFormat used to format times and dates in generated output. |
protected String |
m_xmlrpcURL
|
static int |
MODE_ALLPAGES
A plugin mode. |
static int |
MODE_APPNAME
A plugin mode. |
static int |
MODE_BASEURL
A plugin mode. |
static int |
MODE_LISTLINKS
A plugin mode. |
static int |
MODE_PAGE
A plugin mode. |
static int |
MODE_PAGEHTML
A plugin mode. |
static int |
MODE_PAGEHTMLVERSION
A plugin mode. |
static int |
MODE_PAGEINFO
A plugin mode. |
static int |
MODE_PAGEINFOVERSION
A plugin mode. |
static int |
MODE_PAGEVERSION
A plugin mode. |
static int |
MODE_RECENTCHANGES
A plugin mode. |
static int |
MODE_TIMEZONE
A plugin mode. |
static int |
MODE_UNKNOWN
A plugin mode. |
static int |
MODE_VIEWURL
A plugin mode. |
static String |
pagenameMain
The value used for the Main page. |
static String |
pagenameRecentChanges
The value used for the RecentChanges page. |
static String |
PARAM_COMMAND
A plugin parameter String. |
static String |
PARAM_DATE_FORMAT
A plugin parameter String. |
static String |
PARAM_FORMAT
A plugin parameter String. |
static String |
PARAM_HREF
A plugin parameter String. |
static String |
PARAM_PAGE
A plugin parameter String. |
static String |
PARAM_SINCE
A plugin parameter String. |
static String |
PARAM_TIME_FORMAT
A plugin parameter String. |
static String |
PARAM_VERSION
A plugin parameter String. |
protected boolean |
prohibitDirectCalls
When true, no direct calls to this plugin are permitted. |
static boolean |
reverseSort
When true, dates in recent changes are sorted in reverse order (the default). |
static boolean |
showRemoteTime
When true, times are displayed in the remote time zone, otherwise in UTC. |
static boolean |
wrapWikiText
When true, wraps returned wiki text content in an HTML <pre> element. |
| Fields inherited from interface com.ecyrd.jspwiki.plugin.WikiPlugin |
|---|
CORE_PLUGINS_RESOURCEBUNDLE |
| Constructor Summary | |
|---|---|
InterWikiPlugin()
|
|
| Method Summary | |
|---|---|
protected void |
error(StringBuffer out,
Exception e,
String message)
Process an error by clearing the existing buffer and populating it with an error message. |
String |
execute(WikiContext context,
Map params)
|
protected Calendar |
getRemoteCalendar()
Returns the Calendar of the remote time zone based on the time zone ID returned via XML-RPC. |
protected String |
getRemoteTimeZoneID()
Returns the timezone ID of the remote server as a String. |
protected String |
getViewURL(String pagename)
Returns a remote view URL for the page name. |
protected void |
handleOutput(int mode,
StringBuffer out,
String pagename,
int version,
Object o)
Populates the StringBuffer out provided with the mode, page and version names (required or optional depending on command), and the Object o returned from the XML-RPC client. |
protected void |
handleRecentChanges(StringBuffer out,
Vector in)
|
protected boolean |
isSameDay(Date d1,
Date d2)
|
protected void |
processAllPages(StringBuffer out,
Vector in,
String viewURL)
|
protected InterWikiPlugin.PageRecord |
processHashtable(Hashtable ht)
Processes a Hashtable value, returning a PageRecord. |
protected void |
processListLinks(StringBuffer out,
Vector list)
|
protected void |
processPageInfo(StringBuffer out,
Hashtable ht)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MODE_UNKNOWN
public static final int MODE_TIMEZONE
public static final int MODE_PAGE
public static final int MODE_PAGEHTML
public static final int MODE_PAGEVERSION
public static final int MODE_PAGEHTMLVERSION
public static final int MODE_PAGEINFO
public static final int MODE_PAGEINFOVERSION
public static final int MODE_APPNAME
public static final int MODE_BASEURL
public static final int MODE_VIEWURL
public static final int MODE_ALLPAGES
public static final int MODE_RECENTCHANGES
public static final int MODE_LISTLINKS
public static final String COMMAND_TIMEZONE
public static final String COMMAND_PAGE
public static final String COMMAND_PAGEHTML
public static final String COMMAND_PAGEINFO
public static final String COMMAND_APPNAME
public static final String COMMAND_BASEURL
public static final String COMMAND_VIEWURL
public static final String COMMAND_ALLPAGES
public static final String COMMAND_RECENTCHANGES
public static final String COMMAND_LISTLINKS
public static final String KEY_LASTMODIFIED
public static final String KEY_NAME
public static final String KEY_AUTHOR
public static final String KEY_VERSION
public static final String KEY_PAGE
public static final String KEY_HREF
public static final String KEY_TYPE
public static final String PARAM_COMMAND
public static final String PARAM_HREF
public static final String PARAM_SINCE
public static final String PARAM_PAGE
public static final String PARAM_VERSION
public static final String PARAM_FORMAT
public static final String PARAM_TIME_FORMAT
public static final String PARAM_DATE_FORMAT
public static final String CLASS_XMLRPC
public static String pagenameMain
public static String pagenameRecentChanges
public static boolean wrapWikiText
public static boolean linkBack
public static boolean reverseSort
public static boolean showRemoteTime
protected boolean prohibitDirectCalls
If this plugin is being used on a public wiki it's probably safer to have this set true to keep its features from being abused.
protected static int DEFAULT_MODE
protected DateFormat m_dfmt
protected DateFormat m_utc_tfmt
protected DateFormat m_rem_tfmt
protected boolean m_debug
protected int m_cellpadding
public static final int DEFAULT_DAYS
protected String default_dateformat
protected String default_timeformat
protected WikiEngine m_engine
protected String m_xmlrpcURL
protected boolean m_compact
| Constructor Detail |
|---|
public InterWikiPlugin()
| Method Detail |
|---|
public String execute(WikiContext context,
Map params)
throws PluginException
execute in interface WikiPluginPluginExceptionprotected String getViewURL(String pagename)
protected void handleOutput(int mode,
StringBuffer out,
String pagename,
int version,
Object o)
throws PluginException,
org.apache.xmlrpc.XmlRpcException,
IOException
a - PluginException if the mode is not supported by this plugin.
PluginException
org.apache.xmlrpc.XmlRpcException
IOExceptionprotected String getRemoteTimeZoneID()
protected Calendar getRemoteCalendar()
throws PluginException
PluginException
protected void processPageInfo(StringBuffer out,
Hashtable ht)
throws PluginException
PluginException
protected InterWikiPlugin.PageRecord processHashtable(Hashtable ht)
throws PluginException
PluginException
protected void handleRecentChanges(StringBuffer out,
Vector in)
throws PluginException
PluginException
protected void processAllPages(StringBuffer out,
Vector in,
String viewURL)
throws PluginException,
IOException,
org.apache.xmlrpc.XmlRpcException
PluginException
IOException
org.apache.xmlrpc.XmlRpcException
protected void processListLinks(StringBuffer out,
Vector list)
throws PluginException,
IOException,
org.apache.xmlrpc.XmlRpcException
PluginException
IOException
org.apache.xmlrpc.XmlRpcException
protected boolean isSameDay(Date d1,
Date d2)
protected void error(StringBuffer out,
Exception e,
String message)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||