org.ceryle.wiki.plugin
Class TimelyGreeting

java.lang.Object
  extended by org.ceryle.wiki.plugin.TimelyGreeting
All Implemented Interfaces:
WikiPlugin

public class TimelyGreeting
extends Object
implements WikiPlugin

TimelyGreetingPlugin (or 'TimelyGreeting' in use) is a CeryleWikiPlugin that returns a timely greeting based on either server time or a provided timezone.

Generates a "Good morning!", "Good afternoon!", "Good evening!", or "Good night!" depending on the current time at the timezone of the server or a provided timezone. If the provided timezone cannot be understood, returns a string based on GMT.

While subjective, the time boundaries used by this plugin are:

Parameters

timezone='tzid'
set the timezone to the provided string. The default will be the timezone of the server
verbose='yes' | 'no'
also show time and timezone
format='short' | 'medium' | 'long'
when in verbose mode, selects the format used for display of the time
morning='phrase'
set the "Good morning!" string to the provided value
afternoon='phrase'
set the "Good afternoon!" string to the provided value
evening='phrase'
set the "Good evening!" string to the provided value
night='phrase'
set the "Good night!" string to the provided value (because in English "Good night" is considered a good-bye, the default might need to be altered).

Version:
$Id$
Author:
Murray Altheim

Field Summary
static String PARAM_AFTERNOON
           
static String PARAM_EVENING
           
static String PARAM_FORMAT
           
static String PARAM_MORNING
           
static String PARAM_NIGHT
           
static String PARAM_TIMEZONE
           
static String PARAM_VERBOSE
           
static String VALUE_LONG
           
static String VALUE_MEDIUM
           
static String VALUE_SHORT
           
 
Fields inherited from interface com.ecyrd.jspwiki.plugin.WikiPlugin
CORE_PLUGINS_RESOURCEBUNDLE
 
Constructor Summary
TimelyGreeting()
           
 
Method Summary
 String execute(WikiContext context, Map params)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_TIMEZONE

public static final String PARAM_TIMEZONE
See Also:
Constant Field Values

PARAM_FORMAT

public static final String PARAM_FORMAT
See Also:
Constant Field Values

PARAM_VERBOSE

public static final String PARAM_VERBOSE
See Also:
Constant Field Values

PARAM_MORNING

public static final String PARAM_MORNING
See Also:
Constant Field Values

PARAM_AFTERNOON

public static final String PARAM_AFTERNOON
See Also:
Constant Field Values

PARAM_EVENING

public static final String PARAM_EVENING
See Also:
Constant Field Values

PARAM_NIGHT

public static final String PARAM_NIGHT
See Also:
Constant Field Values

VALUE_SHORT

public static final String VALUE_SHORT
See Also:
Constant Field Values

VALUE_MEDIUM

public static final String VALUE_MEDIUM
See Also:
Constant Field Values

VALUE_LONG

public static final String VALUE_LONG
See Also:
Constant Field Values
Constructor Detail

TimelyGreeting

public TimelyGreeting()
Method Detail

execute

public String execute(WikiContext context,
                      Map params)
               throws PluginException
Specified by:
execute in interface WikiPlugin
Throws:
PluginException


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