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 BaseControllerMain Controller for Promotions
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.ycommercewebservices.v1.controller.BaseController
DEFAULT_CURRENT_PAGE, DEFAULT_PAGE_SIZE
-
-
Constructor Summary
Constructors Constructor Description PromotionsController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Set<PromotionOption>extractOptions(java.lang.String options)CommercePromotionFacadegetCommercePromotionFacade()PromotionDatagetPromotionByCode(java.lang.String code, java.lang.String options)Web service handler for the getPromotionByCode call.protected java.util.List<PromotionData>getPromotionList(java.lang.String type)protected java.util.List<PromotionData>getPromotionList(java.lang.String type, java.lang.String promotionGroup)PromotionDataListgetPromotions(java.lang.String type, java.lang.String promotionGroup)protected voidvalidateTypeParameter(java.lang.String type)-
Methods inherited from class de.hybris.platform.ycommercewebservices.v1.controller.BaseController
handleErrorInternal, handleModelNotFoundException, sanitize
-
-
-
-
Method Detail
-
getPromotions
@Secured("ROLE_TRUSTED_CLIENT") @RequestMapping(method=GET) @ResponseBody public PromotionDataList getPromotions(@RequestParam java.lang.String type, @RequestParam(required=false) java.lang.String promotionGroup) throws RequestParameterException- Throws:
RequestParameterException
-
getPromotionByCode
@Secured("ROLE_TRUSTED_CLIENT") @RequestMapping(value="/{code}", method=GET) @ResponseBody public PromotionData getPromotionByCode(@PathVariable java.lang.String code, @RequestParam(required=false) java.lang.String options)Web service handler for the getPromotionByCode call. The options are turned into a Setand 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 promotionoptions- - 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
PromotionDatawhich will be marshaled to JSON or XML based on Accept-Header
-
validateTypeParameter
protected void validateTypeParameter(java.lang.String type) throws RequestParameterException- Throws:
RequestParameterException
-
getPromotionList
protected java.util.List<PromotionData> getPromotionList(java.lang.String type, java.lang.String promotionGroup)
-
getPromotionList
protected java.util.List<PromotionData> getPromotionList(java.lang.String type)
-
extractOptions
protected java.util.Set<PromotionOption> extractOptions(java.lang.String options)
-
getCommercePromotionFacade
public CommercePromotionFacade getCommercePromotionFacade()
-
-