public class

PreferencesMgr

extends Object
java.lang.Object
   ↳ com.microstrategy.web.preferences.PreferencesMgr

Class Overview

This is the entry point to the preferences functionality in the Web API. The PreferencesMgr is essentially a facade to the ApplicationPreferences subsystem. It hides from the application details of preferences management, such as the caching layer.

Summary

Public Methods
static boolean getBooleanValue(Preferences pref, String name, boolean defaultValue)
Returns preference value as boolean.
static boolean getBooleanValue(Preferences pref, String name)
Returns preference value as boolean.
Preferences getIPASysDefaultPreferences(String serverName, String templateName)

Obtain the system preferences for a given server name and template name .

static PreferencesMgr getInstance()
Obtain the PreferencesMgr singleton instance.
Preferences getSysDefaultPreferences()
Obtain system preferences for all servers.
Preferences getSysDefaultPreferences(String serverName, String projectName)

Obtain the system preferences for a given server.

Preferences getSysDefaultPreferences(WebIServerSession session)

Obtain the system preferences for a given server.

Preferences getSysDefaultPreferences(String serverName)

Obtain the system preferences for a given server.

Preferences getUserDefaultPreferences()
Returns Preferences with only default level values populated.
Preferences getUserPreferences(WebIServerSession session)

Before this call is made, ensure the system definitions file has been specified: SysPrefType.getDefinition().setFilePath(String).

boolean isConfigured()
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static boolean getBooleanValue (Preferences pref, String name, boolean defaultValue)

Returns preference value as boolean. Returns defaultValue if pref object is null or preference doesn't exist within this preferences collection

Parameters
pref preferences object
name preference name
defaultValue defaulr value
Returns
  • preference value

public static boolean getBooleanValue (Preferences pref, String name)

Returns preference value as boolean. Returns false if pref object is null or preference doesn't exist within this preferences collection

Parameters
pref preferences object
name preference name
Returns
  • preference value

public Preferences getIPASysDefaultPreferences (String serverName, String templateName)

Obtain the system preferences for a given server name and template name . Specifying "" as the server name returns the preferences based on the template name

Parameters
serverName The name of the Intelligence Server.
templateName The name of the preferences template
Returns
  • The system preferences.

public static PreferencesMgr getInstance ()

Obtain the PreferencesMgr singleton instance.

Returns
  • The PreferenceMgr instance.

public Preferences getSysDefaultPreferences ()

Obtain system preferences for all servers.

Returns
  • The system default preferences.

public Preferences getSysDefaultPreferences (String serverName, String projectName)

Obtain the system preferences for a given server. Specifying "" as the server name returns the default preferences object for all servers.

The SysDefaultPrefType object corresponding to the serverName is then used to define properties such as the file name. To change the file paths associated with the server, change the relevant SysDefaultPrefType instance before invoking this method.

Parameters
serverName name of the Intelligence Server
projectName name of project in server
Returns
  • the system default preferences

public Preferences getSysDefaultPreferences (WebIServerSession session)

Obtain the system preferences for a given server. Specifying "" as the server name returns the default preferences object for all servers.

The SysDefaultPrefType object corresponding to the serverName is then used to define properties such as the file name. To change the file paths associated with the server, change the relevant SysDefaultPrefType instance before invoking this method.

Parameters
session a session containing the server name, server port, project name or project DSS ID.
Returns
  • the system default preferences

public Preferences getSysDefaultPreferences (String serverName)

Obtain the system preferences for a given server. Specifying "" as the server name returns the default preferences object for all servers.

The SysDefaultPrefType object corresponding to the serverName is then used to define properties such as the file name. To change the file paths associated with the server, change the relevant SysDefaultPrefType instance before invoking this method. Caveat: changing the file name can confuse other processes concurrently accessing the same default preferences.

Parameters
serverName The name of the Intelligence Server.
Returns
  • The system default preferences.

public Preferences getUserDefaultPreferences ()

Returns Preferences with only default level values populated. Useful for initialization.

Returns
  • Preferences with only default level values.

public Preferences getUserPreferences (WebIServerSession session)

Before this call is made, ensure the system definitions file has been specified: SysPrefType.getDefinition().setFilePath(String).

Obtain a user's preferences. User level preferences are keyed of the user's session, hence it is necessary to login to an Intelligence Server before a user's preferences may be retrieved.

Parameters
session The user's web session.
Returns
  • The preferences.

public boolean isConfigured ()

Returns
  • whether preferences is properly setup, ie. SysPrefType.getDefinition().setFilePath(String) has been configured.