Class DefaultAssistedServiceService
- java.lang.Object
-
- de.hybris.platform.assistedserviceservices.impl.DefaultAssistedServiceService
-
- All Implemented Interfaces:
AssistedServiceService
public class DefaultAssistedServiceService extends java.lang.Object implements AssistedServiceService
Default implementation ofAssistedServiceService
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNOT_ANONYMOUS_CART_ERROR
-
Constructor Summary
Constructors Constructor Description DefaultAssistedServiceService()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidbindCustomerToCart(java.lang.String customerId, java.lang.String cartId)Binds customer with provided id to cart if it's anonymous cart.CustomerModelcreateNewCustomer(java.lang.String customerId, java.lang.String customerName)Creates a new customer by it email and name.protected SortQueryDatacreateSortQueryData(java.lang.String sortCode, java.lang.String query)OrderModelgerOrderByCode(java.lang.String orderCode, UserModel customer)Deprecated, for removal: This API element is subject to removal in a future version.since 6.6, useAssistedServiceService.getOrderByCode(String, UserModel)insteadAssistedServiceSessiongetAsmSession()Returns ASM session object with all information about current asm session.PointOfServiceModelgetAssistedServiceAgentStore()Returns the PointOfServiceModel for the logged in as agent.PointOfServiceModelgetAssistedServiceAgentStore(UserModel agent)Returns the PointOfServiceModel for the given as agent.protected BaseSiteServicegetBaseSiteService()CartModelgetCartByCode(java.lang.String cartCode, UserModel customer)search cart by code and customerprotected CartServicegetCartService()java.util.Collection<CartModel>getCartsForCustomer(CustomerModel customer)Returns collection of a customer's cartsprotected CommerceCartServicegetCommerceCartService()protected CommonI18NServicegetCommonI18NService()UserModelgetCustomer(java.lang.String customerId)returns customerprotected CustomerAccountServicegetCustomerAccountService()SearchPageData<CustomerModel>getCustomers(java.lang.String searchCriteria, PageableData pageableData)Get list of customers which username or email starts with provided value.protected java.lang.StringBuildergetCustomerSearchQuery(java.lang.String searchCriteria)protected FlexibleSearchServicegetFlexibleSearchService()CartModelgetLatestModifiedCart(UserModel customer)search for a cart with most resent CartModel::getModifiedtimeprotected ModelServicegetModelService()OrderModelgetOrderByCode(java.lang.String orderCode, UserModel customer)search for orderprotected PagedFlexibleSearchServicegetPagedFlexibleSearchService()protected SessionServicegetSessionService()protected TimeServicegetTimeService()protected UserServicegetUserService()booleanisAbstractOrderMatchBaseSite(AbstractOrderModel abstractOrderModel)Returns true when provided abstractOrderModel relates to current base sitevoidrestoreCartToUser(CartModel cart, UserModel user)Restore cart to provided uservoidsetBaseSiteService(BaseSiteService baseSiteService)voidsetCartService(CartService cartService)voidsetCommerceCartService(CommerceCartService commerceCartService)voidsetCommonI18NService(CommonI18NService commonI18NService)voidsetCustomerAccountService(CustomerAccountService customerAccountService)voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService)voidsetModelService(ModelService modelService)voidsetPagedFlexibleSearchService(PagedFlexibleSearchService pagedFlexibleSearchService)voidsetSessionService(SessionService sessionService)voidsetTimeService(TimeService timeService)voidsetUserService(UserService userService)
-
-
-
Field Detail
-
NOT_ANONYMOUS_CART_ERROR
public static final java.lang.String NOT_ANONYMOUS_CART_ERROR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCustomers
public SearchPageData<CustomerModel> getCustomers(java.lang.String searchCriteria, PageableData pageableData)
Description copied from interface:AssistedServiceServiceGet list of customers which username or email starts with provided value.- Specified by:
getCustomersin interfaceAssistedServiceService- Parameters:
searchCriteria- uid or customer's namepageableData- pageable properties- Returns:
- suggested customers
-
getCustomerSearchQuery
protected java.lang.StringBuilder getCustomerSearchQuery(java.lang.String searchCriteria)
-
createSortQueryData
protected SortQueryData createSortQueryData(java.lang.String sortCode, java.lang.String query)
-
bindCustomerToCart
public void bindCustomerToCart(java.lang.String customerId, java.lang.String cartId) throws AssistedServiceExceptionDescription copied from interface:AssistedServiceServiceBinds customer with provided id to cart if it's anonymous cart.- Specified by:
bindCustomerToCartin interfaceAssistedServiceService- Parameters:
customerId- This is id of the customer to whom we want to bind a cartcartId- the id of the customer cart to pick up- Throws:
AssistedServiceException- in case cart with given cartId is not anonymous
-
getAsmSession
public AssistedServiceSession getAsmSession()
Description copied from interface:AssistedServiceServiceReturns ASM session object with all information about current asm session.- Specified by:
getAsmSessionin interfaceAssistedServiceService- Returns:
- asm session object
-
restoreCartToUser
public void restoreCartToUser(CartModel cart, UserModel user)
Description copied from interface:AssistedServiceServiceRestore cart to provided user- Specified by:
restoreCartToUserin interfaceAssistedServiceService- Parameters:
cart- cart model to be restoreduser- user model which cart to be restored
-
createNewCustomer
public CustomerModel createNewCustomer(java.lang.String customerId, java.lang.String customerName) throws DuplicateUidException
Description copied from interface:AssistedServiceServiceCreates a new customer by it email and name.- Specified by:
createNewCustomerin interfaceAssistedServiceService- Parameters:
customerId- email of to be newly created customer that is used as uidcustomerName- name of to be newly created customer (firstname and surname separated by space symbol)- Returns:
- newly created
CustomerModel - Throws:
DuplicateUidException- in case customer with given customerId already exists
-
getCartsForCustomer
public java.util.Collection<CartModel> getCartsForCustomer(CustomerModel customer)
Description copied from interface:AssistedServiceServiceReturns collection of a customer's carts- Specified by:
getCartsForCustomerin interfaceAssistedServiceService- Parameters:
customer- customer model whose carts to be returned- Returns:
- collection of the customer's cart models
-
getCustomer
public UserModel getCustomer(java.lang.String customerId)
Description copied from interface:AssistedServiceServicereturns customer- Specified by:
getCustomerin interfaceAssistedServiceService- Parameters:
customerId- email of to be newly created customer that is used as uid- Returns:
- a UserModel for given customerId
-
getLatestModifiedCart
public CartModel getLatestModifiedCart(UserModel customer)
Description copied from interface:AssistedServiceServicesearch for a cart with most resent CartModel::getModifiedtime- Specified by:
getLatestModifiedCartin interfaceAssistedServiceService- Parameters:
customer- customer model whose latest modified cart to be returned- Returns:
- a latest modified cart by given customer
-
gerOrderByCode
@Deprecated(since="6.6", forRemoval=true) public OrderModel gerOrderByCode(java.lang.String orderCode, UserModel customer)Deprecated, for removal: This API element is subject to removal in a future version.since 6.6, useAssistedServiceService.getOrderByCode(String, UserModel)insteadDescription copied from interface:AssistedServiceServicesearch for order- Specified by:
gerOrderByCodein interfaceAssistedServiceService- Parameters:
orderCode- the order's codecustomer- customer model whose order to be returned- Returns:
- an OrderModel with given code and given customer
-
getOrderByCode
public OrderModel getOrderByCode(java.lang.String orderCode, UserModel customer)
Description copied from interface:AssistedServiceServicesearch for order- Specified by:
getOrderByCodein interfaceAssistedServiceService- Parameters:
orderCode- the order's codecustomer- customer model whose order to be returned- Returns:
- an OrderModel with given code and given customer
-
getCartByCode
public CartModel getCartByCode(java.lang.String cartCode, UserModel customer)
Description copied from interface:AssistedServiceServicesearch cart by code and customer- Specified by:
getCartByCodein interfaceAssistedServiceService- Parameters:
cartCode- the cart's codecustomer- customer model whose cart to be returned- Returns:
- a CartModel of cart with given cartCode and customer
-
getAssistedServiceAgentStore
public PointOfServiceModel getAssistedServiceAgentStore()
Description copied from interface:AssistedServiceServiceReturns the PointOfServiceModel for the logged in as agent.- Specified by:
getAssistedServiceAgentStorein interfaceAssistedServiceService- Returns:
- PointOfServiceModel
-
getAssistedServiceAgentStore
public PointOfServiceModel getAssistedServiceAgentStore(UserModel agent)
Description copied from interface:AssistedServiceServiceReturns the PointOfServiceModel for the given as agent.- Specified by:
getAssistedServiceAgentStorein interfaceAssistedServiceService- Parameters:
agent- AS agent- Returns:
- PointOfServiceModel a PointOfServiceModel for the given as agent.
-
isAbstractOrderMatchBaseSite
public boolean isAbstractOrderMatchBaseSite(AbstractOrderModel abstractOrderModel)
Description copied from interface:AssistedServiceServiceReturns true when provided abstractOrderModel relates to current base site- Specified by:
isAbstractOrderMatchBaseSitein interfaceAssistedServiceService- Parameters:
abstractOrderModel- order model- Returns:
- true in case order is made against current
BaseSite
-
getFlexibleSearchService
protected FlexibleSearchService getFlexibleSearchService()
-
setFlexibleSearchService
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
-
getCommerceCartService
protected CommerceCartService getCommerceCartService()
-
setCommerceCartService
public void setCommerceCartService(CommerceCartService commerceCartService)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getCartService
protected CartService getCartService()
-
setCartService
public void setCartService(CartService cartService)
-
getCustomerAccountService
protected CustomerAccountService getCustomerAccountService()
-
setCustomerAccountService
public void setCustomerAccountService(CustomerAccountService customerAccountService)
-
getSessionService
protected SessionService getSessionService()
-
setSessionService
public void setSessionService(SessionService sessionService)
-
getCommonI18NService
protected CommonI18NService getCommonI18NService()
-
setCommonI18NService
public void setCommonI18NService(CommonI18NService commonI18NService)
-
getUserService
protected UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
getBaseSiteService
protected BaseSiteService getBaseSiteService()
-
setBaseSiteService
public void setBaseSiteService(BaseSiteService baseSiteService)
-
getPagedFlexibleSearchService
protected PagedFlexibleSearchService getPagedFlexibleSearchService()
-
setPagedFlexibleSearchService
public void setPagedFlexibleSearchService(PagedFlexibleSearchService pagedFlexibleSearchService)
-
getTimeService
protected TimeService getTimeService()
-
setTimeService
public void setTimeService(TimeService timeService)
-
-