public class WeblogPlugin extends 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 String |
ATTR_ISWEBLOG
The attribute which is stashed to the WikiPage attributes to check if a page
is a weblog or not.
|
static String |
DEFAULT_DATEFORMAT
The default date format used in the blog entry page names.
|
static String |
PARAM_ALLOWCOMMENTS
Parameter name for the allowComments.
|
static String |
PARAM_DAYS
Parameter name for the days.
|
static String |
PARAM_ENTRYFORMAT
Parameter name for the entryFormat.
|
static String |
PARAM_MAXENTRIES
Parameter name for the maxEntries.
|
static String |
PARAM_PAGE
Parameter name for the page.
|
static String |
PARAM_PREVIEW
Parameter name for the preview.
|
static String |
PARAM_STARTDATE
Parameter name for the startDate.
|
CORE_PLUGINS_RESOURCEBUNDLE| Constructor and Description |
|---|
WeblogPlugin() |
| Modifier and Type | Method and Description |
|---|---|
String |
execute(Context context,
Map<String,String> params) |
void |
executeParser(PluginElement element,
Context context,
Map<String,String> params)
Mark us as being a real weblog.
|
List<Page> |
findBlogEntries(Engine engine,
String baseName,
Date start,
Date end)
Attempts to locate all pages that correspond to the
blog entry pattern.
|
static String |
makeEntryPage(String pageName)
Return just the basename for entires without date and entry numebr.
|
static String |
makeEntryPage(String pageName,
String date)
Returns the entry page without the entry number.
|
static String |
makeEntryPage(String pageName,
String date,
String entryNum)
Create an entry name based on the blogname, a date, and an entry number.
|
public static final String DEFAULT_DATEFORMAT
public static final String PARAM_STARTDATE
public static final String PARAM_ENTRYFORMAT
public static final String PARAM_DAYS
public static final String PARAM_ALLOWCOMMENTS
public static final String PARAM_MAXENTRIES
public static final String PARAM_PAGE
public static final String PARAM_PREVIEW
public static final String ATTR_ISWEBLOG
public WeblogPlugin()
public static String makeEntryPage(String pageName, String date, String entryNum)
pageName - Name of the blogdate - The date (in ddMMyy format)entryNum - The entry number.public static String makeEntryPage(String pageName)
pageName - The name of the blog.public static String makeEntryPage(String pageName, String date)
pageName - Blog name.date - The date.public String execute(Context context, Map<String,String> params) throws PluginException
execute in interface PluginPluginExceptionpublic List<Page> findBlogEntries(Engine engine, String baseName, Date start, 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, Map<String,String> params)
executeParser in interface ParserStagePluginCopyright © 2001-2020 The Apache Software Foundation. All rights reserved.