Class DefaultB2BApproverService
- java.lang.Object
-
- de.hybris.platform.b2b.services.impl.DefaultB2BApproverService
-
- All Implemented Interfaces:
B2BApproverService<B2BCustomerModel>
public class DefaultB2BApproverService extends java.lang.Object implements B2BApproverService<B2BCustomerModel>
Default implementation of theB2BApproverService
.- Spring Bean ID:
- b2bApproverService
-
-
Constructor Summary
Constructors Constructor Description DefaultB2BApproverService()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description B2BCustomerModel
addApproverToCustomer(java.lang.String user, java.lang.String approver)
Add an approver for a given user and return the updatedB2BCustomerModel
object updated with approver detailsB2BCustomerModel
addApproverToUnit(java.lang.String unitUid, java.lang.String approverUid)
Add approver to given unitSearchPageData<B2BCustomerModel>
findPagedApproversForUnitByGroupMembership(PageableData pageableData, java.lang.String unitUid, java.lang.String... usergroupUid)
Gets list ofSearchPageData
B2BCustomerModel
provided with required pagination parameters withPageableData
java.util.List<UserModel>
getAccountManagerApprovers(PrincipalModel principal)
Gets the list of account manager approvers.java.util.List<B2BCustomerModel>
getAllActiveApprovers(B2BCustomerModel principal)
Gets all the active approvers for a given customerjava.util.List<B2BCustomerModel>
getAllApprovers(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 B2BCommerceUnitService
getB2bCommerceUnitService()
protected B2BUnitService<B2BUnitModel,B2BCustomerModel>
getB2bUnitService()
protected java.util.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 ModelService
getModelService()
protected PagedB2BCustomerDao<B2BCustomerModel>
getPagedB2BCustomerDao()
protected UserService
getUserService()
boolean
isMemberOf(PrincipalGroupModel principal, java.lang.String userGroupUid)
Deprecated.Since 4.4.protected java.lang.String
principalListToUidString(java.util.List<B2BCustomerModel> allApprovers)
Gets the id's for a list of approvers.B2BCustomerModel
removeApproverFromCustomer(java.lang.String user, java.lang.String approver)
Remove an approver for a given user and return the updatedB2BCustomerModel
object updated with approver detailsB2BCustomerModel
removeApproverFromUnit(java.lang.String unitUid, java.lang.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()
relationshipvoid
setB2bCommerceUnitService(B2BCommerceUnitService b2bCommerceUnitService)
void
setB2bUnitService(B2BUnitService<B2BUnitModel,B2BCustomerModel> b2bUnitService)
void
setModelService(ModelService modelService)
void
setPagedB2BCustomerDao(PagedB2BCustomerDao<B2BCustomerModel> pagedB2BCustomerDao)
void
setUserService(UserService userService)
-
-
-
Method Detail
-
getAllApprovers
public java.util.List<B2BCustomerModel> getAllApprovers(B2BCustomerModel principal)
Description copied from interface:B2BApproverService
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.- Specified by:
getAllApprovers
in interfaceB2BApproverService<B2BCustomerModel>
- Parameters:
principal
- the principal (customer)- Returns:
- A collection of approvers
-
getAllActiveApprovers
public java.util.List<B2BCustomerModel> getAllActiveApprovers(B2BCustomerModel principal)
Description copied from interface:B2BApproverService
Gets all the active approvers for a given customer- Specified by:
getAllActiveApprovers
in interfaceB2BApproverService<B2BCustomerModel>
- Returns:
- list of approvers
-
principalListToUidString
protected java.lang.String principalListToUidString(java.util.List<B2BCustomerModel> allApprovers)
Gets the id's for a list of approvers.- Parameters:
allApprovers
-- Returns:
- String list of approver id's
-
getImmediateApprovers
protected java.util.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.- Parameters:
principal
- the principal- Returns:
- the immediate approvers - a list of
B2BCustomerModel
-
getAccountManagerApprovers
public java.util.List<UserModel> getAccountManagerApprovers(PrincipalModel principal)
Description copied from interface:B2BApproverService
Gets the list of account manager approvers.- Specified by:
getAccountManagerApprovers
in interfaceB2BApproverService<B2BCustomerModel>
- Parameters:
principal
- the principal- Returns:
- the approvers
-
addApproverToCustomer
public B2BCustomerModel addApproverToCustomer(java.lang.String user, java.lang.String approver)
Description copied from interface:B2BApproverService
Add an approver for a given user and return the updatedB2BCustomerModel
object updated with approver details- Specified by:
addApproverToCustomer
in interfaceB2BApproverService<B2BCustomerModel>
- Parameters:
user
- A unique identifier forB2BCustomerModel
representing a userapprover
- A unique identifier forB2BCustomerModel
representing a approver- Returns:
- Updated
B2BCustomerModel
object updated with approvers
-
removeApproverFromCustomer
public B2BCustomerModel removeApproverFromCustomer(java.lang.String user, java.lang.String approver)
Description copied from interface:B2BApproverService
Remove an approver for a given user and return the updatedB2BCustomerModel
object updated with approver details- Specified by:
removeApproverFromCustomer
in interfaceB2BApproverService<B2BCustomerModel>
- Parameters:
user
- A unique identifier forB2BCustomerModel
representing a userapprover
- A unique identifier forB2BCustomerModel
representing a approver- Returns:
- Updated
B2BCustomerModel
object removed with approver
-
isMemberOf
@Deprecated(since="4.4") public boolean isMemberOf(PrincipalGroupModel principal, java.lang.String userGroupUid)
Deprecated.Since 4.4.Description copied from interface:B2BApproverService
Checks if the principal is a member of the user group.- Specified by:
isMemberOf
in 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
public B2BCustomerModel addApproverToUnit(java.lang.String unitUid, java.lang.String approverUid)
Description copied from interface:B2BApproverService
Add approver to given unit- Specified by:
addApproverToUnit
in interfaceB2BApproverService<B2BCustomerModel>
- Parameters:
unitUid
- A unique identifier forB2BUnitModel
approverUid
- A unique identifier forB2BCustomerModel
who is a approver- Returns:
- Updated
B2BCustomerModel
object after adding approver to customer.
-
removeApproverFromUnit
public B2BCustomerModel removeApproverFromUnit(java.lang.String unitUid, java.lang.String approverUid)
Description copied from interface:B2BApproverService
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()
relationship- Specified by:
removeApproverFromUnit
in interfaceB2BApproverService<B2BCustomerModel>
- Parameters:
unitUid
- A unique identifier ofB2BUnitModel
approverUid
- A unique identifier ofB2BCustomerModel
- Returns:
- An approver who was removed from a
B2BUnitModel.getApprovers()
-
findPagedApproversForUnitByGroupMembership
public SearchPageData<B2BCustomerModel> findPagedApproversForUnitByGroupMembership(PageableData pageableData, java.lang.String unitUid, java.lang.String... usergroupUid)
Description copied from interface:B2BApproverService
Gets list ofSearchPageData
B2BCustomerModel
provided with required pagination parameters withPageableData
- Specified by:
findPagedApproversForUnitByGroupMembership
in interfaceB2BApproverService<B2BCustomerModel>
- Parameters:
pageableData
- Pagination informationunitUid
- A unique identifier ofB2BUnitModel
usergroupUid
- A unique identifier ofB2BUserGroupModel
- Returns:
- Collection of paginated
B2BCostCenterModel
objects
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getB2bUnitService
protected B2BUnitService<B2BUnitModel,B2BCustomerModel> getB2bUnitService()
-
setB2bUnitService
public void setB2bUnitService(B2BUnitService<B2BUnitModel,B2BCustomerModel> b2bUnitService)
-
getUserService
protected UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
getB2bCommerceUnitService
protected B2BCommerceUnitService getB2bCommerceUnitService()
-
setB2bCommerceUnitService
public void setB2bCommerceUnitService(B2BCommerceUnitService b2bCommerceUnitService)
-
getPagedB2BCustomerDao
protected PagedB2BCustomerDao<B2BCustomerModel> getPagedB2BCustomerDao()
-
setPagedB2BCustomerDao
public void setPagedB2BCustomerDao(PagedB2BCustomerDao<B2BCustomerModel> pagedB2BCustomerDao)
-
-