Class SettingsBean

All Implemented Interfaces:
BusinessObject, BusinessProcessor, Settings, Serializable

public class SettingsBean extends BaseBusinessProcessor implements Settings, Serializable
Represents various settings used by the application. Settings for the application are stored in the sscSetting database table. The various settings represent everything from the default colors and fonts used by the display templates, to the names of the Java classes that implement various business object interfaces for the application.

An instance of SettingsBean is created in the Struts layer. It is initialized there through initialize(), which populates the map property with the results of a query on the sscSetting table. For each setting, an entry in the map is created with the setting code used as the key and its value as the key's value.

The SettingsBean instance created in the Struts layer is passed throughout the application to look up needed settings. The application's BusinessObjectFactory initializes each business object with the SettingsBean immediately after it creates it.

Author:
David Tobey
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • log

      static org.apache.commons.logging.Log log
    • map

      private Map map
      See Also:
  • Constructor Details

    • SettingsBean

      public SettingsBean()
  • Method Details

    • getMap

      public Map getMap()
      Description copied from interface: Settings
      Retrieves the map of settings values for this Settings instance. The keys of this Map correspond to the code field of the sscSetting database table. The values correspond to value field (integerValue, smallValue, mediumValue, or textValue) that corresponds with the value of the valueType field.
      Specified by:
      getMap in interface Settings
      Returns:
      The Map of settings keys and values for this Settings instance.
    • setMap

      public void setMap(Map map)
      Description copied from interface: Settings
      Sets the map of settings values for this Settings instance.
      Specified by:
      setMap in interface Settings
    • setValue

      public void setValue(String key, String value)
      Description copied from interface: Settings
      Sets the value of a given key in this Settings' map.
      Specified by:
      setValue in interface Settings
      Parameters:
      key - The key whose value is being set
      value - The value.
    • getValue

      public String getValue(String key)
      Description copied from interface: Settings
      Gets the value of a given key in this Settings' map.
      Specified by:
      getValue in interface Settings
      Parameters:
      key - The key whose value is to be retrieved.
      Returns:
      The value of the setting.
    • initialize

      public void initialize() throws Exception
      Description copied from interface: Settings
      Initializes this Settings instance. Populates the map property with the results of a query on the sscSetting database table.
      Specified by:
      initialize in interface Settings
      Throws:
      Exception
    • copyAndAlter

      public Settings copyAndAlter(String name, String value) throws Exception
      Description copied from interface: Settings
      Returns a new Settings object that is a copy of this one, but with a given element altered. The incoming name and value represent the element that is to altered and the new value for it. This is useful in custom code if in an isolated area different settings are needed to perform some custom action.
      Specified by:
      copyAndAlter in interface Settings
      Returns:
      A new Settings object with the new setting value applied to it.
      Throws:
      Exception
    • copyAndAlter

      public Settings copyAndAlter(Map settingsToAlter) throws Exception
      Description copied from interface: Settings
      Returns a new Settings object that is a copy of this one, but with certain values altered, as represented in the incoming Map.
      Specified by:
      copyAndAlter in interface Settings
      Parameters:
      settingsToAlter - A Map of new settings to apply to the new object.
      Returns:
      A new Settings object with the new setting value applied to it.
      Throws:
      Exception
    • processSettings

      public Settings processSettings(Map parameters) throws Exception
      Specified by:
      processSettings in interface Settings
      Throws:
      Exception
    • loadSettings

      public Collection loadSettings() throws Exception
      Specified by:
      loadSettings in interface Settings
      Throws:
      Exception
    • loadSettingsByType

      public Map loadSettingsByType(String settingType) throws Exception
      Specified by:
      loadSettingsByType in interface Settings
      Throws:
      Exception
    • loadSettingsAndCount

      public Map loadSettingsAndCount(Map parameters) throws Exception
      Specified by:
      loadSettingsAndCount in interface Settings
      Throws:
      Exception
    • addSetting

      public Map addSetting(Map parameters) throws Exception
      Specified by:
      addSetting in interface Settings
      Throws:
      Exception
    • loadSettingFromID

      public Setting loadSettingFromID(Map parameters) throws Exception
      Specified by:
      loadSettingFromID in interface Settings
      Throws:
      Exception
    • editSetting

      public Map editSetting(Map parameters) throws Exception
      Specified by:
      editSetting in interface Settings
      Throws:
      Exception
    • postChangingSettingEvent

      public Map postChangingSettingEvent(Setting setting, Map parameters) throws Exception
      Specified by:
      postChangingSettingEvent in interface Settings
      Throws:
      Exception
    • deleteSetting

      public void deleteSetting(Map parameters) throws Exception
      Specified by:
      deleteSetting in interface Settings
      Throws:
      Exception
    • editDeleteUserSettings

      public Map editDeleteUserSettings(Map parameters) throws Exception
      Specified by:
      editDeleteUserSettings in interface Settings
      Throws:
      Exception
    • overrideSettings

      public void overrideSettings(Settings s) throws Exception
      Throws:
      Exception
    • overrideSettings

      public void overrideSettings() throws Exception
      Throws:
      Exception
    • overrideSettings

      public void overrideSettings(Map map) throws Exception
      Throws:
      Exception