Class DashboardRestController

java.lang.Object
sk.iway.iwcm.components.welcome.DashboardRestController

@RestController @RequestMapping("/admin/rest/dashboard") @PreAuthorize("@WebjetSecurityService.isAdmin()") public class DashboardRestController extends Object
Exposes dashboard settings and menu destinations. The settings owner and active domain are resolved from the request.
  • Constructor Details

  • Method Details

    • putSettings

      @PutMapping("/settings") public DashboardSettingsDto putSettings(@RequestBody DashboardSettingsDto settings, jakarta.servlet.http.HttpServletRequest request)
      Saves the shared layout and active-domain options, then clears the user's cached administration settings.
      Parameters:
      settings - dashboard settings to validate and persist
      request - request identifying the administrator and active domain
      Returns:
      saved settings with the layout and shortcuts marked as configured
    • deleteSettings

      @DeleteMapping("/settings") public DashboardSettingsDto deleteSettings(jakarta.servlet.http.HttpServletRequest request)
      Clears widget preferences across all domains while retaining shortcuts and their migration state. The returned layout is marked as unconfigured so the client can supply default widgets.
      Parameters:
      request - request identifying the administrator whose settings are reset
      Returns:
      retained shortcuts and configuration flags after the reset
    • resetSettings

      @PutMapping("/settings/reset") public DashboardSettingsDto resetSettings(@RequestBody DashboardSettingsDto layout, jakarta.servlet.http.HttpServletRequest request)
      Atomically installs a supplied layout while retaining the account's configured shortcuts.
      Parameters:
      layout - replacement widgets and active-domain options, including default shortcuts for an unconfigured account
      request - request identifying the administrator and active domain
      Returns:
      persisted layout combined with the retained shortcuts
    • getMenu

      @GetMapping("/menu") public List<MenuBean> getMenu(jakarta.servlet.http.HttpServletRequest request)
    • invalidSettings

      @ExceptionHandler(java.lang.IllegalArgumentException.class) @ResponseStatus(BAD_REQUEST) public Map<String,String> invalidSettings(IllegalArgumentException exception)
      Converts a settings validation failure into the error body of a bad-request response.
      Parameters:
      exception - validation failure containing a message for the client
      Returns:
      response body containing the validation message
    • unavailableSettings

      @ExceptionHandler(java.lang.IllegalStateException.class) @ResponseStatus(SERVICE_UNAVAILABLE) public Map<String,String> unavailableSettings(IllegalStateException exception)
      Logs a persistence failure and returns a service-unavailable error without exposing internal details.
      Parameters:
      exception - persistence failure to log
      Returns:
      response body with a stable reason code and a generic error message