Class UserConsoleResource

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

@Path("/mantle/") 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 an 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:

  • Constructor Details

    • UserConsoleResource

      @Inject public UserConsoleResource(@NonNull UserConsoleService userConsoleService)
  • Method Details

    • isAdministrator

      @GET @Path("/isAdministrator") public jakarta.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

      @GET @Path("/isAuthenticated") public jakarta.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

      @GET @Path("/getAdminContent") @Produces({"application/json","application/xml"}) public SettingsWrapper getAdminContent()
      Returns the list of admin related settings
      Returns:
      list of settings
    • getMantleSettings

      @GET @Path("/settings") @Produces({"application/json","application/xml"}) public SettingsWrapper getMantleSettings()
      Return the current user console settings
      Returns:
      current settings
    • getMondrianCatalogs

      @GET @Path("/cubes") @Produces({"application/json","application/xml"}) public CubesWrapper getMondrianCatalogs()
      Return the list of mondrian cubes in the platform
      Returns:
      list of cubes
    • setLocaleOverride

      @POST @Path("/locale") public jakarta.ws.rs.core.Response setLocaleOverride(String locale)
      Apply the selected locale to the user console.
      Parameters:
      locale - (user console's locale)
      Returns:
    • getLocale

      @GET @Path("/locale") public jakarta.ws.rs.core.Response getLocale()
      Return the server side locale
      Returns:
      server's locale
    • setSessionVariable

      @POST @Path("/session-variable") @Produces("text/plain") public jakarta.ws.rs.core.Response setSessionVariable(@QueryParam("key") String key, @QueryParam("value") String value)
      Sets a session variable for the current user session. If value is null, the session variable is removed.
      Parameters:
      key - The session variable name. Must be whitelisted.
      value - The value to set, or null to remove the variable.
      Returns:
      A Response containing the set value, or null if removed
    • getSessionVariable

      @GET @Path("/session-variable") @Produces({"text/plain","application/json","application/xml"}) public jakarta.ws.rs.core.Response getSessionVariable(@QueryParam("key") String key)
      Retrieves a session variable from the current user session.
      Parameters:
      key - The session variable name. Must be whitelisted.
      Returns:
      A Response containing the session variable value, or no content if not found
    • clearSessionVariable

      @DELETE @Path("/session-variable") public jakarta.ws.rs.core.Response clearSessionVariable(@QueryParam("key") String key)
      Removes a session variable from the current user session.
      Parameters:
      key - The session variable name. Must be whitelisted.
      Returns:
      A Response containing the previous value, or null if not found
    • registeredPlugins

      @GET @Path("/registeredPlugins") public jakarta.ws.rs.core.Response registeredPlugins()
    • buildOkResponse

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