Class DefaultB2BApproverService
java.lang.Object
de.hybris.platform.b2b.services.impl.DefaultB2BApproverService
- All Implemented Interfaces:
B2BApproverService<B2BCustomerModel>
public class DefaultB2BApproverService
extends Object
implements B2BApproverService<B2BCustomerModel>
Default implementation of the
B2BApproverService.- Spring Bean ID:
- b2bApproverService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddApproverToCustomer(String user, String approver) Add an approver for a given user and return the updatedB2BCustomerModelobject updated with approver detailsaddApproverToUnit(String unitUid, String approverUid) Add approver to given unitfindPagedApproversForUnitByGroupMembership(PageableData pageableData, String unitUid, String... usergroupUid) Gets list ofSearchPageDataB2BCustomerModelprovided with required pagination parameters withPageableDatagetAccountManagerApprovers(PrincipalModel principal) Gets the list of account manager approvers.getAllActiveApprovers(B2BCustomerModel principal) Gets all the active approvers for a given customergetAllApprovers(B2BCustomerModel principal) Gets the approvers assigned to principal(customer) directly or as approver groups including its parent unit and all the units assigned to its parent up to the root unit.protected B2BCommerceUnitServiceprotected B2BUnitService<B2BUnitModel,B2BCustomerModel> protected List<B2BCustomerModel>getImmediateApprovers(PrincipalModel principal) Gets the immediate approvers for either a B2BCustomer or B2BUnit (the principal) which also includes the members of the principal's approver groups.protected ModelServiceprotected PagedB2BCustomerDao<B2BCustomerModel>protected UserServicebooleanisMemberOf(PrincipalGroupModel principal, String userGroupUid) Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4.protected StringprincipalListToUidString(List<B2BCustomerModel> allApprovers) Gets the id's for a list of approvers.removeApproverFromCustomer(String user, String approver) Remove an approver for a given user and return the updatedB2BCustomerModelobject updated with approver detailsremoveApproverFromUnit(String unitUid, String approverUid) If an approver is a member of the B2BUnit remove b2bapprovergroup role, if the approver is a member of the current branch of units the approver will be removed fromB2BUnitModel.getApprovers()relationshipvoidsetB2bCommerceUnitService(B2BCommerceUnitService b2bCommerceUnitService) voidsetB2bUnitService(B2BUnitService<B2BUnitModel, B2BCustomerModel> b2bUnitService) voidsetModelService(ModelService modelService) voidsetPagedB2BCustomerDao(PagedB2BCustomerDao<B2BCustomerModel> pagedB2BCustomerDao) voidsetUserService(UserService userService)
-
Constructor Details
-
DefaultB2BApproverService
public DefaultB2BApproverService()
-
-
Method Details
-
getAllApprovers
Description copied from interface:B2BApproverServiceGets the approvers assigned to principal(customer) directly or as approver groups including its parent unit and all the units assigned to its parent up to the root unit.- Specified by:
getAllApproversin interfaceB2BApproverService<B2BCustomerModel>- Parameters:
principal- the principal (customer)- Returns:
- A collection of approvers
-
getAllActiveApprovers
Description copied from interface:B2BApproverServiceGets all the active approvers for a given customer- Specified by:
getAllActiveApproversin interfaceB2BApproverService<B2BCustomerModel>- Returns:
- list of approvers
-
principalListToUidString
Gets the id's for a list of approvers.- Parameters:
allApprovers-- Returns:
- String list of approver id's
-
getImmediateApprovers
Gets the immediate approvers for either a B2BCustomer or B2BUnit (the principal) which also includes the members of the principal's approver groups.- Parameters:
principal- the principal- Returns:
- the immediate approvers - a list of
B2BCustomerModel
-
getAccountManagerApprovers
Description copied from interface:B2BApproverServiceGets the list of account manager approvers.- Specified by:
getAccountManagerApproversin interfaceB2BApproverService<B2BCustomerModel>- Parameters:
principal- the principal- Returns:
- the approvers
-
addApproverToCustomer
Description copied from interface:B2BApproverServiceAdd an approver for a given user and return the updatedB2BCustomerModelobject updated with approver details- Specified by:
addApproverToCustomerin interfaceB2BApproverService<B2BCustomerModel>- Parameters:
user- A unique identifier forB2BCustomerModelrepresenting a userapprover- A unique identifier forB2BCustomerModelrepresenting a approver- Returns:
- Updated
B2BCustomerModelobject updated with approvers
-
removeApproverFromCustomer
Description copied from interface:B2BApproverServiceRemove an approver for a given user and return the updatedB2BCustomerModelobject updated with approver details- Specified by:
removeApproverFromCustomerin interfaceB2BApproverService<B2BCustomerModel>- Parameters:
user- A unique identifier forB2BCustomerModelrepresenting a userapprover- A unique identifier forB2BCustomerModelrepresenting a approver- Returns:
- Updated
B2BCustomerModelobject removed with approver
-
isMemberOf
@Deprecated(since="4.4", forRemoval=true) public boolean isMemberOf(PrincipalGroupModel principal, String userGroupUid) Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4.Description copied from interface:B2BApproverServiceChecks if the principal is a member of the user group.- Specified by:
isMemberOfin interfaceB2BApproverService<B2BCustomerModel>- Parameters:
principal- the principaluserGroupUid- the uid of the user group to check if the principal is a memeber of.- Returns:
- true, if is member of
-
addApproverToUnit
Description copied from interface:B2BApproverServiceAdd approver to given unit- Specified by:
addApproverToUnitin interfaceB2BApproverService<B2BCustomerModel>- Parameters:
unitUid- A unique identifier forB2BUnitModelapproverUid- A unique identifier forB2BCustomerModelwho is a approver- Returns:
- Updated
B2BCustomerModelobject after adding approver to customer.
-
removeApproverFromUnit
Description copied from interface:B2BApproverServiceIf an approver is a member of the B2BUnit remove b2bapprovergroup role, if the approver is a member of the current branch of units the approver will be removed fromB2BUnitModel.getApprovers()relationship- Specified by:
removeApproverFromUnitin interfaceB2BApproverService<B2BCustomerModel>- Parameters:
unitUid- A unique identifier ofB2BUnitModelapproverUid- A unique identifier ofB2BCustomerModel- Returns:
- An approver who was removed from a
B2BUnitModel.getApprovers()
-
findPagedApproversForUnitByGroupMembership
public SearchPageData<B2BCustomerModel> findPagedApproversForUnitByGroupMembership(PageableData pageableData, String unitUid, String... usergroupUid) Description copied from interface:B2BApproverServiceGets list ofSearchPageDataB2BCustomerModelprovided with required pagination parameters withPageableData- Specified by:
findPagedApproversForUnitByGroupMembershipin interfaceB2BApproverService<B2BCustomerModel>- Parameters:
pageableData- Pagination informationunitUid- A unique identifier ofB2BUnitModelusergroupUid- A unique identifier ofB2BUserGroupModel- Returns:
- Collection of paginated
B2BCostCenterModelobjects
-
getModelService
-
setModelService
-
getB2bUnitService
-
setB2bUnitService
-
getUserService
-
setUserService
-
getB2bCommerceUnitService
-
setB2bCommerceUnitService
-
getPagedB2BCustomerDao
-
setPagedB2BCustomerDao
-