org.jaffa.config
Class Config

java.lang.Object
  extended byorg.jaffa.config.Config

public class Config
extends Object

This class manages all the access to the frameworks configuration data In addition it is used for all text string translation. This configuration object manages both static (read from a resource) and dynamic (set by initilization params). Each configuration paramerter will have a static name associated with it. Only the parameters flagged as dynamic will be accepted by the setProperty() method. By default the getters will return Ojects, but any property read from the resource will be returned as string. The dynapic properties will return the same object that was passed into it. NOTE: This has been modified to use the resource bundle libraries from Jakarta/Struts NOTE: Changed Back to use normal resource bundles as Struts doesnt seem to work under J2EE

Version:
1.0
Author:
PaulE

Field Summary
static String PROP_APPLICATION_RESOURCES_DEFAULT_LOCATION
          Dynamic, Returns java.lang.String : The physical path of where the ApplicationResources.default is.
static String PROP_APPLICATION_RESOURCES_LOCATION
          Dynamic, Returns java.lang.String : The physical path of where the ApplicationResources.properties is.
static String PROP_APPLICATION_RESOURCES_OVERRIDE_LOCATION
          Dynamic, Returns java.lang.String : The physical path of where the ApplicationResources.override is.
static String PROP_COMPONENTS_FILE
          Static : Location in the Web Application Tree of the Components.xml file
static String PROP_DEFAULT_GRID_SETTINGS_URI
          Static : The URL location of the User based user grid settings file
static String PROP_DOMAIN_FIELD_VIEWER_COMPONENT_MAPPING_FILE
          Static : The TextTag uses this properties file to determine if a hyperlink to a Viewer component should be generated for a field.
static String PROP_FINDER_MAX_RECORDS_DROP_DOWN_OPTIONS
          Static : The values to be displayed in the 'MaxRecords' dropdown of the Finder/Lookup criteria screens.
static String PROP_JDBC_ENGINE_INIT
          Static : The configuration file to be used when the JDBCEngine provider is used
static String PROP_KEY_FIELD_PER_VIEWER_COMPONENT_FILE
          Static : The TextTag uses this properties file to determine the key-field of a Viewer component for which it has generated a hyperlink.
static String PROP_LOG4J_CONFIG
          Static : Log4j Configuration To Use.
static String PROP_MENULIST_URL
          Static : The URL location of the Menu list file
static String PROP_MESSAGE_RESOURCES_BUNDLE
          Static : The Jaffa exceptions typically contain error codes.
static String PROP_PRESENTATION_COMPONENT_GARBAGE_COLLECTION_FREQUENCY_IN_MINUTES
          Static : The frequency at which the Component Garbage Collector is run.
static String PROP_PRESENTATION_COMPONENT_GARBAGE_COLLECTION_TIME_OUT_IN_MINUTES
          Static : This value is used to determine when a component is idle and should be garbage collected.
static String PROP_PRESENTATION_DEFAULT_GUARDED_HTML_LOCATION
          Static : The default html fragment used for guarded-buttons
static String PROP_RULES_ENGINE_CORE_RULES_URL
          Static : This property holds the url for the core-rules file used by the Dynamic Rules Engine.
static String PROP_RULES_ENGINE_VALIDATORS_URL_LIST
          Static : This property holds the comma-separated list of the various validator.xml urls used by the Dynamic Rules Engine.
static String PROP_RULES_ENGINE_VARIATIONS_DIR
          Static : This value is used to determine the directory in which the variations to the core-rules of the Dynamic-Rules-Engine are located.
static String PROP_SECURITY_POLICY_URL
          Static : The URL location of the Role based security policy file
static String PROP_SECURITY_PORTLET_INVALIDATE_SESSION_BEFORE_REDIRECTING_TO_FINAL_URL
          Static : The invalidate or not to invalidate a Session, when redirecting to the FinalUrl
static String PROP_TIER
          Static : The no. of tiers being used
static String PROP_USER_GRID_SETTINGS_URI
          Static : The URL location of the User based user grid settings file
static String PROP_WEB_SERVER_ROOT
          Dynamic, Returns java.lang.String : The physical path of where the web route is.
static String PROP_WEB_SERVER_ROOT_FILE
          Static : This the the name of a file in the web servers route directory.
 
Constructor Summary
Config()
           
 
Method Summary
static Object getProperty(String key)
          Returns the value of a property.
static Object getProperty(String key, Object defValue)
          Get a property, can be dynamic or static.
static void setProperty(String key, Object value)
          Set Property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_WEB_SERVER_ROOT

public static final String PROP_WEB_SERVER_ROOT
Dynamic, Returns java.lang.String : The physical path of where the web route is. Set in the initialization servlet. Example "C:\tomcat\webapps\Tools"

See Also:
Constant Field Values

PROP_APPLICATION_RESOURCES_LOCATION

public static final String PROP_APPLICATION_RESOURCES_LOCATION
Dynamic, Returns java.lang.String : The physical path of where the ApplicationResources.properties is. Set in the initialization servlet. Example "C:\tomcat\webapps\Tools\WEB-INF\classes\ApplicationResources.properties"

See Also:
Constant Field Values

PROP_APPLICATION_RESOURCES_DEFAULT_LOCATION

public static final String PROP_APPLICATION_RESOURCES_DEFAULT_LOCATION
Dynamic, Returns java.lang.String : The physical path of where the ApplicationResources.default is. Set in the initialization servlet. Example "C:\tomcat\webapps\Tools\WEB-INF\classes\ApplicationResources.default"

See Also:
Constant Field Values

PROP_APPLICATION_RESOURCES_OVERRIDE_LOCATION

public static final String PROP_APPLICATION_RESOURCES_OVERRIDE_LOCATION
Dynamic, Returns java.lang.String : The physical path of where the ApplicationResources.override is. Set in the initialization servlet. Example "C:\ApplicationResources.override"

See Also:
Constant Field Values

PROP_WEB_SERVER_ROOT_FILE

public static final String PROP_WEB_SERVER_ROOT_FILE
Static : This the the name of a file in the web servers route directory. It is used to get the WEB_SERVER_ROOT. '/index.html' is often a good value to use

See Also:
Constant Field Values

PROP_LOG4J_CONFIG

public static final String PROP_LOG4J_CONFIG
Static : Log4j Configuration To Use. 'none', 'default' or specified xml config file

See Also:
Constant Field Values

PROP_COMPONENTS_FILE

public static final String PROP_COMPONENTS_FILE
Static : Location in the Web Application Tree of the Components.xml file

See Also:
Constant Field Values

PROP_JDBC_ENGINE_INIT

public static final String PROP_JDBC_ENGINE_INIT
Static : The configuration file to be used when the JDBCEngine provider is used

See Also:
Constant Field Values

PROP_TIER

public static final String PROP_TIER
Static : The no. of tiers being used

See Also:
Constant Field Values

PROP_PRESENTATION_DEFAULT_GUARDED_HTML_LOCATION

public static final String PROP_PRESENTATION_DEFAULT_GUARDED_HTML_LOCATION
Static : The default html fragment used for guarded-buttons

See Also:
Constant Field Values

PROP_SECURITY_PORTLET_INVALIDATE_SESSION_BEFORE_REDIRECTING_TO_FINAL_URL

public static final String PROP_SECURITY_PORTLET_INVALIDATE_SESSION_BEFORE_REDIRECTING_TO_FINAL_URL
Static : The invalidate or not to invalidate a Session, when redirecting to the FinalUrl

See Also:
Constant Field Values

PROP_SECURITY_POLICY_URL

public static final String PROP_SECURITY_POLICY_URL
Static : The URL location of the Role based security policy file

See Also:
Constant Field Values

PROP_USER_GRID_SETTINGS_URI

public static final String PROP_USER_GRID_SETTINGS_URI
Static : The URL location of the User based user grid settings file

See Also:
Constant Field Values

PROP_DEFAULT_GRID_SETTINGS_URI

public static final String PROP_DEFAULT_GRID_SETTINGS_URI
Static : The URL location of the User based user grid settings file

See Also:
Constant Field Values

PROP_MENULIST_URL

public static final String PROP_MENULIST_URL
Static : The URL location of the Menu list file

See Also:
Constant Field Values

PROP_PRESENTATION_COMPONENT_GARBAGE_COLLECTION_FREQUENCY_IN_MINUTES

public static final String PROP_PRESENTATION_COMPONENT_GARBAGE_COLLECTION_FREQUENCY_IN_MINUTES
Static : The frequency at which the Component Garbage Collector is run.

See Also:
Constant Field Values

PROP_PRESENTATION_COMPONENT_GARBAGE_COLLECTION_TIME_OUT_IN_MINUTES

public static final String PROP_PRESENTATION_COMPONENT_GARBAGE_COLLECTION_TIME_OUT_IN_MINUTES
Static : This value is used to determine when a component is idle and should be garbage collected.

See Also:
Constant Field Values

PROP_RULES_ENGINE_CORE_RULES_URL

public static final String PROP_RULES_ENGINE_CORE_RULES_URL
Static : This property holds the url for the core-rules file used by the Dynamic Rules Engine.

See Also:
Constant Field Values

PROP_RULES_ENGINE_VARIATIONS_DIR

public static final String PROP_RULES_ENGINE_VARIATIONS_DIR
Static : This value is used to determine the directory in which the variations to the core-rules of the Dynamic-Rules-Engine are located.

See Also:
Constant Field Values

PROP_RULES_ENGINE_VALIDATORS_URL_LIST

public static final String PROP_RULES_ENGINE_VALIDATORS_URL_LIST
Static : This property holds the comma-separated list of the various validator.xml urls used by the Dynamic Rules Engine.

See Also:
Constant Field Values

PROP_FINDER_MAX_RECORDS_DROP_DOWN_OPTIONS

public static final String PROP_FINDER_MAX_RECORDS_DROP_DOWN_OPTIONS
Static : The values to be displayed in the 'MaxRecords' dropdown of the Finder/Lookup criteria screens.

See Also:
Constant Field Values

PROP_DOMAIN_FIELD_VIEWER_COMPONENT_MAPPING_FILE

public static final String PROP_DOMAIN_FIELD_VIEWER_COMPONENT_MAPPING_FILE
Static : The TextTag uses this properties file to determine if a hyperlink to a Viewer component should be generated for a field.

See Also:
Constant Field Values

PROP_KEY_FIELD_PER_VIEWER_COMPONENT_FILE

public static final String PROP_KEY_FIELD_PER_VIEWER_COMPONENT_FILE
Static : The TextTag uses this properties file to determine the key-field of a Viewer component for which it has generated a hyperlink.

See Also:
Constant Field Values

PROP_MESSAGE_RESOURCES_BUNDLE

public static final String PROP_MESSAGE_RESOURCES_BUNDLE
Static : The Jaffa exceptions typically contain error codes. Invoking the getLocalizedMessage() on a Jaffa exception will return an appropriate message by looking up the error-code in the specified ResourceBundle. No error is raised in case an invalid ResourceBundle is specified, or if no entry exists for the error-code. The ResourceBundle should refer to a properties file in the classpath. Eg. org/jaffa/resources/ApplicationResources

See Also:
Constant Field Values
Constructor Detail

Config

public Config()
Method Detail

setProperty

public static void setProperty(String key,
                               Object value)
Set Property. This is only valid on properties classifed as 'dynamic' If an invalid property is set, an logging error is raised, and the set opertaion is ignored. Each time a new dynamic property is added, this method must be updated to accept it.

Parameters:
key - the property name.
value - the property value.

getProperty

public static Object getProperty(String key)
                          throws MissingResourceException
Returns the value of a property.

Parameters:
key - the name of the property.
Returns:
the value of a property.
Throws:
MissingResourceException - if the property is not found

getProperty

public static Object getProperty(String key,
                                 Object defValue)
Get a property, can be dynamic or static. Allows for a default value to be returned if the property is not found, or if the property has an empty/null value.

Parameters:
key - the name of the property.
defValue - this value will be returned in case the property has a null value.
Returns:
Either a string (for a static property) or the appropriate object (for a dynamic one)


Copyright © 2002-2004 JAFFA Project.