Class AdminPageController
java.lang.Object
org.broadleafcommerce.common.web.controller.BroadleafAbstractController
org.broadleafcommerce.openadmin.web.controller.AdminAbstractController
org.broadleafcommerce.openadmin.web.controller.entity.AdminBasicEntityController
org.broadleafcommerce.cms.admin.web.controller.AdminPageController
@Controller("blAdminPageController")
@RequestMapping("/pages")
public class AdminPageController
extends AdminBasicEntityController
Handles admin operations for the
Page entity. This entity has fields that are
dependent on the value of the Page.getPageTemplate() field, and as such,
it deviates from the typical AdminBasicEntityController.- Author:
- Andre Azzolini (apazzolini)
-
Field Summary
FieldsFields inherited from class org.broadleafcommerce.openadmin.web.controller.entity.AdminBasicEntityController
adminUserDao, adornedTargetAutoPopulateExtensionManager, ALTERNATE_ID_PROPERTY, CURRENT_FOLDER_ID, CUSTOM_CRITERIA, duplicator, dynamicEntityDao, genericEntityService, IS_SELECTIZE_REQUEST, LOG, multipleCatalogExtensionManager, rowLevelSecurityService, sandBoxHelperFields 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, formService, MODAL_CONTAINER_VIEW, service, validationService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidattachSectionSpecificInfo(PersistencePackageRequest ppr, Map<String, String> pathVars) A hook method that is invoked every time the getSectionPersistencePackageRequest(..) method is invoked.getDynamicForm(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, Map<String, String> pathVars, String propertyName, String propertyTypeId) protected DynamicEntityFormInfogetDynamicForm(EntityForm ef, String id) protected StringgetSectionKey(Map<String, String> pathVars) This method is used to determine the current section key.saveEntity(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, Map<String, String> pathVars, String id, EntityForm entityForm, org.springframework.validation.BindingResult result, org.springframework.web.servlet.mvc.support.RedirectAttributes ra) Attempts to save the given entity.viewEntityForm(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, Map<String, String> pathVars, String id) Renders the main entity form for the specified entityMethods inherited from class org.broadleafcommerce.openadmin.web.controller.entity.AdminBasicEntityController
addAddActionIfAllowed, addAuditableDisplayField, addAuditableDisplayFields, addCollectionItem, addCollectionItem, addEmptyCollectionItem, addEntity, addSelectizeCollectionItem, buildAddCollectionItemModel, buildAuditableDisplayField, buildDirtyList, buildSelectizeCustomCriteria, declareShouldIgnoreAdditionStatusFilter, determineEntityType, duplicateEntity, getCollectionFieldRecords, getCollectionValueDetails, getCurrentFolderId, getCurrentTabName, getCustomCriteria, getErrorDuplicatingResponse, getModalForBlankEntityType, getSelectizeCollectionOptions, getViewSubRecords, initBinder, isAddActionAllowed, isNotReadOnly, modifyEntityForm, reinitializeEntityForm, removeCollectionItem, removeCollectionItem, removeEntity, resolveAppropriateEntityView, saveEntityJson, setTypedEntityModelAttributes, setupViewEntityListBasicModel, showAddCollectionItem, showUpdateCollectionItem, showUpdateCollectionItem, showViewCollectionItem, showViewCollectionItem, showViewUpdateCollection, showViewUpdateCollection, showViewUpdateCollection, showViewUpdateCollection, updateCollectionItem, updateCollectionItem, updateCollectionItemSequence, updateCollectionItemSequence, viewAddEntityForm, viewCollectionItemDetails, viewCollectionItemTab, viewEntityList, viewEntityListSelectize, viewEntityTab, viewReadOnlyCollectionItemTabMethods inherited from class org.broadleafcommerce.openadmin.web.controller.AdminAbstractController
attachSectionSpecificInfo, createSectionCrumb, declareForceUseAdditionStatusFilter, extractDynamicFormFields, getAddEntityTypes, getClassNameForSection, getCollectionListGrid, getCollectionListGrid, getCriteria, getDefaultEntityType, getDynamicFieldTemplateForm, getDynamicForm, getEntityForm, getEntityForm, getEntityForm, getFirstId, getLastId, getLowerCount, getMaxIndex, getMaxResults, getPageSize, getPersistencePackageRequest, getSectionCrumbs, getSectionCustomCriteria, getSectionPersistencePackageRequest, getSectionPersistencePackageRequest, getSectionPersistencePackageRequest, getSectionPersistencePackageRequest, getSortDirections, getSortPropertyNames, getStartIndex, getUpperCount, modifyAddEntityForm, modifyCriteria, modifyEntityForm, populateJsonValidationErrors, setModelAttributes, setSpecializedNameForFields, translateErrorMessageMethods inherited from class org.broadleafcommerce.common.web.controller.BroadleafAbstractController
addDeepLink, getContextPath, isAjaxRequest, jsonResponse
-
Field Details
-
SECTION_KEY
- See Also:
-
-
Constructor Details
-
AdminPageController
public AdminPageController()
-
-
Method Details
-
getSectionKey
Description copied from class:AdminAbstractControllerThis method is used to determine the current section key. For this default implementation, the sectionKey is pulled from the pathVariable, {sectionKey}, as defined by the request mapping on this controller. To support controller inheritance and allow more specialized controllers to delegate some methods to this basic controller, overridden implementations of this method could return a hardcoded value instead of reading the map- Overrides:
getSectionKeyin classAdminAbstractController- Parameters:
pathVars- - the map of all currently bound path variables for this request- Returns:
- the sectionKey for this request
-
getDynamicForm
-
addOnChangeTrigger
-
viewEntityForm
@RequestMapping(value="/{id}", method=GET) public String viewEntityForm(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @PathVariable Map<String, String> pathVars, @PathVariable("id") String id) throws ExceptionDescription copied from class:AdminBasicEntityControllerRenders the main entity form for the specified entity- Overrides:
viewEntityFormin classAdminBasicEntityController- Returns:
- the return view path
- Throws:
Exception
-
saveEntity
@RequestMapping(value="/{id}", method=POST) public String saveEntity(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @PathVariable Map<String, String> pathVars, @PathVariable("id") String id, @ModelAttribute("entityForm") EntityForm entityForm, org.springframework.validation.BindingResult result, org.springframework.web.servlet.mvc.support.RedirectAttributes ra) throws ExceptionDescription copied from class:AdminBasicEntityControllerAttempts to save the given entity. If validation is unsuccessful, it will re-render the entity form with error fields highlighted. On a successful save, it will refresh the entity page.- Overrides:
saveEntityin classAdminBasicEntityController- Returns:
- the return view path
- Throws:
Exception
-
getDynamicForm
@RequestMapping(value="/{propertyName}/dynamicForm", method=GET) public String getDynamicForm(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @PathVariable Map<String, String> pathVars, @PathVariable("propertyName") String propertyName, @RequestParam("propertyTypeId") String propertyTypeId) throws Exception- Throws:
Exception
-
attachSectionSpecificInfo
protected void attachSectionSpecificInfo(PersistencePackageRequest ppr, Map<String, String> pathVars) Description copied from class:AdminAbstractControllerA hook method that is invoked every time the getSectionPersistencePackageRequest(..) method is invoked. This allows specialized controllers to hook into every request and manipulate the persistence package request as desired.- Overrides:
attachSectionSpecificInfoin classAdminAbstractController
-