org.blojsom.plugin.moblog
Class MoblogPlugin

java.lang.Object
  extended byorg.blojsom.plugin.velocity.StandaloneVelocityPlugin
      extended byorg.blojsom.plugin.moblog.MoblogPlugin
All Implemented Interfaces:
Plugin

public class MoblogPlugin
extends StandaloneVelocityPlugin

Moblog Plugin

Since:
blojsom 3.0
Version:
$Id: MoblogPlugin.java,v 1.6 2007/01/17 02:35:11 czarneckid Exp $
Author:
David Czarnecki, Mark Lussier

Field Summary
static java.lang.String DEFAULT_IMAGE_MIME_TYPES
          Default mime-types for images
static java.lang.String DEFAULT_MOBLOG_AUTHORIZATION_FILE
          Default moblog authorization properties file which lists valid e-mail addresses who can moblog entries
static java.lang.String DEFAULT_TEXT_MIME_TYPES
          Default mime-types for text
static java.lang.String PLUGIN_MOBLOG_ATTACHMENT_MIME_TYPES
          Configuration property for attachment mime-types
static java.lang.String PLUGIN_MOBLOG_AUTHORIZED_ADDRESSES
           
static java.lang.String PLUGIN_MOBLOG_CONFIGURATION_IP
          Moblog confifguration parameter for web.xml
static java.lang.String PLUGIN_MOBLOG_IGNORE_EXPRESSION
          Configuration property for regular expression to ignore a certain portion of text
static java.lang.String PLUGIN_MOBLOG_IMAGE_MIME_TYPES
          Configuration property for image mime-types
static java.lang.String PLUGIN_MOBLOG_POLL_TIME
          Moblog configuration parameter for mailbox polling time (5 minutes)
static java.lang.String PLUGIN_MOBLOG_SECRET_WORD
          Configuration property for the secret word that must be present at the beginning of the subject
static java.lang.String PLUGIN_MOBLOG_STORE_PROVIDER
          Moblog configuration parameter for message store provider
static java.lang.String PLUGIN_MOBLOG_TEXT_MIME_TYPES
          Configuration property for text mime-types
static java.lang.String PROPERTY_AUTHORIZATION
          Configuration property for moblog authorization properties file to use
static java.lang.String PROPERTY_CATEGORY
          Configuration property for moblog category
static java.lang.String PROPERTY_ENABLED
          Configuration property for whether or not moblog is enabled for this blog
static java.lang.String PROPERTY_HOSTNAME
          Configuration property for mailhost
static java.lang.String PROPERTY_PASSWORD
          Configuration property for mailbox user password
static java.lang.String PROPERTY_USERID
          Configuration property for mailbox user ID
 
Fields inherited from class org.blojsom.plugin.velocity.StandaloneVelocityPlugin
_servletConfig, _velocityProperties
 
Constructor Summary
MoblogPlugin()
           
 
Method Summary
 void cleanup()
          Perform any cleanup for the plugin.
 void destroy()
          Called when BlojsomServlet is taken out of service
 void init()
          Initialize this plugin.
 Entry[] process(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, Blog blog, java.util.Map context, Entry[] entries)
          Process the blog entries
protected  java.lang.String sanitizeContentType(java.lang.String contentType)
          Return a content type up to the first ; character
 void setEventBroadcaster(EventBroadcaster eventBroadcaster)
          Set the EventBroadcaster
 void setFetcher(Fetcher fetcher)
          Set the Fetcher
 
Methods inherited from class org.blojsom.plugin.velocity.StandaloneVelocityPlugin
mergeTemplate, setServletConfig, setVelocityProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TEXT_MIME_TYPES

public static final java.lang.String DEFAULT_TEXT_MIME_TYPES
Default mime-types for text

See Also:
Constant Field Values

DEFAULT_IMAGE_MIME_TYPES

public static final java.lang.String DEFAULT_IMAGE_MIME_TYPES
Default mime-types for images

See Also:
Constant Field Values

PLUGIN_MOBLOG_CONFIGURATION_IP

public static final java.lang.String PLUGIN_MOBLOG_CONFIGURATION_IP
Moblog confifguration parameter for web.xml

See Also:
Constant Field Values

PLUGIN_MOBLOG_POLL_TIME

public static final java.lang.String PLUGIN_MOBLOG_POLL_TIME
Moblog configuration parameter for mailbox polling time (5 minutes)

See Also:
Constant Field Values

PLUGIN_MOBLOG_STORE_PROVIDER

public static final java.lang.String PLUGIN_MOBLOG_STORE_PROVIDER
Moblog configuration parameter for message store provider

See Also:
Constant Field Values

DEFAULT_MOBLOG_AUTHORIZATION_FILE

public static final java.lang.String DEFAULT_MOBLOG_AUTHORIZATION_FILE
Default moblog authorization properties file which lists valid e-mail addresses who can moblog entries

See Also:
Constant Field Values

PROPERTY_AUTHORIZATION

public static final java.lang.String PROPERTY_AUTHORIZATION
Configuration property for moblog authorization properties file to use

See Also:
Constant Field Values

PROPERTY_HOSTNAME

public static final java.lang.String PROPERTY_HOSTNAME
Configuration property for mailhost

See Also:
Constant Field Values

PROPERTY_USERID

public static final java.lang.String PROPERTY_USERID
Configuration property for mailbox user ID

See Also:
Constant Field Values

PROPERTY_PASSWORD

public static final java.lang.String PROPERTY_PASSWORD
Configuration property for mailbox user password

See Also:
Constant Field Values

PROPERTY_CATEGORY

public static final java.lang.String PROPERTY_CATEGORY
Configuration property for moblog category

See Also:
Constant Field Values

PROPERTY_ENABLED

public static final java.lang.String PROPERTY_ENABLED
Configuration property for whether or not moblog is enabled for this blog

See Also:
Constant Field Values

PLUGIN_MOBLOG_SECRET_WORD

public static final java.lang.String PLUGIN_MOBLOG_SECRET_WORD
Configuration property for the secret word that must be present at the beginning of the subject

See Also:
Constant Field Values

PLUGIN_MOBLOG_IMAGE_MIME_TYPES

public static final java.lang.String PLUGIN_MOBLOG_IMAGE_MIME_TYPES
Configuration property for image mime-types

See Also:
Constant Field Values

PLUGIN_MOBLOG_ATTACHMENT_MIME_TYPES

public static final java.lang.String PLUGIN_MOBLOG_ATTACHMENT_MIME_TYPES
Configuration property for attachment mime-types

See Also:
Constant Field Values

PLUGIN_MOBLOG_TEXT_MIME_TYPES

public static final java.lang.String PLUGIN_MOBLOG_TEXT_MIME_TYPES
Configuration property for text mime-types

See Also:
Constant Field Values

PLUGIN_MOBLOG_IGNORE_EXPRESSION

public static final java.lang.String PLUGIN_MOBLOG_IGNORE_EXPRESSION
Configuration property for regular expression to ignore a certain portion of text

See Also:
Constant Field Values

PLUGIN_MOBLOG_AUTHORIZED_ADDRESSES

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

MoblogPlugin

public MoblogPlugin()
Method Detail

setFetcher

public void setFetcher(Fetcher fetcher)
Set the Fetcher

Parameters:
fetcher - Fetcher

setEventBroadcaster

public void setEventBroadcaster(EventBroadcaster eventBroadcaster)
Set the EventBroadcaster

Parameters:
eventBroadcaster - EventBroadcaster

init

public void init()
          throws PluginException
Initialize this plugin. This method only called when the plugin is instantiated.

Specified by:
init in interface Plugin
Overrides:
init in class StandaloneVelocityPlugin
Throws:
PluginException - If there is an error initializing the plugin

process

public Entry[] process(javax.servlet.http.HttpServletRequest httpServletRequest,
                       javax.servlet.http.HttpServletResponse httpServletResponse,
                       Blog blog,
                       java.util.Map context,
                       Entry[] entries)
                throws PluginException
Process the blog entries

Parameters:
httpServletRequest - Request
httpServletResponse - Response
blog - Blog instance
context - Context
entries - Blog entries retrieved for the particular request
Returns:
Modified set of blog entries
Throws:
PluginException - If there is an error processing the blog entries

cleanup

public void cleanup()
             throws PluginException
Perform any cleanup for the plugin. Called after process(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.blojsom.blog.Blog, java.util.Map, org.blojsom.blog.Entry[]).

Throws:
PluginException - If there is an error performing cleanup for this plugin

destroy

public void destroy()
             throws PluginException
Called when BlojsomServlet is taken out of service

Throws:
PluginException - If there is an error in finalizing this plugin

sanitizeContentType

protected java.lang.String sanitizeContentType(java.lang.String contentType)
Return a content type up to the first ; character

Parameters:
contentType - Content type
Returns:
Content type without any trailing information after a ;