com.konakartadmin.blif
Interface AdminOrderMgrIf

All Known Implementing Classes:
AdminOrderMgr

public interface AdminOrderMgrIf

AdminOrderMgrIf


Method Summary
 void calculateTotals(int scale, int taxQuantityRule, AdminOrderProduct orderProduct)
          We calculate totalPriceIncTax, totalPriceExTax and tax starting from price which is the price of one product without options and without tax.
 void decryptOrder(AdminOrder order)
          Decrypt the encrypted parts of an order - but only if the encryption key passed in is non-null and not empty.
 int deleteOrder(int ordId)
          Deletes an order and all associated records (eg OrderProducts, OrderStatusHistory etc)
 void deleteOrderReturn(int orderRetId)
          Delete the AdminOrderReturn object and any associated AdminOrderReturnProduct objects
 int deleteOrderStatusName(int ordStatId)
          Delete an OrderStatusName
 boolean doesOrderStatusExist(int ordStatId, int langId)
          Checks to see whether an Order Status already exists with this id and this language id.
 void editOrder(AdminOrder order)
          Edit an existing order.
 void editOrderReturn(AdminOrderReturn orderRet)
          Edits an AdminOrderReturn object.
 AdminCreditCard encryptCreditCard(AdminCreditCard creditCard, java.lang.String ek)
          Encrypt the credit card details - but only if the encryption key passed in is non-null and not empty.
 com.konakart.app.ExportOrderResponse exportOrder(com.konakart.app.ExportOrderOptions options)
          Exports the Order
 AdminOrderStatusName[] getAllOrderStatuses(int languageId)
          Returns an array of AdminOrdersStatusName objects for the languages specified
 int getOrderCount(int orderStatus)
          Returns a count of the Orders with the specified order status
 AdminOrder getOrderForOrderId(int orderId)
          Retrieve an order for an orderId, using the default language
 AdminOrder getOrderForOrderId(int orderId, int languageId)
          Returns an order for an orderId and a languageId.
 AdminOrderReturnSearchResult getOrderReturns(AdminOrderReturnSearch retSearch, int offset, int size)
          Search for Order Returns
 AdminOrderSearchResult getOrders(AdminOrderSearch search, int offset, int size, int languageId)
          Returns a set of Orders matching the specified search criteria
 AdminOrder[] getOrdersCreatedSince(java.util.Calendar since, int languageId)
          Returns a set of Orders created since the specified date
 AdminOrderSearchResult getOrdersLite(AdminOrderSearch search, int offset, int size, int languageId)
          Returns a set of Orders matching the specified search criteria - the orders returned are sparsely-populated with: id order number customer name street address city formatted total price inc tax purchase date order status id order status text
 AdminOrderStatusNameSearchResult getOrderStatusNames(AdminOrderStatusNameSearch search)
          This returns an AdminOrderStatusNameSearchResult object.
 int insertIpnHistory(AdminIpnHistory ipnHistory)
          Save the AdminIpnHistory object in the database.
 int insertOrder(AdminOrder order)
          Insert an order.
 int insertOrderReturn(AdminOrderReturn orderRet)
          Inserts an AdminOrderReturn object and links it to an array of AdminOrderProduct objects in order to identify which products in the order were returned.
 int insertOrderStatusName(AdminOrderStatusName ordStat)
          Insert an AdminOrderStatusName object
 int insertOrderStatusNames(AdminOrderStatusName[] ordStats)
          Insert an array of AdminOrderStatusName objects.
 boolean isSaveCreditCardDetails()
          If true, credit card details will be saved
 void refreshConfigs()
          Refresh the Configuration variables for this manager
 AdminIpnHistories searchForIpnHistory(AdminDataDescriptor dataDesc, AdminIpnSearch ipnSearch)
          Search for IPN History objects
 void setCreditCardDetailsOnOrder(AdminCreditCard creditCard)
          Set Credit Card details on an existing order
 void setRewardPointReservationId(int orderId, int reservationId)
          Updates the reward point reservation id for the order identified by orderId.
 void updateOrder(int orderId, int orderStatus, java.lang.String comments, boolean notifyCustomer, AdminOrderUpdate updateOrder)
          Update the order status with optional comments.
 void updateOrderStatus(int orderId, int orderStatus, java.lang.String comments, boolean notifyCustomer)
          Update the order status with optional comments
 int updateOrderStatusName(AdminOrderStatusName ordStat)
          Update an AdminOrderStatusName object
 

Method Detail

getOrderCount

int getOrderCount(int orderStatus)
                  throws org.apache.torque.TorqueException,
                         com.workingdogs.village.DataSetException
Returns a count of the Orders with the specified order status

Parameters:
orderStatus - the order status
Returns:
A count of the Orders with the specified type
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getOrdersLite

AdminOrderSearchResult getOrdersLite(AdminOrderSearch search,
                                     int offset,
                                     int size,
                                     int languageId)
                                     throws KKAdminException
Returns a set of Orders matching the specified search criteria - the orders returned are sparsely-populated with:

Parameters:
search - the Orders search criteria object (can be null)
offset - offset in the db
size - max number of records to return from the offset
languageId - the language Id - or it could be DEFAULT_LANG to use the default language
Returns:
A set of Orders that match the specified search criteria within an AdminOrderSearchResult object
Throws:
KKAdminException

getOrders

AdminOrderSearchResult getOrders(AdminOrderSearch search,
                                 int offset,
                                 int size,
                                 int languageId)
                                 throws java.lang.Exception
Returns a set of Orders matching the specified search criteria

Parameters:
search - the Orders search criteria object (can be null)
offset - offset in the db
size - max number of records to return from the offset
languageId - the language Id - or it could be DEFAILT_LANG to use the default language
Returns:
A set of Orders that match the specified search criteria within an AdminOrderSearchResult object
Throws:
java.lang.Exception

getOrdersCreatedSince

AdminOrder[] getOrdersCreatedSince(java.util.Calendar since,
                                   int languageId)
                                   throws java.lang.Exception
Returns a set of Orders created since the specified date

Parameters:
since - the date to use to define the range of orders to return
languageId - the language id
Returns:
a set of orders placed since the specified date. If there are no orders then an empty array is returned
Throws:
java.lang.Exception

updateOrder

void updateOrder(int orderId,
                 int orderStatus,
                 java.lang.String comments,
                 boolean notifyCustomer,
                 AdminOrderUpdate updateOrder)
                 throws java.lang.Exception
Update the order status with optional comments. If the locale attribute of the order is not null, it will be used to read the email template in the customer's preferred language. Otherwise the default language will be used.

Parameters:
orderId - the order id
orderStatus - the new Order Status
comments - if not null, these comments are added
notifyCustomer - if true the customer will be notified by email
updateOrder - contains order update data such as who updated the order
Throws:
java.lang.Exception

updateOrderStatus

void updateOrderStatus(int orderId,
                       int orderStatus,
                       java.lang.String comments,
                       boolean notifyCustomer)
                       throws java.lang.Exception
Update the order status with optional comments

Parameters:
orderId - the order id
orderStatus - the new Order Status
comments - if not null, these comments are added
notifyCustomer - if true the customer will be notified by email
Throws:
java.lang.Exception

getOrderForOrderId

AdminOrder getOrderForOrderId(int orderId)
                              throws java.lang.Exception
Retrieve an order for an orderId, using the default language

Parameters:
orderId -
Returns:
Returns an AdminOrder object
Throws:
java.lang.Exception

getOrderForOrderId

AdminOrder getOrderForOrderId(int orderId,
                              int languageId)
                              throws java.lang.Exception
Returns an order for an orderId and a languageId. If the languageId is set to -1 then the default language is used.

Parameters:
orderId -
languageId -
Returns:
Returns an AdminOrder object
Throws:
java.lang.Exception

getAllOrderStatuses

AdminOrderStatusName[] getAllOrderStatuses(int languageId)
                                           throws java.lang.Exception
Returns an array of AdminOrdersStatusName objects for the languages specified

Parameters:
languageId -
Returns:
Array of AdminOrdersStatusName objects
Throws:
java.lang.Exception

calculateTotals

void calculateTotals(int scale,
                     int taxQuantityRule,
                     AdminOrderProduct orderProduct)
We calculate totalPriceIncTax, totalPriceExTax and tax starting from price which is the price of one product without options and without tax. Added to the Mgr because we can't do sums on BigDecimal on the client.

Parameters:
scale - The scale used in the calculations
taxQuantityRule - The tax calculation rule to use
orderProduct -

deleteOrder

int deleteOrder(int ordId)
                throws KKAdminException
Deletes an order and all associated records (eg OrderProducts, OrderStatusHistory etc)

Removes records from :

Parameters:
ordId - Order id of the order to delete
Returns:
return the order id of the deleted order
Throws:
KKAdminException

getOrderStatusNames

AdminOrderStatusNameSearchResult getOrderStatusNames(AdminOrderStatusNameSearch search)
                                                     throws org.apache.torque.TorqueException,
                                                            com.workingdogs.village.DataSetException,
                                                            KKAdminException
This returns an AdminOrderStatusNameSearchResult object.

Parameters:
search -
Returns:
Returns an AdminOrderStatusNameSearchResult object
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

deleteOrderStatusName

int deleteOrderStatusName(int ordStatId)
                          throws KKAdminException
Delete an OrderStatusName

Parameters:
ordStatId - An OrderStatusName id
Returns:
returns the id of the deleted order status
Throws:
KKAdminException

insertOrderStatusName

int insertOrderStatusName(AdminOrderStatusName ordStat)
                          throws KKAdminException
Insert an AdminOrderStatusName object

Parameters:
ordStat - An AdminOrderStatusName object
Returns:
returns the id of the inserted AdminOrderStatusName object
Throws:
KKAdminException

insertOrderStatusNames

int insertOrderStatusNames(AdminOrderStatusName[] ordStats)
                           throws KKAdminException
Insert an array of AdminOrderStatusName objects. We use the same id for all of the items in the array.

Parameters:
ordStats - An AdminOrderStatusName array object
Returns:
returns the id of the last inserted AdminOrderStatusName objects
Throws:
KKAdminException

updateOrderStatusName

int updateOrderStatusName(AdminOrderStatusName ordStat)
                          throws KKAdminException
Update an AdminOrderStatusName object

Parameters:
ordStat - An AdminOrderStatusName object
Returns:
returns the id of the updated AdminOrderStatusName object
Throws:
KKAdminException

doesOrderStatusExist

boolean doesOrderStatusExist(int ordStatId,
                             int langId)
                             throws org.apache.torque.TorqueException,
                                    KKAdminException
Checks to see whether an Order Status already exists with this id and this language id. If language Id is set to NOT_SET, we check only for orderstatuses with the specified order status id.

Parameters:
ordStatId - the order status Id
langId - the language Id
Returns:
Returns true if the order status already exists
Throws:
org.apache.torque.TorqueException
KKAdminException

searchForIpnHistory

AdminIpnHistories searchForIpnHistory(AdminDataDescriptor dataDesc,
                                      AdminIpnSearch ipnSearch)
                                      throws java.lang.Exception
Search for IPN History objects

Parameters:
dataDesc -
ipnSearch -
Returns:
Return an AdminIpnHistories object
Throws:
java.lang.Exception

insertOrderReturn

int insertOrderReturn(AdminOrderReturn orderRet)
                      throws java.lang.Exception
Inserts an AdminOrderReturn object and links it to an array of AdminOrderProduct objects in order to identify which products in the order were returned.

Parameters:
orderRet -
Returns:
Returns the id of the newly inserted AdminOrderReturn object
Throws:
java.lang.Exception

editOrderReturn

void editOrderReturn(AdminOrderReturn orderRet)
                     throws java.lang.Exception
Edits an AdminOrderReturn object.

Parameters:
orderRet -
Throws:
java.lang.Exception

deleteOrderReturn

void deleteOrderReturn(int orderRetId)
                       throws java.lang.Exception
Delete the AdminOrderReturn object and any associated AdminOrderReturnProduct objects

Parameters:
orderRetId -
Throws:
java.lang.Exception

getOrderReturns

AdminOrderReturnSearchResult getOrderReturns(AdminOrderReturnSearch retSearch,
                                             int offset,
                                             int size)
                                             throws KKAdminException,
                                                    org.apache.torque.TorqueException,
                                                    com.workingdogs.village.DataSetException
Search for Order Returns

Parameters:
retSearch -
offset -
size -
Returns:
Return an AdminReturns object
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

editOrder

void editOrder(AdminOrder order)
               throws java.lang.Exception
Edit an existing order. This method only allows you to edit certain attributes of an order. In order to change the order status you must use updateOrderStatus(). The attributes that can be modified are: Attributes containing null values will be ignored. In order to clear a String attribute, you must set it to an empty string.

Parameters:
order -
Throws:
java.lang.Exception

setCreditCardDetailsOnOrder

void setCreditCardDetailsOnOrder(AdminCreditCard creditCard)
                                 throws java.lang.Exception,
                                        KKAdminException
Set Credit Card details on an existing order

This method only allows you to update the credit card details on an order. In order to change the order status you must use updateOrderStatus().

The Credit Card details are only saved if the ability to save credit card details is enabled in the configuration of the store.

The orderId must be populated in the id field of the AdminCreditCard object.

Before being saved, this sensitive information is encrypted.

No update or insert is done for attributes of the AdminCreditCard object that are set to null. The credit card details are mapped as follows to attributes in the order object:

The following Credit Card attributes can be saved (on the AdminCreditCard object):

Parameters:
creditCard - the AdminCreditCard object
Throws:
java.lang.Exception
KKAdminException

insertIpnHistory

int insertIpnHistory(AdminIpnHistory ipnHistory)
                     throws java.lang.Exception
Save the AdminIpnHistory object in the database.

Parameters:
ipnHistory -
Returns:
Id of newly created object
Throws:
java.lang.Exception

isSaveCreditCardDetails

boolean isSaveCreditCardDetails()
If true, credit card details will be saved

Returns:
the saveCreditCardDetails

refreshConfigs

void refreshConfigs()
                    throws java.lang.Exception
Refresh the Configuration variables for this manager

Throws:
java.lang.Exception

insertOrder

int insertOrder(AdminOrder order)
                throws java.lang.Exception
Insert an order. This method is intended to be used for importing orders that have previously been validated and saved maybe in another KonaKart. It is used by the KonaKart XML import / export functionality.

Parameters:
order -
Returns:
Returns the order Id
Throws:
java.lang.Exception

encryptCreditCard

AdminCreditCard encryptCreditCard(AdminCreditCard creditCard,
                                  java.lang.String ek)
                                  throws KKAdminException
Encrypt the credit card details - but only if the encryption key passed in is non-null and not empty. Null attributes are copied to the new encrypted credit card details.

Parameters:
creditCard - the original credit card object
ek - the encryption key
Returns:
a new AdminCreditCard object with encrypted fields. If the original creditCard object is null, a null is returned.
Throws:
KKAdminException

decryptOrder

void decryptOrder(AdminOrder order)
                  throws KKAdminException
Decrypt the encrypted parts of an order - but only if the encryption key passed in is non-null and not empty.

Parameters:
order - the order object that will be populated with the unencrypted attributes
Throws:
KKAdminException

setRewardPointReservationId

void setRewardPointReservationId(int orderId,
                                 int reservationId)
                                 throws java.lang.Exception
Updates the reward point reservation id for the order identified by orderId.

Parameters:
orderId -
reservationId -
Throws:
java.lang.Exception

exportOrder

com.konakart.app.ExportOrderResponse exportOrder(com.konakart.app.ExportOrderOptions options)
                                                 throws KKAdminException
Exports the Order

Parameters:
options - Defines the options to use for the export of the Order
Returns:
an ExportOrderResponse object
Throws:
KKAdminException


Copyright © 2011 DS Data Systems UK Ltd.