|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.konakart.bl.BaseMgr
com.konakart.bl.OrderMgr
public class OrderMgr
Manages all business logic relevant to the management of orders within the system
| Field Summary | |
|---|---|
static int |
CANCELLED_STATUS
CANCELLED_STATUS Order Status. |
static int |
DELIVERED_STATUS
DELIVERED Order Status. |
protected static org.apache.commons.logging.Log |
log
the log |
static int |
ORD_PROD_CUSTOMER_INFORMED_OF_DELIVERY_DATE
Product wasn't in stock and but customer has been informed of the delivery date when order was created. |
static int |
ORD_PROD_IN_STOCK
Product in stock when order was created. |
static int |
ORD_PROD_OUT_OF_STOCK_AVAILABLE_DATE_KNOWN
Product out of stock but with known availability date when order was created. |
static int |
ORD_PROD_OUT_OF_STOCK_AVAILABLE_DATE_UNKNOWN
Product out of stock and availability date unknown when order was created. |
static int |
ORD_PROD_PARTIALLY_OUT_OF_STOCK_AVAILABLE_DATE_KNOWN
Product not in stock with the required quantity but with known availability date when order was created. |
static int |
ORD_PROD_PARTIALLY_OUT_OF_STOCK_AVAILABLE_DATE_UNKNOWN
Product not in stock with the required quantity and availability date unknown when order was created. |
static int |
PARTIALLY_DELIVERED_STATUS
PARTIALLY_DELIVERED_STATUS Order Status. |
static int |
PAYMENT_DECLINED_STATUS
PAYMENT_DECLINED Order Status. |
static int |
PAYMENT_RECEIVED_STATUS
PAYMENT_RECEIVED Order Status. |
static int |
PENDING_STATUS
PENDING Order Status. |
static int |
PROCESSING_STATUS
PROCESSING Order Status. |
protected static int |
secretKeyLength
Mutex for the Manager |
static int |
WAITING_PAYMENT_STATUS
WAITING_PAYMENT Order Status. |
| Fields inherited from class com.konakart.bl.BaseMgr |
|---|
templateBaseDir |
| Constructor Summary | |
|---|---|
OrderMgr(KKEngIf eng)
Constructor |
|
| Method Summary | |
|---|---|
protected void |
addTaxRateObjects(Order order,
int taxClassId,
java.util.HashMap<java.lang.Integer,TaxRate> taxRateMap)
We get the tax rate objects for the order and taxClassId and add them to the hash map. |
Order |
changeDeliveryAddress(java.lang.String sessionId,
OrderIf order,
AddressIf deliveryAddress)
The current delivery address is substituted with the new one. |
void |
changeOrderStatus(int orderId,
int status,
boolean customerNotified,
java.lang.String comments)
The state of the current order id changed and an orders_status_history record is added to the order to keep track of the change. |
void |
changeOrderStatus(java.lang.String sessionId,
int orderId,
int status,
boolean customerNotified,
java.lang.String comments)
The state of the current order id changed and an orders_status_history record is added to the order to keep track of the change. |
protected AddToBasketOptionsIf |
createAddToBasketOptions(CreateOrderOptionsIf options)
Creates an AddToBasketOptions object from an CreateOrderOptions |
Order |
createAndSaveOrder(java.lang.String emailAddr,
java.lang.String password,
CustomerRegistrationIf custReg,
BasketIf[] basketItemArray,
java.lang.String shippingModule,
java.lang.String paymentModule,
int languageId)
|
protected FetchProductOptionsIf |
createFetchProductOptions(CreateOrderOptionsIf options)
Creates a FetchProductOptions object from an CreateOrderOptions |
Order |
createOrder(java.lang.String sessionId,
BasketIf[] basketItemArray,
int languageId)
An order object is returned with all addresses populated with the default address of the customer referenced by the session Id. |
Order |
createOrderWithOptions(java.lang.String sessionId,
BasketIf[] basketItemArray,
CreateOrderOptionsIf options,
int languageId)
An order object is returned with all addresses populated with the default address of the customer referenced by the session Id. |
void |
deleteOrderIdForSecretKey(java.lang.String secretKey)
The order id stored in the database and indexed by the secretKey, is deleted |
protected boolean |
doesOrderStatusExist(int status)
Determines whether an order_status record exists for the status id parameter |
protected void |
formatOrderAddresses(Order order)
It gets the address templates for all three addresses and sets the formatted addresses |
OrderStatus[] |
getAllOrderStatuses(int languageId)
Returns an array of Order Status objects for a given language |
protected int |
getCount(KKCriteria c)
This method is mainly used for paging. |
IpnHistory[] |
getIpnHistory(int orderId)
Retrieve an array of IpnHistory objects for an order |
IpnHistory[] |
getIpnHistory(java.lang.String sessionId,
int orderId)
Retrieve an array of IpnHistory objects for an order. |
protected java.lang.String |
getModuleCodeFromQuote(ShippingQuoteIf sq)
Return a shipping module code from the Shipping Quote. |
Order |
getOrder(java.lang.String sessionId,
int orderId,
int languageId)
Retrieve an order for the customer referenced by the sessionId. |
protected void |
getOrderCountryAndZone(Order order)
Instantiate the Country and Zone objects for the order |
protected void |
getOrderDetails(Order order,
int languageId)
Calls methods to get all of the details of the order |
Order |
getOrderForOrderId(int orderId,
int languageId)
Retrieve an order for an orderId. |
int |
getOrderIdFromSecretKey(java.lang.String secretKey)
The order id stored in the database and indexed by the secretKey, is returned |
protected OrderIntegrationMgrInterface |
getOrderIntegrationMgr()
Used to get an instance of the OrderIntegrationMgr |
protected void |
getOrderProducts(Order order)
Get the OrderProduct and the Options of each OrderProduct for this order. |
Orders |
getOrdersPerCustomer(DataDescriptorIf dataDesc,
java.lang.String sessionId,
int languageId)
Retrieve a number of orders for the customer referenced by the sessionId. |
int |
getOrderStatus(java.lang.String sessionId,
int orderId)
Get the order status for an order. |
protected java.lang.String |
getOrderStatusText(int statusId,
int languageId)
It returns the text of the order status based on the status id and the language |
protected void |
getOrderTotals(Order order)
Populates the Order object with an array of OrderTotal objects sorted by the sortOrder attribute |
protected ReorderMgrInterface |
getReorderMgr()
Used to get an instance of the ReorderMgr |
java.lang.String |
getSecretKeyForOrderId(int orderId)
Every time we send a notification to a payment gateway, we get a new secret key for the order, which is sent back to us in the reply. |
java.lang.String |
getStatusText(int statusId,
int languageId)
Returns the text of a status from the orders_status table |
protected void |
getStatusTrail(Order order,
int languageId)
Populates the Order object with an array of OrderStatusHistory objects |
protected java.math.BigDecimal |
getTaxRate(Order order,
int taxClassId)
We get the tax rate for the order and taxClassId |
TaxRate[] |
getTaxRateObjectsPerOrder(Order order)
Returns a list of TaxRate objects used by this order. |
protected void |
manageDataDescriptor(DataDescriptorIf dataDesc,
org.apache.torque.util.Criteria c)
Provides common code to deal with the management of the DataDescriptor. |
int |
saveIpnHistory(java.lang.String sessionId,
IpnHistoryIf ipnHistory)
The IpnHistory object is saved in the database. |
int |
saveOrder(java.lang.String sessionId,
OrderIf order,
int languageId)
A new order is created in the DB. |
Orders |
searchForOrdersPerCustomer(java.lang.String sessionId,
DataDescriptorIf dataDesc,
OrderSearchIf orderSearch,
int languageId)
Return orders matching the search criteria. |
void |
setCreditCardDetailsOnOrder(java.lang.String sessionId,
int orderId,
CreditCardIf card)
The credit card details in the CreditCard object passed in as a parameter, are saved in the database for an existing order. |
protected void |
setCriteriaWithStandardAttributes(KKCriteria c,
int languageId)
Set the criteria object with all of the attributes for an order |
void |
setRewardPointReservationId(int customerId,
int orderId,
int reservationId)
Verifies that the order belongs to the customer identified by the customerId
parameter and then updates the reservation id. |
void |
setRewardPointReservationId(java.lang.String sessionId,
int orderId,
int reservationId)
Verifies that the order belongs to the customer identified by the sessionId
parameter and then updates the reservation id. |
void |
updateInventory(java.lang.String sessionId,
int orderId)
If the STOCK_LIMITED configuration variable is set to true, we subtract the products in stock by the product orders. |
void |
updateInventoryWithOptions(java.lang.String sessionId,
int orderId,
CreateOrderOptionsIf options)
If the STOCK_LIMITED configuration variable is set to true, we subtract the products in stock by the product orders. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ORD_PROD_IN_STOCK
public static final int ORD_PROD_OUT_OF_STOCK_AVAILABLE_DATE_KNOWN
public static final int ORD_PROD_OUT_OF_STOCK_AVAILABLE_DATE_UNKNOWN
public static final int ORD_PROD_PARTIALLY_OUT_OF_STOCK_AVAILABLE_DATE_KNOWN
public static final int ORD_PROD_PARTIALLY_OUT_OF_STOCK_AVAILABLE_DATE_UNKNOWN
public static final int ORD_PROD_CUSTOMER_INFORMED_OF_DELIVERY_DATE
protected static org.apache.commons.logging.Log log
protected static final int secretKeyLength
public static final int PENDING_STATUS
public static final int PROCESSING_STATUS
public static final int DELIVERED_STATUS
public static final int WAITING_PAYMENT_STATUS
public static final int PAYMENT_RECEIVED_STATUS
public static final int PAYMENT_DECLINED_STATUS
public static final int PARTIALLY_DELIVERED_STATUS
public static final int CANCELLED_STATUS
| Constructor Detail |
|---|
public OrderMgr(KKEngIf eng)
throws java.lang.Exception
eng -
java.lang.Exception| Method Detail |
|---|
public int saveOrder(java.lang.String sessionId,
OrderIf order,
int languageId)
throws java.lang.Exception
saveOrder in interface OrderMgrIfsessionId - order - languageId -
java.lang.Exceptionprotected java.lang.String getModuleCodeFromQuote(ShippingQuoteIf sq)
The code and moduleCode on the ShippingQuote should be identical if there aren't multiple quotes for the shipping module but in the case of the more complex shipping modules such as UPS, UPSINT, FEDEX etc... multiple quotes are possible and in these circumstances the code has "_n" (where 'n' is an integer) append to the code to make it unique for showing on the UI for selection by the user.
The reason the ModuleCode is checked here for null and empty string is that it is possible that an older shipping module isn't populating the new moduleCode attribute - in these cases we revert to the old behaviour of just using the code attribute.
sq -
protected OrderIntegrationMgrInterface getOrderIntegrationMgr()
throws org.apache.torque.TorqueException,
KKException,
com.workingdogs.village.DataSetException,
java.lang.Exception
java.lang.Exception
com.workingdogs.village.DataSetException
KKException
org.apache.torque.TorqueExceptionprotected ReorderMgrInterface getReorderMgr()
public Order createOrder(java.lang.String sessionId,
BasketIf[] basketItemArray,
int languageId)
throws java.lang.Exception
createOrder in interface OrderMgrIfsessionId - basketItemArray - languageId -
java.lang.Exception
public Order createOrderWithOptions(java.lang.String sessionId,
BasketIf[] basketItemArray,
CreateOrderOptionsIf options,
int languageId)
throws java.lang.Exception
createOrderWithOptions in interface OrderMgrIfsessionId - basketItemArray - options - languageId -
java.lang.Exception
public Order changeDeliveryAddress(java.lang.String sessionId,
OrderIf order,
AddressIf deliveryAddress)
throws java.lang.Exception
changeDeliveryAddress in interface OrderMgrIfsessionId - order - deliveryAddress -
java.lang.Exception
public TaxRate[] getTaxRateObjectsPerOrder(Order order)
throws java.lang.Exception
getTaxRateObjectsPerOrder in interface OrderMgrIforder -
java.lang.Exception
protected java.lang.String getOrderStatusText(int statusId,
int languageId)
throws com.workingdogs.village.DataSetException,
org.apache.torque.TorqueException,
KKException
statusId - languageId -
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKException
protected java.math.BigDecimal getTaxRate(Order order,
int taxClassId)
throws java.lang.Exception
order - taxClassId -
java.lang.Exception
protected void addTaxRateObjects(Order order,
int taxClassId,
java.util.HashMap<java.lang.Integer,TaxRate> taxRateMap)
throws java.lang.Exception
order - taxClassId - taxRateMap -
java.lang.Exception
protected void formatOrderAddresses(Order order)
throws java.lang.Exception
order -
java.lang.Exception
public Orders getOrdersPerCustomer(DataDescriptorIf dataDesc,
java.lang.String sessionId,
int languageId)
throws java.lang.Exception
getOrdersPerCustomer in interface OrderMgrIfdataDesc - sessionId - languageId -
java.lang.Exception
public Orders searchForOrdersPerCustomer(java.lang.String sessionId,
DataDescriptorIf dataDesc,
OrderSearchIf orderSearch,
int languageId)
throws java.lang.Exception
searchForOrdersPerCustomer in interface OrderMgrIfsessionId - dataDesc - orderSearch - languageId -
java.lang.Exception
public Order getOrder(java.lang.String sessionId,
int orderId,
int languageId)
throws java.lang.Exception
getOrder in interface OrderMgrIfsessionId - orderId - languageId -
java.lang.Exception
public Order getOrderForOrderId(int orderId,
int languageId)
throws java.lang.Exception
getOrderForOrderId in interface OrderMgrIforderId - languageId -
java.lang.Exception
protected void getOrderProducts(Order order)
throws java.lang.Exception
order -
java.lang.Exception
protected void getOrderDetails(Order order,
int languageId)
throws java.lang.Exception
order - languageId -
java.lang.Exception
protected void getOrderTotals(Order order)
throws org.apache.torque.TorqueException,
com.workingdogs.village.DataSetException
order -
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
protected void getStatusTrail(Order order,
int languageId)
throws org.apache.torque.TorqueException,
com.workingdogs.village.DataSetException
order - languageId -
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
protected void getOrderCountryAndZone(Order order)
throws java.lang.Exception
order -
java.lang.Exception
protected void setCriteriaWithStandardAttributes(KKCriteria c,
int languageId)
c - languageId -
protected int getCount(KKCriteria c)
throws org.apache.torque.TorqueException,
com.workingdogs.village.DataSetException
c -
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
protected boolean doesOrderStatusExist(int status)
throws org.apache.torque.TorqueException,
KKException
status -
org.apache.torque.TorqueException
KKException
public java.lang.String getStatusText(int statusId,
int languageId)
throws java.lang.Exception
getStatusText in interface OrderMgrIfstatusId - languageId -
java.lang.Exception
public void changeOrderStatus(java.lang.String sessionId,
int orderId,
int status,
boolean customerNotified,
java.lang.String comments)
throws java.lang.Exception
changeOrderStatus in interface OrderMgrIfsessionId - orderId - status - customerNotified - Has the customer been notifiedcomments -
java.lang.Exception
public int getOrderStatus(java.lang.String sessionId,
int orderId)
throws java.lang.Exception
getOrderStatus in interface OrderMgrIfsessionId - orderId -
java.lang.Exception
public OrderStatus[] getAllOrderStatuses(int languageId)
throws java.lang.Exception
getAllOrderStatuses in interface OrderMgrIflanguageId -
java.lang.Exception
public void changeOrderStatus(int orderId,
int status,
boolean customerNotified,
java.lang.String comments)
throws java.lang.Exception
changeOrderStatus in interface OrderMgrIforderId - status - customerNotified - Has the customer been notifiedcomments -
java.lang.Exception
public void updateInventory(java.lang.String sessionId,
int orderId)
throws java.lang.Exception
updateInventory in interface OrderMgrIfsessionId - orderId -
java.lang.Exception
public void updateInventoryWithOptions(java.lang.String sessionId,
int orderId,
CreateOrderOptionsIf options)
throws java.lang.Exception
updateInventoryWithOptions in interface OrderMgrIfsessionId - orderId - options -
java.lang.Exception
public java.lang.String getSecretKeyForOrderId(int orderId)
throws java.lang.Exception
getSecretKeyForOrderId in interface OrderMgrIforderId -
java.lang.Exception
public int getOrderIdFromSecretKey(java.lang.String secretKey)
throws com.workingdogs.village.DataSetException,
org.apache.torque.TorqueException
getOrderIdFromSecretKey in interface OrderMgrIfsecretKey -
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
public void deleteOrderIdForSecretKey(java.lang.String secretKey)
throws org.apache.torque.TorqueException
deleteOrderIdForSecretKey in interface OrderMgrIfsecretKey -
org.apache.torque.TorqueException
public int saveIpnHistory(java.lang.String sessionId,
IpnHistoryIf ipnHistory)
throws java.lang.Exception
saveIpnHistory in interface OrderMgrIfsessionId - ipnHistory -
java.lang.Exception
public IpnHistory[] getIpnHistory(java.lang.String sessionId,
int orderId)
throws java.lang.Exception
getIpnHistory in interface OrderMgrIfsessionId - The session id of the logged in userorderId - The numeric id of the order
java.lang.Exception
public IpnHistory[] getIpnHistory(int orderId)
throws com.workingdogs.village.DataSetException,
org.apache.torque.TorqueException
getIpnHistory in interface OrderMgrIforderId -
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
public Order createAndSaveOrder(java.lang.String emailAddr,
java.lang.String password,
CustomerRegistrationIf custReg,
BasketIf[] basketItemArray,
java.lang.String shippingModule,
java.lang.String paymentModule,
int languageId)
throws java.lang.Exception
createAndSaveOrder in interface OrderMgrIfemailAddr - password - custReg - basketItemArray - shippingModule - paymentModule - languageId -
java.lang.Exception
public void setCreditCardDetailsOnOrder(java.lang.String sessionId,
int orderId,
CreditCardIf card)
throws java.lang.Exception
setCreditCardDetailsOnOrder in interface OrderMgrIfsessionId - orderId - card -
java.lang.Exceptionprotected FetchProductOptionsIf createFetchProductOptions(CreateOrderOptionsIf options)
options -
protected AddToBasketOptionsIf createAddToBasketOptions(CreateOrderOptionsIf options)
options -
public void setRewardPointReservationId(java.lang.String sessionId,
int orderId,
int reservationId)
throws java.lang.Exception
sessionId
parameter and then updates the reservation id.
setRewardPointReservationId in interface OrderMgrIfsessionId - orderId - reservationId -
java.lang.Exception
public void setRewardPointReservationId(int customerId,
int orderId,
int reservationId)
throws java.lang.Exception
customerId
parameter and then updates the reservation id.
setRewardPointReservationId in interface OrderMgrIfcustomerId - orderId - reservationId -
java.lang.Exception
protected void manageDataDescriptor(DataDescriptorIf dataDesc,
org.apache.torque.util.Criteria c)
dataDesc - c -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||