Class UserConsoleResource

java.lang.Object
org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
org.pentaho.platform.web.http.api.resources.UserConsoleResource

public class UserConsoleResource extends AbstractJaxRSResource
The 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:

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 Details

  • 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

      public List<Setting> getAdminContent()
      Returns the list of admin related settings
      Returns:
      list of settings
    • getMantleSettings

      public List<Setting> getMantleSettings()
      Return the current user console settings
      Returns:
      current settings
    • getMondrianCatalogs

      public List<Cube> getMondrianCatalogs()
      Return the list of mondrian cubes in the platform
      Returns:
      list of cubes
    • setLocaleOverride

      public javax.ws.rs.core.Response setLocaleOverride(String locale)
      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

      public javax.ws.rs.core.Response setSessionVariable(String key, String value)
      Sets the value of a session variable.
      Parameters:
      key - The name of the session variable
      value - The value of the session variable
      Returns:
    • getSessionVariable

      public javax.ws.rs.core.Response getSessionVariable(String key)
      Gets the value of a session variable.
      Parameters:
      key - The name of the session variable
      Returns:
    • clearSessionVariable

      public javax.ws.rs.core.Response clearSessionVariable(String key)
      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

      protected javax.ws.rs.core.Response buildOkResponse(Object entity)