Package org.apache.wiki.plugin

# Class AbstractReferralPlugin

java.lang.Object
org.apache.wiki.plugin.AbstractReferralPlugin

All Implemented Interfaces:
  `org.apache.wiki.api.plugin.Plugin`

Direct Known Subclasses:
  `IndexPlugin`, `PageViewPlugin`, `RecentChangesPlugin`, `ReferringPagesPlugin`, `ReferringUndefinedPagesPlugin`, `UndefinedPagesPlugin`, `UnusedPagesPlugin`

public abstract class AbstractReferralPlugin extends Object implements org.apache.wiki.api.plugin.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)

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`ALL_ITEMS`
Magic value for rendering all items.
`protected int`
`items`
`protected String`
`m_after`
`protected String`
`m_before`
`protected SimpleDateFormat`
`m_dateFormat`
`protected Date`
`m_dateLastModified`
`protected org.apache.wiki.api.core.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 String`
`m_separator`
`protected String`
`m_show`
`protected PageSorter`
`m_sorter`
`static final String`
`PARAM_AFTER`
Parameter name for the output after the link.
`static final String`
`PARAM_BEFORE`
Parameter name for the output before the link.
`static final String`
`PARAM_COLUMNS`
Parameter name for setting the number of columns that will be displayed by the plugin.
`static final String`
`PARAM_EXCLUDE`
Parameter name for setting the list of excluded patterns.
`static final String`
`PARAM_INCLUDE`
Parameter name for setting the list of included patterns.
`static final String`
`PARAM_LASTMODIFIED`
Parameter name for showing the last modification count.
`static final String`
`PARAM_MAXWIDTH`
Parameter name for setting the maximum width.
`static final String`
`PARAM_SEPARATOR`
Parameter name for the separator string.
`static final String`
`PARAM_SHOW`
Parameter name for the show parameter.
`static final String`
`PARAM_SHOW_VALUE_COUNT`
Parameter name for setting show to "count".
`static final String`
`PARAM_SHOW_VALUE_PAGES`
Parameter name for setting show to "pages".
`protected static final String`
`PARAM_SORTORDER`
Parameter name for specifying the sort order.
`protected static final String`
`PARAM_SORTORDER_HUMAN`
`protected static final String`
`PARAM_SORTORDER_JAVA`
`protected static final 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 String`
`applyColumnsStyle(String result)`
`protected List<String>`
`filterAndSortCollection(Collection<String> c)`
Filters and sorts a collection according to the include and exclude parameters.
`protected List<String>`
`filterCollection(Collection<String> c)`
Filters a collection according to the include and exclude parameters.
`protected List<org.apache.wiki.api.core.Page>`
`filterWikiPageCollection(Collection<org.apache.wiki.api.core.Page> pages)`
`void`
`initialize(org.apache.wiki.api.core.Context context, Map<String,String> params)`
`protected String`
`makeHTML(org.apache.wiki.api.core.Context context, String wikitext)`
Makes HTML with common parameters.
`protected String`
`wikitizeCollection(Collection<String> 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 org.apache.wiki.api.plugin.Plugin

`execute, getDisplayName, getSnipExample`

## Field Details

### 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_COLUMNS

public static final String PARAM_COLUMNS
Parameter name for setting the number of columns that will be displayed by the plugin. Value is `"columns"`. Available since 2.11.0.

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

### items

protected int items

### 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 org.apache.wiki.api.core.Engine m_engine

## Constructor Details

### AbstractReferralPlugin

public AbstractReferralPlugin()

## Method Details

### initialize

public void initialize(org.apache.wiki.api.core.Context context, Map<String,String> params) throws org.apache.wiki.api.exceptions.PluginException

Parameters:
  `context` - the wiki context
  `params` - parameters for initializing the plugin
Throws:
  `org.apache.wiki.api.exceptions.PluginException` - if any of the plugin parameters are malformed

### filterWikiPageCollection

protected List<org.apache.wiki.api.core.Page> filterWikiPageCollection(Collection<org.apache.wiki.api.core.Page> pages)

### filterCollection

protected List<String> filterCollection(Collection<String> c)
Filters a collection according to the include and exclude parameters.

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

### filterAndSortCollection

protected List<String> filterAndSortCollection(Collection<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 String wikitizeCollection(Collection<String> 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(org.apache.wiki.api.core.Context context, String wikitext)
Makes HTML with common parameters.

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

### applyColumnsStyle

protected String applyColumnsStyle(String result)