Class OrdersController
- java.lang.Object
-
- de.hybris.platform.ycommercewebservices.v2.controller.BaseController
-
- de.hybris.platform.ycommercewebservices.v2.controller.BaseCommerceController
-
- de.hybris.platform.ycommercewebservices.v2.controller.OrdersController
-
@Controller @RequestMapping("/{baseSiteId}") public class OrdersController extends BaseCommerceControllerWeb Service Controller for the ORDERS resource. Most methods check orders of the user. Methods require authentication and are restricted to https channel.
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.ycommercewebservices.v2.controller.BaseCommerceController
API_COMPATIBILITY_B2C_CHANNELS
-
Fields inherited from class de.hybris.platform.ycommercewebservices.v2.controller.BaseController
BASIC_FIELD_SET, DEFAULT_CURRENT_PAGE, DEFAULT_FIELD_SET, DEFAULT_PAGE_SIZE, HEADER_TOTAL_COUNT, INVALID_REQUEST_BODY_ERROR_MESSAGE
-
-
Constructor Summary
Constructors Constructor Description OrdersController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcountUserOrders(java.lang.String statuses, javax.servlet.http.HttpServletResponse response)voiddoCancelOrder(java.lang.String code, CancellationRequestEntryInputListWsDTO cancellationRequestEntryInputList)OrderWsDTOgetOrder(java.lang.String code, java.lang.String fields)OrderHistoryListWsDTOgetUserOrderHistory(java.lang.String statuses, int currentPage, int pageSize, java.lang.String sort, java.lang.String fields, javax.servlet.http.HttpServletResponse response)OrderWsDTOgetUserOrders(java.lang.String code, java.lang.String fields)protected OrderCancelEntryDatamapToOrderCancelEntryData(CancellationRequestEntryInputWsDTO entryInput)OrderWsDTOplaceOrder(java.lang.String cartId, java.lang.String fields)protected OrderCancelRequestDataprepareCancellationRequestData(java.lang.String code, CancellationRequestEntryInputListWsDTO cancellationRequestEntryInputList)It prepares theOrderCancelRequestDataobject by taking the order code and a map of order entry and cancel quantity and sets the userprotected voidvalidateUserForOrder(java.lang.String code)Validates if the current user has access to the order-
Methods inherited from class de.hybris.platform.ycommercewebservices.v2.controller.BaseCommerceController
addPaymentDetailsInternal, addPaymentDetailsInternal, applyVoucherForCartInternal, createAddressInternal, createAddressInternal, getAddressDTOValidator, getAddressValidator, getCartFacade, getCartVoucherValidator, getCcPaymentInfoValidator, getCheckoutFacade, getDeliveryAddressValidator, getHttpRequestAddressDataPopulator, getHttpRequestPaymentInfoPopulator, getPaymentDetailsDTOValidator, getSessionCart, getUserFacade, getVoucherFacade, setAddressDTOValidator, setAddressValidator, setCartDeliveryAddressInternal, setCartDeliveryModeInternal, setCartFacade, setCcPaymentInfoValidator, setCheckoutFacade, setDeliveryAddressValidator, setHttpRequestAddressDataPopulator, setHttpRequestPaymentInfoPopulator, setPaymentDetailsDTOValidator, setPaymentDetailsInternal, setUserFacade, setVoucherFacade, validateCartForPlaceOrder, validateStatusesEnumValue
-
Methods inherited from class de.hybris.platform.ycommercewebservices.v2.controller.BaseController
addPaginationField, getDataMapper, handleDuplicateUidException, handleErrorInternal, handleHttpMessageNotReadableException, handleModelNotFoundException, logParam, logParam, logValue, sanitize, setDataMapper, setTotalCountHeader, setTotalCountHeader, validate
-
-
-
-
Method Detail
-
getOrder
@Secured("ROLE_TRUSTED_CLIENT") @RequestMapping(value="/orders/{code}", method=GET) @Cacheable(value="orderCache", key="T(de.hybris.platform.commercewebservicescommons.cache.CommerceCacheKeyGenerator).generateKey(false,true,\'getOrder\',#code,#fields)") @ResponseBody public OrderWsDTO getOrder(@PathVariable java.lang.String code, @RequestParam(defaultValue="DEFAULT") java.lang.String fields)
-
getUserOrders
@Secured({"ROLE_CUSTOMERGROUP","ROLE_CLIENT","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/users/{userId}/orders/{code}", method=GET) @Cacheable(value="orderCache", key="T(de.hybris.platform.commercewebservicescommons.cache.CommerceCacheKeyGenerator).generateKey(true,true,\'getOrderForUserByCode\',#code,#fields)") @ResponseBody public OrderWsDTO getUserOrders(@PathVariable java.lang.String code, @RequestParam(defaultValue="DEFAULT") java.lang.String fields)
-
getUserOrderHistory
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/users/{userId}/orders", method=GET) @ResponseBody public OrderHistoryListWsDTO getUserOrderHistory(@RequestParam(required=false) java.lang.String statuses, @RequestParam(defaultValue="0") int currentPage, @RequestParam(defaultValue="20") int pageSize, @RequestParam(required=false) java.lang.String sort, @RequestParam(defaultValue="DEFAULT") java.lang.String fields, javax.servlet.http.HttpServletResponse response)
-
countUserOrders
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/users/{userId}/orders", method=HEAD) @ResponseBody public void countUserOrders(@RequestParam(required=false) java.lang.String statuses, javax.servlet.http.HttpServletResponse response)
-
placeOrder
@Secured({"ROLE_CUSTOMERGROUP","ROLE_CLIENT","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/users/{userId}/orders", method=POST) @ResponseStatus(CREATED) @ResponseBody @SiteChannelRestriction(allowedSiteChannelsProperty="api.compatibility.b2c.channels") public OrderWsDTO placeOrder(@RequestParam java.lang.String cartId, @RequestParam(defaultValue="DEFAULT") java.lang.String fields) throws PaymentAuthorizationException, InvalidCartException, NoCheckoutCartException
-
doCancelOrder
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/users/{userId}/orders/{code}/cancellation", method=POST) @ResponseStatus(OK) public void doCancelOrder(@PathVariable java.lang.String code, @RequestBody CancellationRequestEntryInputListWsDTO cancellationRequestEntryInputList)
-
validateUserForOrder
protected void validateUserForOrder(java.lang.String code)
Validates if the current user has access to the order- Parameters:
code- the order code- Throws:
NotFoundException- if current user has no access to the order
-
prepareCancellationRequestData
protected OrderCancelRequestData prepareCancellationRequestData(java.lang.String code, CancellationRequestEntryInputListWsDTO cancellationRequestEntryInputList)
It prepares theOrderCancelRequestDataobject by taking the order code and a map of order entry and cancel quantity and sets the user- Parameters:
code- which we want to request to cancelcancellationRequestEntryInputList- map of order entry and cancel quantity- Returns:
- Populated
OrderCancelRequestData
-
mapToOrderCancelEntryData
protected OrderCancelEntryData mapToOrderCancelEntryData(CancellationRequestEntryInputWsDTO entryInput)
-
-