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

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.AdminOfferController

@Controller(value="blAdminOfferController")
@RequestMapping(value="/offer")
public class AdminOfferController
extends AdminBasicEntityController

Author:
Elbert Bautista (elbertbautista)

Field Summary
protected static String SECTION_KEY
           
 
Fields inherited from class org.broadleafcommerce.openadmin.web.controller.entity.AdminBasicEntityController
entityConfiguration, entityValidator, formService, service
 
Fields inherited from class org.broadleafcommerce.openadmin.web.controller.AdminAbstractController
adminNavigationService
 
Constructor Summary
AdminOfferController()
           
 
Method Summary
protected  void constructRuleBuilder(EntityForm entityForm, Entity entity, String fieldName, String friendlyName, String styleClass, String fieldService, String fieldJson)
           
protected  DataWrapper convertJsonToDataWrapper(String json)
          When using Thymeleaf, we need to convert the JSON string back to a DataWrapper object because Thymeleaf escapes JSON strings.
protected  String[] getSectionCustomCriteria()
           
protected  String getSectionKey(Map<String,String> pathVars)
           
 void initBinder(org.springframework.web.bind.WebDataBinder binder)
           
 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
addCollectionItem, addEntity, attachSectionSpecificInfo, getAddEntityTypes, getBlankDynamicFieldTemplateForm, getClassNameForSection, getCollectionFieldRecords, getCollectionListGrid, getDefaultEntityType, getDynamicFieldTemplateForm, getDynamicForm, getSectionPersistencePackageRequest, getSectionPersistencePackageRequest, removeCollectionItem, removeEntity, saveEntity, setModelAttributes, showAddCollectionItem, showSelectCollectionItem, showUpdateCollectionItem, updateCollectionItem, viewAddEntityForm, viewCollectionItemDetails, viewEntityList
 
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

AdminOfferController

public AdminOfferController()
Method Detail

getSectionKey

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

getSectionCustomCriteria

protected String[] getSectionCustomCriteria()
Overrides:
getSectionCustomCriteria in class AdminBasicEntityController

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
                                            String id)
                      throws Exception
Overrides:
viewEntityForm in class AdminBasicEntityController
Throws:
Exception

initBinder

@InitBinder
public void initBinder(org.springframework.web.bind.WebDataBinder binder)
Overrides:
initBinder in class AdminBasicEntityController

constructRuleBuilder

protected void constructRuleBuilder(EntityForm entityForm,
                                    Entity entity,
                                    String fieldName,
                                    String friendlyName,
                                    String styleClass,
                                    String fieldService,
                                    String fieldJson)
                             throws IOException
Throws:
IOException

convertJsonToDataWrapper

protected DataWrapper convertJsonToDataWrapper(String json)
                                        throws IOException
When using Thymeleaf, we need to convert the JSON string back to a DataWrapper object because Thymeleaf escapes JSON strings. Thymeleaf uses it's own object de-serializer see: https://github.com/thymeleaf/thymeleaf/issues/84 see: http://forum.thymeleaf.org/Spring-Javascript-and-escaped-JSON-td4024739.html

Parameters:
json -
Returns:
DataWrapper
Throws:
IOException


Copyright © 2013. All Rights Reserved.