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 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)
- 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 SummaryFields Modifier and Type Field Description static intALL_ITEMSMagic value for rendering all items.protected java.lang.Stringm_afterprotected java.lang.Stringm_beforeprotected java.text.SimpleDateFormatm_dateFormatprotected java.util.Datem_dateLastModifiedprotected Enginem_engineprotected org.apache.oro.text.regex.Pattern[]m_excludeprotected org.apache.oro.text.regex.Pattern[]m_includeprotected booleanm_lastModifiedprotected intm_maxwidthprotected java.lang.Stringm_separatorprotected java.lang.Stringm_showprotected PageSorterm_sorterstatic java.lang.StringPARAM_AFTERParameter name for the output after the link.static java.lang.StringPARAM_BEFOREParameter name for the output before the link.static java.lang.StringPARAM_EXCLUDEParameter name for setting the list of excluded patterns.static java.lang.StringPARAM_INCLUDEParameter name for setting the list of included patterns.static java.lang.StringPARAM_LASTMODIFIEDParameter name for showing the last modification count.static java.lang.StringPARAM_MAXWIDTHParameter name for setting the maximum width.static java.lang.StringPARAM_SEPARATORParameter name for the separator string.static java.lang.StringPARAM_SHOWParameter name for the show parameter.static java.lang.StringPARAM_SHOW_VALUE_COUNTParameter name for setting show to "count".static java.lang.StringPARAM_SHOW_VALUE_PAGESParameter name for setting show to "pages".protected static java.lang.StringPARAM_SORTORDERParameter name for specifying the sort order.protected static java.lang.StringPARAM_SORTORDER_HUMANprotected static java.lang.StringPARAM_SORTORDER_JAVAprotected static java.lang.StringPARAM_SORTORDER_LOCALEFields inherited from interface org.apache.wiki.api.plugin.PluginCORE_PLUGINS_RESOURCEBUNDLE
- 
Constructor SummaryConstructors Constructor Description AbstractReferralPlugin()
- 
Method SummaryModifier and Type Method Description 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)voidinitialize(Context context, java.util.Map<java.lang.String,java.lang.String> params)protected java.lang.StringmakeHTML(Context context, java.lang.String wikitext)Makes HTML with common parameters.protected java.lang.StringwikitizeCollection(java.util.Collection<java.lang.String> links, java.lang.String separator, int numItems)Makes WikiText from a Collection.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- 
Field Details- 
ALL_ITEMSMagic value for rendering all items.- See Also:
- Constant Field Values
 
- 
PARAM_MAXWIDTHParameter name for setting the maximum width. Value is "maxwidth".- See Also:
- Constant Field Values
 
- 
PARAM_SEPARATORParameter name for the separator string. Value is "separator".- See Also:
- Constant Field Values
 
- 
PARAM_AFTERParameter name for the output after the link. Value is "after".- See Also:
- Constant Field Values
 
- 
PARAM_BEFOREParameter name for the output before the link. Value is "before".- See Also:
- Constant Field Values
 
- 
PARAM_EXCLUDEParameter name for setting the list of excluded patterns. Value is "exclude".- See Also:
- Constant Field Values
 
- 
PARAM_INCLUDEParameter name for setting the list of included patterns. Value is "include".- See Also:
- Constant Field Values
 
- 
PARAM_SHOWParameter name for the show parameter. Value is "show".- See Also:
- Constant Field Values
 
- 
PARAM_SHOW_VALUE_PAGESParameter name for setting show to "pages". Value is "pages".- See Also:
- Constant Field Values
 
- 
PARAM_SHOW_VALUE_COUNTParameter name for setting show to "count". Value is "count".- See Also:
- Constant Field Values
 
- 
PARAM_LASTMODIFIEDParameter name for showing the last modification count. Value is "showLastModified".- See Also:
- Constant Field Values
 
- 
PARAM_SORTORDERParameter 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- 
AbstractReferralPluginpublic AbstractReferralPlugin()
 
- 
- 
Method Details- 
initializepublic 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
 
- 
filterWikiPageCollection
- 
filterCollectionprotected 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.
 
- 
filterAndSortCollectionprotected 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.
 
- 
wikitizeCollectionprotected 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
 
- 
makeHTMLMakes HTML with common parameters.- Parameters:
- context- The WikiContext
- wikitext- The wikitext to render
- Returns:
- HTML
- Since:
- 1.6.4
 
 
-