Class OrgCustomerManagementController

java.lang.Object
de.hybris.platform.b2bocc.v2.controllers.BaseController
de.hybris.platform.b2bocc.v2.controllers.OrgCustomerManagementController

@Controller @RequestMapping("/{baseSiteId}/users/{userId}/orgCustomers") public class OrgCustomerManagementController extends BaseController
  • Field Details

    • RESOURCE_NOT_FOUND_ERROR_MESSAGE

      protected static final String RESOURCE_NOT_FOUND_ERROR_MESSAGE
      See Also:
    • MODEL_SAVING_ERROR_MESSAGE

      protected static final String MODEL_SAVING_ERROR_MESSAGE
      See Also:
    • b2bUnitFacade

      protected B2BUnitFacade b2bUnitFacade
    • dataMapper

      protected DataMapper 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

      @Secured({"ROLE_B2BADMINGROUP","ROLE_TRUSTED_CLIENT"}) @GetMapping("/{orgCustomerId}") @ResponseBody public UserWsDTO getOrgCustomer(@PathVariable String orgCustomerId, @RequestParam(defaultValue="DEFAULT") String fields)
    • 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

      @ResponseStatus(OK) @DeleteMapping(value="/{orgCustomerId}/orgUserGroups/{userGroupId}", produces="application/json") public void removeOrgUserGroupFromOrgCustomer(@PathVariable String orgCustomerId, @PathVariable String userGroupId)
    • 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

      protected boolean isUserExisting(String orgUnitUserId)
    • doesUserIdBelongToCurrentCustomer

      protected boolean doesUserIdBelongToCurrentCustomer(String orgUnitUserId)
    • isCurrentCustomerUnitIdEqualToUnitId

      protected boolean isCurrentCustomerUnitIdEqualToUnitId(String orgUnitId)