org.broadleafcommerce.cms.admin.web.controller
Class AdminAssetUploadController

java.lang.Object
  extended by org.broadleafcommerce.common.web.controller.BroadleafAbstractController
      extended by org.broadleafcommerce.openadmin.web.controller.AdminAbstractController
          extended by org.broadleafcommerce.cms.admin.web.controller.AdminAssetUploadController

@Controller(value="blAdminAssetUploadController")
@RequestMapping(value="/{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
protected  AdminAssetController assetController
           
protected  EntityConfiguration entityConfiguration
           
protected  StaticAssetService staticAssetService
           
protected  StaticAssetStorageService staticAssetStorageService
           
 
Fields inherited from class org.broadleafcommerce.openadmin.web.controller.AdminAbstractController
adminNavigationService, adminRemoteSecurityService, entityFormValidator, FILTER_VALUE_SEPARATOR, FILTER_VALUE_SEPARATOR_REGEX, formService, mainEntityActionsExtensionManager, service
 
Constructor Summary
AdminAssetUploadController()
           
 
Method Summary
 String chooseMediaForMapKey(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, String sectionKey, String id, org.springframework.util.MultiValueMap<String,String> requestParams)
           
 String upload(javax.servlet.http.HttpServletRequest request, org.springframework.web.multipart.MultipartFile file, String sectionKey)
           
 Map<String,Object> upload(javax.servlet.http.HttpServletRequest request, org.springframework.web.multipart.MultipartFile file, String sectionKey, String id)
           
 
Methods inherited from class org.broadleafcommerce.openadmin.web.controller.AdminAbstractController
attachSectionSpecificInfo, extractDynamicFormFields, getAddEntityTypes, getBlankDynamicFieldTemplateForm, getBlankDynamicFieldTemplateForm, getClassNameForSection, getCollectionListGrid, getCollectionListGrid, getCriteria, getDefaultEntityType, getDynamicFieldTemplateForm, getDynamicForm, getMaxIndex, getSectionCustomCriteria, getSectionKey, getSectionPersistencePackageRequest, getSectionPersistencePackageRequest, getSortDirections, getSortPropertyNames, getStartIndex, setModelAttributes
 
Methods inherited from class org.broadleafcommerce.common.web.controller.BroadleafAbstractController
addDeepLink, getContextPath, isAjaxRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entityConfiguration

protected EntityConfiguration entityConfiguration

staticAssetStorageService

protected StaticAssetStorageService staticAssetStorageService

staticAssetService

protected StaticAssetService staticAssetService

assetController

protected AdminAssetController assetController
Constructor Detail

AdminAssetUploadController

public AdminAssetUploadController()
Method Detail

chooseMediaForMapKey

@RequestMapping(value="/{id}/chooseAsset",
                method=GET)
public String chooseMediaForMapKey(javax.servlet.http.HttpServletRequest request,
                                                  javax.servlet.http.HttpServletResponse response,
                                                  org.springframework.ui.Model model,
                                                  @PathVariable(value="sectionKey")
                                                  String sectionKey,
                                                  @PathVariable(value="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; charset=utf-8")
@ResponseBody
public Map<String,Object> upload(javax.servlet.http.HttpServletRequest request,
                                                             @RequestParam(value="file")
                                                             org.springframework.web.multipart.MultipartFile file,
                                                             @PathVariable(value="sectionKey")
                                                             String sectionKey,
                                                             @PathVariable(value="id")
                                                             String id)
                          throws IOException
Throws:
IOException

upload

@RequestMapping(value="/uploadAsset",
                method=POST)
public String upload(javax.servlet.http.HttpServletRequest request,
                                    @RequestParam(value="file")
                                    org.springframework.web.multipart.MultipartFile file,
                                    @PathVariable(value="sectionKey")
                                    String sectionKey)
              throws IOException
Throws:
IOException


Copyright © 2013. All Rights Reserved.