Class AddressController
- java.lang.Object
-
- de.hybris.platform.ycommercewebservices.v2.controller.BaseController
-
- de.hybris.platform.ycommercewebservices.v2.controller.BaseCommerceController
-
- de.hybris.platform.ycommercewebservices.v2.controller.AddressController
-
@Controller @RequestMapping("/{baseSiteId}/users/{userId}/addresses") public class AddressController extends BaseCommerceController
-
-
Field Summary
-
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
-
-
Constructor Summary
Constructors Constructor Description AddressController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AddressWsDTOcreateAddress(AddressWsDTO address, java.lang.String fields)AddressWsDTOcreateAddress(javax.servlet.http.HttpServletRequest request, java.lang.String fields)protected ErrorListWsDTOcreateResponseErrors(org.springframework.validation.Errors errors)AddressWsDTOgetAddress(java.lang.String addressId, java.lang.String fields)AddressListWsDTOgetAddresses(java.lang.String fields)protected booleanisAddressValid(AddressData addressData, org.springframework.validation.Errors errors, AddressValidationData validationData)Checks if address is valid by a validatorsprotected voidpopulateErrors(org.springframework.validation.Errors errors, AddressVerificationResult<AddressVerificationDecision> addressVerificationResult)Populates Errors objectvoidremoveAddress(java.lang.String addressId)voidreplaceAddress(java.lang.String addressId, AddressWsDTO address)voidreplaceAddress(java.lang.String addressId, javax.servlet.http.HttpServletRequest request)voidupdateAddress(java.lang.String addressId, AddressWsDTO address)voidupdateAddress(java.lang.String addressId, javax.servlet.http.HttpServletRequest request)AddressValidationWsDTOvalidateAddress(AddressWsDTO address, java.lang.String fields)AddressValidationWsDTOvalidateAddress(javax.servlet.http.HttpServletRequest request, java.lang.String fields)protected AddressValidationDataverifyAddresByService(AddressData addressData, org.springframework.validation.Errors errors, AddressValidationData validationData)Verifies address by commerce service-
Methods inherited from class de.hybris.platform.ycommercewebservices.v2.controller.BaseCommerceController
addPaymentDetailsInternal, addPaymentDetailsInternal, applyVoucherForCartInternal, createAddressInternal, createAddressInternal, getAddressDTOValidator, getAddressValidator, getCartFacade, 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, handleModelNotFoundException, logParam, logParam, logParam, logValue, sanitize, setDataMapper, setTotalCountHeader, setTotalCountHeader, validate
-
-
-
-
Method Detail
-
getAddresses
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(method=GET) @ResponseBody public AddressListWsDTO getAddresses(@RequestParam(defaultValue="DEFAULT") java.lang.String fields)
-
createAddress
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(method=POST) @ResponseBody @ResponseStatus(CREATED) public AddressWsDTO createAddress(javax.servlet.http.HttpServletRequest request, @RequestParam(defaultValue="DEFAULT") java.lang.String fields) throws WebserviceValidationException- Throws:
WebserviceValidationException
-
createAddress
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(method=POST, consumes={"application/json","application/xml"}) @ResponseBody @ResponseStatus(CREATED) public AddressWsDTO createAddress(@RequestBody AddressWsDTO address, @RequestParam(defaultValue="DEFAULT") java.lang.String fields) throws WebserviceValidationException- Throws:
WebserviceValidationException
-
getAddress
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/{addressId}", method=GET) @ResponseBody public AddressWsDTO getAddress(@PathVariable java.lang.String addressId, @RequestParam(defaultValue="DEFAULT") java.lang.String fields) throws WebserviceValidationException- Throws:
WebserviceValidationException
-
replaceAddress
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/{addressId}", method=PUT) @ResponseStatus(OK) public void replaceAddress(@PathVariable java.lang.String addressId, javax.servlet.http.HttpServletRequest request) throws WebserviceValidationException- Throws:
WebserviceValidationException
-
replaceAddress
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/{addressId}", method=PUT, consumes={"application/json","application/xml"}) @ResponseStatus(OK) public void replaceAddress(@PathVariable java.lang.String addressId, @RequestBody AddressWsDTO address) throws WebserviceValidationException- Throws:
WebserviceValidationException
-
updateAddress
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/{addressId}", method=PATCH) @ResponseStatus(OK) public void updateAddress(@PathVariable java.lang.String addressId, javax.servlet.http.HttpServletRequest request) throws WebserviceValidationException- Throws:
WebserviceValidationException
-
updateAddress
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/{addressId}", method=PATCH, consumes={"application/json","application/xml"}) @ResponseStatus(OK) public void updateAddress(@PathVariable java.lang.String addressId, @RequestBody AddressWsDTO address) throws WebserviceValidationException- Throws:
WebserviceValidationException
-
removeAddress
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/{addressId}", method=DELETE) @ResponseStatus(OK) public void removeAddress(@PathVariable java.lang.String addressId)
-
validateAddress
@Secured({"ROLE_CUSTOMERGROUP","ROLE_CLIENT","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/verification", method=POST) @ResponseBody public AddressValidationWsDTO validateAddress(javax.servlet.http.HttpServletRequest request, @RequestParam(defaultValue="DEFAULT") java.lang.String fields)
-
validateAddress
@Secured({"ROLE_CUSTOMERGROUP","ROLE_CLIENT","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/verification", method=POST, consumes={"application/json","application/xml"}) @ResponseBody public AddressValidationWsDTO validateAddress(@RequestBody AddressWsDTO address, @RequestParam(defaultValue="DEFAULT") java.lang.String fields)
-
isAddressValid
protected boolean isAddressValid(AddressData addressData, org.springframework.validation.Errors errors, AddressValidationData validationData)
Checks if address is valid by a validators- Returns:
true- address is valid ,false- address is invalid
-
verifyAddresByService
protected AddressValidationData verifyAddresByService(AddressData addressData, org.springframework.validation.Errors errors, AddressValidationData validationData)
Verifies address by commerce service- Returns:
- object with verification errors and suggested addresses list
-
createResponseErrors
protected ErrorListWsDTO createResponseErrors(org.springframework.validation.Errors errors)
-
populateErrors
protected void populateErrors(org.springframework.validation.Errors errors, AddressVerificationResult<AddressVerificationDecision> addressVerificationResult)Populates Errors object- Parameters:
errors-addressVerificationResult-
-
-