Class DefaultCartRestorationService
java.lang.Object
de.hybris.platform.sap.sapordermgmtservices.cart.impl.DefaultCartRestorationService
- All Implemented Interfaces:
CartRestorationService
Default implementation of the restoration service. Task of this class is to create a BOL representation of the cart
(which has a counterpart in the SAP back end) from a persisted hybris cart.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static StringHybris session cart is stored in hybris session using this key -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateItemsFromCart(CartModel fromCart) Creates a list of BOL items from a hybris cart model.Returns the standard session cart, basing on the hybris persistenceprotected de.hybris.platform.servicelayer.model.ModelServicede.hybris.platform.servicelayer.session.SessionServicebooleanDoes a standard session cart exist?voidRemoves the internal session cart, basing on the hybris persistencerestoreCart(CartModel fromCart) Restores a BOL cart from the persisted standard session cartvoidsetCartFactory(de.hybris.platform.order.CartFactory cartFactory) Sets standard cart factory via spring injectionvoidsetCartRestorationServiceHooks(List<CartRestorationServiceHook> defaultCartRestorationServiceHook) voidsetCartService(CartService cartService) voidSets session cart (stores it into the session)voidsetItemFactory(ItemFactory itemFactory) voidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService) Sets standard model service via spring injectionvoidsetSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService) Sets standard session service via spring injection
-
Field Details
-
SESSION_CART_PARAMETER_NAME
Hybris session cart is stored in hybris session using this key
-
-
Constructor Details
-
DefaultCartRestorationService
public DefaultCartRestorationService()
-
-
Method Details
-
restoreCart
Description copied from interface:CartRestorationServiceRestores a BOL cart from the persisted standard session cart- Specified by:
restoreCartin interfaceCartRestorationService- Parameters:
fromCart- Session cart in hybris persistence- Returns:
- Restorated cart, basing on the BOL cart
-
createItemsFromCart
Creates a list of BOL items from a hybris cart model. Those cart items carry following attributes copied from the entities of typeAbstractOrderEntryModel:- ProductId
- Quantity
- Parameters:
fromCart- Cart model- Returns:
- List of BOL items
-
setInternalSessionCart
Description copied from interface:CartRestorationServiceSets session cart (stores it into the session)- Specified by:
setInternalSessionCartin interfaceCartRestorationService
-
getInternalSessionCart
Description copied from interface:CartRestorationServiceReturns the standard session cart, basing on the hybris persistence- Specified by:
getInternalSessionCartin interfaceCartRestorationService- Returns:
- hybris cart model
-
hasInternalSessionCart
public boolean hasInternalSessionCart()Description copied from interface:CartRestorationServiceDoes a standard session cart exist?- Specified by:
hasInternalSessionCartin interfaceCartRestorationService- Returns:
- true if a hybris session cart exists
-
removeInternalSessionCart
public void removeInternalSessionCart()Description copied from interface:CartRestorationServiceRemoves the internal session cart, basing on the hybris persistence- Specified by:
removeInternalSessionCartin interfaceCartRestorationService
-
getSessionService
public de.hybris.platform.servicelayer.session.SessionService getSessionService()- Returns:
- Standard session service (needed to access session cart and references to product configuration runtime objects attached to cart entries)
-
setSessionService
public void setSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService) Sets standard session service via spring injection- Parameters:
sessionService-
-
getModelService
protected de.hybris.platform.servicelayer.model.ModelService getModelService()- Returns:
- Model service
-
setModelService
public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService) Sets standard model service via spring injection- Parameters:
modelService-
-
setCartFactory
public void setCartFactory(de.hybris.platform.order.CartFactory cartFactory) Sets standard cart factory via spring injection- Parameters:
cartFactory-
-
getCartService
- Returns:
- the cartService
-
setCartService
- Parameters:
cartService- the cartService to set
-
getCartRestorationServiceHooks
- Returns:
- the defaultCartRestorationServiceHook
-
setCartRestorationServiceHooks
public void setCartRestorationServiceHooks(List<CartRestorationServiceHook> defaultCartRestorationServiceHook) - Parameters:
defaultCartRestorationServiceHook- the defaultCartRestorationServiceHook to set
-
getItemFactory
- Returns:
- the itemFactory
-
setItemFactory
- Parameters:
itemFactory- the itemFactory to set
-