Class UserConsoleResource
UserConsoleResource
service provides both shared and user-specific state or settings related with the use
of the Pentaho User Console.
The following operations provide access to User Console system settings (shared by all users):
The UserConsoleResource
exposes operations to access and manage user session variables.
User session variables are unique per user session and reset to their default values at every user session creation.
Contrast session variables with user settings, accessed via UserSettingsResource
,
which are persisted across user sessions and shared by all active sessions of a user.
One last characteristic of session variables is that only those declared in the properties
userConsoleResource.getSessionVarWhiteList
and userConsoleResource.setSessionVarWhiteList
of the system file system/restConfig.properties
, can be read or modified via this class.
By default, these are scheduler_folder
and showOverrideDialog
.
Generic user session variables are accessed and managed via the operations:
The following operations expose specific (non-generic) user session information:
isAuthenticated()
isAdministrator()
getLocale()
- gets the effective locale of the user session-
setLocaleOverride(String)
- sets the locale of the user session, viaLocaleHelper.setSessionLocaleOverride(Locale)
andLocaleHelper.setThreadLocaleOverride(Locale)
The state changing operations of this service,
with the notable exception of setLocaleOverride(String)
,
are protected against CSRF attacks, and thus require a CSRF token to be called.
This resolves to:
-
Field Summary
Fields inherited from class org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
acceptableMediaTypes, httpServletRequest, httpServletResponse, TEXT_HTML
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected javax.ws.rs.core.Response
buildOkResponse
(Object entity) javax.ws.rs.core.Response
Deletes the value of a session variable.Returns the list of admin related settingsjavax.ws.rs.core.Response
Return the server side localeReturn the current user console settingsReturn the list of mondrian cubes in the platformjavax.ws.rs.core.Response
getSessionVariable
(String key) Gets the value of a session variable.javax.ws.rs.core.Response
Returns whether the current user is an administrator.javax.ws.rs.core.Response
Returns whether the user is sn authenticated user or not.javax.ws.rs.core.Response
javax.ws.rs.core.Response
setLocaleOverride
(String locale) Apply the selected locale to the user console.javax.ws.rs.core.Response
setSessionVariable
(String key, String value) Sets the value of a session variable.Methods inherited from class org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
setHttpHeaders
-
Field Details
-
userConsoleService
-
-
Constructor Details
-
UserConsoleResource
public UserConsoleResource()
-
-
Method Details
-
isAdministrator
public javax.ws.rs.core.Response isAdministrator()Returns whether the current user is an administrator.Example Request:
GET pentaho/api/mantle/isAdministrator- Returns:
- String true if the user is an administrator, or false otherwise.
Example Response:
true
-
isAuthenticated
public javax.ws.rs.core.Response isAuthenticated()Returns whether the user is sn authenticated user or not.Example Request:
GET pentaho/api/mantle/isAuthenticated- Returns:
- String true if the user is an administrator, or false otherwise.
Example Response:
true
-
getAdminContent
Returns the list of admin related settings- Returns:
- list of settings
-
getMantleSettings
Return the current user console settings- Returns:
- current settings
-
getMondrianCatalogs
Return the list of mondrian cubes in the platform- Returns:
- list of cubes
-
setLocaleOverride
Apply the selected locale to the user console.- Parameters:
locale
- (user console's locale)- Returns:
-
getLocale
public javax.ws.rs.core.Response getLocale()Return the server side locale- Returns:
- server's locale
-
setSessionVariable
Sets the value of a session variable.- Parameters:
key
- The name of the session variablevalue
- The value of the session variable- Returns:
-
getSessionVariable
Gets the value of a session variable.- Parameters:
key
- The name of the session variable- Returns:
-
clearSessionVariable
Deletes the value of a session variable.- Parameters:
key
- The name of the session variable- Returns:
-
registeredPlugins
public javax.ws.rs.core.Response registeredPlugins() -
buildOkResponse
-