Class AbstractAdminAbstractControllerExtensionHandler
java.lang.Object
org.broadleafcommerce.common.extension.AbstractExtensionHandler
org.broadleafcommerce.openadmin.web.controller.AbstractAdminAbstractControllerExtensionHandler
- All Implemented Interfaces:
ExtensionHandler
,AdminAbstractControllerExtensionHandler
- Direct Known Subclasses:
AdminOfferControllerExtensionHandler
,TypedEntityBasicEntityExtensionHandler
public class AbstractAdminAbstractControllerExtensionHandler
extends AbstractExtensionHandler
implements AdminAbstractControllerExtensionHandler
Abstract implementatino of
AdminAbstractControllerExtensionHandler
.
Individual implementations of this extension handler should subclass this class as it will allow them to only override the methods that they need for their particular scenarios.
- Author:
- Andre Azzolini (apazzolini)
-
Field Summary
Fields inherited from class org.broadleafcommerce.common.extension.AbstractExtensionHandler
enabled, priority
Fields inherited from interface org.broadleafcommerce.openadmin.web.controller.AdminAbstractControllerExtensionHandler
NEW_CLASS_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAdditionalMainActions
(String sectionClassName, List<EntityFormAction> actions) Invoked every timeAdminBasicEntityController#viewEntityList()
is invoked to allow additional main form actions to be contributed.isAddRequest
(Entity entity, ExtensionResultHolder<Boolean> resultHolder) Extension point to determine if the entity requested is a new empty add request.modifyDynamicForm
(EntityForm form, String parentEntityId) Invoked wheneverAdminAbstractController#getBlankDynamicFieldTemplateForm
orAdminAbstractController.getDynamicFieldTemplateForm(org.broadleafcommerce.openadmin.web.form.entity.DynamicEntityFormInfo, java.lang.String, org.broadleafcommerce.openadmin.web.form.entity.EntityForm)
is invoked.modifyMainActions
(ClassMetadata cmd, List<EntityFormAction> mainActions) Extension point to override the actions that are added by default when viewing a ceiling entity for a particular section (for instance, a list of Products in the 'Product' section).modifyModelForAddCollectionType
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, String sectionKey, String id, org.springframework.util.MultiValueMap<String, String> requestParams, MapMetadata md) Extension point to modify the model for specific collection typesmodifyPreAddEntityForm
(EntityForm entityForm, ClassMetadata cmd, Map<String, String> pathVars) Extension point for setting values on an EntityForm before the initial object is persisted.overrideSaveEntityJsonResponse
(jakarta.servlet.http.HttpServletResponse response, boolean hasValidationErrors, String sectionKey, String id, ExtensionResultHolder<String> resultHolder) Extension point to determine if the current save transaction is the first valid save.setAdditionalModelAttributes
(org.springframework.ui.Model model, String sectionKey) Invoked every timeAdminAbstractController.setModelAttributes(Model, String)
is invoked.Methods inherited from class org.broadleafcommerce.common.extension.AbstractExtensionHandler
getPriority, isEnabled, setEnabled, setPriority
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.broadleafcommerce.common.extension.ExtensionHandler
getPriority, isEnabled
-
Constructor Details
-
AbstractAdminAbstractControllerExtensionHandler
public AbstractAdminAbstractControllerExtensionHandler()
-
-
Method Details
-
addAdditionalMainActions
public ExtensionResultStatusType addAdditionalMainActions(String sectionClassName, List<EntityFormAction> actions) Description copied from interface:AdminAbstractControllerExtensionHandler
Invoked every timeAdminBasicEntityController#viewEntityList()
is invoked to allow additional main form actions to be contributed.- Specified by:
addAdditionalMainActions
in interfaceAdminAbstractControllerExtensionHandler
- Returns:
-
modifyMainActions
public ExtensionResultStatusType modifyMainActions(ClassMetadata cmd, List<EntityFormAction> mainActions) Description copied from interface:AdminAbstractControllerExtensionHandler
Extension point to override the actions that are added by default when viewing a ceiling entity for a particular section (for instance, a list of Products in the 'Product' section). Assuming that the user has proper permissions, the mainActions list would haveDefaultMainActions.ADD
- Specified by:
modifyMainActions
in interfaceAdminAbstractControllerExtensionHandler
- Parameters:
cmd
- the metadata for the ceiling entity that is being displayedmainActions
- the actions that are added to the main form by default. Use this list to add more actions
-
setAdditionalModelAttributes
public ExtensionResultStatusType setAdditionalModelAttributes(org.springframework.ui.Model model, String sectionKey) Description copied from interface:AdminAbstractControllerExtensionHandler
Invoked every timeAdminAbstractController.setModelAttributes(Model, String)
is invoked.- Specified by:
setAdditionalModelAttributes
in interfaceAdminAbstractControllerExtensionHandler
- Returns:
- the extension result status
-
modifyDynamicForm
Description copied from interface:AdminAbstractControllerExtensionHandler
Invoked wheneverAdminAbstractController#getBlankDynamicFieldTemplateForm
orAdminAbstractController.getDynamicFieldTemplateForm(org.broadleafcommerce.openadmin.web.form.entity.DynamicEntityFormInfo, java.lang.String, org.broadleafcommerce.openadmin.web.form.entity.EntityForm)
is invoked. This method provides the ability to modify the dynamic form that is created as a result of those two methods.- Specified by:
modifyDynamicForm
in interfaceAdminAbstractControllerExtensionHandler
- Returns:
-
modifyModelForAddCollectionType
public ExtensionResultStatusType modifyModelForAddCollectionType(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, String sectionKey, String id, org.springframework.util.MultiValueMap<String, String> requestParams, MapMetadata md) Description copied from interface:AdminAbstractControllerExtensionHandler
Extension point to modify the model for specific collection types- Specified by:
modifyModelForAddCollectionType
in interfaceAdminAbstractControllerExtensionHandler
- Returns:
-
isAddRequest
public ExtensionResultStatusType isAddRequest(Entity entity, ExtensionResultHolder<Boolean> resultHolder) Description copied from interface:AdminAbstractControllerExtensionHandler
Extension point to determine if the entity requested is a new empty add request.- Specified by:
isAddRequest
in interfaceAdminAbstractControllerExtensionHandler
- Returns:
-
overrideSaveEntityJsonResponse
public ExtensionResultStatusType overrideSaveEntityJsonResponse(jakarta.servlet.http.HttpServletResponse response, boolean hasValidationErrors, String sectionKey, String id, ExtensionResultHolder<String> resultHolder) Description copied from interface:AdminAbstractControllerExtensionHandler
Extension point to determine if the current save transaction is the first valid save.- Specified by:
overrideSaveEntityJsonResponse
in interfaceAdminAbstractControllerExtensionHandler
- Returns:
-
modifyPreAddEntityForm
public ExtensionResultStatusType modifyPreAddEntityForm(EntityForm entityForm, ClassMetadata cmd, Map<String, String> pathVars) Description copied from interface:AdminAbstractControllerExtensionHandler
Extension point for setting values on an EntityForm before the initial object is persisted.- Specified by:
modifyPreAddEntityForm
in interfaceAdminAbstractControllerExtensionHandler
- Returns:
-