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 around
B2BUnitModel.- Spring Bean ID:
- b2bUnitService
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddMember(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 unitfindAccountManagerForUnit(T unit) Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4.Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4.findUnitByUid(String uid) Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4.findUnitWithCreditLimit(T unit, CurrencyModel currency) Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4.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 theunitDeprecated, for removal: This API element is subject to removal in a future version.Since 6.0.getAllParents(T unit) Get all the parent units in the organization hierarchy all the way up to the root.Gets all process definition name registered with theProcessDefinitionFactorygetAllUnitsOfOrganization(B2BCustomerModel customer) Retrieves all units of an organization thecustomerbelongs too.getAllUnitsOfOrganization(T unit) Deprecated, for removal: This API element is subject to removal in a future version.Since 6.0.<M extends PrincipalModel>
Set<M>getAllUserGroupMembersForType(UserGroupModel userGroup, Class<M> memberType) Retrieves all members of a User Group of the specified typeDeprecated, for removal: This API element is subject to removal in a future version.since 1905.getB2BCustomers(T unit) Gets the b2 b customers.getB2BUnits(T unit) Gets units that are children of the current unit.Gets the branch of a unit.getCustomers(Set<T> branch) Gets the employees.getParent(B2BCustomerModel employee) Gets the parent unit of a user.Gets the parent unit of a unit.getRootUnit(T unit) Gets the root unit.getUnitForUid(String uid) Find unit by uid.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 theunitgetUsersOfUserGroup(B2BUnitModel unit, String userGroupId, boolean recursive) Gets all members from the unit who belong to specified User GroupgetUsersOfUserGroup(T unit, 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 Details
-
getAllUnitsOfOrganization
Deprecated, for removal: This API element is subject to removal in a future version.Since 6.0. UsegetBranch(T)insteadRetrieves all units of an organization theunitbelongs too.- Parameters:
unit- AB2BUnitModelwithin an organization- Returns:
- A list of all units within an organization.
-
getAllUnitsOfOrganization
Retrieves all units of an organization thecustomerbelongs too.- Parameters:
customer- the session user.- Returns:
- the all units of organization
-
getAllUserGroupMembersForType
<M extends PrincipalModel> Set<M> getAllUserGroupMembersForType(UserGroupModel userGroup, 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
Gets the parent unit of a user.- Parameters:
employee- the employee- Returns:
- the parent
-
getParent
Gets the parent unit of a unit.- Parameters:
unit- the child unit- Returns:
- the parent unit or null if
unitwas the root unit.
-
getRootUnit
Gets the root unit.- Parameters:
unit- the unit- Returns:
- the root unit
-
findUnitByUid
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
Find unit by uid.- Parameters:
uid- the uid- Returns:
- the b2 b unit model
-
getBranch
Gets the branch of a unit.- Parameters:
unit- the unit- Returns:
- the branch
-
getCustomers
Gets the employees.- Parameters:
branch- the branch- Returns:
- the employees
-
disableBranch
Disable branch. Mark all units in the branch as active = false- Parameters:
unit- the unit
-
enableBranch
Enable branch. Mark all unit in the branch as active = true.- Parameters:
unit- the unit
-
getAllParents
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
Adds the member to a group. The model is not saved.- Parameters:
group- the groupmember- the member
-
getB2BCustomers
Gets the b2 b customers.- Parameters:
unit- the unit- Returns:
- the b2 b customers
-
getB2BUnits
Gets units that are children of the current unit.- Parameters:
unit- the unit- Returns:
- the b2 b units
-
updateParentB2BUnit
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) Collection<U> getUsersOfUserGroup(T unit, 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
Collection<B2BCustomerModel> getUsersOfUserGroup(B2BUnitModel unit, 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, 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, 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, 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, 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
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, 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
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
Sets the branch for the current use in the session.- Parameters:
session-currentUser-
-
getAllProcessDefinitionsNames
Gets all process definition name registered with theProcessDefinitionFactory- Returns:
- A unique list of all Business process names.
-
disableUnit
Disables a b2b unit- Parameters:
unit- the unit
-
enableUnit
Enables a b2b unit- Parameters:
unit- the unit
-
setCurrentUnit
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
-