Class OrgCustomerManagementController
java.lang.Object
de.hybris.platform.b2b.occ.v2.controllers.BaseController
de.hybris.platform.b2b.occ.v2.controllers.OrgCustomerManagementController
@Controller
@RequestMapping("/{baseSiteId}/users/{userId}/orgCustomers")
public class OrgCustomerManagementController
extends BaseController
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected B2BUnitFacadeprotected DataMapperprotected static final Stringprotected org.springframework.validation.Validatorprotected org.springframework.validation.Validatorprotected org.springframework.validation.Validatorprotected static final StringFields inherited from class de.hybris.platform.b2b.occ.v2.controllers.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 TypeMethodDescriptionaddApproverToOrgCustomer(String orgCustomerId, String approverId, String fields) addOrgUserGroupToOrgCustomer(String orgCustomerId, String userGroupId, String fields) addPermissionToOrgCustomer(String orgCustomerId, String permissionId, String fields) createOrgCustomer(OrgCustomerCreationWsDTO orgCustomerCreation, String fields) protected booleandoesUserIdBelongToCurrentCustomer(String orgUnitUserId) getOrgCustomer(String orgCustomerId, String fields) getOrgCustomerApprovers(String orgCustomerId, int currentPage, int pageSize, String sort, String fields) getOrgCustomerOrgUserGroups(String orgCustomerId, int currentPage, int pageSize, String sort, String fields) getOrgCustomerPermissions(String orgCustomerId, int currentPage, int pageSize, String sort, String fields) getOrgCustomers(int currentPage, int pageSize, String sort, String fields) protected booleanisCurrentCustomerUnitIdEqualToUnitId(String orgUnitId) protected booleanisUserExisting(String orgUnitUserId) removeApproverFromOrgCustomer(String orgCustomerId, String approverId, String fields) voidremoveOrgUserGroupFromOrgCustomer(String orgCustomerId, String userGroupId) removePermissionFromOrgCustomer(String orgCustomerId, String permissionId, String fields) voidupdateOrgCustomer(String orgCustomerId, OrgCustomerModificationWsDTO orgCustomerModification) Methods inherited from class de.hybris.platform.b2b.occ.v2.controllers.BaseController
addPaginationField, getDataMapper, handleDuplicateUidException, handleErrorInternal, handleHttpMessageNotReadableException, handleModelNotFoundException, logParam, logParam, logParam, logValue, sanitize, setDataMapper, setTotalCountHeader, setTotalCountHeader, validate
-
Field Details
-
RESOURCE_NOT_FOUND_ERROR_MESSAGE
- See Also:
-
MODEL_SAVING_ERROR_MESSAGE
- See Also:
-
b2bUnitFacade
-
dataMapper
-
orgCustomerCreationWsDTOValidator
protected org.springframework.validation.Validator orgCustomerCreationWsDTOValidator -
orgCustomerModificationWsDTOValidator
protected org.springframework.validation.Validator orgCustomerModificationWsDTOValidator -
orgCustomerPasswordResetValidator
protected org.springframework.validation.Validator orgCustomerPasswordResetValidator
-
-
Constructor Details
-
OrgCustomerManagementController
public OrgCustomerManagementController()
-
-
Method Details
-
getOrgCustomer
-
getOrgCustomers
@ResponseBody @GetMapping(produces="application/json") public OrgUnitUserListWsDTO getOrgCustomers(@RequestParam(value="currentPage",defaultValue="0") int currentPage, @RequestParam(value="pageSize",defaultValue="20") int pageSize, @RequestParam(value="sort",defaultValue="name") String sort, @RequestParam(required=false,defaultValue="DEFAULT") String fields) -
createOrgCustomer
@Secured({"ROLE_B2BADMINGROUP","ROLE_TRUSTED_CLIENT"}) @PostMapping(consumes="application/json") @ResponseStatus(CREATED) @ResponseBody public UserWsDTO createOrgCustomer(@RequestBody OrgCustomerCreationWsDTO orgCustomerCreation, @RequestParam(defaultValue="DEFAULT") String fields) -
updateOrgCustomer
@Secured({"ROLE_B2BADMINGROUP","ROLE_TRUSTED_CLIENT"}) @PatchMapping(value="/{orgCustomerId}", consumes="application/json") @ResponseStatus(NO_CONTENT) public void updateOrgCustomer(@PathVariable String orgCustomerId, @RequestBody OrgCustomerModificationWsDTO orgCustomerModification) -
getOrgCustomerApprovers
@ResponseBody @GetMapping(value="/{orgCustomerId}/approvers", produces="application/json") public OrgUnitUserListWsDTO getOrgCustomerApprovers(@PathVariable String orgCustomerId, @RequestParam(value="currentPage",defaultValue="0") int currentPage, @RequestParam(value="pageSize",defaultValue="20") int pageSize, @RequestParam(value="sort",defaultValue="name") String sort, @RequestParam(required=false,defaultValue="DEFAULT") String fields) -
addApproverToOrgCustomer
@ResponseStatus(OK) @PostMapping(value="/{orgCustomerId}/approvers/{approverId}", produces="application/json") @ResponseBody public B2BSelectionDataWsDTO addApproverToOrgCustomer(@PathVariable String orgCustomerId, @PathVariable String approverId, @RequestParam(defaultValue="DEFAULT") String fields) -
removeApproverFromOrgCustomer
@ResponseStatus(OK) @DeleteMapping(value="/{orgCustomerId}/approvers/{approverId}", produces="application/json") @ResponseBody public B2BSelectionDataWsDTO removeApproverFromOrgCustomer(@PathVariable String orgCustomerId, @PathVariable String approverId, @RequestParam(defaultValue="DEFAULT") String fields) -
getOrgCustomerOrgUserGroups
@ResponseBody @GetMapping(value="/{orgCustomerId}/orgUserGroups", produces="application/json") public OrgUnitUserGroupListWsDTO getOrgCustomerOrgUserGroups(@PathVariable String orgCustomerId, @RequestParam(value="currentPage",defaultValue="0") int currentPage, @RequestParam(value="pageSize",defaultValue="20") int pageSize, @RequestParam(value="sort",defaultValue="name") String sort, @RequestParam(required=false,defaultValue="DEFAULT") String fields) -
addOrgUserGroupToOrgCustomer
@ResponseStatus(OK) @PostMapping(value="/{orgCustomerId}/orgUserGroups/{userGroupId}", produces="application/json") @ResponseBody public B2BSelectionDataWsDTO addOrgUserGroupToOrgCustomer(@PathVariable String orgCustomerId, @PathVariable String userGroupId, @RequestParam(defaultValue="DEFAULT") String fields) -
removeOrgUserGroupFromOrgCustomer
-
getOrgCustomerPermissions
@ResponseBody @GetMapping(value="/{orgCustomerId}/permissions", produces="application/json") public B2BPermissionListWsDTO getOrgCustomerPermissions(@PathVariable String orgCustomerId, @RequestParam(value="currentPage",defaultValue="0") int currentPage, @RequestParam(value="pageSize",defaultValue="20") int pageSize, @RequestParam(value="sort",defaultValue="name") String sort, @RequestParam(required=false,defaultValue="DEFAULT") String fields) -
addPermissionToOrgCustomer
@ResponseStatus(OK) @PostMapping(value="/{orgCustomerId}/permissions/{permissionId}", produces="application/json") @ResponseBody public B2BSelectionDataWsDTO addPermissionToOrgCustomer(@PathVariable String orgCustomerId, @PathVariable String permissionId, @RequestParam(defaultValue="DEFAULT") String fields) -
removePermissionFromOrgCustomer
@ResponseStatus(OK) @DeleteMapping(value="/{orgCustomerId}/permissions/{permissionId}", produces="application/json") @ResponseBody public B2BSelectionDataWsDTO removePermissionFromOrgCustomer(@PathVariable String orgCustomerId, @PathVariable String permissionId, @RequestParam(defaultValue="DEFAULT") String fields) -
handleModelSavingException
@ResponseStatus(BAD_REQUEST) @ResponseBody @ExceptionHandler(ModelSavingException.class) public ErrorListWsDTO handleModelSavingException(Exception ex) -
handleNotFoundException
@ResponseStatus(NOT_FOUND) @ResponseBody @ExceptionHandler({UnknownIdentifierException.class,java.lang.NullPointerException.class}) public ErrorListWsDTO handleNotFoundException(Exception ex) -
isUserExisting
-
doesUserIdBelongToCurrentCustomer
-
isCurrentCustomerUnitIdEqualToUnitId
-