Class AdminCustomerSegmentAdornedTargetController
java.lang.Object
org.broadleafcommerce.common.web.controller.BroadleafAbstractController
org.broadleafcommerce.openadmin.web.controller.AdminAbstractController
com.broadleafcommerce.customersegment.admin.web.controller.AdminCustomerSegmentAdornedTargetController
@Controller("blAdminCustomerSegmentAdornedTargetController")
@RequestMapping("/create-adorned-target/{sectionKey:.+}")
public class AdminCustomerSegmentAdornedTargetController
extends org.broadleafcommerce.openadmin.web.controller.AdminAbstractController
- Author:
- Chris Kittrell (ckittrell)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.broadleafcommerce.openadmin.web.service.FormBuilderServiceFields inherited from class org.broadleafcommerce.openadmin.web.controller.AdminAbstractController
adminNavigationService, adminRemoteSecurityService, CURRENT_ADMIN_MODULE_ATTRIBUTE_NAME, CURRENT_ADMIN_SECTION_ATTRIBUTE_NAME, customCriteriaService, DEFAULT_CONTAINER_VIEW, entityConfiguration, entityFormValidator, eps, extensionManager, FILTER_VALUE_SEPARATOR, FILTER_VALUE_SEPARATOR_REGEX, filterProductTypeExtensionManager, LOG, MODAL_CONTAINER_VIEW, service, validationService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateCollectionItem(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, Map<String, String> pathVars, String parentId, String collectionField, org.broadleafcommerce.openadmin.web.form.entity.EntityForm entityForm, org.springframework.validation.BindingResult result) Creates the new collection item & adds it to the specified collection.protected String[]Obtains the controller's custom criteriaprotected StringhandleErrorResponse(jakarta.servlet.http.HttpServletRequest request, Map<String, String> pathVars, String sectionKey, List<org.broadleafcommerce.openadmin.dto.SectionCrumb> sectionCrumbs, org.springframework.ui.Model model, org.broadleafcommerce.openadmin.web.form.entity.EntityForm entityForm, org.broadleafcommerce.openadmin.dto.Entity targetEntity, org.broadleafcommerce.openadmin.dto.ClassMetadata targetEntityClassMetadata) voidinitBinder(org.springframework.web.bind.WebDataBinder binder) Invoked on every request to provide the ability to register specific binders for Spring's binding process.protected voidmodifyEntityForm(org.broadleafcommerce.openadmin.web.form.entity.EntityForm entityForm, Map<String, String> pathVars) This method is invoked whenever an assembled EntityForm is rendered.showCreateCollectionItem(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, Map<String, String> pathVars, String parentId, String collectionField, org.springframework.util.MultiValueMap<String, String> requestParams) Shows the modal dialog that is used to create a CustomerSegment & add it to the given collection.viewTab(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, Map<String, String> pathVars, String id, String collectionField, String collectionItemId, String tabName, org.broadleafcommerce.openadmin.web.form.entity.EntityForm ef) Methods inherited from class org.broadleafcommerce.openadmin.web.controller.AdminAbstractController
attachSectionSpecificInfo, attachSectionSpecificInfo, createSectionCrumb, declareForceUseAdditionStatusFilter, extractDynamicFormFields, getAddEntityTypes, getClassNameForSection, getCollectionListGrid, getCollectionListGrid, getCriteria, getDefaultEntityType, getDynamicFieldTemplateForm, getDynamicForm, getEntityForm, getEntityForm, getEntityForm, getFirstId, getLastId, getLowerCount, getMaxIndex, getMaxResults, getPageSize, getPersistencePackageRequest, getSectionCrumbs, getSectionCustomCriteria, getSectionKey, getSectionPersistencePackageRequest, getSectionPersistencePackageRequest, getSectionPersistencePackageRequest, getSectionPersistencePackageRequest, getSortDirections, getSortPropertyNames, getStartIndex, getUpperCount, modifyAddEntityForm, modifyCriteria, populateJsonValidationErrors, setModelAttributes, setSpecializedNameForFields, translateErrorMessageMethods inherited from class org.broadleafcommerce.common.web.controller.BroadleafAbstractController
addDeepLink, getContextPath, isAjaxRequest, jsonResponse
-
Field Details
-
formService
protected org.broadleafcommerce.openadmin.web.service.FormBuilderService formService
-
-
Constructor Details
-
AdminCustomerSegmentAdornedTargetController
public AdminCustomerSegmentAdornedTargetController()
-
-
Method Details
-
showCreateCollectionItem
@RequestMapping(value="/{parentId}/{collectionField:.*}", method=GET) public String showCreateCollectionItem(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @PathVariable Map<String, String> pathVars, @PathVariable("parentId") String parentId, @PathVariable("collectionField") String collectionField, @RequestParam org.springframework.util.MultiValueMap<String, throws ExceptionString> requestParams) Shows the modal dialog that is used to create a CustomerSegment & add it to the given collection.Currently, this is only intended to support the Adorned relationships between Offer & CustomerSegment and ContentTargeter & CustomerSegment. The intention here is to render a blank form (similar to a Basic Collection's Persist) to define the new CustomerSegment which will later be added to the CustomerSegmentXref collection.
- Parameters:
request-response-model-pathVars-parentId-collectionField-requestParams-- Returns:
- the return view path
- Throws:
Exception
-
createCollectionItem
@RequestMapping(value="/{parentId}/{collectionField:.*}", method=POST) public String createCollectionItem(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @PathVariable Map<String, String> pathVars, @PathVariable("parentId") String parentId, @PathVariable("collectionField") String collectionField, @ModelAttribute("entityForm") org.broadleafcommerce.openadmin.web.form.entity.EntityForm entityForm, org.springframework.validation.BindingResult result) throws ExceptionCreates the new collection item & adds it to the specified collection.- Parameters:
request-response-model-pathVars-parentId-collectionField-entityForm-- Returns:
- the return view path
- Throws:
Exception
-
viewTab
@RequestMapping(value="/{id}/{collectionField:.*}/{collectionItemId}/{tabName}", method=POST) public String viewTab(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @PathVariable Map<String, String> pathVars, @PathVariable("id") String id, @PathVariable("collectionField") String collectionField, @PathVariable("collectionItemId") String collectionItemId, @PathVariable("tabName") String tabName, @ModelAttribute("entityForm") org.broadleafcommerce.openadmin.web.form.entity.EntityForm ef) throws Exception- Throws:
Exception
-
modifyEntityForm
protected void modifyEntityForm(org.broadleafcommerce.openadmin.web.form.entity.EntityForm entityForm, Map<String, String> pathVars) throws ExceptionThis method is invoked whenever an assembled EntityForm is rendered. This typically occurs when viewing an entity in the admin or viewing an error state on a POST for that entity.- Overrides:
modifyEntityFormin classorg.broadleafcommerce.openadmin.web.controller.AdminAbstractController- Parameters:
entityForm-- Throws:
Exception
-
handleErrorResponse
protected String handleErrorResponse(jakarta.servlet.http.HttpServletRequest request, Map<String, String> pathVars, String sectionKey, List<org.broadleafcommerce.openadmin.dto.SectionCrumb> sectionCrumbs, org.springframework.ui.Model model, org.broadleafcommerce.openadmin.web.form.entity.EntityForm entityForm, org.broadleafcommerce.openadmin.dto.Entity targetEntity, org.broadleafcommerce.openadmin.dto.ClassMetadata targetEntityClassMetadata) throws Exception- Throws:
Exception
-
getCustomCriteria
Obtains the controller's custom criteria- Returns:
-
initBinder
@InitBinder public void initBinder(org.springframework.web.bind.WebDataBinder binder) Invoked on every request to provide the ability to register specific binders for Spring's binding process. By default, we register a binder that treats empty Strings as null and a Boolean editor that supports either true or false. If the value is passed in as null, it will treat it as false.- Parameters:
binder-
-