Class AbstractReferralPlugin

java.lang.Object
org.apache.wiki.plugin.AbstractReferralPlugin
All Implemented Interfaces:
Plugin
Direct Known Subclasses:
IndexPlugin, PageViewPlugin, RecentChangesPlugin, ReferringPagesPlugin, ReferringUndefinedPagesPlugin, UndefinedPagesPlugin, UnusedPagesPlugin

public abstract class AbstractReferralPlugin
extends java.lang.Object
implements Plugin
This is a base class for all plugins using referral things.

Parameters (also valid for all subclasses of this class) :

  • maxwidth - maximum width of generated links
  • separator - separator between generated links (wikitext)
  • after - output after the link
  • before - output before the link
  • exclude - a regular expression of pages to exclude from the list.
  • include - a regular expression of pages to include in the list.
  • show - value is either "pages" (default) or "count". When "count" is specified, shows only the count of pages which match. (since 2.8)
  • showLastModified - When show=count, shows also the last modified date. (since 2.8)
  • sortOrder - specifies the sort order for the resulting list. Options are 'human', 'java', 'locale' or a RuleBasedCollator rule string. (since 2.8.3)
  • Field Summary

    Fields
    Modifier and Type Field Description
    static int ALL_ITEMS
    Magic value for rendering all items.
    protected java.lang.String m_after  
    protected java.lang.String m_before  
    protected java.text.SimpleDateFormat m_dateFormat  
    protected java.util.Date m_dateLastModified  
    protected Engine m_engine  
    protected org.apache.oro.text.regex.Pattern[] m_exclude  
    protected org.apache.oro.text.regex.Pattern[] m_include  
    protected boolean m_lastModified  
    protected int m_maxwidth  
    protected java.lang.String m_separator  
    protected java.lang.String m_show  
    protected PageSorter m_sorter  
    static java.lang.String PARAM_AFTER
    Parameter name for the output after the link.
    static java.lang.String PARAM_BEFORE
    Parameter name for the output before the link.
    static java.lang.String PARAM_EXCLUDE
    Parameter name for setting the list of excluded patterns.
    static java.lang.String PARAM_INCLUDE
    Parameter name for setting the list of included patterns.
    static java.lang.String PARAM_LASTMODIFIED
    Parameter name for showing the last modification count.
    static java.lang.String PARAM_MAXWIDTH
    Parameter name for setting the maximum width.
    static java.lang.String PARAM_SEPARATOR
    Parameter name for the separator string.
    static java.lang.String PARAM_SHOW
    Parameter name for the show parameter.
    static java.lang.String PARAM_SHOW_VALUE_COUNT
    Parameter name for setting show to "count".
    static java.lang.String PARAM_SHOW_VALUE_PAGES
    Parameter name for setting show to "pages".
    protected static java.lang.String PARAM_SORTORDER
    Parameter name for specifying the sort order.
    protected static java.lang.String PARAM_SORTORDER_HUMAN  
    protected static java.lang.String PARAM_SORTORDER_JAVA  
    protected static java.lang.String PARAM_SORTORDER_LOCALE  

    Fields inherited from interface org.apache.wiki.api.plugin.Plugin

    CORE_PLUGINS_RESOURCEBUNDLE
  • Constructor Summary

    Constructors
    Constructor Description
    AbstractReferralPlugin()  
  • Method Summary

    Modifier and Type Method Description
    protected java.util.List<java.lang.String> filterAndSortCollection​(java.util.Collection<java.lang.String> c)
    Filters and sorts a collection according to the include and exclude parameters.
    protected java.util.List<java.lang.String> filterCollection​(java.util.Collection<java.lang.String> c)
    Filters a collection according to the include and exclude parameters.
    protected java.util.List<Page> filterWikiPageCollection​(java.util.Collection<Page> pages)  
    void initialize​(Context context, java.util.Map<java.lang.String,​java.lang.String> params)  
    protected java.lang.String makeHTML​(Context context, java.lang.String wikitext)
    Makes HTML with common parameters.
    protected java.lang.String wikitizeCollection​(java.util.Collection<java.lang.String> links, java.lang.String separator, int numItems)
    Makes WikiText from a Collection.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.wiki.api.plugin.Plugin

    execute
  • Field Details

  • Constructor Details

  • Method Details

    • initialize

      public void initialize​(Context context, java.util.Map<java.lang.String,​java.lang.String> params) throws PluginException
      Parameters:
      context - the wiki context
      params - parameters for initializing the plugin
      Throws:
      PluginException - if any of the plugin parameters are malformed
    • filterWikiPageCollection

      protected java.util.List<Page> filterWikiPageCollection​(java.util.Collection<Page> pages)
    • filterCollection

      protected java.util.List<java.lang.String> filterCollection​(java.util.Collection<java.lang.String> c)
      Filters a collection according to the include and exclude parameters.
      Parameters:
      c - The collection to filter.
      Returns:
      A filtered collection.
    • filterAndSortCollection

      protected java.util.List<java.lang.String> filterAndSortCollection​(java.util.Collection<java.lang.String> c)
      Filters and sorts a collection according to the include and exclude parameters.
      Parameters:
      c - The collection to filter.
      Returns:
      A filtered and sorted collection.
    • wikitizeCollection

      protected java.lang.String wikitizeCollection​(java.util.Collection<java.lang.String> links, java.lang.String separator, int numItems)
      Makes WikiText from a Collection.
      Parameters:
      links - Collection to make into WikiText.
      separator - Separator string to use.
      numItems - How many items to show.
      Returns:
      The WikiText
    • makeHTML

      protected java.lang.String makeHTML​(Context context, java.lang.String wikitext)
      Makes HTML with common parameters.
      Parameters:
      context - The WikiContext
      wikitext - The wikitext to render
      Returns:
      HTML
      Since:
      1.6.4