public interface

PreferencesBean

implements AppComponent RequestPersistable
com.microstrategy.web.app.beans.PreferencesBean
Known Indirect Subclasses

Class Overview

The PreferencesBean is an application level bean that allows end users to set their preferences values. Preferences allows users to customize the application to their own settings.
Preferences are managed by the Preferences class, which is an application level object shared through the appContext class. The PreferencesBean is responsible to present the end-user graphical interface and to handle the events of updating the Preferences values.
Graphically, preferences are grouped based on the level and their usage. Usually for the level, we would have user and administrator preferences. User preferences apply only to the current user and project; administrator preferences are only available to administrator and are applied to all users. On the usage we have groups like General, Grid display, Graph display, etc. We have groups that only apply at the user level, such as History List; we also have groups that only apply at the admin level, such as Login.
The PreferencesBean extends the AppComponent (the base for all Application beans). It provides an initFromXml() method which receives a Node and creates the internal structures for groups and group-sets.
It provides methods to retrieve/set the current group/group-set based on its name.
It has an EventHandler, this event handler is the one responsible to receive the request, update the Preferences or set the current group/group-set from it.
Each group will define the transform it should use to render the preferences. The generateOutput() method (inherited from WebComponent) will check which is the current group, and will call its transform to generate the MarkupOutput.
The class also provides a method to return a MarkupOutput to use to render the groups list.
It implements Persistable. We would use this to save the state of the bean. On the state the current group and group-set are saved.

Summary

Nested Classes
interface PreferencesBean.GroupInfo  
Constants
String KEEP_TEMP_PREFERENCE
String SAVE_TEMP_PREFERENCE
[Expand]
Inherited Constants
From interface com.microstrategy.utils.serialization.EnumWebPersistableState
From interface com.microstrategy.web.app.beans.AppComponent
Public Methods
abstract void afterUpdate(Map pValues, PreferencesException ex)
abstract String getApplyToAllProjects()
Whether to apply the changes to all projects
abstract String getCurrentGroup()
Returns the current group title.
abstract PreferencesBean.GroupInfo getCurrentGroupInfo()
abstract String getCurrentGroupName()
Returns the current group's name.
abstract String getCurrentGroupSet()
Returns which is the current groupset
abstract PreferencesBean.GroupInfo getCurrentGroupSetInfo()
abstract PreferenceLevel getCurrentLevel()
Returns the preferences level of the current preferences group
abstract FeatureInfos getFeatureInfos()
abstract PreferencesBean.GroupInfo getGroupSetInfo(String groupSetName)
abstract String getPrevGroupName()
Returns the previous group's name.
abstract boolean getSettingVisibility(String controlledDiv)
abstract Map getTemporalValues()
abstract int getType()
Returns the transformable type as in EnumWebTransformableType.
abstract String getValidationMessage(String name)
abstract Map getValues()
abstract boolean hasValidationErrors()
abstract boolean havePreferencesChanged()
Determines if the user has attemped to change the preferences on a page.
abstract boolean initFromXML(Element root)
Initialize the groups/group-sets from the information of the root
abstract boolean isLoginRequired()
abstract boolean isValidLevel(String level)
Determine if the user has all the privileges required for accessing the preferences under the specified level.
abstract boolean isValidPreference(String name)
abstract MarkupOutput renderGroupsList()
Returns the output to render the groups list.
abstract MarkupOutput renderGroupsList(boolean ignoreCurrent)
Returns the output to render the groups list.
abstract void setApplyToAllProjects(String applyToAllProjects)
Sets whether to apply the changes to all projects
abstract void setCurrentGroup(String currentGroup)
Sets the current group.
abstract void setCurrentGroupSet(String currentGroupSet)
Sets the current groupset.
abstract void setIsLoginRequired(boolean value)
This method is deprecated. isLoginRequired() can be determined automatically
abstract void setPrevGroupName(String prevGroupName)
Set the previous group's name.
abstract void setSettingVisibility(String settingDiv, String visible)
abstract void setXMLStatus(int status)
Set the EnumRequestStatus status of the bean.
abstract void toggleSettingsVisibility(String settingDiv)
[Expand]
Inherited Methods
From interface com.microstrategy.utils.serialization.Persistable
From interface com.microstrategy.web.app.beans.AppComponent
From interface com.microstrategy.web.beans.RequestPersistable
From interface com.microstrategy.web.beans.Transformable
From interface com.microstrategy.web.beans.WebComponent

Constants

public static final String KEEP_TEMP_PREFERENCE

Constant Value: "1"

public static final String SAVE_TEMP_PREFERENCE

Constant Value: "0"

Public Methods

public abstract void afterUpdate (Map pValues, PreferencesException ex)

public abstract String getApplyToAllProjects ()

Whether to apply the changes to all projects

Returns
  • whether to apply the changes to all projects

public abstract String getCurrentGroup ()

Returns the current group title.

Returns
  • the current group's title

public abstract PreferencesBean.GroupInfo getCurrentGroupInfo ()

Returns

public abstract String getCurrentGroupName ()

Returns the current group's name.

Returns
  • the current group's name

public abstract String getCurrentGroupSet ()

Returns which is the current groupset

Returns
  • the current groupSet's title

public abstract PreferencesBean.GroupInfo getCurrentGroupSetInfo ()

Returns

public abstract PreferenceLevel getCurrentLevel ()

Returns the preferences level of the current preferences group

Returns
  • the current groupSet's level

public abstract FeatureInfos getFeatureInfos ()

public abstract PreferencesBean.GroupInfo getGroupSetInfo (String groupSetName)

Parameters
groupSetName name of the PreferencesBean.GroupInfo to search for.
Returns

public abstract String getPrevGroupName ()

Returns the previous group's name.

Returns
  • the previous group's name

public abstract boolean getSettingVisibility (String controlledDiv)

public abstract Map getTemporalValues ()

Returns
  • Map instance with the current temporal values of the preferences object

public abstract int getType ()

Returns the transformable type as in EnumWebTransformableType.

Returns
  • an int value indicating the type bean, value coming from the EnumSysBeanTypes enumeration.

public abstract String getValidationMessage (String name)

public abstract Map getValues ()

public abstract boolean hasValidationErrors ()

public abstract boolean havePreferencesChanged ()

Determines if the user has attemped to change the preferences on a page.

Returns
  • true if the user has attemped to change the preferences on a page.

public abstract boolean initFromXML (Element root)

Initialize the groups/group-sets from the information of the root

Parameters
root the XML Element with the structure information
Returns
  • true if the root contained valid information

public abstract boolean isLoginRequired ()

Returns
  • boolean value indicating if the user is required to log out and log back in in order to have the new preference values applied.

public abstract boolean isValidLevel (String level)

Determine if the user has all the privileges required for accessing the preferences under the specified level.

Parameters
level String value with the level the user is trying to access
Returns
  • boolean value indicating if the user is enabled to access this preference level or not.

public abstract boolean isValidPreference (String name)

public abstract MarkupOutput renderGroupsList ()

Returns the output to render the groups list.

Returns
  • the output to display the groups list information.

public abstract MarkupOutput renderGroupsList (boolean ignoreCurrent)

Returns the output to render the groups list.

Parameters
ignoreCurrent ignores which group and group set are currently selected. Displays them all as links
Returns
  • the output to display the groups list information.

public abstract void setApplyToAllProjects (String applyToAllProjects)

Sets whether to apply the changes to all projects

Parameters
applyToAllProjects whether to apply the changes to all projects

public abstract void setCurrentGroup (String currentGroup)

Sets the current group. If the new group doesn't exist, it is ignored.

Parameters
currentGroup the name of the new current group

public abstract void setCurrentGroupSet (String currentGroupSet)

Sets the current groupset. If there is no group-set with currentGroupSet the value is ignored.
If the current group exist in the new group-set, the group is kept as current group, if not, the first group of the group-set is used.

Parameters
currentGroupSet the name of the new current group set

public abstract void setIsLoginRequired (boolean value)

This method is deprecated.
isLoginRequired() can be determined automatically

Parameters
value boolean flag indicating if the user is required to log out and log back in in order to have the new preference values applied.

public abstract void setPrevGroupName (String prevGroupName)

Set the previous group's name.

Parameters
prevGroupName the previous group's name

public abstract void setSettingVisibility (String settingDiv, String visible)

public abstract void setXMLStatus (int status)

Set the EnumRequestStatus status of the bean. By default the status of this bean is WebBeanRequestWaitingForUserInput.

Parameters
status int value with the status of this bean

public abstract void toggleSettingsVisibility (String settingDiv)