uk.co.mullsoft.jean
Class JEANConfig

java.lang.Object
  extended by uk.co.mullsoft.jean.JEANConfig
Direct Known Subclasses:
CalendarConfig, FileConfiguration, MailConfiguration, MultimediaConfig, RSSConfiguration

public abstract class JEANConfig
extends java.lang.Object


Field Summary
protected  org.w3c.dom.Document configDocument
           
protected  boolean newConfig
           
 
Constructor Summary
JEANConfig()
           
 
Method Summary
 void createNewParameters(JEANAPI api, org.w3c.dom.Document configDocument, org.w3c.dom.Element configurationElement)
           
 org.w3c.dom.Document getConfigDocument()
           
abstract  NamedValue[] getNewParameters(JEANAPI api)
          These are application parameters that must be provided during the first run of the application.
 java.lang.String getParameter(JEANAPI api, java.lang.String name)
           
 java.lang.String[] getParameterNames()
           
 boolean isNewConfig()
           
 void loadColors(JEANAPI api)
           
 void loadConfigDocument(JEANAPI api)
          Load the configuration document, if it does not exist then create any new configuration parameters.
 void removeParameter(JEANAPI api, java.lang.String name)
           
 void save(JEANAPI api)
           
 void setColors(JEANAPI api, NodeType type, NamedValue[] colors)
           
 void setColorsWithoutSaving(JEANAPI api, NodeType type, NamedValue[] colors)
           
 void setParameter(JEANAPI api, java.lang.String name, java.lang.String value)
           
 void setParameters(JEANAPI api, org.w3c.dom.Element configurationElement)
          Parameters that have no user name are system parameters and are set up at startup.
 void setParameters(JEANAPI api, NamedValue[] params)
           
abstract  void setStartupParameters(JEANAPI api, NamedValue[] params)
          application parameters with no user are set up during startup.
 void setSystemParameter(JEANAPI api, java.lang.String name, java.lang.String value)
           
 void setSystemParameters(JEANAPI api, NamedValue[] params)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configDocument

protected org.w3c.dom.Document configDocument

newConfig

protected boolean newConfig
Constructor Detail

JEANConfig

public JEANConfig()
Method Detail

loadConfigDocument

public void loadConfigDocument(JEANAPI api)
Load the configuration document, if it does not exist then create any new configuration parameters.


getConfigDocument

public org.w3c.dom.Document getConfigDocument()

isNewConfig

public boolean isNewConfig()

setColorsWithoutSaving

public void setColorsWithoutSaving(JEANAPI api,
                                   NodeType type,
                                   NamedValue[] colors)

setColors

public void setColors(JEANAPI api,
                      NodeType type,
                      NamedValue[] colors)

loadColors

public void loadColors(JEANAPI api)

setParameter

public void setParameter(JEANAPI api,
                         java.lang.String name,
                         java.lang.String value)

setSystemParameter

public void setSystemParameter(JEANAPI api,
                               java.lang.String name,
                               java.lang.String value)

setParameters

public void setParameters(JEANAPI api,
                          NamedValue[] params)

setSystemParameters

public void setSystemParameters(JEANAPI api,
                                NamedValue[] params)

getParameter

public java.lang.String getParameter(JEANAPI api,
                                     java.lang.String name)

getParameterNames

public java.lang.String[] getParameterNames()

removeParameter

public void removeParameter(JEANAPI api,
                            java.lang.String name)

createNewParameters

public void createNewParameters(JEANAPI api,
                                org.w3c.dom.Document configDocument,
                                org.w3c.dom.Element configurationElement)

setParameters

public void setParameters(JEANAPI api,
                          org.w3c.dom.Element configurationElement)
Parameters that have no user name are system parameters and are set up at startup. Parameters that have a user name are stored and accessible by that user only


save

public void save(JEANAPI api)

getNewParameters

public abstract NamedValue[] getNewParameters(JEANAPI api)
These are application parameters that must be provided during the first run of the application.

Parameters:
api - the current JEANAPI
Returns:
an array of NamedValues, name and String[2] {value of each parameter,username}

setStartupParameters

public abstract void setStartupParameters(JEANAPI api,
                                          NamedValue[] params)
application parameters with no user are set up during startup.