org.melati
Class MelatiConfig

Package class diagram package MelatiConfig
java.lang.Object
  extended by org.melati.MelatiConfig

public class MelatiConfig
extends Object

A MelatiConfig loads and provides access to the configuration parameters for melati. These are held in org.melati.MelatiConfig.properties.


Constructor Summary
MelatiConfig()
          Allows creation of a MelatiConfig with default config params.
MelatiConfig(Properties properties)
          Constructor from a given Properties object.
MelatiConfig(String propertiesName)
          Allows creation of a MelatiConfig with a specified properties file.
 
Method Summary
 AccessHandler getAccessHandler()
           
 FormDataAdaptorFactory getFdaFactory()
           
 FormDataAdaptorFactory getFormDataAdaptorFactory()
           
 String getJavascriptLibraryURL()
           
static String getLoginPageServletClassName()
           
static String getLogoutPageServletClassName()
           
static PoemLocale getPoemLocale()
           
 List<String> getPreferredCharsets()
          Return the set encodings that the server prefers and supports.
 String getRealPath()
           
 ServletTemplateEngine getServletTemplateEngine()
           
static SimpleDateAdaptor getSimpleDateAdaptor()
          Called from within templets.
 String getStaticURL()
          Normally set to melati-static.
 TemplateEngine getTemplateEngine()
           
 String getTemplatePath()
           
 TempletLoader getTempletLoader()
           
static YMDDateAdaptor getYMDDateAdaptor()
          Called from within templets using #set $yearField = $melati.Config.YMDDateAdaptor.yearField($field) idiom.
static YMDHMSTimestampAdaptor getYMDHMSTimestampAdaptor()
          Called from within templets using #set $secondField = $melati.Config.YMDHMSTimestampAdaptor.secondField($field) idiom.
 void setAccessHandler(AccessHandler accessHandler)
          Set the AccessHandler for use by this Melati.
 void setFdaFactory(FormDataAdaptorFactory fdaFactory)
           
 void setFormDataAdaptorFactory(FormDataAdaptorFactory fdaf)
          Set the FormDataAdaptorFactory for use by this Melati.
 void setJavascriptLibraryURL(String url)
          Set the JavascriptLibraryURL for use by this Melati.
static void setLoginPageServletClassName(String loginPageServletClassName)
           
static void setLogoutPageServletClassName(String logoutPageServletClassName)
           
 void setPoemiLocale(PoemLocale poemLocale)
           
 void setPreferredCharsets(Vector<String> preferredCharsets)
           
 void setRealPath(String realPathP)
           
 void setStaticURL(String url)
          Set the StaticURL for use by this Melati.
 void setTemplateEngine(TemplateEngine templateEngine)
          Set the TemplateEngine to use.
 void setTemplatePath(String templatePath)
           
 void setTempletLoader(TempletLoader templetLoader)
          Set the TempletLoader for use by this Melati.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MelatiConfig

public MelatiConfig()
Allows creation of a MelatiConfig with default config params.


MelatiConfig

public MelatiConfig(String propertiesName)
Allows creation of a MelatiConfig with a specified properties file.

Parameters:
propertiesName - the name of a properties file

MelatiConfig

public MelatiConfig(Properties properties)
Constructor from a given Properties object.

Parameters:
properties - the properties object to look in
Method Detail

getServletTemplateEngine

public ServletTemplateEngine getServletTemplateEngine()
Returns:
ServletTemplateEngine in use.

getTemplateEngine

public TemplateEngine getTemplateEngine()
Returns:
TemplateEngine in use.

setTemplateEngine

public void setTemplateEngine(TemplateEngine templateEngine)
Set the TemplateEngine to use.

Parameters:
templateEngine - a TemplateEngine

getAccessHandler

public AccessHandler getAccessHandler()
Returns:
the configured AccessHandler

setAccessHandler

public void setAccessHandler(AccessHandler accessHandler)
Set the AccessHandler for use by this Melati.

Parameters:
accessHandler - a AccessHandler

getTempletLoader

public TempletLoader getTempletLoader()
Returns:
the configured TempletLoader

setTempletLoader

public void setTempletLoader(TempletLoader templetLoader)
Set the TempletLoader for use by this Melati.

Parameters:
templetLoader - a TempletLoader

getFormDataAdaptorFactory

public FormDataAdaptorFactory getFormDataAdaptorFactory()
Returns:
the configured FormDataAdaptorFactory

setFormDataAdaptorFactory

public void setFormDataAdaptorFactory(FormDataAdaptorFactory fdaf)
Set the FormDataAdaptorFactory for use by this Melati.

Parameters:
fdaf - a FormDataAdaptorFactory

getJavascriptLibraryURL

public String getJavascriptLibraryURL()
Returns:
the location of javascript for this site.

setJavascriptLibraryURL

public void setJavascriptLibraryURL(String url)
Set the JavascriptLibraryURL for use by this Melati.

Parameters:
url - a URL to the directory containing the JavaScript for this site

getStaticURL

public String getStaticURL()
Normally set to melati-static.

Returns:
the location of static content for this site.

setStaticURL

public void setStaticURL(String url)
Set the StaticURL for use by this Melati.

Parameters:
url - a URL to the directory containing the static content

getTemplatePath

public String getTemplatePath()
Returns:
the location of templates.

setTemplatePath

public void setTemplatePath(String templatePath)
Parameters:
templatePath - The templatePath to set.

getLogoutPageServletClassName

public static String getLogoutPageServletClassName()
Returns:
the class name of the logout servlet

setLogoutPageServletClassName

public static void setLogoutPageServletClassName(String logoutPageServletClassName)
Parameters:
logoutPageServletClassName - The logoutPageServletClassName to set.

getLoginPageServletClassName

public static String getLoginPageServletClassName()
Returns:
the class name of the login servlet

setLoginPageServletClassName

public static void setLoginPageServletClassName(String loginPageServletClassName)
Parameters:
loginPageServletClassName - The loginPageServletClassName to set.

getPoemLocale

public static PoemLocale getPoemLocale()
Returns:
The configured locale, defaults to British English melati locale.

setPoemiLocale

public void setPoemiLocale(PoemLocale poemLocale)
Parameters:
poemLocale - The PoemLocale to set.

getPreferredCharsets

public List<String> getPreferredCharsets()
Return the set encodings that the server prefers and supports.

Returns:
List of encoding names or aliases.

setPreferredCharsets

public void setPreferredCharsets(Vector<String> preferredCharsets)
Parameters:
preferredCharsets - The preferredCharsets to set.

getFdaFactory

public FormDataAdaptorFactory getFdaFactory()
Returns:
Returns the fdaFactory.

setFdaFactory

public void setFdaFactory(FormDataAdaptorFactory fdaFactory)
Parameters:
fdaFactory - The fdaFactory to set.

getYMDDateAdaptor

public static YMDDateAdaptor getYMDDateAdaptor()
Called from within templets using #set $yearField = $melati.Config.YMDDateAdaptor.yearField($field) idiom. Perhaps this should be elsewhere.

Returns:
the adaptor for rendering dates as drop-downs.

getYMDHMSTimestampAdaptor

public static YMDHMSTimestampAdaptor getYMDHMSTimestampAdaptor()
Called from within templets using #set $secondField = $melati.Config.YMDHMSTimestampAdaptor.secondField($field) idiom. Perhaps this should be elsewhere.

Returns:
the adaptor for rendering timestamps as drop-downs.

getSimpleDateAdaptor

public static SimpleDateAdaptor getSimpleDateAdaptor()
Called from within templets. Perhaps this should be elsewhere.

Returns:
the adaptor for rendering dates as normal.

setRealPath

public void setRealPath(String realPathP)
Parameters:
realPathP - the path to set

getRealPath

public String getRealPath()
Returns:
the real path, if set null otherwise


Copyright © 2000-2010 PanEris. All Rights Reserved.