Class StylesJspBean

All Implemented Interfaces:
Serializable

@RequestScoped @Named @Controller(controllerJsp="ManageStyles.jsp", controllerPath="jsp/admin/style/", right="CORE_STYLES_MANAGEMENT", securityTokenEnabled=true) public class StylesJspBean extends MVCAdminJspBean
This class provides the user interface to manage Styles features
See Also:
  • Field Details

  • Constructor Details

    • StylesJspBean

      public StylesJspBean()
  • Method Details

    • getStylesManagement

      @View(value="manageStyles", defaultView=true) public String getStylesManagement(Models model, jakarta.servlet.http.HttpServletRequest request)
      Displays the list of styles in the management view.
      Parameters:
      model - the model used to pass attributes to the view
      request - the HTTP request
      Returns:
      the HTML code of the styles management page
    • getStyleItems

      @Action("getStyleItems") @ResponseBody public List<Style> getStyleItems(int numPage)
      Retrieves a paginated list of style items for the specified page number.
      Parameters:
      numPage - The page number to retrieve.
      Returns:
      A list of style items for the specified page.
    • getCreateStyle

      @View(value="getCreateStyle", securityTokenAction="createStyle") public String getCreateStyle(Models model)
      Returns the create form of a new style
      Parameters:
      model - The Models
      Returns:
      The html code for the create form of a new style
    • doCreateStyle

      @Action("createStyle") public String doCreateStyle(@Valid @Valid Style style, BindingResult bindingResult, Models model, jakarta.servlet.http.HttpServletRequest request) throws AccessDeniedException
      Handles the creation of a new style by validating the form inputs, checking for conflicts, and persisting the style if valid.
      Parameters:
      style - the style object bound from the creation form
      bindingResult - the result of the validation of the style object
      model - the model used to pass attributes to the view
      request - the HTTP request
      Returns:
      the JSP URL or redirect URL of the process result
      Throws:
      AccessDeniedException - if the security token is invalid
    • getModifyStyle

      @View(value="getModifyStyle", securityTokenAction="modifyStyle") public String getModifyStyle(int nStyleId, Models model)
      Returns the form to update a style identified by its id.
      Parameters:
      nStyleId - the identifier of the style to modify
      model - the model used to pass attributes to the view
      Returns:
      the HTML code of the update form
    • doModifyStyle

      @Action("modifyStyle") public String doModifyStyle(@Valid @Valid Style style, int nStyleId, BindingResult bindingResult, Models model, jakarta.servlet.http.HttpServletRequest request)
      Processes the update of a style by validating the form inputs, checking for conflicts, and persisting the modifications if valid.
      Parameters:
      style - the style object bound from the update form
      nStyleId - the identifier of the style being updated
      bindingResult - the result of the validation of the style object
      model - the model used to pass attributes to the view
      request - the HTTP request
      Returns:
      the JSP URL or redirect URL of the process result
    • getConfirmRemoveStyle

      @View(value="getConfirmRemoveStyle", securityTokenAction="removeStyle") public String getConfirmRemoveStyle(int nId, jakarta.servlet.http.HttpServletRequest request)
      Returns the confirmation page for removing a style identified by its id.
      Parameters:
      nId - the identifier of the style to remove
      request - the HTTP request
      Returns:
      the HTML code of the remove confirmation page
    • doRemoveStyle

      @Action("removeStyle") public String doRemoveStyle(int nId, jakarta.servlet.http.HttpServletRequest request)
      Processes the deletion of a style identified by its id.
      Parameters:
      nId - the identifier of the style to remove
      request - the HTTP request
      Returns:
      the JSP URL or redirect URL of the process result