Class PreferencesBeanImpl

  • All Implemented Interfaces:
    EnumWebPersistableState, Persistable, AppComponent, PreferencesBean, RequestPersistable, Transformable, WebComponent
    Direct Known Subclasses:
    OptionsBeanImpl

    @Deprecated
    public class PreferencesBeanImpl
    extends AbstractPersistableAppComponent
    implements PreferencesBean
    Deprecated.
    this class will be made non-public
    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
    • Field Detail

      • _currentGroupSet

        protected java.lang.String _currentGroupSet
        Deprecated.
      • _currentGroup

        protected java.lang.String _currentGroup
        Deprecated.
      • _prevGroupName

        protected java.lang.String _prevGroupName
        Deprecated.
        Since:
        MicroStrategy Web 8.0.0
      • _applyToAllProjects

        protected java.lang.String _applyToAllProjects
        Deprecated.
        Since:
        MicroStrategy Web 8.0.0
      • SEPARATOR

        protected static final java.lang.String SEPARATOR
        Deprecated.
        See Also:
        Constant Field Values
      • PREFERENCE_CURRENT_GROUP_SET

        protected static final java.lang.String PREFERENCE_CURRENT_GROUP_SET
        Deprecated.
        See Also:
        Constant Field Values
      • PREFERENCE_CURRENT_GROUP

        protected static final java.lang.String PREFERENCE_CURRENT_GROUP
        Deprecated.
        See Also:
        Constant Field Values
    • Method Detail

      • getValidationErrors

        public PreferencesException getValidationErrors()
        Deprecated.
        Since:
        MicroStrategy Web 9.0.0
      • isLoginRequired

        public boolean isLoginRequired()
        Deprecated.
        Specified by:
        isLoginRequired in interface PreferencesBean
        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
        public void setIsLoginRequired​(boolean value)
        Deprecated.
        isLoginRequired() can be determined automatically
        Specified by:
        setIsLoginRequired in interface PreferencesBean
        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
      • renderGroupsList

        public MarkupOutput renderGroupsList()
        Deprecated.
        Returns the output to render the groups list.
        Specified by:
        renderGroupsList in interface PreferencesBean
        Returns:
        the output to display the groups list information.
      • renderGroupsList

        public MarkupOutput renderGroupsList​(boolean ignoreCurrent)
        Deprecated.
        Returns the output to render the groups list.
        Specified by:
        renderGroupsList in interface PreferencesBean
        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.
      • getVisibleGroupSetCount

        protected int getVisibleGroupSetCount()
        Deprecated.
        Returns:
        integer value with the count of visible group sets available
      • initFromXML

        public boolean initFromXML​(org.w3c.dom.Element root)
        Deprecated.
        Initialize the groups/group-sets from the information of the root
        Specified by:
        initFromXML in interface PreferencesBean
        Parameters:
        root - the XML Element with the structure information
        Returns:
        true if the root contained valid information
      • getCurrentGroupSet

        public java.lang.String getCurrentGroupSet()
        Deprecated.
        Returns which is the current groupset
        Specified by:
        getCurrentGroupSet in interface PreferencesBean
        Returns:
        the current groupSet's title
      • setCurrentGroupSet

        public void setCurrentGroupSet​(java.lang.String currentGroupSet)
        Deprecated.
        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.
        Specified by:
        setCurrentGroupSet in interface PreferencesBean
        Parameters:
        currentGroupSet - the name of the new current group set
      • getGroupSetInfo

        public PreferencesBean.GroupInfo getGroupSetInfo​(java.lang.String groupSetName)
        Deprecated.
        Specified by:
        getGroupSetInfo in interface PreferencesBean
        Parameters:
        groupSetName - name of the GroupInfo to search for.
        Returns:
        a GroupInfo instance corresponding to the group set name sent in as parameter
        Since:
        MicroStrategy Web 8.0.0
      • isValidLevel

        public boolean isValidLevel​(java.lang.String level)
        Deprecated.
        Determine if the user has all the privileges required for accessing the preferences under the specified level.
        Specified by:
        isValidLevel in interface PreferencesBean
        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
      • getCurrentLevel

        public PreferenceLevel getCurrentLevel()
        Deprecated.
        Returns the preferences level of the current preferences group
        Specified by:
        getCurrentLevel in interface PreferencesBean
        Returns:
        the current groupSet's level
      • getCurrentGroup

        public java.lang.String getCurrentGroup()
        Deprecated.
        Returns the current group's title.
        Specified by:
        getCurrentGroup in interface PreferencesBean
        Returns:
        the current group's title
      • getCurrentGroupName

        public java.lang.String getCurrentGroupName()
        Deprecated.
        Returns the current group's name.
        Specified by:
        getCurrentGroupName in interface PreferencesBean
        Returns:
        the current group's name
        Since:
        MicroStrategy Web 8.0.0
      • setCurrentGroup

        public void setCurrentGroup​(java.lang.String currentGroup)
        Deprecated.
        Sets the current group. If the new group doesn't exist, it is ignored.
        Specified by:
        setCurrentGroup in interface PreferencesBean
        Parameters:
        currentGroup - the name of the new current group
      • getTemporalValues

        public java.util.Map getTemporalValues()
        Deprecated.
        Specified by:
        getTemporalValues in interface PreferencesBean
        Returns:
        Map instance with the current temporal values of the preferences object
      • getXMLStatus

        public int getXMLStatus()
        Deprecated.
        Returns the EnumRequestStatus status of the bean. By default the status of this bean is WebBeanRequestWaitingForUserInput. When the method is invoked with true, then the status changes to be Succesfull.
        Specified by:
        getXMLStatus in interface WebComponent
        Overrides:
        getXMLStatus in class AbstractAppComponent
        Returns:
        the EnumRequestStatus of the component.
      • collectData

        public void collectData()
        Deprecated.
        Triggers execution to the back end no matter whether it is synchronous or asynchronous. If this method fails to collect data, an exception is raised and saved in a WebBeanError instance.
        Specified by:
        collectData in interface WebComponent
        Overrides:
        collectData in class AbstractAppComponent
      • getApplyToAllProjects

        public java.lang.String getApplyToAllProjects()
        Deprecated.
        Whether to apply the changes to all projects
        Specified by:
        getApplyToAllProjects in interface PreferencesBean
        Returns:
        whether to apply the changes to all projects
        Since:
        MicroStrategy Web 8.0.0
      • setApplyToAllProjects

        public void setApplyToAllProjects​(java.lang.String applyToAllProjects)
        Deprecated.
        Sets whether to apply the changes to all projects
        Specified by:
        setApplyToAllProjects in interface PreferencesBean
        Parameters:
        applyToAllProjects - whether to apply the changes to all projects
        Since:
        MicroStrategy Web 8.0.0
      • getPrevGroupName

        public java.lang.String getPrevGroupName()
        Deprecated.
        Returns the previous group's name.
        Specified by:
        getPrevGroupName in interface PreferencesBean
        Returns:
        the previous group's name
        Since:
        MicroStrategy Web 8.0.0
      • setPrevGroupName

        public void setPrevGroupName​(java.lang.String prevGroupName)
        Deprecated.
        Set the previous group's name.
        Specified by:
        setPrevGroupName in interface PreferencesBean
        Parameters:
        prevGroupName - the previous group's name
        Since:
        MicroStrategy Web 8.0.0
      • setSettingVisibility

        public void setSettingVisibility​(java.lang.String settingDiv,
                                         java.lang.String visible)
        Deprecated.
        Set the value in the Hashmap _advSettingsVisibility.
        Specified by:
        setSettingVisibility in interface PreferencesBean
        Parameters:
        settingDiv - The key to the value stored in Hashmap.
        Since:
        MicroStrategy Web 9.0.0
      • toggleSettingsVisibility

        public void toggleSettingsVisibility​(java.lang.String settingDiv)
        Deprecated.
        Toggle the value in the Hashmap _advSettingsVisibility.
        Specified by:
        toggleSettingsVisibility in interface PreferencesBean
        Parameters:
        settingDiv - The key to the value stored in Hashmap.
        Since:
        MicroStrategy Web 9.0.0
      • getSettingVisibility

        public boolean getSettingVisibility​(java.lang.String settingDiv)
        Deprecated.
        Retrieves the boolean value indicating whether we should render the advanced setting Div with Id as setting Div as visible.
        Specified by:
        getSettingVisibility in interface PreferencesBean
        Parameters:
        settingDiv - The Id of the controlled setting Div.
        Returns:
        boolean value indicating whether the Div should be visible or not
        Since:
        MicroStrategy Web 9.0.0