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 org.broadleafcommerce.openadmin.web.controller.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

    Fields
    Modifier and Type
    Field
    Description
     
    protected org.broadleafcommerce.common.persistence.EntityConfiguration
     
     
     

    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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    chooseMediaForMapKey(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.
    org.springframework.http.ResponseEntity<Map<String,Object>>
    upload(jakarta.servlet.http.HttpServletRequest request, org.springframework.web.multipart.MultipartFile file, String sectionKey, String id)
     
    org.springframework.http.ResponseEntity<Map<String,Object>>
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • entityConfiguration

      protected org.broadleafcommerce.common.persistence.EntityConfiguration entityConfiguration
    • staticAssetStorageService

      protected StaticAssetStorageService staticAssetStorageService
    • staticAssetService

      protected StaticAssetService staticAssetService
    • assetController

      protected AdminAssetController 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,String> requestParams) throws Exception
      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