org.ceryle.wiki.plugin.emailnotifier
Class EmailNotifierPlugin

java.lang.Object
  extended by org.ceryle.wiki.plugin.emailnotifier.EmailNotifierPlugin
All Implemented Interfaces:
InitializablePlugin, WikiPlugin
Direct Known Subclasses:
EmailNotifier

public class EmailNotifierPlugin
extends Object
implements WikiPlugin, InitializablePlugin

Sends an email notification upon page changes. Assure that for each wiki that we see a plugin execute request from that we have a NotifierThread running. On each plugin execution, update the NotifierThread with the "current" parameters to the plugin. This plugin simply returns a status message about when the notifier will next run.

NOTE: If two instances of this plugin are placed in a wiki, (either on the same or differing pages), there is no harm to it, but the results will be unpredictable in that the notification task will use the last set of parameters that it received. Since parameters are updated each time the plugin is executed this menas that the last viewed page with this plugin is the one whose parameters will get used.

Usage: Simple text message, to be built every hour at 5 minutes after the hour.

    [{EmailNotifierPlugin changedPagePattern='* CHANGED_PAGE_NAME by CHANGED_PAGE_INFO\n'

    Hello, here are the changes in the last 24 hours.
    ----
    CHANGED_PAGE_LIST
    ----
    To unsubscribe see the SUBSCRIPTION_PAGE.
    }]
 

Design notes:
Rough class hierarchy...
Plugin --1> Map --*> Thread --1> Task --*> Subscribers

Author:
John Volkar (john.volkar at gmail.com), Murray Altheim, StevenPozarycki

Field Summary
 
Fields inherited from interface com.ecyrd.jspwiki.plugin.WikiPlugin
CORE_PLUGINS_RESOURCEBUNDLE
 
Constructor Summary
EmailNotifierPlugin()
           
 
Method Summary
 String execute(WikiContext context, Map paramMap)
          Get the NotifierTask instance appropriate for the context, update its parameters, return its status message.
 void initialize(WikiContext context, Map map)
          For compliance with earlier versions of the InitializablePlugin API.
 void initialize(WikiEngine engine)
          Make this plugin initializable, so it gets executed at wiki startup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmailNotifierPlugin

public EmailNotifierPlugin()
Method Detail

initialize

public void initialize(WikiContext context,
                       Map map)
                throws PluginException
For compliance with earlier versions of the InitializablePlugin API.

Throws:
PluginException

initialize

public void initialize(WikiEngine engine)
                throws PluginException
Make this plugin initializable, so it gets executed at wiki startup.

Specified by:
initialize in interface InitializablePlugin
Throws:
PluginException

execute

public String execute(WikiContext context,
                      Map paramMap)
Get the NotifierTask instance appropriate for the context, update its parameters, return its status message.

Specified by:
execute in interface WikiPlugin


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.