org.ceryle.wiki.plugin.mostpopular
Class MostPopularPlugin
java.lang.Object
org.ceryle.wiki.plugin.mostpopular.MostPopularPlugin
- All Implemented Interfaces:
- WikiPlugin
- Direct Known Subclasses:
- MostPopular
public class MostPopularPlugin
- extends Object
- implements WikiPlugin
Almost contrary to its name, the MostPopularPlugin is not the staking
any claim as the most popular plugin, instead it provides a list of
the most popular pages (ranked by hit count) on the wiki.
This plugin relies on the JSPWiki events API.
Most of the plugin's work is done by the
MostPopularListener
class, which listens for and counts
WikiPageEvent.PAGE_DELIVERED events,
and also manages the serialization and deserialization of its page
cache between sessions. The listener is a singleton-per-WikiEngine.
Parameters:
- max='all' or a number (optional)
- Limits the number of ranked pages to the provided number.
If the value is "all" the entire wiki will be listed. No
parameter (the default) will list only the top ten.
- exclude='WikiPage1 WikiPage2'
- Will exclude a whitespace- or comma-delimited list of
pages from the output list.
- showdate='true' | 'false' | 'format'
- If 'true', includes the creation date of the cache (i.e.,
when the count began). If provided as a format string,
the accepted values are (case insensitive): 'short',
'medium', 'long', or 'full'. The default (for 'true') is
the short format (these match the formats described in
java.text.DateFormat).
Alternately, the format can be specified as any of the
int values in DateFormat, but because these aren't meant
to be public values, there's a risk they could change
depending on Java version.
- showcount='true' | 'false'
- If true, includes the hit count for the page.
- debug='true' | 'false'
- If true, outputs more verbose messages.
To Do
- Could use the QueryPlugin to create the page exclusion list.
- Could use the PluginTextUtil to provide options on the output
format (seems a bit like overkill though).
- Since:
- 2.4.15
- Author:
- Murray Altheim
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HIT
public static String HIT
- The singular word "hit".
HITS
public static String HITS
- The plural word "hits".
PARAM_EXCLUDE
public static final String PARAM_EXCLUDE
- See Also:
- Constant Field Values
PARAM_SHOWCOUNT
public static final String PARAM_SHOWCOUNT
- See Also:
- Constant Field Values
PARAM_SHOWDATE
public static final String PARAM_SHOWDATE
- See Also:
- Constant Field Values
PARAM_MAX
public static final String PARAM_MAX
- See Also:
- Constant Field Values
MostPopularPlugin
public MostPopularPlugin()
execute
public String execute(WikiContext context,
Map params)
throws PluginException
- Specified by:
execute in interface WikiPlugin
- Throws:
PluginException
The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.