Class AdminAssetController
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.AdminAssetController
@Controller("blAdminAssetController")
@RequestMapping("/assets")
public class AdminAssetController
extends AdminBasicEntityController
Handles admin operations for the
Asset
entity. This is mostly to support displaying image assets inline
in listgrids.- Author:
- Andre Azzolini (apazzolini)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AssetFormBuilderService
static final String
protected StaticAssetMultiTenantExtensionManager
protected StaticAssetService
protected StaticAssetStorageService
Fields 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, sandBoxHelper
Fields 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, MODAL_CONTAINER_VIEW, service, validationService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
This method is called when attempting to add new entities that have a polymorphic tree.protected String
getSectionKey
(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 entityviewEntityList
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, Map<String, String> pathVars, org.springframework.util.MultiValueMap<String, String> requestParams) Renders the main entity listing for the specified class, which is based on the current sectionKey with some optional criteria.Methods 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, viewEntityListSelectize, viewEntityTab, viewReadOnlyCollectionItemTab
Methods inherited from class org.broadleafcommerce.openadmin.web.controller.AdminAbstractController
attachSectionSpecificInfo, attachSectionSpecificInfo, createSectionCrumb, declareForceUseAdditionStatusFilter, extractDynamicFormFields, getAddEntityTypes, getClassNameForSection, getCollectionListGrid, getCollectionListGrid, getCriteria, 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, translateErrorMessage
Methods inherited from class org.broadleafcommerce.common.web.controller.BroadleafAbstractController
addDeepLink, getContextPath, isAjaxRequest, jsonResponse
-
Field Details
-
SECTION_KEY
- See Also:
-
formService
-
staticAssetService
-
staticAssetStorageService
-
staticAssetExtensionManager
-
-
Constructor Details
-
AdminAssetController
public AdminAssetController()
-
-
Method Details
-
getSectionKey
Description copied from class:AdminAbstractController
This 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:
getSectionKey
in classAdminAbstractController
- Parameters:
pathVars
- - the map of all currently bound path variables for this request- Returns:
- the sectionKey for this request
-
viewEntityList
@RequestMapping(value="", method=GET) public String viewEntityList(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @PathVariable Map<String, String> pathVars, @RequestParam org.springframework.util.MultiValueMap<String, throws ExceptionString> requestParams) Description copied from class:AdminBasicEntityController
Renders the main entity listing for the specified class, which is based on the current sectionKey with some optional criteria.- Overrides:
viewEntityList
in classAdminBasicEntityController
requestParams
- a Map of property name -> list critiera values- Returns:
- the return view path
- Throws:
Exception
-
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:AdminBasicEntityController
Renders the main entity form for the specified entity- Overrides:
viewEntityForm
in 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:AdminBasicEntityController
Attempts 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:
saveEntity
in classAdminBasicEntityController
- Returns:
- the return view path
- Throws:
Exception
-
getDefaultEntityType
Description copied from class:AdminAbstractController
This method is called when attempting to add new entities that have a polymorphic tree.If this method returns null, there is no default type set for this particular entity type, and the user will be presented with a selection of possible types to utilize.
If it returns a non-null value, the returned fullyQualifiedClassname will be used and will bypass the selection step.
- Overrides:
getDefaultEntityType
in classAdminAbstractController
- Returns:
- null if there is no default type, otherwise the default type
-