org.broadleafcommerce.admin.web.controller.entity
Class AdminProductController

java.lang.Object
  extended by org.broadleafcommerce.common.web.controller.BroadleafAbstractController
      extended by org.broadleafcommerce.openadmin.web.controller.AdminAbstractController
          extended by org.broadleafcommerce.openadmin.web.controller.entity.AdminBasicEntityController
              extended by org.broadleafcommerce.admin.web.controller.entity.AdminProductController

@Controller(value="blAdminProductController")
@RequestMapping(value="/product")
public class AdminProductController
extends AdminBasicEntityController

Handles admin operations for the Product entity. Editing a product requires custom criteria in order to properly invoke the ProductCustomPersistenceHandler

Author:
Andre Azzolini (apazzolini)
See Also:
ProductCustomPersistenceHandler}

Field Summary
protected static String SECTION_KEY
           
 
Fields inherited from class org.broadleafcommerce.openadmin.web.controller.AdminAbstractController
adminNavigationService, adminRemoteSecurityService, entityConfiguration, entityFormValidator, FILTER_VALUE_SEPARATOR, FILTER_VALUE_SEPARATOR_REGEX, formService, mainEntityActionsExtensionManager, service
 
Constructor Summary
AdminProductController()
           
 
Method Summary
protected  String buildAddCollectionItemModel(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, String id, String collectionField, String sectionKey, Property collectionProperty, FieldMetadata md, PersistencePackageRequest ppr, EntityForm entityForm, Entity entity)
           
 String[] getSectionCustomCriteria()
           
protected  String getSectionKey(Map<String,String> pathVars)
           
protected  void removeRequiredValidation(EntityForm entityForm)
          Clears out any required validation on the fields within an entity form.
protected  String showAddAdditionalSku(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, String id)
           
 String showAddCollectionItem(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, Map<String,String> pathVars, String id, String collectionField, org.springframework.util.MultiValueMap<String,String> requestParams)
           
protected  String showUpdateAdditionalSku(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, String id, String collectionItemId)
           
 String showUpdateCollectionItem(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, Map<String,String> pathVars, String id, String collectionField, String collectionItemId)
           
 String viewEntityForm(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, Map<String,String> pathVars, String id)
           
 
Methods inherited from class org.broadleafcommerce.openadmin.web.controller.entity.AdminBasicEntityController
addAddActionIfAllowed, addCollectionItem, addEntity, getCollectionFieldRecords, getCollectionValueDetails, initBinder, removeCollectionItem, removeEntity, saveEntity, showSelectCollectionItem, showViewCollectionItem, showViewUpdateCollection, showViewUpdateCollection, updateCollectionItem, updateCollectionItemSequence, viewAddEntityForm, viewCollectionItemDetails, viewEntityList
 
Methods inherited from class org.broadleafcommerce.openadmin.web.controller.AdminAbstractController
attachSectionSpecificInfo, extractDynamicFormFields, getAddEntityTypes, getBlankDynamicFieldTemplateForm, getBlankDynamicFieldTemplateForm, getClassNameForSection, getCollectionListGrid, getCriteria, getDefaultEntityType, getDynamicFieldTemplateForm, getDynamicForm, getMaxIndex, getSectionPersistencePackageRequest, getSectionPersistencePackageRequest, getSortDirections, getSortPropertyNames, getStartIndex, setModelAttributes
 
Methods inherited from class org.broadleafcommerce.common.web.controller.BroadleafAbstractController
getContextPath, isAjaxRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECTION_KEY

protected static final String SECTION_KEY
See Also:
Constant Field Values
Constructor Detail

AdminProductController

public AdminProductController()
Method Detail

getSectionKey

protected String getSectionKey(Map<String,String> pathVars)
Overrides:
getSectionKey in class AdminAbstractController

getSectionCustomCriteria

public String[] getSectionCustomCriteria()
Overrides:
getSectionCustomCriteria in class AdminAbstractController

showAddAdditionalSku

protected String showAddAdditionalSku(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response,
                                      org.springframework.ui.Model model,
                                      String id)
                               throws Exception
Throws:
Exception

buildAddCollectionItemModel

protected String buildAddCollectionItemModel(javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response,
                                             org.springframework.ui.Model model,
                                             String id,
                                             String collectionField,
                                             String sectionKey,
                                             Property collectionProperty,
                                             FieldMetadata md,
                                             PersistencePackageRequest ppr,
                                             EntityForm entityForm,
                                             Entity entity)
                                      throws ServiceException
Overrides:
buildAddCollectionItemModel in class AdminBasicEntityController
Throws:
ServiceException

showUpdateAdditionalSku

protected String showUpdateAdditionalSku(javax.servlet.http.HttpServletRequest request,
                                         javax.servlet.http.HttpServletResponse response,
                                         org.springframework.ui.Model model,
                                         String id,
                                         String collectionItemId)
                                  throws Exception
Throws:
Exception

showUpdateCollectionItem

@RequestMapping(value="/{id}/{collectionField:.*}/{collectionItemId}",
                method=GET)
public String showUpdateCollectionItem(javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response,
                                                      org.springframework.ui.Model model,
                                                      @PathVariable
                                                      Map<String,String> pathVars,
                                                      @PathVariable(value="id")
                                                      String id,
                                                      @PathVariable(value="collectionField")
                                                      String collectionField,
                                                      @PathVariable(value="collectionItemId")
                                                      String collectionItemId)
                                throws Exception
Overrides:
showUpdateCollectionItem in class AdminBasicEntityController
Throws:
Exception

showAddCollectionItem

@RequestMapping(value="/{id}/{collectionField}/add",
                method=GET)
public String showAddCollectionItem(javax.servlet.http.HttpServletRequest request,
                                                   javax.servlet.http.HttpServletResponse response,
                                                   org.springframework.ui.Model model,
                                                   @PathVariable
                                                   Map<String,String> pathVars,
                                                   @PathVariable(value="id")
                                                   String id,
                                                   @PathVariable(value="collectionField")
                                                   String collectionField,
                                                   @RequestParam
                                                   org.springframework.util.MultiValueMap<String,String> requestParams)
                             throws Exception
Overrides:
showAddCollectionItem in class AdminBasicEntityController
Throws:
Exception

viewEntityForm

@RequestMapping(value="/{id}",
                method=GET)
public String viewEntityForm(javax.servlet.http.HttpServletRequest request,
                                            javax.servlet.http.HttpServletResponse response,
                                            org.springframework.ui.Model model,
                                            @PathVariable
                                            Map<String,String> pathVars,
                                            @PathVariable(value="id")
                                            String id)
                      throws Exception
Overrides:
viewEntityForm in class AdminBasicEntityController
Throws:
Exception

removeRequiredValidation

protected void removeRequiredValidation(EntityForm entityForm)
Clears out any required validation on the fields within an entity form. Used for additional Skus since none of those fields should be required.

Parameters:
entityForm -


Copyright © 2013. All Rights Reserved.