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 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"}) @RequestMapping(value="/{orgCustomerId}", method=GET) @ResponseBody public UserWsDTO getOrgCustomer(@PathVariable String orgCustomerId, @RequestParam(defaultValue="DEFAULT") String fields)
    • getOrgCustomers

      @ResponseBody @RequestMapping(method=GET) 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"}) @RequestMapping(method=POST) @ResponseStatus(CREATED) @ResponseBody public UserWsDTO createOrgCustomer(@RequestBody OrgCustomerCreationWsDTO orgCustomerCreation, @RequestParam(defaultValue="DEFAULT") String fields)
    • updateOrgCustomer

      @Secured({"ROLE_B2BADMINGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/{orgCustomerId}", method=PATCH) @ResponseStatus(NO_CONTENT) public void updateOrgCustomer(@PathVariable String orgCustomerId, @RequestBody OrgCustomerModificationWsDTO orgCustomerModification)
    • getOrgCustomerApprovers

      @ResponseBody @RequestMapping(value="/{orgCustomerId}/approvers", method=GET) 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) @RequestMapping(value="/{orgCustomerId}/approvers/{approverId}", method=POST) @ResponseBody public B2BSelectionDataWsDTO addApproverToOrgCustomer(@PathVariable String orgCustomerId, @PathVariable String approverId, @RequestParam(defaultValue="DEFAULT") String fields)
    • removeApproverFromOrgCustomer

      @ResponseStatus(OK) @RequestMapping(value="/{orgCustomerId}/approvers/{approverId}", method=DELETE) @ResponseBody public B2BSelectionDataWsDTO removeApproverFromOrgCustomer(@PathVariable String orgCustomerId, @PathVariable String approverId, @RequestParam(defaultValue="DEFAULT") String fields)
    • getOrgCustomerOrgUserGroups

      @ResponseBody @RequestMapping(value="/{orgCustomerId}/orgUserGroups", method=GET) 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) @RequestMapping(value="/{orgCustomerId}/orgUserGroups/{userGroupId}", method=POST) @ResponseBody public B2BSelectionDataWsDTO addOrgUserGroupToOrgCustomer(@PathVariable String orgCustomerId, @PathVariable String userGroupId, @RequestParam(defaultValue="DEFAULT") String fields)
    • removeOrgUserGroupFromOrgCustomer

      @ResponseStatus(OK) @RequestMapping(value="/{orgCustomerId}/orgUserGroups/{userGroupId}", method=DELETE) public void removeOrgUserGroupFromOrgCustomer(@PathVariable String orgCustomerId, @PathVariable String userGroupId)
    • getOrgCustomerPermissions

      @ResponseBody @RequestMapping(value="/{orgCustomerId}/permissions", method=GET) 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) @RequestMapping(value="/{orgCustomerId}/permissions/{permissionId}", method=POST) @ResponseBody public B2BSelectionDataWsDTO addPermissionToOrgCustomer(@PathVariable String orgCustomerId, @PathVariable String permissionId, @RequestParam(defaultValue="DEFAULT") String fields)
    • removePermissionFromOrgCustomer

      @ResponseStatus(OK) @RequestMapping(value="/{orgCustomerId}/permissions/{permissionId}", method=DELETE) @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)