Class GenericBrowserSettings
- java.lang.Object
 - 
- com.microstrategy.web.app.GenericBrowserSettings
 
 
- 
- All Implemented Interfaces:
 BrowserSettings,EnumBrowserType
- Direct Known Subclasses:
 AbstractBrowserSettings,HttpBrowserSettings
public abstract class GenericBrowserSettings extends java.lang.Object implements BrowserSettings
This abstract class represents a generic implementation of the BrowserSettings interface.It provides with implementation of methods that can be used on other BrowserSettings child classes. Some of these methods are the ones that provide a cache system for the values (
addCacheValue(),getCacheValue(), etc); others for values related to the Query String and Form Data (buildBrowserSettingURLParameter(),getValueFromQueryString(), etc); and generic methods for finding out information about the client browser that made a request (isDHTMLSupported(),getBrowserType(), etc)As mentioned above, this implementation provides a cache system that can be used transparently by the classes that extend this implementation. It is assumed that the values saved under the main keys are with URL-like format, for example:
key1=subkey1=value1&subkey2=value2
This formatting is completely hidden if using the cache methods. If the cache does not exist then the updateCacheValue() method can be directly used and this one will create the cache and will provide the URL-like string required to be saved as the value of a cookie, a preference, or any other.- Since:
 - MicroStrategy Web 7.3.1 or earlier
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected ContainerServices_containerServicesInstance ofContainerServicesto be used for accessing the values of Form, Query String and cookiesprotected WebIServerSession_sessionInstance ofWebIServerSessionrelated with the BrowserSettings currently processedprotected static java.lang.StringGENERIC_HTTP_SESSION_KEYPrimary key to use for representing global temporal browser setting valuesprotected static java.lang.StringGENERIC_KEYPrimary key to use for representing global persistent browser setting valuesprotected static java.lang.StringGENERIC_PROJECT_KEY_PREFIXkey name prefix for project settings *- 
Fields inherited from interface com.microstrategy.web.objects.EnumBrowserType
BROWSER_TYPE_ANDROID, BROWSER_TYPE_CHROME, BROWSER_TYPE_EDGE, BROWSER_TYPE_FIREFOX, BROWSER_TYPE_FIREFOX_2, BROWSER_TYPE_FIREFOX_3, BROWSER_TYPE_FIREFOX_3_5, BROWSER_TYPE_IE, BROWSER_TYPE_IE_W3C, BROWSER_TYPE_IE10, BROWSER_TYPE_IE11, BROWSER_TYPE_IE6, BROWSER_TYPE_IE7, BROWSER_TYPE_IE8, BROWSER_TYPE_IE9, BROWSER_TYPE_NETSCAPE, BROWSER_TYPE_OTHER, BROWSER_TYPE_SAFARI, BROWSER_TYPE_UNKNOWN 
 - 
 
- 
Constructor Summary
Constructors Constructor Description GenericBrowserSettings()Class Constructor. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddCacheValue(java.lang.String key, java.lang.String value)Deprecated.it is only used by deprecated classes.protected voidaddCacheValue(java.lang.String key, java.lang.String value, boolean persistable)Deprecated.it is only used by deprecated classes.java.lang.StringgetBrowserCompatName()Returns the name of the IE browser including its status to indicate whether it is requesitng in Compatibility Mode.java.lang.StringgetBrowserName()Returns the name of the browser that is being used for performing the requestintgetBrowserType()Returns the type of the browser that is being used for performing the request being handled.intgetBrowserTypeAndVersion()Returns the type and the version of the browserjava.lang.StringgetBrowserVersion()Returns the numeric version of the browser that is being used.protected java.util.EnumerationgetCacheNames()Deprecated.it is only used by deprecated classes.protected java.lang.StringgetCacheValue(java.lang.String key)Deprecated.it is only used by deprecated classes.protected java.lang.StringgetCacheValue(java.lang.String key, java.lang.String subkey)Deprecated.it is only used by deprecated classes.MarkupOutputgetDebugOut()Get the Debug Information into the outputjava.lang.StringgetDefaultValue(java.lang.String key)Return the default value of a specific setting.BrowserSettingDefinitionListgetDefinitionList()Return the default definition of the browser setting which will be use to determine the value of the browser settings in case the setting requested is not found for the user.java.lang.StringgetLocale()Get the locale value saved as browser settingPreferencesgetPreferences()Get the Preferences instance currently assigned to this BrowserSettingsWebIServerSessiongetSession()Gets the session that is used as default when accessing session settings.java.lang.StringgetUserAgent()Retrives the USER-AGENT string from the header of the browser.protected java.lang.StringgetValueFromQueryString(java.lang.String keyName, java.lang.String subKeyName)Deprecated.it is only used by deprecated classes.booleanhasValueSet(java.lang.String keyName)Checks whether a value has been set for the given key name or notprotected booleanisCacheValueModified(java.lang.String key)Deprecated.it is only used by deprecated classes.protected booleanisCacheValuePersistable(java.lang.String key)Deprecated.it is only used by deprecated classes.booleanisCSS2Supported()Indicates if the browser currently used by the client can handle CSS 2 styles.booleanisDHTMLSupported()Indicates if the browser currently used by the client can handle DHTML content or not.booleanisEdgeModeEnabled()Get flag whether System Preference enables a tag to force IE browsers to render in highest Document Mode.protected booleanisValueCached(java.lang.String key)Deprecated.it is only used by deprecated classes.protected booleanisValueSafeForXSS(java.lang.String key, java.lang.String value)Check if the value is safe for XSS, which means check the value contains valid HTML tag or notprotected voidsetCacheValuePersistable(java.lang.String key, boolean persistable)Deprecated.it is only used by deprecated classes.voidsetDefinitionList(BrowserSettingDefinitionList bsDefinitionList)Sets the default definition of the browser setting.voidsetIframeVisibility(java.lang.String value)Define a browser setting for allowing the IFrame to be shown on DHTML environments.voidsetPreferences(Preferences preferences)Set the Preferences instance to use for this BrowserSettings instancevoidsetSession(WebIServerSession currentSession)Sets the session that will be used as default when accessing session settings.protected java.lang.StringupdateCacheValue(java.lang.String key, java.lang.String subkey, java.lang.String newValue)Deprecated.it is only used by deprecated classes.- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface com.microstrategy.web.app.BrowserSettings
clearHttpSessionValues, clearSessionBrowserSettings, clearSessionValues, clearSessionValues, flush, getHttpSessionValue, getSessionValue, getSessionValue, getValue, setHttpSessionValue, setSessionValue, setSessionValue, setValue 
 - 
 
 - 
 
- 
- 
Field Detail
- 
GENERIC_KEY
protected static final java.lang.String GENERIC_KEY
Primary key to use for representing global persistent browser setting values- See Also:
 - Constant Field Values
 
 
- 
GENERIC_HTTP_SESSION_KEY
protected static final java.lang.String GENERIC_HTTP_SESSION_KEY
Primary key to use for representing global temporal browser setting values- See Also:
 - Constant Field Values
 
 
- 
GENERIC_PROJECT_KEY_PREFIX
protected static final java.lang.String GENERIC_PROJECT_KEY_PREFIX
key name prefix for project settings *- Since:
 - MicroStrategy Web 8.0.2
 - See Also:
 - Constant Field Values
 
 
- 
_containerServices
protected ContainerServices _containerServices
Instance ofContainerServicesto be used for accessing the values of Form, Query String and cookies 
- 
_session
protected WebIServerSession _session
Instance ofWebIServerSessionrelated with the BrowserSettings currently processed 
 - 
 
- 
Method Detail
- 
setPreferences
public void setPreferences(Preferences preferences)
Set the Preferences instance to use for this BrowserSettings instance- Specified by:
 setPreferencesin interfaceBrowserSettings- Parameters:
 preferences- a validPreferencesinstance
 
- 
getPreferences
public Preferences getPreferences()
Get the Preferences instance currently assigned to this BrowserSettings- Specified by:
 getPreferencesin interfaceBrowserSettings- Returns:
 - a 
Preferencesinstance 
 
- 
setSession
public void setSession(WebIServerSession currentSession)
Sets the session that will be used as default when accessing session settings.- Specified by:
 setSessionin interfaceBrowserSettings- Parameters:
 currentSession- an initializedWebIServerSessioninstance that represents the current session opened.
 
- 
getSession
public WebIServerSession getSession()
Gets the session that is used as default when accessing session settings.- Specified by:
 getSessionin interfaceBrowserSettings- Returns:
 - currentSession an initialized 
WebIServerSessioninstance that represents the current session opened. 
 
- 
getBrowserType
public int getBrowserType()
Returns the type of the browser that is being used for performing the request being handled.- Specified by:
 getBrowserTypein interfaceBrowserSettings- Returns:
 - an 
intvalue depending on the type of browser used by the client:BROWSER_TYPE_NETSCAPEBROWSER_TYPE_IEBROWSER_TYPE_OTHER 
 
- 
getBrowserTypeAndVersion
public int getBrowserTypeAndVersion()
Returns the type and the version of the browser- Specified by:
 getBrowserTypeAndVersionin interfaceBrowserSettings- Returns:
 - an 
intvalue depending on the type of browser defined inBrowserSettings. - Since:
 - MicroStrategy Web 9.0.1
 
 
- 
getBrowserVersion
public java.lang.String getBrowserVersion()
Returns the numeric version of the browser that is being used. ie. 1.5, 6, 7- Specified by:
 getBrowserVersionin interfaceBrowserSettings- Since:
 - MicroStrategy Web 9.0.0
 
 
- 
isCSS2Supported
public boolean isCSS2Supported()
Indicates if the browser currently used by the client can handle CSS 2 styles.- Specified by:
 isCSS2Supportedin interfaceBrowserSettings- Returns:
 - a 
booleanvalue indicating if the client browser can display and handle CSS 2 styles. 
 
- 
getUserAgent
public java.lang.String getUserAgent()
Retrives the USER-AGENT string from the header of the browser.- Specified by:
 getUserAgentin interfaceBrowserSettings- Returns:
 - a 
Stringvalue indicating USER-AGENT string from the header of the browser - Since:
 - MicroStrategy Web 8.0.0
 
 
- 
isDHTMLSupported
public boolean isDHTMLSupported()
Indicates if the browser currently used by the client can handle DHTML content or not.- Specified by:
 isDHTMLSupportedin interfaceBrowserSettings- Returns:
 - a 
booleanvalue indicating if the client browser can display and handle DHTML code. 
 
- 
getLocale
public java.lang.String getLocale()
Get the locale value saved as browser setting- Specified by:
 getLocalein interfaceBrowserSettings- Returns:
 - the localeId available for this BrowserSettings instance.
 
 
- 
setDefinitionList
public void setDefinitionList(BrowserSettingDefinitionList bsDefinitionList)
Sets the default definition of the browser setting. This definition object will be use to determine the value of the browser settings in case the setting requested is not found for the user.- Specified by:
 setDefinitionListin interfaceBrowserSettings- Parameters:
 bsDefinitionList- the default definition of the browser settings
 
- 
getDefinitionList
public BrowserSettingDefinitionList getDefinitionList()
Description copied from interface:BrowserSettingsReturn the default definition of the browser setting which will be use to determine the value of the browser settings in case the setting requested is not found for the user.- Specified by:
 getDefinitionListin interfaceBrowserSettings- Returns:
 - the default definition of the browser setting. This definition object will be use to determine the value of the browser settings in case the setting requested is not found for the user.
 
 
- 
getDefaultValue
public java.lang.String getDefaultValue(java.lang.String key)
Return the default value of a specific setting. Returns an null if the definition of the setting was not found on the definition list.- Specified by:
 getDefaultValuein interfaceBrowserSettings- Parameters:
 key- the name of the browser setting.- Returns:
 - the default value of a specific setting
 
 
- 
hasValueSet
public boolean hasValueSet(java.lang.String keyName)
Description copied from interface:BrowserSettingsChecks whether a value has been set for the given key name or not- Specified by:
 hasValueSetin interfaceBrowserSettings- Parameters:
 keyName- the name associated with the setting- Returns:
 - true if there is a value been set already (other than the default)
 - Since:
 - MicroStrategy Web 9.0.0
 
 
- 
getCacheValue
protected java.lang.String getCacheValue(java.lang.String key, java.lang.String subkey)Deprecated.it is only used by deprecated classes.Obtains the value of the given key-subkey pair if stored on the cache.- Parameters:
 key- Key to search for in the cachesubkey- Subkey to search for in the cache contents- Returns:
 - The value associated with the key-subkey sent. If no value found, returns null.
 
 
- 
getCacheValue
protected java.lang.String getCacheValue(java.lang.String key)
Deprecated.it is only used by deprecated classes.Obtains the value of the given key if stored on the cache- Parameters:
 key- Key to search for in the cache- Returns:
 - The value associated with the key sent. If no value found, returns null.
 
 
- 
isCacheValuePersistable
protected boolean isCacheValuePersistable(java.lang.String key)
Deprecated.it is only used by deprecated classes.Determines if the cache value related with the key given is a persistable browser setting or not- Parameters:
 key- Key to search for in the cache- Returns:
 Trueif the cache value is related to a persistent browser setting. Otherwise (or if not found) returnsFalse
 
- 
setCacheValuePersistable
protected void setCacheValuePersistable(java.lang.String key, boolean persistable)Deprecated.it is only used by deprecated classes.Sets if the cache value related with the key given is a persistable browser setting or not. If the value is not found, nothing is done.- Parameters:
 key- Key to search for in the cachepersistable-Trueif the cache value will be related to a persistent browser setting. Otherwise,False
 
- 
isCacheValueModified
protected boolean isCacheValueModified(java.lang.String key)
Deprecated.it is only used by deprecated classes.Determines if the cache value has been modified since it was initially loaded.- Parameters:
 key- Key to search for in the cache- Returns:
 Trueif the value has been modified from its original value. Otherwise (or if value is not found) returnsFalse
 
- 
isValueCached
protected boolean isValueCached(java.lang.String key)
Deprecated.it is only used by deprecated classes.Determines if the key sent as parameter is already contained in the cache or not- Parameters:
 key- key to search for in the cache- Returns:
 Trueif the value is contained in the cache, otherwise returnsFalse
 
- 
getCacheNames
protected java.util.Enumeration getCacheNames()
Deprecated.it is only used by deprecated classes.Return an enumeration of all the keys used in the cache.- Returns:
 - an 
Enumerationwith all the key names saved in the cache 
 
- 
addCacheValue
protected void addCacheValue(java.lang.String key, java.lang.String value)Deprecated.it is only used by deprecated classes.Adds the indicated value under the given key on the cache. By default it will be considered that the browser setting related is temporal.- Parameters:
 key- Key to use for the value to storevalue- Value to save in the cache.
 
- 
addCacheValue
protected void addCacheValue(java.lang.String key, java.lang.String value, boolean persistable)Deprecated.it is only used by deprecated classes.Adds the indicated value under the given key on the cache.- Parameters:
 key- Key to use for the value to storevalue- Value to save in the cache.persistable- indicates if the browser setting is temporal or permanent
 
- 
isValueSafeForXSS
protected boolean isValueSafeForXSS(java.lang.String key, java.lang.String value)Check if the value is safe for XSS, which means check the value contains valid HTML tag or not- Parameters:
 key- Key to use for the valuevalue- Value to be checked- Returns:
 - If the value safe for XSS or not
 
 
- 
updateCacheValue
protected java.lang.String updateCacheValue(java.lang.String key, java.lang.String subkey, java.lang.String newValue)Deprecated.it is only used by deprecated classes.Update the value under the given key-subkey combination on the cache- Parameters:
 key- key to search for in the cachesubkey- subkey to search for in the cache valuenewValue- new value that the key-subkey combination will have- Returns:
 - the full String of the cache value saved under the key (includes all subkeys information)
 
 
- 
getValueFromQueryString
protected java.lang.String getValueFromQueryString(java.lang.String keyName, java.lang.String subKeyName)Deprecated.it is only used by deprecated classes.Based on the key and subkey given, search this value on the URL and on the Form Data- Parameters:
 keyName- key to look forsubKeyName- subkey to look for- Returns:
 - the value corresponding to the key-subkey pair sent. If no value is found,
 
nullis returned. 
 
- 
getDebugOut
public MarkupOutput getDebugOut()
Description copied from interface:BrowserSettingsGet the Debug Information into the output- Specified by:
 getDebugOutin interfaceBrowserSettings- Returns:
 - an instance of 
MarkupOutput. 
 
- 
setIframeVisibility
public void setIframeVisibility(java.lang.String value)
Define a browser setting for allowing the IFrame to be shown on DHTML environments. A request for hidding the IFrame has precedence over one for showing it.- Specified by:
 setIframeVisibilityin interfaceBrowserSettings- Parameters:
 value- String value of a boolean indicating if the IFrame should be shown.- Since:
 - MicroStrategy Web 8.0.0
 
 
- 
getBrowserName
public java.lang.String getBrowserName()
Description copied from interface:BrowserSettingsReturns the name of the browser that is being used for performing the request- Specified by:
 getBrowserNamein interfaceBrowserSettings- Returns:
 - a value depending on the type and version of browser used by the client. supported browser names: ie7, ie8, ie9, ie10, firefox, chrome, safari; otherwise: unsupported-browser.
 
 
- 
getBrowserCompatName
public java.lang.String getBrowserCompatName()
Description copied from interface:BrowserSettingsReturns the name of the IE browser including its status to indicate whether it is requesitng in Compatibility Mode.- Specified by:
 getBrowserCompatNamein interfaceBrowserSettings- Returns:
 - a value depending on the type and version of browser used by the client. supported browser compat names: ie8c, ie9c, ie10c otherwise: ""
 
 
- 
isEdgeModeEnabled
public boolean isEdgeModeEnabled()
Get flag whether System Preference enables a tag to force IE browsers to render in highest Document Mode.- Specified by:
 isEdgeModeEnabledin interfaceBrowserSettings- Returns:
 - boolean
 
 
 - 
 
 -