Package org.apache.wiki.plugin
Class AbstractReferralPlugin
java.lang.Object
org.apache.wiki.plugin.AbstractReferralPlugin
- All Implemented Interfaces:
Plugin
- Direct Known Subclasses:
IndexPlugin
,PageViewPlugin
,RecentChangesPlugin
,ReferringPagesPlugin
,ReferringUndefinedPagesPlugin
,UndefinedPagesPlugin
,UnusedPagesPlugin
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
FieldsModifier and TypeFieldDescriptionstatic final int
Magic value for rendering all items.protected int
protected String
protected String
protected SimpleDateFormat
protected Date
protected Engine
protected org.apache.oro.text.regex.Pattern[]
protected org.apache.oro.text.regex.Pattern[]
protected boolean
protected int
protected String
protected String
protected PageSorter
static final String
Parameter name for the output after the link.static final String
Parameter name for the output before the link.static final String
Parameter name for setting the number of columns that will be displayed by the plugin.static final String
Parameter name for setting the list of excluded patterns.static final String
Parameter name for setting the list of included patterns.static final String
Parameter name for showing the last modification count.static final String
Parameter name for setting the maximum width.static final String
Parameter name for the separator string.static final String
Parameter name for the show parameter.static final String
Parameter name for setting show to "count".static final String
Parameter name for setting show to "pages".protected static final String
Parameter name for specifying the sort order.protected static final String
protected static final String
protected static final String
Fields inherited from interface org.apache.wiki.api.plugin.Plugin
CORE_PLUGINS_RESOURCEBUNDLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
applyColumnsStyle
(String result) Filters and sorts a collection according to the include and exclude parameters.Filters a collection according to the include and exclude parameters.filterWikiPageCollection
(Collection<Page> pages) void
initialize
(Context context, Map<String, String> params) protected String
Makes HTML with common parameters.protected String
wikitizeCollection
(Collection<String> links, String separator, int numItems) Makes WikiText from a Collection.
-
Field Details
-
ALL_ITEMS
Magic value for rendering all items.- See Also:
-
PARAM_MAXWIDTH
Parameter name for setting the maximum width. Value is "maxwidth".- See Also:
-
PARAM_SEPARATOR
Parameter name for the separator string. Value is "separator".- See Also:
-
PARAM_AFTER
Parameter name for the output after the link. Value is "after".- See Also:
-
PARAM_BEFORE
Parameter name for the output before the link. Value is "before".- See Also:
-
PARAM_EXCLUDE
Parameter name for setting the list of excluded patterns. Value is "exclude".- See Also:
-
PARAM_INCLUDE
Parameter name for setting the list of included patterns. Value is "include".- See Also:
-
PARAM_SHOW
Parameter name for the show parameter. Value is "show".- See Also:
-
PARAM_SHOW_VALUE_PAGES
Parameter name for setting show to "pages". Value is "pages".- See Also:
-
PARAM_SHOW_VALUE_COUNT
Parameter name for setting show to "count". Value is "count".- See Also:
-
PARAM_LASTMODIFIED
Parameter name for showing the last modification count. Value is "showLastModified".- See Also:
-
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:
-
PARAM_SORTORDER
Parameter name for specifying the sort order. Value is "sortOrder".- See Also:
-
PARAM_SORTORDER_HUMAN
- See Also:
-
PARAM_SORTORDER_JAVA
- See Also:
-
PARAM_SORTORDER_LOCALE
- See Also:
-
m_maxwidth
-
m_before
-
m_separator
-
m_after
-
items
-
m_exclude
-
m_include
-
m_sorter
-
m_show
-
m_lastModified
-
m_dateLastModified
-
m_dateFormat
-
m_engine
-
-
Constructor Details
-
AbstractReferralPlugin
public AbstractReferralPlugin()
-
-
Method Details
-
initialize
- Parameters:
context
- the wiki contextparams
- parameters for initializing the plugin- Throws:
PluginException
- if any of the plugin parameters are malformed
-
filterWikiPageCollection
-
filterCollection
Filters a collection according to the include and exclude parameters.- Parameters:
c
- The collection to filter.- Returns:
- A filtered collection.
-
filterAndSortCollection
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
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
Makes HTML with common parameters.- Parameters:
context
- The WikiContextwikitext
- The wikitext to render- Returns:
- HTML
- Since:
- 1.6.4
-
applyColumnsStyle
-