com.ecyrd.jspwiki.plugin
Class WeblogPlugin

java.lang.Object
  |
  +--com.ecyrd.jspwiki.plugin.WeblogPlugin
All Implemented Interfaces:
WikiPlugin

public class WeblogPlugin
extends java.lang.Object
implements WikiPlugin

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.

Since:
1.9.21

Field Summary
static java.lang.String DEFAULT_DATEFORMAT
           
static int DEFAULT_DAYS
           
static java.lang.String DEFAULT_PAGEFORMAT
           
static java.lang.String PARAM_ALLOWCOMMENTS
           
static java.lang.String PARAM_DAYS
           
static java.lang.String PARAM_STARTDATE
           
 
Constructor Summary
WeblogPlugin()
           
 
Method Summary
 java.lang.String execute(WikiContext context, java.util.Map params)
          This is the main entry point for any plugin.
 java.util.List findBlogEntries(PageManager mgr, 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)
           
static java.lang.String makeEntryPage(java.lang.String pageName, java.lang.String date)
           
static java.lang.String makeEntryPage(java.lang.String pageName, java.lang.String date, java.lang.String entryNum)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DAYS

public static final int DEFAULT_DAYS
See Also:
Constant Field Values

DEFAULT_PAGEFORMAT

public static final java.lang.String DEFAULT_PAGEFORMAT
See Also:
Constant Field Values

DEFAULT_DATEFORMAT

public static final java.lang.String DEFAULT_DATEFORMAT
See Also:
Constant Field Values

PARAM_STARTDATE

public static final java.lang.String PARAM_STARTDATE
See Also:
Constant Field Values

PARAM_DAYS

public static final java.lang.String PARAM_DAYS
See Also:
Constant Field Values

PARAM_ALLOWCOMMENTS

public static final java.lang.String PARAM_ALLOWCOMMENTS
See Also:
Constant Field Values
Constructor Detail

WeblogPlugin

public WeblogPlugin()
Method Detail

makeEntryPage

public static java.lang.String makeEntryPage(java.lang.String pageName,
                                             java.lang.String date,
                                             java.lang.String entryNum)

makeEntryPage

public static java.lang.String makeEntryPage(java.lang.String pageName)

makeEntryPage

public static java.lang.String makeEntryPage(java.lang.String pageName,
                                             java.lang.String date)

execute

public java.lang.String execute(WikiContext context,
                                java.util.Map params)
                         throws PluginException
Description copied from interface: WikiPlugin
This is the main entry point for any plugin. The parameters are parsed, and a special parameter called "_body" signifies the name of the plugin body, i.e. the part of the plugin that is not a parameter of the form "key=value". This has been separated using an empty line.

Note that it is preferred that the plugin returns XHTML-compliant HTML (i.e. close all tags, use <br /> instead of <br>, etc.

Specified by:
execute in interface WikiPlugin
Parameters:
context - The current WikiContext.
params - A Map which contains key-value pairs. Any parameter that the user has specified on the wiki page will contain String-String parameters, but it is possible that at some future date, JSPWiki will give you other things that are not Strings.
Returns:
HTML, ready to be included into the rendered page.
Throws:
PluginException - In case anything goes wrong.

findBlogEntries

public java.util.List findBlogEntries(PageManager mgr,
                                      java.lang.String baseName,
                                      java.util.Date start,
                                      java.util.Date end)
                               throws ProviderException
Attempts to locate all pages that correspond to the blog entry pattern. Returns a list of pages with their FIRST revisions.

ProviderException