com.konakart.al
Class BasketMgr

java.lang.Object
  extended by com.konakart.al.BaseMgr
      extended by com.konakart.al.BasketMgr

public class BasketMgr
extends BaseMgr

Contains methods to add and remove products from the shopping basket.


Field Summary
 
Fields inherited from class com.konakart.al.BaseMgr
eng, kkAppEng, log
 
Constructor Summary
protected BasketMgr(com.konakart.appif.KKEngIf eng, KKAppEng kkAppEng)
          Constructor
 
Method Summary
 void addToBasket(com.konakart.appif.BasketIf item, boolean refresh)
          Saves a new Basket object in the database for the current customer.
 void addToBasketWithOptions(com.konakart.appif.BasketIf item, com.konakart.appif.AddToBasketOptionsIf options, boolean refresh)
          Saves a new Basket object in the database for the current customer.
 void emptyBasket()
          All items in the basket are removed from the database and the array of basket items for the current customer, are deleted.
 void getBasketItemsPerCustomer()
          Get the basket items for a customer and language and set them on the customer customer object of the customerMgr.
 java.lang.String getBasketTotal()
          Returns the total price of the basket as a formatted string so that it may be used directly in the UI.
 void removeFromBasket(com.konakart.appif.BasketIf item, boolean refresh)
          The Basket object is removed from the database and so no longer appears in the customer's basket.
 void updateBasket(com.konakart.appif.BasketIf item, boolean refresh)
          Updates the Basket object in the database.
 
Methods inherited from class com.konakart.al.BaseMgr
getEng, getKkAppEng, setEng, setKkAppEng
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasketMgr

protected BasketMgr(com.konakart.appif.KKEngIf eng,
                    KKAppEng kkAppEng)
             throws com.konakart.app.KKException
Constructor

Parameters:
eng -
kkAppEng -
Throws:
com.konakart.app.KKException
Method Detail

getBasketItemsPerCustomer

public void getBasketItemsPerCustomer()
                               throws com.konakart.app.KKException
Get the basket items for a customer and language and set them on the customer customer object of the customerMgr. Each item has a fully populated product object.

Throws:
com.konakart.app.KKException

emptyBasket

public void emptyBasket()
                 throws com.konakart.app.KKException
All items in the basket are removed from the database and the array of basket items for the current customer, are deleted.

Throws:
com.konakart.app.KKException

removeFromBasket

public void removeFromBasket(com.konakart.appif.BasketIf item,
                             boolean refresh)
                      throws com.konakart.app.KKException
The Basket object is removed from the database and so no longer appears in the customer's basket. We read a new list from the database and refresh the current customer's basket if refresh is set to true.

Parameters:
item - The basket object to be removed
refresh - If set to true, the current customer's basket is refreshed
Throws:
com.konakart.app.KKException

addToBasket

public void addToBasket(com.konakart.appif.BasketIf item,
                        boolean refresh)
                 throws com.konakart.app.KKException
Saves a new Basket object in the database for the current customer. We read a new list from the database and refresh the current customer's basket if refresh is set to true.

Parameters:
item - The basket object to be added
refresh - If set to true, the current customer's basket is refreshed
Throws:
com.konakart.app.KKException

addToBasketWithOptions

public void addToBasketWithOptions(com.konakart.appif.BasketIf item,
                                   com.konakart.appif.AddToBasketOptionsIf options,
                                   boolean refresh)
                            throws com.konakart.app.KKException
Saves a new Basket object in the database for the current customer. We read a new list from the database and refresh the current customer's basket if refresh is set to true. It receives an options object as input in order to configure certain aspects of the method.

Parameters:
item - The basket object to be added
options - An object containing options for the method. It may be set to null.
refresh - If set to true, the current customer's basket is refreshed
Throws:
com.konakart.app.KKException

updateBasket

public void updateBasket(com.konakart.appif.BasketIf item,
                         boolean refresh)
                  throws com.konakart.app.KKException
Updates the Basket object in the database. The only attribute that may be changed is quantity. We read a new list from the database and refresh the current customer's basket if refresh is set to true.

Parameters:
item - The basket object to be updated
refresh - If set to true, the current customer's basket is refreshed
Throws:
com.konakart.app.KKException

getBasketTotal

public java.lang.String getBasketTotal()
                                throws com.konakart.app.KKException,
                                       KKAppException
Returns the total price of the basket as a formatted string so that it may be used directly in the UI.

Returns:
Total value of basket already formatted
Throws:
com.konakart.app.KKException
KKAppException


Copyright © 2006 DS Data Systems UK Ltd.