Class SettingsBean
java.lang.Object
com.softslate.commerce.businessobjects.core.BaseBusinessObject
com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
com.softslate.commerce.businessobjects.core.SettingsBean
- All Implemented Interfaces:
BusinessObject
,BusinessProcessor
,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 Summary
FieldsModifier and TypeFieldDescription(package private) static org.apache.commons.logging.Log
private Map
private static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddSetting
(Map parameters) copyAndAlter
(String name, String value) Returns a new Settings object that is a copy of this one, but with a given element altered.copyAndAlter
(Map settingsToAlter) Returns a new Settings object that is a copy of this one, but with certain values altered, as represented in the incoming Map.void
deleteSetting
(Map parameters) editDeleteUserSettings
(Map parameters) editSetting
(Map parameters) getMap()
Retrieves the map of settings values for thisSettings
instance.Gets the value of a given key in thisSettings
'map
.void
Initializes thisSettings
instance.loadSettingFromID
(Map parameters) loadSettingsAndCount
(Map parameters) loadSettingsByType
(String settingType) void
void
void
overrideSettings
(Map map) postChangingSettingEvent
(Setting setting, Map parameters) processSettings
(Map parameters) void
Sets the map of settings values for thisSettings
instance.void
Sets the value of a given key in thisSettings
'map
.Methods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
formatDateTime, formatPrice, getAppComponents, getAppSettings, getAttributeIDs, getBusinessObjectFactory, getDaoFactory, getEventBus, getInjector, getProductIDs, getSettings, getUser, initialize, isProcessorClassActive, loadMatchingSkus, parseDateTime, parseResponseData, prepareRequestData, sendHTTPGet, sendHTTPPost, sendHTTPPost, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setEventBus, setInjector, setSettings, setUser, updateOrderTotals, updateOrderTotals, updateOrderTotals, utils
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initialize
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
log
static org.apache.commons.logging.Log log -
map
- See Also:
-
-
Constructor Details
-
SettingsBean
public SettingsBean()
-
-
Method Details
-
getMap
Description copied from interface:Settings
Retrieves the map of settings values for thisSettings
instance. The keys of thisMap
correspond to thecode
field of thesscSetting
database table. The values correspond to value field (integerValue
,smallValue
,mediumValue
, ortextValue
) that corresponds with the value of thevalueType
field. -
setMap
Description copied from interface:Settings
Sets the map of settings values for thisSettings
instance. -
setValue
Description copied from interface:Settings
Sets the value of a given key in thisSettings
'map
. -
getValue
Description copied from interface:Settings
Gets the value of a given key in thisSettings
'map
. -
initialize
Description copied from interface:Settings
Initializes thisSettings
instance. Populates themap
property with the results of a query on thesscSetting
database table.- Specified by:
initialize
in interfaceSettings
- Throws:
Exception
-
copyAndAlter
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 interfaceSettings
- Returns:
- A new Settings object with the new setting value applied to it.
- Throws:
Exception
-
copyAndAlter
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 interfaceSettings
- 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
- Specified by:
processSettings
in interfaceSettings
- Throws:
Exception
-
loadSettings
- Specified by:
loadSettings
in interfaceSettings
- Throws:
Exception
-
loadSettingsByType
- Specified by:
loadSettingsByType
in interfaceSettings
- Throws:
Exception
-
loadSettingsAndCount
- Specified by:
loadSettingsAndCount
in interfaceSettings
- Throws:
Exception
-
addSetting
- Specified by:
addSetting
in interfaceSettings
- Throws:
Exception
-
loadSettingFromID
- Specified by:
loadSettingFromID
in interfaceSettings
- Throws:
Exception
-
editSetting
- Specified by:
editSetting
in interfaceSettings
- Throws:
Exception
-
postChangingSettingEvent
- Specified by:
postChangingSettingEvent
in interfaceSettings
- Throws:
Exception
-
deleteSetting
- Specified by:
deleteSetting
in interfaceSettings
- Throws:
Exception
-
editDeleteUserSettings
- Specified by:
editDeleteUserSettings
in interfaceSettings
- Throws:
Exception
-
overrideSettings
- Throws:
Exception
-
overrideSettings
- Throws:
Exception
-
overrideSettings
- Throws:
Exception
-