Interface IPluginAction<F>

Type Parameters:
F - the dto used by the process method, might be session variables or any useful data for the action processing.
All Known Subinterfaces:
IExtendableResourcePluginAction
All Known Implementing Classes:
AbstractPluginAction

public interface IPluginAction<F>
A plugin Action.
The action should rely on a service instead of implementing the business rules itself if possible.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    fillModel(jakarta.servlet.http.HttpServletRequest request, AdminUser adminUser, Map<String,Object> model)
    Fills the model to provide necessary data to fill the button template
    Gets the template to display the action (typically a button - but also check box, select...)
    The action name
    boolean
    isInvoked(jakarta.servlet.http.HttpServletRequest request)
    Returns true if the action is invoked, false otherwise.
    process(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AdminUser adminUser, F sessionFields)
    Processes the request
  • Method Details

    • isInvoked

      boolean isInvoked(jakarta.servlet.http.HttpServletRequest request)
      Returns true if the action is invoked, false otherwise.
      Uses one or several button names to detect if the action is called or note.
      Parameters:
      request - the request
      Returns:
      true if the action is invoked, false otherwise.
    • process

      IPluginActionResult process(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AdminUser adminUser, F sessionFields) throws AccessDeniedException
      Processes the request
      Parameters:
      request - the request
      response - the response
      adminUser - the user
      sessionFields - the session fields
      Returns:
      the action result
      Throws:
      AccessDeniedException - if the user can't access the feature
    • fillModel

      void fillModel(jakarta.servlet.http.HttpServletRequest request, AdminUser adminUser, Map<String,Object> model)
      Fills the model to provide necessary data to fill the button template
      Parameters:
      request - the request
      adminUser - the admin user to filter features
      model - the model
    • getButtonTemplate

      String getButtonTemplate()
      Gets the template to display the action (typically a button - but also check box, select...) Return an empty string if no display is needed (for default directory actions : create, search...)
      Returns:
      the template
    • getName

      String getName()
      The action name
      Returns:
      the name