Class PromotionsController

java.lang.Object
de.hybris.platform.ycommercewebservices.v1.controller.BaseController
de.hybris.platform.ycommercewebservices.v1.controller.PromotionsController

@Controller("promotionsControllerV1") @RequestMapping("/{baseSiteId}/promotions") public class PromotionsController extends BaseController
Main Controller for Promotions
  • Constructor Details

    • PromotionsController

      public PromotionsController()
  • Method Details

    • getPromotions

      @Secured("ROLE_TRUSTED_CLIENT") @RequestMapping(method=GET) @ResponseBody public PromotionDataList getPromotions(@RequestParam String type, @RequestParam(required=false) String promotionGroup) throws RequestParameterException
      Throws:
      RequestParameterException
    • getPromotionByCode

      @Secured("ROLE_TRUSTED_CLIENT") @RequestMapping(value="/{code}", method=GET) @ResponseBody public PromotionData getPromotionByCode(@PathVariable String code, @RequestParam(required=false) String options)
      Web service handler for the getPromotionByCode call. The options are turned into a Set and passed on to the facade. BASIC is included by default.
      Sample Call: https://localhost:9002/rest/v1/{SITE}/promotions/{CODE}?options=BASIC%2CEXTENDED
      Keep in mind ',' needs to be encoded as %2C
      Parameters:
      code - - the unique code used to identify a promotion
      options - - a String enumerating the detail level, values are BASIC (included by default), EXTENDED. Combine by using a ',', which needs to be encoded as part of a URI using URLEncoding: %2C.
      Returns:
      the PromotionData which will be marshaled to JSON or XML based on Accept-Header
    • validateTypeParameter

      protected void validateTypeParameter(String type) throws RequestParameterException
      Throws:
      RequestParameterException
    • getPromotionList

      protected List<PromotionData> getPromotionList(String type, String promotionGroup)
    • getPromotionList

      protected List<PromotionData> getPromotionList(String type)
    • extractOptions

      protected Set<PromotionOption> extractOptions(String options)
    • getCommercePromotionFacade

      public CommercePromotionFacade getCommercePromotionFacade()