Class DefaultBolCartFacade
java.lang.Object
de.hybris.platform.sap.sapordermgmtservices.bolfacade.impl.DefaultBolCartFacade
- All Implemented Interfaces:
BolCartFacade
- Direct Known Subclasses:
CPQDefaultBolCartFacade
Facade for accessing the cart entity via the BOL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddEntriesToCart(List<Item> items) Adds a list of items to the cart, keeping their handlesvoidaddItemsToCart(List<Item> items) Adds a list of items to the cart, keeping their handlesAdds a product to the cartCreates a new address instance.Creates a new session cart.protected ItemcreateNewItem(String code, long quantity, String handle) Creates a new BOL cart item from the attributes provided.protected ItemcreateNewItem(String code, long quantity, String handle, Basket currentCart) Creates a new BOL cart item from the attributes provided.protected StringformatProductIdForBOL(String input) Formats product ID taken from hybris catalog and prepares it for sending to LO-API.Fetches available delivery types from the cache.getCart()Return current cart from BOL.protected MessageListFilters the list of messages attached to the cart and just returns the error ones.getCartItem(int itemNumber) Fetches cart item per item numberprotected ItemgetCartItem(String code) Fetches cart item per product idgetOrder()hasCart()Does a session cart exist? This cart is connected to a (non-persisted) order in the SAP back end.booleanplaceOrderFromCart(Basket cart) Places an order based on a cart, and returns this order.voidReleases the current session cart.voidsetGenericFactory(GenericFactory genericFactory) voidsetSapPartnerService(SapPartnerService sapPartnerService) voidUpdates the session cart and re-reads it from the SAP back end.Validates the cart and compiles the list of cart error messages.
-
Constructor Details
-
DefaultBolCartFacade
public DefaultBolCartFacade()
-
-
Method Details
-
getGenericFactory
- Returns:
- the genericFactory
-
setGenericFactory
- Parameters:
genericFactory- the genericFactory to set
-
getCart
Description copied from interface:BolCartFacadeReturn current cart from BOL.- Specified by:
getCartin interfaceBolCartFacade- Returns:
- Current cart, might be null if not created yet.
-
hasCart
Description copied from interface:BolCartFacadeDoes a session cart exist? This cart is connected to a (non-persisted) order in the SAP back end.- Specified by:
hasCartin interfaceBolCartFacade- Returns:
- Does a session cart exist?
-
getAllowedDeliveryTypes
Description copied from interface:BolCartFacadeFetches available delivery types from the cache. Cache is filled from the SAP back end customizing (ERP customizing table TVSB)- Specified by:
getAllowedDeliveryTypesin interfaceBolCartFacade- Returns:
- Map of delivery types. Key is the shipping condition code, value the language dependent description
-
createAddress
Description copied from interface:BolCartFacadeCreates a new address instance.- Specified by:
createAddressin interfaceBolCartFacade- Returns:
- BOL Address representation
-
createCart
Description copied from interface:BolCartFacadeCreates a new session cart. This call creates a (non-persisted) order in the SAP back end. At this point in time, the sold-to party needs to be known.- Specified by:
createCartin interfaceBolCartFacade- Returns:
- Newly created cart BO instance
-
placeOrderFromCart
Description copied from interface:BolCartFacadePlaces an order based on a cart, and returns this order. At this point in time, the order is persisted in the SAP back end.- Specified by:
placeOrderFromCartin interfaceBolCartFacade- Parameters:
cart- SAP representation of a cart- Returns:
- SAP representation of an order which has been submitted
-
getCartItem
Description copied from interface:BolCartFacadeFetches cart item per item number- Specified by:
getCartItemin interfaceBolCartFacade- Parameters:
itemNumber- Internal item number- Returns:
- BOL representation of cart item
-
getCartItem
Fetches cart item per product id- Parameters:
code- Product ID- Returns:
- BOL representation of cart item
-
getOrder
- Returns:
- The BOL representation of the order
-
getCartBE
- Returns:
- The cart backend object which establishes the connection to the ERP system
-
getCartErrors
Filters the list of messages attached to the cart and just returns the error ones.- Returns:
- Error messages related to the cart
-
updateCart
public void updateCart()Description copied from interface:BolCartFacadeUpdates the session cart and re-reads it from the SAP back end.- Specified by:
updateCartin interfaceBolCartFacade
-
addToCart
Description copied from interface:BolCartFacadeAdds a product to the cart- Specified by:
addToCartin interfaceBolCartFacade- Parameters:
code- Product ID to be added to the cartquantity- Quantity to be added to the cart- Returns:
- BOL representation of new item
-
createNewItem
Creates a new BOL cart item from the attributes provided. Creates the cart if this has not happened yet.- Parameters:
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 created- Returns:
- handle of newly created item
-
createNewItem
Creates a new BOL cart item from the attributes provided.- Parameters:
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 to- Returns:
- handle of newly created item
-
releaseCart
public void releaseCart()Description copied from interface:BolCartFacadeReleases the current session cart. A new, initial session cart will be created. An existing session in the SAP back end is released as well, therefore reservations are gone.- Specified by:
releaseCartin interfaceBolCartFacade
-
setSapPartnerService
- Parameters:
sapPartnerService- the sapPartnerService to set
-
validateCart
Description copied from interface:BolCartFacadeValidates the cart and compiles the list of cart error messages. Performs a back end call and touches all items to be sure all error situations are handled. Depending on the customizing in the back end, this can be avoided by either redefining this method or the corresponding one inSalesDocument- Specified by:
validateCartin interfaceBolCartFacade- Returns:
- List of cart error messages arising from validation.
-
formatProductIdForBOL
Formats product ID taken from hybris catalog and prepares it for sending to LO-API. Adds leading zeros.- Parameters:
input-- Returns:
- Formatted product ID
-
addItemsToCart
Description copied from interface:BolCartFacadeAdds a list of items to the cart, keeping their handles- Specified by:
addItemsToCartin interfaceBolCartFacade- Parameters:
items- BOL items
-
addEntriesToCart
Description copied from interface:BolCartFacadeAdds a list of items to the cart, keeping their handles- Specified by:
addEntriesToCartin interfaceBolCartFacade- Parameters:
items- BOL items item list- Returns:
- list of items
-
isBackendDown
public boolean isBackendDown()- Specified by:
isBackendDownin interfaceBolCartFacade- Returns:
- Is back end not available for a planned downtime?
-