Class AdminOfferController

java.lang.Object
org.broadleafcommerce.common.web.controller.BroadleafAbstractController

@Controller("blAdminOfferController") @RequestMapping("/offer") public class AdminOfferController extends AdminBasicEntityController
Handles admin operations for the Offer entity. Certain Offer fields should only render when specific values are set for other fields; we provide the support for that in this controller.
Author:
Andre Azzolini (apazzolini)
  • Field Details

  • Constructor Details

    • AdminOfferController

      public AdminOfferController()
  • Method Details

    • getSectionKey

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

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

      @RequestMapping(value="", method=GET) public String viewEntityList(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @PathVariable Map<String,String> pathVars, @RequestParam org.springframework.util.MultiValueMap<String,String> requestParams) throws Exception
      Overrides:
      viewEntityList in class AdminBasicEntityController
      Throws:
      Exception
    • viewEntityForm

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

      @RequestMapping(value="/add", method=GET) public String viewAddEntityForm(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @PathVariable Map<String,String> pathVars, @RequestParam(defaultValue="") String entityType) throws Exception
      Overrides:
      viewAddEntityForm in class AdminBasicEntityController
      Throws:
      Exception
    • addEntity

      @RequestMapping(value="/add", method=POST) public String addEntity(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @PathVariable Map<String,String> pathVars, @ModelAttribute("entityForm") EntityForm entityForm, org.springframework.validation.BindingResult result) throws Exception
      Overrides:
      addEntity in class AdminBasicEntityController
      Throws:
      Exception
    • duplicateEntity

      @Deprecated @RequestMapping(value="/{id}/duplicate", method=POST) public String duplicateEntity(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @PathVariable Map<String,String> pathVars, @PathVariable("id") String id, @ModelAttribute("entityForm") EntityForm entityForm, org.springframework.validation.BindingResult result) throws Exception
      Deprecated.
      Moved method to superclass
      Overrides:
      duplicateEntity in class AdminBasicEntityController
      Throws:
      Exception
    • modifyModelAttributes

      protected void modifyModelAttributes(org.springframework.ui.Model model)
      Offer field visibility is dependent on other fields in the entity. Mark the form with the appropriate class so that the Javascript will know to handle this form.

      We also want to tell the UI to make item target criteria required. We cannot manage this at the entity level via an