Package com.microstrategy.web.app.beans
Interface PreferencesBean
-
- All Superinterfaces:
AppComponent
,EnumWebPersistableState
,Persistable
,RequestPersistable
,Transformable
,WebComponent
- All Known Subinterfaces:
OptionsBean
- All Known Implementing Classes:
OptionsBeanImpl
,PreferencesBeanImpl
public interface PreferencesBean extends AppComponent, RequestPersistable
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.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
PreferencesBean.GroupInfo
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
KEEP_TEMP_PREFERENCE
static java.lang.String
SAVE_TEMP_PREFERENCE
-
Fields inherited from interface com.microstrategy.web.app.beans.AppComponent
COMPONENT_POSITION_NOT_INITIALIZED
-
Fields inherited from interface com.microstrategy.utils.serialization.EnumWebPersistableState
BARE_MINIMAL_STATE_INFO, MAXIMAL_STATE_INFO, MINIMAL_STATE_INFO, TYPICAL_STATE_INFO
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
afterUpdate(java.util.Map pValues, PreferencesException ex)
java.lang.String
getApplyToAllProjects()
Whether to apply the changes to all projectsjava.lang.String
getCurrentGroup()
Returns the current group title.PreferencesBean.GroupInfo
getCurrentGroupInfo()
java.lang.String
getCurrentGroupName()
Returns the current group's name.java.lang.String
getCurrentGroupSet()
Returns which is the current groupsetPreferencesBean.GroupInfo
getCurrentGroupSetInfo()
PreferenceLevel
getCurrentLevel()
Returns the preferences level of the current preferences groupFeatureInfos
getFeatureInfos()
PreferencesBean.GroupInfo
getGroupSetInfo(java.lang.String groupSetName)
java.lang.String
getPrevGroupName()
Returns the previous group's name.boolean
getSettingVisibility(java.lang.String controlledDiv)
java.util.Map
getTemporalValues()
int
getType()
Returns the transformable type as inEnumWebTransformableType
.java.lang.String
getValidationMessage(java.lang.String name)
java.util.Map
getValues()
boolean
hasValidationErrors()
boolean
havePreferencesChanged()
Determines if the user has attemped to change the preferences on a page.boolean
initFromXML(org.w3c.dom.Element root)
Initialize the groups/group-sets from the information of the rootboolean
isLoginRequired()
boolean
isValidLevel(java.lang.String level)
Determine if the user has all the privileges required for accessing the preferences under the specified level.boolean
isValidPreference(java.lang.String name)
MarkupOutput
renderGroupsList()
Returns the output to render the groups list.MarkupOutput
renderGroupsList(boolean ignoreCurrent)
Returns the output to render the groups list.void
setApplyToAllProjects(java.lang.String applyToAllProjects)
Sets whether to apply the changes to all projectsvoid
setCurrentGroup(java.lang.String currentGroup)
Sets the current group.void
setCurrentGroupSet(java.lang.String currentGroupSet)
Sets the current groupset.void
setIsLoginRequired(boolean value)
Deprecated.isLoginRequired()
can be determined automaticallyvoid
setPrevGroupName(java.lang.String prevGroupName)
Set the previous group's name.void
setSettingVisibility(java.lang.String settingDiv, java.lang.String visible)
void
setXMLStatus(int status)
Set theEnumRequestStatus
status of the bean.void
toggleSettingsVisibility(java.lang.String settingDiv)
-
Methods inherited from interface com.microstrategy.web.app.beans.AppComponent
getAppContext, getDescriptor, getDescriptor, getEventManager, getExtraInput, getExtraUrl, getLeft, getResultFilterMode, getTop, isDialog, isForcedChildrenStateSaving, isModal, isModalOpen, isOpen, setExtraInput, setExtraUrl, setForcedChildrenStateSaving, setHasJustOpened, setIsDialog, setIsModal, setIsOpen, setLeft, setTop
-
Methods inherited from interface com.microstrategy.utils.serialization.Persistable
restoreState, restoreState, saveState, saveState, saveState, saveState
-
Methods inherited from interface com.microstrategy.web.beans.RequestPersistable
restoreStateFromRequest, restoreStateFromRequest
-
Methods inherited from interface com.microstrategy.web.beans.Transformable
addTransform, addTransformByClass, addTransformByStyle, addTransformByStyle, clearTransforms, getBeanContext, getMessageString, getMyTransformInstances, getTransformInstance, getTransformInstance, getTransformInstances, hasTransform, hasTransform, invalidateTransformCache, setBeanContext, transform, transform
-
Methods inherited from interface com.microstrategy.web.beans.WebComponent
addChild, addChildStateInfo, addChildStateInfo, collectData, collectMinimalData, generateOutput, getBeanContext, getChild, getChild, getChildByClass, getChildByType, getChildCount, getChildrenByClass, getDefaultStateLevel, getFeaturesManager, getMaximumStateLevel, getName, getOutputFormat, getParent, getPath, getPersistMode, getRenderingFilter, getRoot, getTargetBean, getTargetBeanPath, getWebEvent, getWebEvent, getWebEventHandler, getXMLStatus, handleRequest, hasChanged, hasJustOpened, initBean, invalidateChildrenState, isBeanContextEmpty, isFeatureAvailable, prepareForReuse, removeChild, removeChild, searchChild, setBeanContext, setBeanContext, setChanged, setChanged, setDefaultStateLevel, setFeaturesManager, setName, setOutputFormat, setParent, setPersistMode, setRenderingFilter, setTargetBean, setTargetBeanPath, setWebEventHandler
-
-
-
-
Field Detail
-
SAVE_TEMP_PREFERENCE
static final java.lang.String SAVE_TEMP_PREFERENCE
- Since:
- MicroStrategy Web 9.0.0
- See Also:
- Constant Field Values
-
KEEP_TEMP_PREFERENCE
static final java.lang.String KEEP_TEMP_PREFERENCE
- Since:
- MicroStrategy Web 9.0.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
afterUpdate
void afterUpdate(java.util.Map pValues, PreferencesException ex)
-
getValues
java.util.Map getValues()
-
hasValidationErrors
boolean hasValidationErrors()
-
getValidationMessage
java.lang.String getValidationMessage(java.lang.String name)
-
isValidPreference
boolean isValidPreference(java.lang.String name)
-
isLoginRequired
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.
- Since:
- MicroStrategy Web 8.0.0
-
setIsLoginRequired
@Deprecated void setIsLoginRequired(boolean value)
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.- Since:
- MicroStrategy Web 8.0.0
-
isValidLevel
boolean isValidLevel(java.lang.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.
- Since:
- MicroStrategy Web 8.0.0
-
renderGroupsList
MarkupOutput renderGroupsList()
Returns the output to render the groups list.- Returns:
- the output to display the groups list information.
-
renderGroupsList
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.
-
initFromXML
boolean initFromXML(org.w3c.dom.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
-
getCurrentGroupSet
java.lang.String getCurrentGroupSet()
Returns which is the current groupset- Returns:
- the current groupSet's title
-
setCurrentGroupSet
void setCurrentGroupSet(java.lang.String currentGroupSet)
Sets the current groupset. If there is no group-set withcurrentGroupSet
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
-
getCurrentLevel
PreferenceLevel getCurrentLevel()
Returns the preferences level of the current preferences group- Returns:
- the current groupSet's level
-
getCurrentGroup
java.lang.String getCurrentGroup()
Returns the current group title.- Returns:
- the current group's title
-
getCurrentGroupName
java.lang.String getCurrentGroupName()
Returns the current group's name.- Returns:
- the current group's name
- Since:
- MicroStrategy Web 8.0.0
-
setCurrentGroup
void setCurrentGroup(java.lang.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
-
getTemporalValues
java.util.Map getTemporalValues()
- Returns:
- Map instance with the current temporal values of the preferences object
-
getFeatureInfos
FeatureInfos getFeatureInfos()
-
getType
int getType()
Description copied from interface:Transformable
Returns the transformable type as inEnumWebTransformableType
.- Specified by:
getType
in interfaceTransformable
- Returns:
- an
int
value indicating the type bean, value coming from theEnumSysBeanTypes
enumeration.
-
setXMLStatus
void setXMLStatus(int status)
Set theEnumRequestStatus
status of the bean. By default the status of this bean isEnumRequestStatus.WebBeanRequestWaitingForUserInput
.- Parameters:
status
-int
value with the status of this bean
-
getApplyToAllProjects
java.lang.String getApplyToAllProjects()
Whether to apply the changes to all projects- Returns:
- whether to apply the changes to all projects
- Since:
- MicroStrategy Web 8.0.0
-
setApplyToAllProjects
void setApplyToAllProjects(java.lang.String applyToAllProjects)
Sets whether to apply the changes to all projects- Parameters:
applyToAllProjects
- whether to apply the changes to all projects- Since:
- MicroStrategy Web 8.0.0
-
getPrevGroupName
java.lang.String getPrevGroupName()
Returns the previous group's name.- Returns:
- the previous group's name
- Since:
- MicroStrategy Web 8.0.0
-
setPrevGroupName
void setPrevGroupName(java.lang.String prevGroupName)
Set the previous group's name.- Parameters:
prevGroupName
- the previous group's name- Since:
- MicroStrategy Web 8.0.0
-
getCurrentGroupSetInfo
PreferencesBean.GroupInfo getCurrentGroupSetInfo()
- Returns:
- a
PreferencesBean.GroupInfo
instance corresponding to the current group set selected - Since:
- MicroStrategy Web 8.0.0
-
getCurrentGroupInfo
PreferencesBean.GroupInfo getCurrentGroupInfo()
- Returns:
- a
PreferencesBean.GroupInfo
instance corresponding to the current group selected - Since:
- MicroStrategy Web 8.0.0
-
getGroupSetInfo
PreferencesBean.GroupInfo getGroupSetInfo(java.lang.String groupSetName)
- Parameters:
groupSetName
- name of thePreferencesBean.GroupInfo
to search for.- Returns:
- a
PreferencesBean.GroupInfo
instance corresponding to the group set name sent in as parameter - Since:
- MicroStrategy Web 8.0.0
-
havePreferencesChanged
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.
- Since:
- MicroStrategy Web 9.0.0
-
setSettingVisibility
void setSettingVisibility(java.lang.String settingDiv, java.lang.String visible)
- Since:
- MicroStrategy Web 9.0.0
-
getSettingVisibility
boolean getSettingVisibility(java.lang.String controlledDiv)
- Since:
- MicroStrategy Web 9.0.0
-
toggleSettingsVisibility
void toggleSettingsVisibility(java.lang.String settingDiv)
- Since:
- MicroStrategy Web 9.0.0
-
-