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.
The action should rely on a service instead of implementing the business rules itself if possible.
fillModel(HttpServletRequest, AdminUser, Map)is called by the JspBean to add additionnal data in the main modelgetButtonTemplate()is used to display buttons.isInvoked(HttpServletRequest)is used by a JspBean to detect the invoked action.process(HttpServletRequest, HttpServletResponse, AdminUser, Object)is called by the JspBean to process the invoked action. TheIPluginActionResultmay contain html content or a redirect url or a noop as a result of the action processing.getName()is mainly for debbuging purpose
-
Method Summary
Modifier and TypeMethodDescriptionvoidfillModel(jakarta.servlet.http.HttpServletRequest request, AdminUser adminUser, Map<String, Object> model) Fills the model to provide necessary data to fill the button templateGets 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...)getName()The action namebooleanisInvoked(jakarta.servlet.http.HttpServletRequest request) Returnstrueif the action is invoked,falseotherwise.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) Returnstrueif the action is invoked,falseotherwise.
Uses one or several button names to detect if the action is called or note.- Parameters:
request- the request- Returns:
trueif the action is invoked,falseotherwise.
-
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 requestresponse- the responseadminUser- the usersessionFields- 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 requestadminUser- the admin user to filter featuresmodel- 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
-