public class WeblogPlugin extends java.lang.Object implements Plugin, ParserStagePlugin
Builds a simple weblog. The pageformat can use the following params:
%p - Page name
Parameters:
The "days" and "startDate" can also be sent in HTTP parameters, and the names are "weblog.days" and "weblog.startDate", respectively.
The weblog plugin also adds an attribute to each page it is on: "weblogplugin.isweblog" is set to "true". This can be used to quickly peruse pages which have weblogs.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTR_ISWEBLOG
The attribute which is stashed to the WikiPage attributes to check if a page
is a weblog or not.
|
static java.lang.String |
DEFAULT_DATEFORMAT
The default date format used in the blog entry page names.
|
static java.lang.String |
PARAM_ALLOWCOMMENTS
Parameter name for the allowComments.
|
static java.lang.String |
PARAM_DAYS
Parameter name for the days.
|
static java.lang.String |
PARAM_ENTRYFORMAT
Parameter name for the entryFormat.
|
static java.lang.String |
PARAM_MAXENTRIES
Parameter name for the maxEntries.
|
static java.lang.String |
PARAM_PAGE
Parameter name for the page.
|
static java.lang.String |
PARAM_PREVIEW
Parameter name for the preview.
|
static java.lang.String |
PARAM_STARTDATE
Parameter name for the startDate.
|
CORE_PLUGINS_RESOURCEBUNDLE| Constructor and Description |
|---|
WeblogPlugin() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
execute(Context context,
java.util.Map<java.lang.String,java.lang.String> params) |
void |
executeParser(PluginElement element,
Context context,
java.util.Map<java.lang.String,java.lang.String> params)
Mark us as being a real weblog.
|
java.util.List<Page> |
findBlogEntries(Engine engine,
java.lang.String baseName,
java.util.Date start,
java.util.Date end)
Attempts to locate all pages that correspond to the
blog entry pattern.
|
static java.lang.String |
makeEntryPage(java.lang.String pageName)
Return just the basename for entires without date and entry numebr.
|
static java.lang.String |
makeEntryPage(java.lang.String pageName,
java.lang.String date)
Returns the entry page without the entry number.
|
static java.lang.String |
makeEntryPage(java.lang.String pageName,
java.lang.String date,
java.lang.String entryNum)
Create an entry name based on the blogname, a date, and an entry number.
|
public static final java.lang.String DEFAULT_DATEFORMAT
public static final java.lang.String PARAM_STARTDATE
public static final java.lang.String PARAM_ENTRYFORMAT
public static final java.lang.String PARAM_DAYS
public static final java.lang.String PARAM_ALLOWCOMMENTS
public static final java.lang.String PARAM_MAXENTRIES
public static final java.lang.String PARAM_PAGE
public static final java.lang.String PARAM_PREVIEW
public static final java.lang.String ATTR_ISWEBLOG
public WeblogPlugin()
public static java.lang.String makeEntryPage(java.lang.String pageName, java.lang.String date, java.lang.String entryNum)
pageName - Name of the blogdate - The date (in ddMMyy format)entryNum - The entry number.public static java.lang.String makeEntryPage(java.lang.String pageName)
pageName - The name of the blog.public static java.lang.String makeEntryPage(java.lang.String pageName, java.lang.String date)
pageName - Blog name.date - The date.public java.lang.String execute(Context context, java.util.Map<java.lang.String,java.lang.String> params) throws PluginException
execute in interface PluginPluginExceptionpublic java.util.List<Page> findBlogEntries(Engine engine, java.lang.String baseName, java.util.Date start, java.util.Date end)
engine - Engine which is used to get the pagesbaseName - The basename (e.g. "Main" if you want "Main_blogentry_xxxx")start - The date which is the first to be consideredend - The end date which is the last to be consideredpublic void executeParser(PluginElement element, Context context, java.util.Map<java.lang.String,java.lang.String> params)
executeParser in interface ParserStagePluginCopyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.