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.Logprivate Mapprivate 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.voiddeleteSetting(Map parameters) editDeleteUserSettings(Map parameters) editSetting(Map parameters) getMap()Retrieves the map of settings values for thisSettingsinstance.Gets the value of a given key in thisSettings'map.voidInitializes thisSettingsinstance.loadSettingFromID(Map parameters) loadSettingsAndCount(Map parameters) loadSettingsByType(String settingType) voidvoidvoidoverrideSettings(Map map) postChangingSettingEvent(Setting setting, Map parameters) processSettings(Map parameters) voidSets the map of settings values for thisSettingsinstance.voidSets 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, utilsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:SettingsRetrieves the map of settings values for thisSettingsinstance. The keys of thisMapcorrespond to thecodefield of thesscSettingdatabase table. The values correspond to value field (integerValue,smallValue,mediumValue, ortextValue) that corresponds with the value of thevalueTypefield. -
setMap
Description copied from interface:SettingsSets the map of settings values for thisSettingsinstance. -
setValue
Description copied from interface:SettingsSets the value of a given key in thisSettings'map. -
getValue
Description copied from interface:SettingsGets the value of a given key in thisSettings'map. -
initialize
Description copied from interface:SettingsInitializes thisSettingsinstance. Populates themapproperty with the results of a query on thesscSettingdatabase table.- Specified by:
initializein interfaceSettings- Throws:
Exception
-
copyAndAlter
Description copied from interface:SettingsReturns 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:
copyAndAlterin interfaceSettings- Returns:
- A new Settings object with the new setting value applied to it.
- Throws:
Exception
-
copyAndAlter
Description copied from interface:SettingsReturns a new Settings object that is a copy of this one, but with certain values altered, as represented in the incoming Map.- Specified by:
copyAndAlterin 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:
processSettingsin interfaceSettings- Throws:
Exception
-
loadSettings
- Specified by:
loadSettingsin interfaceSettings- Throws:
Exception
-
loadSettingsByType
- Specified by:
loadSettingsByTypein interfaceSettings- Throws:
Exception
-
loadSettingsAndCount
- Specified by:
loadSettingsAndCountin interfaceSettings- Throws:
Exception
-
addSetting
- Specified by:
addSettingin interfaceSettings- Throws:
Exception
-
loadSettingFromID
- Specified by:
loadSettingFromIDin interfaceSettings- Throws:
Exception
-
editSetting
- Specified by:
editSettingin interfaceSettings- Throws:
Exception
-
postChangingSettingEvent
- Specified by:
postChangingSettingEventin interfaceSettings- Throws:
Exception
-
deleteSetting
- Specified by:
deleteSettingin interfaceSettings- Throws:
Exception
-
editDeleteUserSettings
- Specified by:
editDeleteUserSettingsin interfaceSettings- Throws:
Exception
-
overrideSettings
- Throws:
Exception
-
overrideSettings
- Throws:
Exception
-
overrideSettings
- Throws:
Exception
-