public class DefaultBolCartFacade extends java.lang.Object implements BolCartFacade
| Constructor and Description |
|---|
DefaultBolCartFacade() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<Item> |
addEntriesToCart(java.util.List<Item> items)
Adds a list of items to the cart, keeping their handles
|
void |
addItemsToCart(java.util.List<Item> items)
Adds a list of items to the cart, keeping their handles
|
Item |
addToCart(java.lang.String code,
long quantity)
Adds a product to the cart
|
Address |
createAddress()
Creates a new address instance.
|
Basket |
createCart()
Creates a new session cart.
|
protected Item |
createNewItem(java.lang.String code,
long quantity,
java.lang.String handle)
Creates a new BOL cart item from the attributes provided.
|
protected Item |
createNewItem(java.lang.String code,
long quantity,
java.lang.String handle,
Basket currentCart)
Creates a new BOL cart item from the attributes provided.
|
protected java.lang.String |
formatProductIdForBOL(java.lang.String input)
Formats product ID taken from hybris catalog and prepares it for sending to LO-API.
|
java.util.Map<java.lang.String,java.lang.String> |
getAllowedDeliveryTypes()
Fetches available delivery types from the cache.
|
Basket |
getCart()
Return current cart from BOL.
|
BasketBackend |
getCartBE() |
protected MessageList |
getCartErrors()
Filters the list of messages attached to the cart and just returns the error ones.
|
Item |
getCartItem(int itemNumber)
Fetches cart item per item number
|
protected Item |
getCartItem(java.lang.String code)
Fetches cart item per product id
|
GenericFactory |
getGenericFactory() |
Order |
getOrder() |
java.lang.Boolean |
hasCart()
Does a session cart exist? This cart is connected to a (non-persisted) order in the SAP back end.
|
boolean |
isBackendDown() |
Order |
placeOrderFromCart(Basket cart)
Places an order based on a cart, and returns this order.
|
void |
releaseCart()
Releases the current session cart.
|
void |
setGenericFactory(GenericFactory genericFactory) |
void |
setSapPartnerService(SapPartnerService sapPartnerService) |
void |
updateCart()
Updates the session cart and re-reads it from the SAP back end.
|
MessageList |
validateCart()
Validates the cart and compiles the list of cart error messages.
|
public GenericFactory getGenericFactory()
public void setGenericFactory(GenericFactory genericFactory)
genericFactory - the genericFactory to setpublic Basket getCart()
BolCartFacadegetCart in interface BolCartFacadepublic java.lang.Boolean hasCart()
BolCartFacadehasCart in interface BolCartFacadepublic java.util.Map<java.lang.String,java.lang.String> getAllowedDeliveryTypes()
BolCartFacadegetAllowedDeliveryTypes in interface BolCartFacadepublic Address createAddress()
BolCartFacadecreateAddress in interface BolCartFacadepublic Basket createCart()
BolCartFacadecreateCart in interface BolCartFacadepublic Order placeOrderFromCart(Basket cart)
BolCartFacadeplaceOrderFromCart in interface BolCartFacadecart - SAP representation of a cartpublic Item getCartItem(int itemNumber)
BolCartFacadegetCartItem in interface BolCartFacadeitemNumber - Internal item numberprotected Item getCartItem(java.lang.String code)
code - Product IDpublic Order getOrder()
public BasketBackend getCartBE()
protected MessageList getCartErrors()
public void updateCart()
BolCartFacadeupdateCart in interface BolCartFacadepublic Item addToCart(java.lang.String code, long quantity)
BolCartFacadeaddToCart in interface BolCartFacadecode - Product ID to be added to the cartquantity - Quantity to be added to the cartprotected Item createNewItem(java.lang.String code, long quantity, java.lang.String handle)
code - Product code (SAP material number)quantity - Quantityhandle - Handle to be set into new item. Can be provided as null, in this case a new handle will be createdprotected Item createNewItem(java.lang.String code, long quantity, java.lang.String handle, Basket currentCart)
code - Product code (SAP material number)quantity - Quantityhandle - Handle to be set into new item. Can be provided as null, in this case a new handle will be createdcurrentCart - The BOL cart object the items will be attached topublic void releaseCart()
BolCartFacadereleaseCart in interface BolCartFacadepublic void setSapPartnerService(SapPartnerService sapPartnerService)
sapPartnerService - the sapPartnerService to setpublic MessageList validateCart()
BolCartFacadeSalesDocumentvalidateCart in interface BolCartFacadeprotected java.lang.String formatProductIdForBOL(java.lang.String input)
input - public void addItemsToCart(java.util.List<Item> items)
BolCartFacadeaddItemsToCart in interface BolCartFacadeitems - BOL itemspublic java.util.List<Item> addEntriesToCart(java.util.List<Item> items)
BolCartFacadeaddEntriesToCart in interface BolCartFacadeitems - BOL items item listpublic boolean isBackendDown()
isBackendDown in interface BolCartFacadeCopyright © 2018 SAP SE. All Rights Reserved.