com.ecyrd.jspwiki.plugin
Class AbstractReferralPlugin

java.lang.Object
  extended by com.ecyrd.jspwiki.plugin.AbstractReferralPlugin
All Implemented Interfaces:
WikiPlugin
Direct Known Subclasses:
IndexPlugin, PageViewPlugin, RecentChangesPlugin, ReferringPagesPlugin, UndefinedPagesPlugin, UnusedPagesPlugin

public abstract class AbstractReferralPlugin
extends Object
implements WikiPlugin

This is a base class for all plugins using referral things.

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


Field Summary
static int ALL_ITEMS
          Magic value for rendering all items.
protected  String m_after
           
protected  String m_before
           
protected  SimpleDateFormat m_dateFormat
           
protected  Date m_dateLastModified
           
protected  WikiEngine 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  String m_separator
           
protected  String m_show
           
protected  PageSorter m_sorter
           
static String PARAM_AFTER
          Parameter name for the output after the link.
static String PARAM_BEFORE
          Parameter name for the output before the link.
static String PARAM_EXCLUDE
          Parameter name for setting the list of excluded patterns.
static String PARAM_INCLUDE
          Parameter name for setting the list of included patterns.
static String PARAM_LASTMODIFIED
          Parameter name for showing the last modification count.
static String PARAM_MAXWIDTH
          Parameter name for setting the maximum width.
static String PARAM_SEPARATOR
          Parameter name for the separator string.
static String PARAM_SHOW
          Parameter name for the show parameter.
static String PARAM_SHOW_VALUE_COUNT
          Parameter name for setting show to "count".
static String PARAM_SHOW_VALUE_PAGES
          Parameter name for setting show to "pages".
protected static String PARAM_SORTORDER
          Parameter name for specifying the sort order.
protected static String PARAM_SORTORDER_HUMAN
           
protected static String PARAM_SORTORDER_JAVA
           
protected static String PARAM_SORTORDER_LOCALE
           
 
Fields inherited from interface com.ecyrd.jspwiki.plugin.WikiPlugin
CORE_PLUGINS_RESOURCEBUNDLE
 
Constructor Summary
AbstractReferralPlugin()
           
 
Method Summary
protected  Collection filterAndSortCollection(Collection c)
          Filters and sorts a collection according to the include and exclude parameters.
protected  Collection filterCollection(Collection c)
          Filters a collection according to the include and exclude parameters.
 void initialize(WikiContext context, Map params)
           
protected  String makeHTML(WikiContext context, String wikitext)
          Makes HTML with common parameters.
protected  String wikitizeCollection(Collection links, 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 com.ecyrd.jspwiki.plugin.WikiPlugin
execute
 

Field Detail

ALL_ITEMS

public static final int ALL_ITEMS
Magic value for rendering all items.

See Also:
Constant Field Values

PARAM_MAXWIDTH

public static final String PARAM_MAXWIDTH
Parameter name for setting the maximum width. Value is "maxwidth".

See Also:
Constant Field Values

PARAM_SEPARATOR

public static final String PARAM_SEPARATOR
Parameter name for the separator string. Value is "separator".

See Also:
Constant Field Values

PARAM_AFTER

public static final String PARAM_AFTER
Parameter name for the output after the link. Value is "after".

See Also:
Constant Field Values

PARAM_BEFORE

public static final String PARAM_BEFORE
Parameter name for the output before the link. Value is "before".

See Also:
Constant Field Values

PARAM_EXCLUDE

public static final String PARAM_EXCLUDE
Parameter name for setting the list of excluded patterns. Value is "exclude".

See Also:
Constant Field Values

PARAM_INCLUDE

public static final String PARAM_INCLUDE
Parameter name for setting the list of included patterns. Value is "include".

See Also:
Constant Field Values

PARAM_SHOW

public static final String PARAM_SHOW
Parameter name for the show parameter. Value is "show".

See Also:
Constant Field Values

PARAM_SHOW_VALUE_PAGES

public static final String PARAM_SHOW_VALUE_PAGES
Parameter name for setting show to "pages". Value is "pages".

See Also:
Constant Field Values

PARAM_SHOW_VALUE_COUNT

public static final String PARAM_SHOW_VALUE_COUNT
Parameter name for setting show to "count". Value is "count".

See Also:
Constant Field Values

PARAM_LASTMODIFIED

public static final String PARAM_LASTMODIFIED
Parameter name for showing the last modification count. Value is "showLastModified".

See Also:
Constant Field Values

PARAM_SORTORDER

protected static final String PARAM_SORTORDER
Parameter name for specifying the sort order. Value is "sortOrder".

See Also:
Constant Field Values

PARAM_SORTORDER_HUMAN

protected static final String PARAM_SORTORDER_HUMAN
See Also:
Constant Field Values

PARAM_SORTORDER_JAVA

protected static final String PARAM_SORTORDER_JAVA
See Also:
Constant Field Values

PARAM_SORTORDER_LOCALE

protected static final String PARAM_SORTORDER_LOCALE
See Also:
Constant Field Values

m_maxwidth

protected int m_maxwidth

m_before

protected String m_before

m_separator

protected String m_separator

m_after

protected String m_after

m_exclude

protected org.apache.oro.text.regex.Pattern[] m_exclude

m_include

protected org.apache.oro.text.regex.Pattern[] m_include

m_sorter

protected PageSorter m_sorter

m_show

protected String m_show

m_lastModified

protected boolean m_lastModified

m_dateLastModified

protected Date m_dateLastModified

m_dateFormat

protected SimpleDateFormat m_dateFormat

m_engine

protected WikiEngine m_engine
Constructor Detail

AbstractReferralPlugin

public AbstractReferralPlugin()
Method Detail

initialize

public void initialize(WikiContext context,
                       Map 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 Collection filterCollection(Collection c)
Filters a collection according to the include and exclude parameters.

Parameters:
c - The collection to filter.
Returns:
A filtered collection.

filterAndSortCollection

protected Collection filterAndSortCollection(Collection 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 String wikitizeCollection(Collection links,
                                    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 String makeHTML(WikiContext context,
                          String wikitext)
Makes HTML with common parameters.

Parameters:
context - The WikiContext
wikitext - The wikitext to render
Returns:
HTML
Since:
1.6.4