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
public abstract class AbstractReferralPlugin extends 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
RuleBasedCollatorrule string. (since 2.8.3)
-
Field Summary
Fields Modifier and Type Field Description static intALL_ITEMSMagic value for rendering all items.protected Stringm_afterprotected Stringm_beforeprotected SimpleDateFormatm_dateFormatprotected Datem_dateLastModifiedprotected Enginem_engineprotected org.apache.oro.text.regex.Pattern[]m_excludeprotected org.apache.oro.text.regex.Pattern[]m_includeprotected booleanm_lastModifiedprotected intm_maxwidthprotected Stringm_separatorprotected Stringm_showprotected PageSorterm_sorterstatic StringPARAM_AFTERParameter name for the output after the link.static StringPARAM_BEFOREParameter name for the output before the link.static StringPARAM_EXCLUDEParameter name for setting the list of excluded patterns.static StringPARAM_INCLUDEParameter name for setting the list of included patterns.static StringPARAM_LASTMODIFIEDParameter name for showing the last modification count.static StringPARAM_MAXWIDTHParameter name for setting the maximum width.static StringPARAM_SEPARATORParameter name for the separator string.static StringPARAM_SHOWParameter name for the show parameter.static StringPARAM_SHOW_VALUE_COUNTParameter name for setting show to "count".static StringPARAM_SHOW_VALUE_PAGESParameter name for setting show to "pages".protected static StringPARAM_SORTORDERParameter name for specifying the sort order.protected static StringPARAM_SORTORDER_HUMANprotected static StringPARAM_SORTORDER_JAVAprotected static StringPARAM_SORTORDER_LOCALEFields 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 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<Page>filterWikiPageCollection(Collection<Page> pages)voidinitialize(Context context, Map<String,String> params)protected StringmakeHTML(Context context, String wikitext)Makes HTML with common parameters.protected StringwikitizeCollection(Collection<String> links, String separator, int numItems)Makes WikiText from a Collection.
-
Field Details
-
ALL_ITEMS
Magic value for rendering all items.- See Also:
- Constant Field Values
-
PARAM_MAXWIDTH
Parameter name for setting the maximum width. Value is "maxwidth".- See Also:
- Constant Field Values
-
PARAM_SEPARATOR
Parameter name for the separator string. Value is "separator".- See Also:
- Constant Field Values
-
PARAM_AFTER
Parameter name for the output after the link. Value is "after".- See Also:
- Constant Field Values
-
PARAM_BEFORE
Parameter name for the output before the link. Value is "before".- See Also:
- Constant Field Values
-
PARAM_EXCLUDE
Parameter name for setting the list of excluded patterns. Value is "exclude".- See Also:
- Constant Field Values
-
PARAM_INCLUDE
Parameter name for setting the list of included patterns. Value is "include".- See Also:
- Constant Field Values
-
PARAM_SHOW
Parameter name for the show parameter. Value is "show".- See Also:
- Constant Field Values
-
PARAM_SHOW_VALUE_PAGES
Parameter name for setting show to "pages". Value is "pages".- See Also:
- Constant Field Values
-
PARAM_SHOW_VALUE_COUNT
Parameter name for setting show to "count". Value is "count".- See Also:
- Constant Field Values
-
PARAM_LASTMODIFIED
Parameter name for showing the last modification count. Value is "showLastModified".- See Also:
- Constant Field Values
-
PARAM_SORTORDER
Parameter name for specifying the sort order. Value is "sortOrder".- See Also:
- Constant Field Values
-
PARAM_SORTORDER_HUMAN
- See Also:
- Constant Field Values
-
PARAM_SORTORDER_JAVA
- See Also:
- Constant Field Values
-
PARAM_SORTORDER_LOCALE
- See Also:
- Constant Field Values
-
m_maxwidth
-
m_before
-
m_separator
-
m_after
-
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
-