Class DefaultB2BUnitService
java.lang.Object
de.hybris.platform.b2b.services.impl.DefaultB2BUnitService
- All Implemented Interfaces:
B2BUnitService<B2BUnitModel,B2BCustomerModel>
public class DefaultB2BUnitService
extends Object
implements B2BUnitService<B2BUnitModel,B2BCustomerModel>
Default implementation of the
B2BUnitService- Spring Bean ID:
- b2bUnitService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMember(B2BUnitModel group, PrincipalModel member) Adds the member to a group.voiddisableBranch(B2BUnitModel unit) Disable branch.voiddisableUnit(B2BUnitModel unit) Disables a b2b unitvoidenableBranch(B2BUnitModel unit) Enable branch.voidenableUnit(B2BUnitModel unit) Enables a b2b unitDeprecated, 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(B2BUnitModel unit, CurrencyModel currency) Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4.Get salesrep from unit, checking parent units up the organization tree up to the root unit if salesrep is not set in theunitprotected B2BCreditLimitModelDeprecated, for removal: This API element is subject to removal in a future version.Since 6.0.getAllParents(B2BUnitModel 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 employee) Retrieves all units of an organization thecustomerbelongs too.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(B2BUnitModel unit) Gets the b2 b customers.protected Set<B2BUnitModel>getB2BHierarchyUnits(Set<B2BUnitModel> units) protected B2BUnitDaogetB2BUnits(B2BUnitModel unit) Gets units that are children of the current unit.getBranch(B2BUnitModel unit) Gets the branch of a unit.protected voidgetBranch(B2BUnitModel parent, Set<B2BUnitModel> organizationSet) protected Set<B2BUnitModel>getBranchHierarchy(B2BUnitModel parent) protected ConfigurationServicegetCustomers(Set<B2BUnitModel> branch) Gets the employees.protected ModelServicegetParent(B2BCustomerModel employee) Gets the parent unit of a user.getParent(B2BUnitModel unit) Gets the parent unit of a unit.protected PrincipalGroupMembersDaoprotected ProcessDefinitionFactorygetRootUnit(B2BUnitModel unit) Gets the root unit.protected SearchRestrictionServiceprotected SessionServiceprotected TypeServicegetUnitForUid(String uid) Find unit by uid.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 theunitprotected UserServicegetUsersOfUserGroup(B2BUnitModel unit, String userGroupId) Deprecated, for removal: This API element is subject to removal in a future version.Since 6.0.getUsersOfUserGroup(B2BUnitModel unit, String userGroupId, boolean recursive) Gets all members from the unit who belong to specified User Groupprotected EnumerationValueModellookupPriceGroupFromClosestParent(B2BUnitModel unitOfCustomer) voidsetB2bUnitDao(B2BUnitDao b2bUnitDao) voidsetConfigurationService(ConfigurationService configurationService) voidsetCurrentUnit(B2BCustomerModel customer, B2BUnitModel unit) Assigns a default unit for a customer who may be a member of multiple units.voidsetModelService(ModelService modelService) voidsetPrincipalGroupMembersDao(PrincipalGroupMembersDao principalGroupMembersDao) voidsetProcessDefinitionFactory(ProcessDefinitionFactory processDefinitionFactory) voidsetSearchRestrictionService(SearchRestrictionService searchRestrictionService) voidsetSessionService(SessionService sessionService) voidsetTypeService(TypeService typeService) voidsetUserService(UserService userService) protected voidtoggleBranch(B2BUnitModel unit, Boolean enable) Enables or disables a branch and it sibling typesB2BCostCenterModelB2BBudgetModelandB2BCustomerModelassigned to all units in the branch.protected voidtoggleUnit(B2BUnitModel b2bUnitModel, Boolean enable) voidupdateBranchInSession(Session session, UserModel currentUser) Sets the branch for the current use in the session.voidupdateParentB2BUnit(B2BUnitModel parentB2BUnit, PrincipalModel member) Set the parent unit of a given principal.
-
Constructor Details
-
DefaultB2BUnitService
public DefaultB2BUnitService()
-
-
Method Details
-
getAllUnitsOfOrganization
@Deprecated(since="6.0", forRemoval=true) public Set<B2BUnitModel> getAllUnitsOfOrganization(B2BUnitModel unit) Deprecated, for removal: This API element is subject to removal in a future version.Since 6.0. UsegetBranch(B2BUnitModel)insteadDescription copied from interface:B2BUnitServiceRetrieves all units of an organization theunitbelongs too.- Specified by:
getAllUnitsOfOrganizationin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
unit- AB2BUnitModelwithin an organization- Returns:
- A list of all units within an organization.
-
getBranch
Description copied from interface:B2BUnitServiceGets the branch of a unit.- Specified by:
getBranchin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
unit- the unit- Returns:
- the branch
-
disableBranch
Description copied from interface:B2BUnitServiceDisable branch. Mark all units in the branch as active = false- Specified by:
disableBranchin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
unit- the unit
-
enableBranch
Description copied from interface:B2BUnitServiceEnable branch. Mark all unit in the branch as active = true.- Specified by:
enableBranchin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
unit- the unit
-
disableUnit
Description copied from interface:B2BUnitServiceDisables a b2b unit- Specified by:
disableUnitin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
unit- the unit
-
enableUnit
Description copied from interface:B2BUnitServiceEnables a b2b unit- Specified by:
enableUnitin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
unit- the unit
-
setCurrentUnit
Description copied from interface:B2BUnitServiceAssigns 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- Specified by:
setCurrentUnitin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
customer- The current customerunit- AB2BUnitModelto be assigned as the default for a customer
-
toggleBranch
Enables or disables a branch and it sibling typesB2BCostCenterModelB2BBudgetModelandB2BCustomerModelassigned to all units in the branch.- Parameters:
unit- A unit to look up a branch for viagetBranch(de.hybris.platform.b2b.model.B2BUnitModel)enable- IfBoolean.TRUEall units in the branch will be activated by setting active attribute to true. If false the reverse will happen.
-
toggleUnit
-
getB2BHierarchyUnits
-
getB2BUnits
Description copied from interface:B2BUnitServiceGets units that are children of the current unit.- Specified by:
getB2BUnitsin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
unit- the unit- Returns:
- the b2 b units
-
getB2BCustomers
Description copied from interface:B2BUnitServiceGets the b2 b customers.- Specified by:
getB2BCustomersin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
unit- the unit- Returns:
- the b2 b customers
-
getBranchHierarchy
-
getBranch
-
getAllUnitsOfOrganization
Description copied from interface:B2BUnitServiceRetrieves all units of an organization thecustomerbelongs too.- Specified by:
getAllUnitsOfOrganizationin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
employee- the session user.- Returns:
- the all units of organization
-
getParent
Description copied from interface:B2BUnitServiceGets the parent unit of a user.- Specified by:
getParentin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
employee- the employee- Returns:
- the parent
-
getParent
Description copied from interface:B2BUnitServiceGets the parent unit of a unit.- Specified by:
getParentin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
unit- the child unit- Returns:
- the parent unit or null if
unitwas the root unit.
-
getRootUnit
Description copied from interface:B2BUnitServiceGets the root unit.- Specified by:
getRootUnitin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
unit- the unit- Returns:
- the root unit
-
getAllParents
Description copied from interface:B2BUnitServiceGet all the parent units in the organization hierarchy all the way up to the root.- Specified by:
getAllParentsin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
unit- the unit- Returns:
- A Set of all b2b units (CompanyModel)
-
findUnitByUid
Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4. UsegetUnitForUid(String)insteadDescription copied from interface:B2BUnitServiceFind unit by uid.- Specified by:
findUnitByUidin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
uid- the uid- Returns:
- the b2 b unit model
-
getUnitForUid
Description copied from interface:B2BUnitServiceFind unit by uid.- Specified by:
getUnitForUidin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
uid- the uid- Returns:
- the b2 b unit model
-
getCustomers
Description copied from interface:B2BUnitServiceGets the employees.- Specified by:
getCustomersin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
branch- the branch- Returns:
- the employees
-
getAllUserGroupMembersForType
public <M extends PrincipalModel> Set<M> getAllUserGroupMembersForType(UserGroupModel userGroup, Class<M> memberType) Description copied from interface:B2BUnitServiceRetrieves all members of a User Group of the specified type- Specified by:
getAllUserGroupMembersForTypein interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
userGroup- the user groupmemberType- the principle's member type- Returns:
- the principle members
-
addMember
Description copied from interface:B2BUnitServiceAdds the member to a group. The model is not saved.- Specified by:
addMemberin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
group- the groupmember- the member
-
updateParentB2BUnit
Description copied from interface:B2BUnitServiceSet the parent unit of a given principal. The member is not saved.- Specified by:
updateParentB2BUnitin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
parentB2BUnit- the parent b2 b unitmember- the member
-
getUsersOfUserGroup
@Deprecated(since="6.0", forRemoval=true) public Collection<B2BCustomerModel> getUsersOfUserGroup(B2BUnitModel unit, String userGroupId) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:B2BUnitServiceGets all members from the unit who belong to specified User Group- Specified by:
getUsersOfUserGroupin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Parameters:
unit- the unituserGroupId- the user group id- Returns:
- A collection of users who are members of the unit with group userGroupId
-
getUsersOfUserGroup
public Collection<B2BCustomerModel> getUsersOfUserGroup(B2BUnitModel unit, String userGroupId, boolean recursive) Description copied from interface:B2BUnitServiceGets all members from the unit who belong to specified User Group- Specified by:
getUsersOfUserGroupin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - 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
-
updateBranchInSession
Description copied from interface:B2BUnitServiceSets the branch for the current use in the session.- Specified by:
updateBranchInSessionin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel>
-
findApprovalProcessCodeForUnit
@Deprecated(since="4.4", forRemoval=true) public String findApprovalProcessCodeForUnit(B2BUnitModel unit) Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4. UsegetApprovalProcessCodeForUnit(B2BUnitModel)insteadDescription copied from interface:B2BUnitServiceGet approval process code from unit, checking parent units up the organization tree up to the root unit if process is not set in theunit- Specified by:
findApprovalProcessCodeForUnitin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Returns:
- approval process code
-
getApprovalProcessCodeForUnit
@Deprecated(since="1905", forRemoval=true) public String getApprovalProcessCodeForUnit(B2BUnitModel 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.Description copied from interface:B2BUnitServiceGet approval process code from unit, checking parent units up the organization tree up to the root unit if process is not set in theunit- Specified by:
getApprovalProcessCodeForUnitin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Returns:
- approval process code
-
setUserService
-
getAllApprovalProcesses
Deprecated, for removal: This API element is subject to removal in a future version.Since 6.0. UsegetAllProcessDefinitionsNames()Description copied from interface:B2BUnitServiceGet All Approval Process codes defined in local.properties- Specified by:
getAllApprovalProcessesin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Returns:
- List of approval process codes
-
getAllProcessDefinitionsNames
Description copied from interface:B2BUnitServiceGets all process definition name registered with theProcessDefinitionFactory- Specified by:
getAllProcessDefinitionsNamesin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Returns:
- A unique list of all Business process names.
-
findAccountManagerForUnit
@Deprecated(since="4.4", forRemoval=true) public EmployeeModel findAccountManagerForUnit(B2BUnitModel unit) Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4. UsegetAccountManagerForUnit(B2BUnitModel)insteadDescription copied from interface:B2BUnitServiceGet salesrep from unit, checking parent units up the organization tree up to the root unit if salesrep is not set in theunit- Specified by:
findAccountManagerForUnitin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Returns:
- the account manager
-
getAccountManagerForUnit
Description copied from interface:B2BUnitServiceGet salesrep from unit, checking parent units up the organization tree up to the root unit if salesrep is not set in theunit- Specified by:
getAccountManagerForUnitin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Returns:
- the account manager
-
findUnitWithCreditLimit
@Deprecated(since="4.4", forRemoval=true) public B2BUnitModel findUnitWithCreditLimit(B2BUnitModel unit, CurrencyModel currency) Deprecated, for removal: This API element is subject to removal in a future version.Since 4.4. UsegetUnitWithCreditLimit(B2BUnitModel)insteadDescription copied from interface:B2BUnitServiceGet 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- Specified by:
findUnitWithCreditLimitin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Returns:
- unit with credit limit/check
-
getUnitWithCreditLimit
Description copied from interface:B2BUnitServiceGet 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- Specified by:
getUnitWithCreditLimitin interfaceB2BUnitService<B2BUnitModel,B2BCustomerModel> - Returns:
- unit with credit limit/check
-
getActiveCreditLimit
-
getConfigurationService
-
getSearchRestrictionService
-
lookupPriceGroupFromClosestParent
-
setConfigurationService
-
setSearchRestrictionService
-
setB2bUnitDao
-
getModelService
-
setModelService
-
getSessionService
-
setSessionService
-
getUserService
-
getProcessDefinitionFactory
-
setProcessDefinitionFactory
-
getPrincipalGroupMembersDao
-
setPrincipalGroupMembersDao
-
getB2bUnitDao
-
setTypeService
-
getTypeService
-