org.ceryle.wiki.plugin.randompages
Class RandomPagesPlugin
java.lang.Object
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:
- Randomize the number of pages. This gives some days broader scope
than others. Narrower scope allows readers to hit every page.
Broader scope increases the probability that something will be of
interest. 5 to 20 pages is a good range.
- Run the script infrequently. About once a day is good.
- Run the script at random times. Don't run it at noon every day,
but at 10:37am one day, 2:42pm the next.
- Let the RandomPages script float in RecentChanges.
- It is worth noting the kinds of pages that come up in RandomPages.
It will give you a feel for what the real interests are of the
community.
- Don't be discouraged if not many people read it or if not many
discussions flow from it. This is how your mind works. You ignore
most of the random thoughts you have, but occasionally you run with
one. This happens too with RandomPages.
-- SunirShah
[30 October 2000] I've stopped the script. I have to fix it.
- Author:
- Murray Altheim
- See Also:
RandomPagesScheduler
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
RandomPagesPlugin
public RandomPagesPlugin()
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.