Class AdminAssetUploadController
java.lang.Object
org.broadleafcommerce.common.web.controller.BroadleafAbstractController
org.broadleafcommerce.openadmin.web.controller.AdminAbstractController
org.broadleafcommerce.cms.admin.web.controller.AdminAssetUploadController
@Controller("blAdminAssetUploadController")
@RequestMapping("/{sectionKey}")
public class AdminAssetUploadController
extends AdminAbstractController
AdminAssetUploadController handles uploading or selecting assets.
Used with entities like SkuImpl
and CategoryImpl
that have CustomPersistenceHandler
configurations that provide support for adding maps of Media objects.
- Author:
- Brian Polster (bpolster)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AdminAssetController
protected EntityConfiguration
protected StaticAssetService
protected StaticAssetStorageService
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, entityFormValidator, eps, extensionManager, FILTER_VALUE_SEPARATOR, FILTER_VALUE_SEPARATOR_REGEX, filterProductTypeExtensionManager, formService, LOG, MODAL_CONTAINER_VIEW, service, validationService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchooseMediaForMapKey
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, String sectionKey, String addlSectionKey, String id, org.springframework.util.MultiValueMap<String, String> requestParams) chooseMediaForMapKey
(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) upload
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, Map<String, String> pathVars, org.springframework.web.multipart.MultipartFile file, org.springframework.util.MultiValueMap<String, String> requestParams) Used by the Asset list view to upload an asset and then immediately show the edit form for that record.upload
(jakarta.servlet.http.HttpServletRequest request, org.springframework.web.multipart.MultipartFile file, String sectionKey, String id) upload
(jakarta.servlet.http.HttpServletRequest request, org.springframework.web.multipart.MultipartFile file, String sectionKey, String addlSectionKey, String id) 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, modifyEntityForm, populateJsonValidationErrors, setModelAttributes, setSpecializedNameForFields, translateErrorMessage
Methods inherited from class org.broadleafcommerce.common.web.controller.BroadleafAbstractController
addDeepLink, getContextPath, isAjaxRequest, jsonResponse
-
Field Details
-
entityConfiguration
-
staticAssetStorageService
-
staticAssetService
-
assetController
-
-
Constructor Details
-
AdminAssetUploadController
public AdminAssetUploadController()
-
-
Method Details
-
chooseMediaForMapKey
@RequestMapping(value="/{id}/chooseAsset", method=GET) public String chooseMediaForMapKey(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @PathVariable("sectionKey") String sectionKey, @PathVariable("id") String id, @RequestParam org.springframework.util.MultiValueMap<String, String> requestParams) throws Exception- Throws:
Exception
-
upload
@RequestMapping(value="/{id}/uploadAsset", method=POST, produces="application/json") public org.springframework.http.ResponseEntity<Map<String,Object>> upload(jakarta.servlet.http.HttpServletRequest request, @RequestParam("file") org.springframework.web.multipart.MultipartFile file, @PathVariable("sectionKey") String sectionKey, @PathVariable("id") String id) throws IOException - Throws:
IOException
-
upload
@RequestMapping(value="/uploadAsset", method=POST) public String upload(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @PathVariable Map<String, String> pathVars, @RequestParam("file") org.springframework.web.multipart.MultipartFile file, @RequestParam org.springframework.util.MultiValueMap<String, throws ExceptionString> requestParams) Used by the Asset list view to upload an asset and then immediately show the edit form for that record.- Parameters:
request
-file
-sectionKey
-- Returns:
- Throws:
IOException
Exception
-
chooseMediaForMapKey
@RequestMapping(value="/{addlSectionKey}/{id}/chooseAsset", method=GET) public String chooseMediaForMapKey(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @PathVariable("sectionKey") String sectionKey, @PathVariable("addlSectionKey") String addlSectionKey, @PathVariable("id") String id, @RequestParam org.springframework.util.MultiValueMap<String, String> requestParams) throws Exception- Throws:
Exception
-
upload
@RequestMapping(value="/{addlSectionKey}/{id}/uploadAsset", method=POST, produces="application/json") public org.springframework.http.ResponseEntity<Map<String,Object>> upload(jakarta.servlet.http.HttpServletRequest request, @RequestParam("file") org.springframework.web.multipart.MultipartFile file, @PathVariable("sectionKey") String sectionKey, @PathVariable("addlSectionKey") String addlSectionKey, @PathVariable("id") String id) throws IOException - Throws:
IOException
-