Class 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)
    • columns - How many columns should the output be displayed on.
    • 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)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String applyColumnsStyle​(java.lang.String result)  
      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
    • Method Detail

      • 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
      • 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
      • applyColumnsStyle

        protected java.lang.String applyColumnsStyle​(java.lang.String result)