public abstract class

GenericBrowserSettings

extends Object
implements BrowserSettings
java.lang.Object
   ↳ com.microstrategy.web.app.GenericBrowserSettings
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

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.

Summary

Constants
String GENERIC_HTTP_SESSION_KEY Primary key to use for representing global temporal browser setting values
String GENERIC_KEY Primary key to use for representing global persistent browser setting values
String GENERIC_PROJECT_KEY_PREFIX key name prefix for project settings *
[Expand]
Inherited Constants
From interface com.microstrategy.web.objects.EnumBrowserType
Fields
protected ContainerServices _containerServices Instance of ContainerServices to be used for accessing the values of Form, Query String and cookies
protected WebIServerSession _session Instance of WebIServerSession related with the BrowserSettings currently processed
Public Constructors
GenericBrowserSettings()
Class Constructor.
Public Methods
String getBrowserCompatName()
Returns the name of the IE browser including its status to indicate whether it is requesitng in Compatibility Mode.
String getBrowserName()
Returns the name of the browser that is being used for performing the request
int getBrowserType()
Returns the type of the browser that is being used for performing the request being handled.
int getBrowserTypeAndVersion()
Returns the type and the version of the browser
String getBrowserVersion()
Returns the numeric version of the browser that is being used.
MarkupOutput getDebugOut()
Get the Debug Information into the output
String getDefaultValue(String key)
Return the default value of a specific setting.
BrowserSettingDefinitionList getDefinitionList()
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.
String getLocale()
Get the locale value saved as browser setting
Preferences getPreferences()
Get the Preferences instance currently assigned to this BrowserSettings
WebIServerSession getSession()
Gets the session that is used as default when accessing session settings.
String getUserAgent()
Retrives the USER-AGENT string from the header of the browser.
boolean hasValueSet(String keyName)
Checks whether a value has been set for the given key name or not
boolean isCSS2Supported()
Indicates if the browser currently used by the client can handle CSS 2 styles.
boolean isDHTMLSupported()
Indicates if the browser currently used by the client can handle DHTML content or not.
boolean isEdgeModeEnabled()
Get flag whether System Preference enables a tag to force IE browsers to render in highest Document Mode.
void setDefinitionList(BrowserSettingDefinitionList bsDefinitionList)
Sets the default definition of the browser setting.
void setIframeVisibility(String value)
Define a browser setting for allowing the IFrame to be shown on DHTML environments.
void setPreferences(Preferences preferences)
Set the Preferences instance to use for this BrowserSettings instance
void setSession(WebIServerSession currentSession)
Sets the session that will be used as default when accessing session settings.
Protected Methods
void addCacheValue(String key, String value)
This method is deprecated. it is only used by deprecated classes.
void addCacheValue(String key, String value, boolean persistable)
This method is deprecated. it is only used by deprecated classes.
Enumeration getCacheNames()
This method is deprecated. it is only used by deprecated classes.
String getCacheValue(String key, String subkey)
This method is deprecated. it is only used by deprecated classes.
String getCacheValue(String key)
This method is deprecated. it is only used by deprecated classes.
String getValueFromQueryString(String keyName, String subKeyName)
This method is deprecated. it is only used by deprecated classes.
boolean isCacheValueModified(String key)
This method is deprecated. it is only used by deprecated classes.
boolean isCacheValuePersistable(String key)
This method is deprecated. it is only used by deprecated classes.
boolean isValueCached(String key)
This method is deprecated. it is only used by deprecated classes.
boolean isValueSafeForXSS(String key, String value)
Check if the value is safe for XSS, which means check the value contains valid HTML tag or not
void setCacheValuePersistable(String key, boolean persistable)
This method is deprecated. it is only used by deprecated classes.
String updateCacheValue(String key, String subkey, String newValue)
This method is deprecated. it is only used by deprecated classes.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.microstrategy.web.app.BrowserSettings

Constants

protected static final String GENERIC_HTTP_SESSION_KEY

Primary key to use for representing global temporal browser setting values

Constant Value: "bSetTemp"

protected static final String GENERIC_KEY

Primary key to use for representing global persistent browser setting values

Constant Value: "bSet"

protected static final String GENERIC_PROJECT_KEY_PREFIX

key name prefix for project settings *

Constant Value: "bProj_"

Fields

protected ContainerServices _containerServices

Instance of ContainerServices to be used for accessing the values of Form, Query String and cookies

protected WebIServerSession _session

Instance of WebIServerSession related with the BrowserSettings currently processed

Public Constructors

public GenericBrowserSettings ()

Class Constructor. Initializes an empty instance of the class.

Public Methods

public String getBrowserCompatName ()

Returns the name of the IE browser including its status to indicate whether it is requesitng in Compatibility Mode.

Returns
  • a value depending on the type and version of browser used by the client. supported browser compat names: ie8c, ie9c, ie10c otherwise: ""

public String getBrowserName ()

Returns the name of the browser that is being used for performing the request

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.

public int getBrowserType ()

Returns the type of the browser that is being used for performing the request being handled.

Returns
  • an int value depending on the type of browser used by the client:
  • BROWSER_TYPE_NETSCAPE
  • BROWSER_TYPE_IE
  • BROWSER_TYPE_OTHER

public int getBrowserTypeAndVersion ()

Returns the type and the version of the browser

Returns

public String getBrowserVersion ()

Returns the numeric version of the browser that is being used. ie. 1.5, 6, 7

public MarkupOutput getDebugOut ()

Get the Debug Information into the output

Returns

public String getDefaultValue (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.

Parameters
key the name of the browser setting.
Returns
  • the default value of a specific setting

public BrowserSettingDefinitionList getDefinitionList ()

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.

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.

public String getLocale ()

Get the locale value saved as browser setting

Returns
  • the localeId available for this BrowserSettings instance.

public Preferences getPreferences ()

Get the Preferences instance currently assigned to this BrowserSettings

Returns

public WebIServerSession getSession ()

Gets the session that is used as default when accessing session settings.

Returns
  • currentSession an initialized WebIServerSession instance that represents the current session opened.

public String getUserAgent ()

Retrives the USER-AGENT string from the header of the browser.

Returns
  • a String value indicating USER-AGENT string from the header of the browser

public boolean hasValueSet (String keyName)

Checks whether a value has been set for the given key name or not

Parameters
keyName the name associated with the setting
Returns
  • true if there is a value been set already (other than the default)

public boolean isCSS2Supported ()

Indicates if the browser currently used by the client can handle CSS 2 styles.

Returns
  • a boolean value indicating if the client browser can display and handle CSS 2 styles.

public boolean isDHTMLSupported ()

Indicates if the browser currently used by the client can handle DHTML content or not.

Returns
  • a boolean value indicating if the client browser can display and handle DHTML code.

public boolean isEdgeModeEnabled ()

Get flag whether System Preference enables a tag to force IE browsers to render in highest Document Mode.

Returns
  • boolean

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.

Parameters
bsDefinitionList the default definition of the browser settings

public void setIframeVisibility (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.

Parameters
value String value of a boolean indicating if the IFrame should be shown.

public void setPreferences (Preferences preferences)

Set the Preferences instance to use for this BrowserSettings instance

Parameters
preferences a valid Preferences instance

public void setSession (WebIServerSession currentSession)

Sets the session that will be used as default when accessing session settings.

Parameters
currentSession an initialized WebIServerSession instance that represents the current session opened.

Protected Methods

protected void addCacheValue (String key, String value)

This method is 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 store
value Value to save in the cache.

protected void addCacheValue (String key, String value, boolean persistable)

This method is 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 store
value Value to save in the cache.
persistable indicates if the browser setting is temporal or permanent

protected Enumeration getCacheNames ()

This method is deprecated.
it is only used by deprecated classes.

Return an enumeration of all the keys used in the cache.

Returns
  • an Enumeration with all the key names saved in the cache

protected String getCacheValue (String key, String subkey)

This method is 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 cache
subkey Subkey to search for in the cache contents
Returns
  • The value associated with the key-subkey sent. If no value found, returns null.

protected String getCacheValue (String key)

This method is 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.

protected String getValueFromQueryString (String keyName, String subKeyName)

This method is 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 for
subKeyName subkey to look for
Returns
  • the value corresponding to the key-subkey pair sent. If no value is found, null is returned.

protected boolean isCacheValueModified (String key)

This method is 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
  • True if the value has been modified from its original value. Otherwise (or if value is not found) returns False

protected boolean isCacheValuePersistable (String key)

This method is 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
  • True if the cache value is related to a persistent browser setting. Otherwise (or if not found) returns False

protected boolean isValueCached (String key)

This method is 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
  • True if the value is contained in the cache, otherwise returns False

protected boolean isValueSafeForXSS (String key, 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 value
value Value to be checked
Returns
  • If the value safe for XSS or not

protected void setCacheValuePersistable (String key, boolean persistable)

This method is 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 cache
persistable True if the cache value will be related to a persistent browser setting. Otherwise, False

protected String updateCacheValue (String key, String subkey, String newValue)

This method is 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 cache
subkey subkey to search for in the cache value
newValue 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)