Class UsersController
java.lang.Object
de.hybris.platform.ycommercewebservices.v2.controller.BaseController
de.hybris.platform.ycommercewebservices.v2.controller.BaseCommerceController
de.hybris.platform.ycommercewebservices.v2.controller.UsersController
@Controller
@RequestMapping("/{baseSiteId}/users")
public class UsersController
extends BaseCommerceController
-
Field Summary
FieldsFields inherited from class de.hybris.platform.ycommercewebservices.v2.controller.BaseCommerceController
API_COMPATIBILITY_B2C_CHANNELS, ENTRYFields 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancontainsRole(org.springframework.security.core.Authentication auth, String role) protected voidconvertToCustomer(String password, String guid) createUser(UserSignUpWsDTO user, String fields, javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse) createUser(String login, String password, String titleCode, String firstName, String lastName, String guid, String fields, javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse) protected StringgetAbsoluteLocationURL(javax.servlet.http.HttpServletRequest httpRequest, String uid) protected CustomerDatagetCustomerData(RegisterData registerData, boolean userExists, String userId) getUserCustomerGroups(String userId, String fields) protected voidvoidvoidreplaceUser(UserWsDTO user) voidreplaceUser(String firstName, String lastName, String titleCode, javax.servlet.http.HttpServletRequest request) Deprecated, for removal: This API element is subject to removal in a future version.since 2005.voidreplaceUserLogin(String newLogin, String password) voidreplaceUserPassword(String userId, String old, String newPassword) voidupdateUser(UserWsDTO user) voidupdateUser(javax.servlet.http.HttpServletRequest request) Deprecated, for removal: This API element is subject to removal in a future version.since 2005.Methods inherited from class de.hybris.platform.ycommercewebservices.v2.controller.BaseCommerceController
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, validateStatusesEnumValueMethods inherited from class de.hybris.platform.ycommercewebservices.v2.controller.BaseController
addPaginationField, getDataMapper, handleDuplicateUidException, handleErrorInternal, handleHttpMessageNotReadableException, handleModelNotFoundException, logParam, logParam, logValue, sanitize, setDataMapper, setTotalCountHeader, setTotalCountHeader, validate
-
Field Details
-
USER_MAPPER_CONFIG
- See Also:
-
-
Constructor Details
-
UsersController
public UsersController()
-
-
Method Details
-
createUser
@Secured({"ROLE_CLIENT","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(method=POST) @ResponseStatus(CREATED) @ResponseBody public UserWsDTO createUser(@RequestParam(required=false) String login, @RequestParam String password, @RequestParam(required=false) String titleCode, @RequestParam(required=false) String firstName, @RequestParam(required=false) String lastName, @RequestParam(required=false) String guid, @RequestParam(defaultValue="DEFAULT") String fields, javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse) throws DuplicateUidException - Throws:
DuplicateUidException
-
convertToCustomer
- Throws:
DuplicateUidException
-
registerNewUser
protected void registerNewUser(String login, String password, String titleCode, String firstName, String lastName) throws DuplicateUidException - Throws:
DuplicateUidException
-
createUser
@Secured({"ROLE_CLIENT","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(method=POST, consumes={"application/json","application/xml"}) @ResponseStatus(CREATED) @ResponseBody public UserWsDTO createUser(@RequestBody UserSignUpWsDTO user, @RequestParam(defaultValue="DEFAULT") String fields, javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse) -
getCustomerData
protected CustomerData getCustomerData(RegisterData registerData, boolean userExists, String userId) -
getAbsoluteLocationURL
-
getUser
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/{userId}", method=GET) @ResponseBody @SiteChannelRestriction(allowedSiteChannelsProperty="api.compatibility.b2c.channels") public UserWsDTO getUser(@RequestParam(defaultValue="DEFAULT") String fields) -
replaceUser
@Deprecated(since="2005", forRemoval=true) @Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/{userId}", method=PUT) @ResponseStatus(OK) public void replaceUser(@RequestParam String firstName, @RequestParam String lastName, @RequestParam String titleCode, javax.servlet.http.HttpServletRequest request) throws DuplicateUidException Deprecated, for removal: This API element is subject to removal in a future version.since 2005. Please usereplaceUser(UserWsDTO)instead.- Throws:
DuplicateUidException
-
replaceUser
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/{userId}", method=PUT, consumes={"application/json","application/xml"}) @ResponseStatus(OK) public void replaceUser(@RequestBody UserWsDTO user) throws DuplicateUidException - Throws:
DuplicateUidException
-
updateUser
@Deprecated(since="2005", forRemoval=true) @Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/{userId}", method=PATCH) @ResponseStatus(OK) public void updateUser(javax.servlet.http.HttpServletRequest request) throws DuplicateUidException Deprecated, for removal: This API element is subject to removal in a future version.since 2005. Please useupdateUser(UserWsDTO)instead.- Throws:
DuplicateUidException
-
updateUser
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/{userId}", method=PATCH, consumes={"application/json","application/xml"}) @ResponseStatus(OK) public void updateUser(@RequestBody UserWsDTO user) throws DuplicateUidException - Throws:
DuplicateUidException
-
removeUser
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/{userId}", method=DELETE) @ResponseStatus(OK) public void removeUser() -
replaceUserLogin
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/{userId}/login", method=PUT) @ResponseStatus(OK) public void replaceUserLogin(@RequestParam String newLogin, @RequestParam String password) throws DuplicateUidException - Throws:
DuplicateUidException
-
replaceUserPassword
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/{userId}/password", method=PUT) @ResponseStatus(ACCEPTED) public void replaceUserPassword(@PathVariable String userId, @RequestParam(required=false) String old, @RequestParam("new") String newPassword) -
containsRole
-
getUserCustomerGroups
@Secured({"ROLE_CUSTOMERGROUP","ROLE_TRUSTED_CLIENT","ROLE_CUSTOMERMANAGERGROUP"}) @RequestMapping(value="/{userId}/customergroups", method=GET) @ResponseBody public UserGroupListWsDTO getUserCustomerGroups(@PathVariable String userId, @RequestParam(defaultValue="DEFAULT") String fields)
-