Package de.hybris.platform.b2b.services
Interface B2BUnitService<T extends CompanyModel,U extends UserModel>
-
- Type Parameters:
T- extension ofCompanyModelU- extension ofUserModel
- All Known Implementing Classes:
B2BUnitServiceProxy,DefaultB2BUnitService
public interface B2BUnitService<T extends CompanyModel,U extends UserModel>A service aroundB2BUnitModel.- Spring Bean ID:
- b2bUnitService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddMember(T group, PrincipalModel member)Adds the member to a group.voiddisableBranch(T unit)Disable branch.voiddisableUnit(B2BUnitModel unit)Disables a b2b unitvoidenableBranch(T unit)Enable branch.voidenableUnit(B2BUnitModel unit)Enables a b2b unitEmployeeModelfindAccountManagerForUnit(T unit)Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4.java.lang.StringfindApprovalProcessCodeForUnit(T unit)Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4.TfindUnitByUid(java.lang.String uid)Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4.TfindUnitWithCreditLimit(T unit, CurrencyModel currency)Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4.EmployeeModelgetAccountManagerForUnit(T unit)Get salesrep from unit, checking parent units up the organization tree up to the root unit if salesrep is not set in theunitjava.util.List<java.lang.String>getAllApprovalProcesses()Deprecated, for removal: This API element is subject to removal in a future version.Since 6.0.java.util.List<T>getAllParents(T unit)Get all the parent units in the organization hierarchy all the way up to the root.java.util.Set<java.lang.String>getAllProcessDefinitionsNames()Gets all process definition name registered with theProcessDefinitionFactoryjava.util.Set<T>getAllUnitsOfOrganization(B2BCustomerModel customer)Retrieves all units of an organization thecustomerbelongs too.java.util.Set<T>getAllUnitsOfOrganization(T unit)Deprecated, for removal: This API element is subject to removal in a future version.Since 6.0.<M extends PrincipalModel>
java.util.Set<M>getAllUserGroupMembersForType(UserGroupModel userGroup, java.lang.Class<M> memberType)Retrieves all members of a User Group of the specified typejava.lang.StringgetApprovalProcessCodeForUnit(T unit)Deprecated, for removal: This API element is subject to removal in a future version.since 1905.java.util.Set<U>getB2BCustomers(T unit)Gets the b2 b customers.java.util.Set<T>getB2BUnits(T unit)Gets units that are children of the current unit.java.util.Set<T>getBranch(T unit)Gets the branch of a unit.java.util.Set<U>getCustomers(java.util.Set<T> branch)Gets the employees.TgetParent(B2BCustomerModel employee)Gets the parent unit of a user.TgetParent(T unit)Gets the parent unit of a unit.TgetRootUnit(T unit)Gets the root unit.TgetUnitForUid(java.lang.String uid)Find unit by uid.TgetUnitWithCreditLimit(T unit)Get unit with credit limit/credit check group value, checking parent units up the organization tree up to the root unit if credit limit / credit check group is not set in theunitjava.util.Collection<B2BCustomerModel>getUsersOfUserGroup(B2BUnitModel unit, java.lang.String userGroupId, boolean recursive)Gets all members from the unit who belong to specified User Groupjava.util.Collection<U>getUsersOfUserGroup(T unit, java.lang.String userGroupId)Deprecated, for removal: This API element is subject to removal in a future version.Since 6.0.voidsetCurrentUnit(B2BCustomerModel customer, B2BUnitModel unit)Assigns a default unit for a customer who may be a member of multiple units.voidupdateBranchInSession(Session session, UserModel currentUser)Sets the branch for the current use in the session.voidupdateParentB2BUnit(T parentB2BUnit, PrincipalModel member)Set the parent unit of a given principal.
-
-
-
Method Detail
-
getAllUnitsOfOrganization
@Deprecated(since="6.0", forRemoval=true) java.util.Set<T> getAllUnitsOfOrganization(T unit)Deprecated, for removal: This API element is subject to removal in a future version.Since 6.0. Use#getBranch(T)insteadRetrieves all units of an organization theunitbelongs too.- Parameters:
unit- AB2BUnitModelwithin an organization- Returns:
- A list of all units within an organization.
-
getAllUnitsOfOrganization
java.util.Set<T> getAllUnitsOfOrganization(B2BCustomerModel customer)
Retrieves all units of an organization thecustomerbelongs too.- Parameters:
customer- the session user.- Returns:
- the all units of organization
-
getAllUserGroupMembersForType
<M extends PrincipalModel> java.util.Set<M> getAllUserGroupMembersForType(UserGroupModel userGroup, java.lang.Class<M> memberType)
Retrieves all members of a User Group of the specified type- Parameters:
userGroup- the user groupmemberType- the principle's member type- Returns:
- the principle members
-
getParent
T getParent(B2BCustomerModel employee)
Gets the parent unit of a user.- Parameters:
employee- the employee- Returns:
- the parent
-
getParent
T getParent(T unit)
Gets the parent unit of a unit.- Parameters:
unit- the child unit- Returns:
- the parent unit or null if
unitwas the root unit.
-
getRootUnit
T getRootUnit(T unit)
Gets the root unit.- Parameters:
unit- the unit- Returns:
- the root unit
-
findUnitByUid
@Deprecated(since="4.4", forRemoval=true) T findUnitByUid(java.lang.String uid)Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4. UsegetUnitForUid(String)insteadFind unit by uid.- Parameters:
uid- the uid- Returns:
- the b2 b unit model
-
getUnitForUid
T getUnitForUid(java.lang.String uid)
Find unit by uid.- Parameters:
uid- the uid- Returns:
- the b2 b unit model
-
getBranch
java.util.Set<T> getBranch(T unit)
Gets the branch of a unit.- Parameters:
unit- the unit- Returns:
- the branch
-
getCustomers
java.util.Set<U> getCustomers(java.util.Set<T> branch)
Gets the employees.- Parameters:
branch- the branch- Returns:
- the employees
-
disableBranch
void disableBranch(T unit)
Disable branch. Mark all units in the branch as active = false- Parameters:
unit- the unit
-
enableBranch
void enableBranch(T unit)
Enable branch. Mark all unit in the branch as active = true.- Parameters:
unit- the unit
-
getAllParents
java.util.List<T> getAllParents(T unit)
Get all the parent units in the organization hierarchy all the way up to the root.- Parameters:
unit- the unit- Returns:
- A Set of all b2b units (CompanyModel)
-
addMember
void addMember(T group, PrincipalModel member)
Adds the member to a group. The model is not saved.- Parameters:
group- the groupmember- the member
-
getB2BCustomers
java.util.Set<U> getB2BCustomers(T unit)
Gets the b2 b customers.- Parameters:
unit- the unit- Returns:
- the b2 b customers
-
getB2BUnits
java.util.Set<T> getB2BUnits(T unit)
Gets units that are children of the current unit.- Parameters:
unit- the unit- Returns:
- the b2 b units
-
updateParentB2BUnit
void updateParentB2BUnit(T parentB2BUnit, PrincipalModel member)
Set the parent unit of a given principal. The member is not saved.- Parameters:
parentB2BUnit- the parent b2 b unitmember- the member
-
getUsersOfUserGroup
@Deprecated(since="6.0", forRemoval=true) java.util.Collection<U> getUsersOfUserGroup(T unit, java.lang.String userGroupId)Deprecated, for removal: This API element is subject to removal in a future version.Gets all members from the unit who belong to specified User Group- Parameters:
unit- the unituserGroupId- the user group id- Returns:
- A collection of users who are members of the unit with group userGroupId
-
getUsersOfUserGroup
java.util.Collection<B2BCustomerModel> getUsersOfUserGroup(B2BUnitModel unit, java.lang.String userGroupId, boolean recursive)
Gets all members from the unit who belong to specified User Group- Parameters:
unit- the unituserGroupId- the user group idrecursive- If true the lookup of users will continue for unit parent until at least one is found.- Returns:
- A collection of users who are members of the unit with group userGroupId
-
findApprovalProcessCodeForUnit
@Deprecated(since="4.4", forRemoval=true) java.lang.String findApprovalProcessCodeForUnit(T unit)Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4. UsegetApprovalProcessCodeForUnit(CompanyModel)insteadGet approval process code from unit, checking parent units up the organization tree up to the root unit if process is not set in theunit- Parameters:
unit-- Returns:
- approval process code
-
getApprovalProcessCodeForUnit
@Deprecated(since="1905", forRemoval=true) java.lang.String getApprovalProcessCodeForUnit(T unit)Deprecated, for removal: This API element is subject to removal in a future version.since 1905. Please use {@link de.hybris.platform.b2b.process.approval.services.impl.DefaultB2BApprovalProcessService.getApprovalProcessCodeForUnit(B2BUnitModel)} instead.Get approval process code from unit, checking parent units up the organization tree up to the root unit if process is not set in theunit- Parameters:
unit-- Returns:
- approval process code
-
getAllApprovalProcesses
@Deprecated(since="6.0", forRemoval=true) java.util.List<java.lang.String> getAllApprovalProcesses()Deprecated, for removal: This API element is subject to removal in a future version.Since 6.0. UsegetAllProcessDefinitionsNames()Get All Approval Process codes defined in local.properties- Returns:
- List of approval process codes
-
findAccountManagerForUnit
@Deprecated(since="4.4", forRemoval=true) EmployeeModel findAccountManagerForUnit(T unit)Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4. UsegetAccountManagerForUnit(CompanyModel)insteadGet salesrep from unit, checking parent units up the organization tree up to the root unit if salesrep is not set in theunit- Parameters:
unit-- Returns:
- the account manager
-
getAccountManagerForUnit
EmployeeModel getAccountManagerForUnit(T unit)
Get salesrep from unit, checking parent units up the organization tree up to the root unit if salesrep is not set in theunit- Parameters:
unit-- Returns:
- the account manager
-
findUnitWithCreditLimit
@Deprecated(since="4.4", forRemoval=true) T findUnitWithCreditLimit(T unit, CurrencyModel currency)Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4. UsegetUnitWithCreditLimit(CompanyModel)insteadGet unit with credit limit/credit check group value, checking parent units up the organization tree up to the root unit if credit limit / credit check group is not set in theunit- Parameters:
unit-currency-- Returns:
- unit with credit limit/check
-
getUnitWithCreditLimit
T getUnitWithCreditLimit(T unit)
Get unit with credit limit/credit check group value, checking parent units up the organization tree up to the root unit if credit limit / credit check group is not set in theunit- Parameters:
unit-- Returns:
- unit with credit limit/check
-
updateBranchInSession
void updateBranchInSession(Session session, UserModel currentUser)
Sets the branch for the current use in the session.- Parameters:
session-currentUser-
-
getAllProcessDefinitionsNames
java.util.Set<java.lang.String> getAllProcessDefinitionsNames()
Gets all process definition name registered with theProcessDefinitionFactory- Returns:
- A unique list of all Business process names.
-
disableUnit
void disableUnit(B2BUnitModel unit)
Disables a b2b unit- Parameters:
unit- the unit
-
enableUnit
void enableUnit(B2BUnitModel unit)
Enables a b2b unit- Parameters:
unit- the unit
-
setCurrentUnit
void setCurrentUnit(B2BCustomerModel customer, B2BUnitModel unit)
Assigns a default unit for a customer who may be a member of multiple units. and modifies a branch for this customers session based on the unit- Parameters:
customer- The current customerunit- AB2BUnitModelto be assigned as the default for a customer
-
-