Class OrdersController
java.lang.Object
de.hybris.platform.commercewebservices.core.v2.controller.BaseController
de.hybris.platform.commercewebservices.core.v2.controller.BaseCommerceController
de.hybris.platform.commercewebservices.core.v2.controller.OrdersController
@Controller
@RequestMapping("/{baseSiteId}")
public class OrdersController
extends BaseCommerceController
Web 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.commercewebservices.core.v2.controller.BaseCommerceController
API_COMPATIBILITY_B2C_CHANNELS, ENTRYFields inherited from class de.hybris.platform.commercewebservices.core.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 -
Method Summary
Modifier and TypeMethodDescriptionvoidcountUserOrders(String statuses, javax.servlet.http.HttpServletResponse response) voiddoCancelOrder(String code, CancellationRequestEntryInputListWsDTO cancellationRequestEntryInputList) getUserOrderHistory(String statuses, int currentPage, int pageSize, String sort, String fields, javax.servlet.http.HttpServletResponse response) getUserOrders(String code, String fields) protected OrderCancelEntryDataplaceOrder(String cartId, String fields) protected OrderCancelRequestDataprepareCancellationRequestData(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(String code) Validates if the current user has access to the orderMethods inherited from class de.hybris.platform.commercewebservices.core.v2.controller.BaseCommerceController
addPaymentDetailsInternal, applyVoucherForCartInternal, 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, validateStatusesEnumValueMethods inherited from class de.hybris.platform.commercewebservices.core.v2.controller.BaseController
addPaginationField, getDataMapper, handleDuplicateUidException, handleErrorInternal, handleHttpMessageNotReadableException, handleModelNotFoundException, logParam, logParam, logValue, sanitize, setDataMapper, setTotalCountHeader, setTotalCountHeader, validate
-
Constructor Details
-
OrdersController
public OrdersController()
-
-
Method Details
-
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 String code, @RequestParam(defaultValue="DEFAULT") 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 String code, @RequestParam(defaultValue="DEFAULT") 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) String statuses, @RequestParam(defaultValue="0") int currentPage, @RequestParam(defaultValue="20") int pageSize, @RequestParam(required=false) String sort, @RequestParam(defaultValue="DEFAULT") 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) 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 String cartId, @RequestParam(defaultValue="DEFAULT") String fields) throws PaymentAuthorizationException, InvalidCartException, NoCheckoutCartException -
doCancelOrder
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @PostMapping(value="/users/{userId}/orders/{code}/cancellation", produces="application/json", consumes="application/json") @ResponseStatus(OK) public void doCancelOrder(@PathVariable String code, @RequestBody CancellationRequestEntryInputListWsDTO cancellationRequestEntryInputList) -
validateUserForOrder
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(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)
-