Almost contrary to its name, the MostPopularPlugin, another NeWikiPlugin, 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).

Test #

[{MostPopular max='5'}]

no pages.