org.ceryle.wiki.plugin.randompages
Class RandomPagesPlugin

java.lang.Object
  extended by org.ceryle.wiki.plugin.randompages.RandomPagesPlugin
All Implemented Interfaces:
WikiPlugin
Direct Known Subclasses:
RandomPages

public class RandomPagesPlugin
extends Object
implements WikiPlugin

Plugin for providing a randomly-updated, randomly-sized list of randomly-selected wiki pages. This notably does not update the list each time it is called but maintains a WikiEngine-specific Timer thread that manages the list. The idea being that for a random amount of time everyone on the wiki sees the same set of pages.

Parameters:

maxpages='n'
Returns a list of between 5 and n pages. If unspecified or less than 5, a maximum count of 20 is used (i.e., between 5 and 20 pages).
refresh='n'
The maximum period between refreshes, in hours. See RandomPagesScheduler.setLimits(WikiEngine,int,int,int).
output='format'
Determines the format of the output. The default is a list. The description of this parameter can be found in the PluginTextUtils.formatOutput(WikiEngine,Collection,int,boolean) method, with the recognized values: "none", "count", "list", "bullet", "number", "space", "comma", or "colon".

If the collection ID is '*' the plugin will instead return an index of the available collections.

Notes

The basic idea for the RandomPagesPlugin comes from the RandomPages page on MeatballWiki:

After mulling the idea over, I've hacked together a couple scripts to generate a listing of random pages on Wiki:RandomPages -- SunirShah

Some things I've learnt about running a RandomPages script:

-- SunirShah

[30 October 2000] I've stopped the script. I have to fix it.

Author:
Murray Altheim
See Also:
RandomPagesScheduler

Field Summary
static String PARAM_EXCLUDE
           
static String PARAM_MAXPAGES
           
static String PARAM_OUTPUT
           
static String PARAM_REFRESH
           
 
Fields inherited from interface com.ecyrd.jspwiki.plugin.WikiPlugin
CORE_PLUGINS_RESOURCEBUNDLE
 
Constructor Summary
RandomPagesPlugin()
           
 
Method Summary
 String execute(WikiContext context, Map params)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_REFRESH

public static final String PARAM_REFRESH
See Also:
Constant Field Values

PARAM_MAXPAGES

public static final String PARAM_MAXPAGES
See Also:
Constant Field Values

PARAM_OUTPUT

public static final String PARAM_OUTPUT
See Also:
Constant Field Values

PARAM_EXCLUDE

public static final String PARAM_EXCLUDE
See Also:
Constant Field Values
Constructor Detail

RandomPagesPlugin

public RandomPagesPlugin()
Method Detail

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.