com.konakartadmin.bl
Class AdminOrderMgr

java.lang.Object
  extended by com.konakartadmin.bl.AdminBaseMgr
      extended by com.konakartadmin.bl.AdminOrderMgr
All Implemented Interfaces:
AdminOrderMgrIf

public class AdminOrderMgr
extends AdminBaseMgr
implements AdminOrderMgrIf

The AdminOrderMgr - for Managing Orders for the Admin Application


Nested Class Summary
protected  class AdminOrderMgr.StaticData
           
 
Field Summary
protected static org.apache.commons.logging.Log log
          the log
protected static java.lang.String mutex
          Mutex for this manager
protected static java.util.Map<java.lang.String,AdminOrderMgr.StaticData> staticDataHM
          Hash Map that contains the static data
 
Fields inherited from class com.konakartadmin.bl.AdminBaseMgr
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir
 
Constructor Summary
AdminOrderMgr(KKAdminIf eng)
           
 
Method Summary
protected  void addOrderReturnsToOrder(AdminOrder order)
          Get an array of order return objects for this order and attach them to the order
protected  int addOrderSearchCriteria(com.konakart.bl.KKCriteria c, AdminOrderSearch orderSearch)
           
protected  void addOrdersOrderBy(com.konakart.bl.KKCriteria c, AdminOrderSearch orderSearch)
           
protected  void addOrderStatusOrderBy(com.konakart.bl.KKCriteria c, AdminOrderStatusNameSearch search)
           
protected  int addOrderStatusSearchCriteria(com.konakart.bl.KKCriteria c, AdminOrderStatusNameSearch search)
           
 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
protected  boolean doesOrderExist(int orderId)
          Returns true if the parameter orderId points to an order in the database.
protected  boolean doesOrderStatusExist(int status)
          Determines whether an order_status record exists for the status id parameter
 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
 com.konakart.app.ExportOrderResponse exportOrderByShippingModule(com.konakart.app.ExportOrderOptions options)
          Export an order to XML by using the respective Shipping Module to export the order.
 com.konakart.app.ExportOrderResponse exportOrderToXml(com.konakart.app.ExportOrderOptions options)
          Export an order to XML
 com.konakart.app.ExportOrderResponse exportOrderToXmlString(com.konakart.app.ExportOrderOptions options)
          Export an order to an XML String
protected  void formatOrderAddresses(AdminOrder order)
          It gets the address templates for all three addresses and sets the formatted addresses
protected  AdminOrderIntegrationMgrInterface getAdminOrderIntegMgrInstanceByName(java.lang.String className)
          Called to instantiate an AdminOrderIntegrationMgr.
protected  AdminOrderIntegrationMgrInterface getAdminOrderIntegrationMgr()
          Used to get an instance of the OrderIntegrationMgr
 AdminOrderStatusName[] getAllOrderStatuses(int languageId)
          Returns an array of AdminOrdersStatusName objects for the languages specified
protected  int getCount(com.konakart.bl.KKCriteria c)
          This method is mainly used for paging.
protected  java.lang.String getEncryptionKey(int orderId)
          Returns the encryption key used on an Order
protected  int getIpnCount(com.konakart.bl.KKCriteria c)
          This method is mainly used for paging.
 int getOrderCount(int orderStatus)
          Returns a count of the Orders with the specified order status
protected  void getOrderCountryAndZone(AdminOrder order)
          Instantiate the Country and Zone objects for the order
protected  void getOrderDetails(AdminOrder order, int languageId)
          Calls methods to get all of the details of the order
 AdminOrder getOrderForExport(int orderId)
          Return the AdminOrder with the specified orderId.
 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.
protected  void getOrderProducts(AdminOrder order)
          Get the OrderProduct and the Options of each OrderProduct for this order.
 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.
protected  void getOrderTotals(AdminOrder order)
          Populates the Order object with an array of OrderTotal objects sorted by the sortOrder attribute
protected  int getReturnsCount(com.konakart.bl.KKCriteria c)
          This method is mainly used for paging.
protected  void getStatusTrail(AdminOrder order, int languageId)
          Populates the Order object with an array of OrderStatusHistory objects
 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
protected  void setCriteriaForEncyptionCols(com.konakart.bl.KKCriteria c)
          Set the criteria object with all of the encryption attributes for a "Lite" order
protected  void setCriteriaWithJoinsLite(com.konakart.bl.KKCriteria c, int languageId)
          Set the criteria object with all of the attributes for a "Lite" order
protected  void setCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c, int languageId)
          Set the criteria object with all of the attributes for an order
protected  void setCriteriaWithStandardAttributesLite(com.konakart.bl.KKCriteria c, int languageId)
          Set the criteria object with all of the attributes for a "Lite" order
 void setRewardPointReservationId(int orderId, int reservationId)
          Updates the reward point reservation id for the order identified by orderId.
protected  void setupStoreCreditCardDetails(AdminOrderMgr.StaticData sd)
          Set the pre-search string based on the configuration variable value
 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
 
Methods inherited from class com.konakartadmin.bl.AdminBaseMgr
addInsertAttr, addInsertAttr, checkIntIsSet, checkRequired, getAdminAddressMgr, getAdminAuditMgr, getAdminBillingMgr, getAdminBookableProductMgr, getAdminCatMgr, getAdminConfigMgr, getAdminCurrMgr, getAdminCustMgr, getAdminCustTagMgr, getAdminEmailMgr, getAdminEng, getAdminHtmlMgr, getAdminLanguageMgr, getAdminManuMgr, getAdminMessageMgr, getAdminMiscItemMgr, getAdminModulesMgr, getAdminMultiStoreMgr, getAdminOrderMgr, getAdminPdfMgr, getAdminProdAttrMgr, getAdminProdMgr, getAdminPromMgr, getAdminPublishProdMgr, getAdminReviewMgr, getAdminSearchRuleMgr, getAdminSecMgr, getAdminSolrMgr, getAdminStoreMgr, getAdminTagMgr, getAdminTaxMgr, getAdminValidationMgr, getAdminVelocityContextMgr, getAdminWishListMgr, getBooleanFromString, getExportXMLData, getIntFromString, getKkConfig, getKkInstanceId, getMode, getModeString, getMqMgr, getNewCriteria, getNewCriteria, getPostSearchText, getPreSearchText, getPropertyValue, getRecordCount, getRewardPointMgr, getSingleIntResult, getStoreId, getTemplate, getTemplateBase, getXml_io, init, isConfigSet, isEnterprise, isMultiStoreLanguagesShared, isMultiStoreMode, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareProducts, isMultiStoreSingleDBCSMode, isMultiStoreSingleDBMode, isMultiStoreSingleDBNonCSMode, manageException, removeCData, setAdminEng, setupWildCardRules, setWildCardAfter, setWildCardBefore, shutdownGracefully, shutdownGracefully, timestampStr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
the log


mutex

protected static java.lang.String mutex
Mutex for this manager


staticDataHM

protected static java.util.Map<java.lang.String,AdminOrderMgr.StaticData> staticDataHM
Hash Map that contains the static data

Constructor Detail

AdminOrderMgr

public AdminOrderMgr(KKAdminIf eng)
              throws java.lang.Exception
Parameters:
eng -
Throws:
java.lang.Exception
Method Detail

setupStoreCreditCardDetails

protected void setupStoreCreditCardDetails(AdminOrderMgr.StaticData sd)
Set the pre-search string based on the configuration variable value

Parameters:
sd - StaticData

getOrderCount

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

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

getCount

protected int getCount(com.konakart.bl.KKCriteria c)
                throws org.apache.torque.TorqueException,
                       com.workingdogs.village.DataSetException
This method is mainly used for paging.

Parameters:
c - the KKCriteria
Returns:
The number of records present in the database matching the given criteria
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getIpnCount

protected int getIpnCount(com.konakart.bl.KKCriteria c)
                   throws org.apache.torque.TorqueException,
                          com.workingdogs.village.DataSetException
This method is mainly used for paging.

Parameters:
c -
Returns:
The number of records present in the database matching the given criteria
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getOrdersLite

public 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:

Specified by:
getOrdersLite in interface AdminOrderMgrIf
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

decryptOrder

public 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.

Specified by:
decryptOrder in interface AdminOrderMgrIf
Parameters:
order - the order object that will be populated with the unencrypted attributes
Throws:
KKAdminException

getOrders

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

Specified by:
getOrders in interface AdminOrderMgrIf
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

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

Specified by:
getOrdersCreatedSince in interface AdminOrderMgrIf
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

getOrderTotals

protected void getOrderTotals(AdminOrder order)
                       throws org.apache.torque.TorqueException,
                              com.workingdogs.village.DataSetException
Populates the Order object with an array of OrderTotal objects sorted by the sortOrder attribute

Parameters:
order -
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getOrderProducts

protected void getOrderProducts(AdminOrder order)
                         throws java.lang.Exception
Get the OrderProduct and the Options of each OrderProduct for this order.

Parameters:
order -
Throws:
java.lang.Exception

getOrderDetails

protected void getOrderDetails(AdminOrder order,
                               int languageId)
                        throws java.lang.Exception
Calls methods to get all of the details of the order

Parameters:
order -
Throws:
java.lang.Exception

updateOrder

public void updateOrder(int orderId,
                        int orderStatus,
                        java.lang.String comments,
                        boolean notifyCustomer,
                        AdminOrderUpdate updateOrder)
                 throws java.lang.Exception
Description copied from interface: AdminOrderMgrIf
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.

Specified by:
updateOrder in interface AdminOrderMgrIf
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

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

Specified by:
updateOrderStatus in interface AdminOrderMgrIf
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

getAdminOrderIntegrationMgr

protected AdminOrderIntegrationMgrInterface getAdminOrderIntegrationMgr()
Used to get an instance of the OrderIntegrationMgr

Returns:
Returns an OrderIntegrationMgr Object

getAdminOrderIntegMgrInstanceByName

protected AdminOrderIntegrationMgrInterface getAdminOrderIntegMgrInstanceByName(java.lang.String className)
                                                                         throws java.lang.InstantiationException,
                                                                                java.lang.IllegalAccessException,
                                                                                java.lang.ClassNotFoundException,
                                                                                java.lang.IllegalArgumentException,
                                                                                java.lang.reflect.InvocationTargetException
Called to instantiate an AdminOrderIntegrationMgr. It determines whether the AdminOrderIntegrationMgr has a constructor where KKAdmin is passed in and if it does, then this constructor is used. Otherwise the empty constructor is used.

Parameters:
className -
Returns:
Returns an instantiated Module
Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.reflect.InvocationTargetException
java.lang.IllegalArgumentException

getOrderForOrderId

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

Specified by:
getOrderForOrderId in interface AdminOrderMgrIf
Parameters:
orderId -
Returns:
Returns an AdminOrder object
Throws:
java.lang.Exception

getOrderForOrderId

public 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.

Specified by:
getOrderForOrderId in interface AdminOrderMgrIf
Parameters:
orderId -
languageId -
Returns:
Returns an AdminOrder object
Throws:
java.lang.Exception

getEncryptionKey

protected java.lang.String getEncryptionKey(int orderId)
                                     throws org.apache.torque.TorqueException,
                                            com.workingdogs.village.DataSetException
Returns the encryption key used on an Order

Parameters:
orderId -
Returns:
Returns the encryption key for the order or null if it doesn't exist
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

doesOrderStatusExist

protected boolean doesOrderStatusExist(int status)
                                throws org.apache.torque.TorqueException,
                                       KKAdminException
Determines whether an order_status record exists for the status id parameter

Parameters:
status -
Returns:
Returns true or false
Throws:
org.apache.torque.TorqueException
KKAdminException

formatOrderAddresses

protected void formatOrderAddresses(AdminOrder order)
                             throws java.lang.Exception
It gets the address templates for all three addresses and sets the formatted addresses

Parameters:
order -
Throws:
java.lang.Exception

getStatusTrail

protected void getStatusTrail(AdminOrder order,
                              int languageId)
                       throws org.apache.torque.TorqueException,
                              com.workingdogs.village.DataSetException
Populates the Order object with an array of OrderStatusHistory objects

Parameters:
order -
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getOrderCountryAndZone

protected void getOrderCountryAndZone(AdminOrder order)
                               throws java.lang.Exception
Instantiate the Country and Zone objects for the order

Throws:
java.lang.Exception

getAllOrderStatuses

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

Specified by:
getAllOrderStatuses in interface AdminOrderMgrIf
Parameters:
languageId -
Returns:
Array of AdminOrdersStatusName objects
Throws:
java.lang.Exception

addOrdersOrderBy

protected void addOrdersOrderBy(com.konakart.bl.KKCriteria c,
                                AdminOrderSearch orderSearch)

addOrderSearchCriteria

protected int addOrderSearchCriteria(com.konakart.bl.KKCriteria c,
                                     AdminOrderSearch orderSearch)

setCriteriaWithJoinsLite

protected void setCriteriaWithJoinsLite(com.konakart.bl.KKCriteria c,
                                        int languageId)
Set the criteria object with all of the attributes for a "Lite" order

Parameters:
c - Criteria to add to
languageId - the language Id

setCriteriaWithStandardAttributesLite

protected void setCriteriaWithStandardAttributesLite(com.konakart.bl.KKCriteria c,
                                                     int languageId)
Set the criteria object with all of the attributes for a "Lite" order

Parameters:
c -

setCriteriaForEncyptionCols

protected void setCriteriaForEncyptionCols(com.konakart.bl.KKCriteria c)
Set the criteria object with all of the encryption attributes for a "Lite" order

Parameters:
c -

setCriteriaWithStandardAttributes

protected void setCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c,
                                                 int languageId)
Set the criteria object with all of the attributes for an order

Parameters:
c -

calculateTotals

public 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.

Specified by:
calculateTotals in interface AdminOrderMgrIf
Parameters:
scale - The scale used in the calculations
taxQuantityRule - The tax calculation rule to use
orderProduct -

deleteOrder

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

Removes records from :

Specified by:
deleteOrder in interface AdminOrderMgrIf
Parameters:
ordId - Order id of the order to delete
Returns:
return the order id of the deleted order
Throws:
KKAdminException

getOrderStatusNames

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

Specified by:
getOrderStatusNames in interface AdminOrderMgrIf
Parameters:
search -
Returns:
Returns an AdminOrderStatusNameSearchResult object
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

deleteOrderStatusName

public int deleteOrderStatusName(int ordStatId)
                          throws KKAdminException
Delete an OrderStatusName

Specified by:
deleteOrderStatusName in interface AdminOrderMgrIf
Parameters:
ordStatId - An OrderStatusName id
Returns:
returns the id of the deleted order status
Throws:
KKAdminException

insertOrderStatusName

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

Specified by:
insertOrderStatusName in interface AdminOrderMgrIf
Parameters:
ordStat - An AdminOrderStatusName object
Returns:
returns the id of the inserted AdminOrderStatusName object
Throws:
KKAdminException

insertOrderStatusNames

public 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.

Specified by:
insertOrderStatusNames in interface AdminOrderMgrIf
Parameters:
ordStats - An AdminOrderStatusName array object
Returns:
returns the id of the last inserted AdminOrderStatusName objects
Throws:
KKAdminException

updateOrderStatusName

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

Specified by:
updateOrderStatusName in interface AdminOrderMgrIf
Parameters:
ordStat - An AdminOrderStatusName object
Returns:
returns the id of the updated AdminOrderStatusName object
Throws:
KKAdminException

doesOrderStatusExist

public 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.

Specified by:
doesOrderStatusExist in interface AdminOrderMgrIf
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

addOrderStatusOrderBy

protected void addOrderStatusOrderBy(com.konakart.bl.KKCriteria c,
                                     AdminOrderStatusNameSearch search)

addOrderStatusSearchCriteria

protected int addOrderStatusSearchCriteria(com.konakart.bl.KKCriteria c,
                                           AdminOrderStatusNameSearch search)

searchForIpnHistory

public AdminIpnHistories searchForIpnHistory(AdminDataDescriptor dataDesc,
                                             AdminIpnSearch ipnSearch)
                                      throws java.lang.Exception
Description copied from interface: AdminOrderMgrIf
Search for IPN History objects

Specified by:
searchForIpnHistory in interface AdminOrderMgrIf
Parameters:
dataDesc -
ipnSearch -
Returns:
Return an AdminIpnHistories object
Throws:
java.lang.Exception

insertOrderReturn

public 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.

Specified by:
insertOrderReturn in interface AdminOrderMgrIf
Parameters:
orderRet -
Returns:
Returns the id of the newly inserted AdminOrderReturn object
Throws:
java.lang.Exception

editOrderReturn

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

Specified by:
editOrderReturn in interface AdminOrderMgrIf
Parameters:
orderRet -
Throws:
java.lang.Exception

deleteOrderReturn

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

Specified by:
deleteOrderReturn in interface AdminOrderMgrIf
Parameters:
orderRetId -
Throws:
java.lang.Exception

addOrderReturnsToOrder

protected void addOrderReturnsToOrder(AdminOrder order)
                               throws KKAdminException,
                                      org.apache.torque.TorqueException,
                                      com.workingdogs.village.DataSetException
Get an array of order return objects for this order and attach them to the order

Parameters:
order -
Throws:
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKAdminException

getOrderReturns

public AdminOrderReturnSearchResult getOrderReturns(AdminOrderReturnSearch retSearch,
                                                    int offset,
                                                    int size)
                                             throws KKAdminException,
                                                    org.apache.torque.TorqueException,
                                                    com.workingdogs.village.DataSetException
Description copied from interface: AdminOrderMgrIf
Search for Order Returns

Specified by:
getOrderReturns in interface AdminOrderMgrIf
Parameters:
retSearch -
offset -
size -
Returns:
Return an AdminReturns object
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getReturnsCount

protected int getReturnsCount(com.konakart.bl.KKCriteria c)
                       throws org.apache.torque.TorqueException,
                              com.workingdogs.village.DataSetException
This method is mainly used for paging.

Parameters:
c -
Returns:
The number of records present in the database matching the given criteria
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

editOrder

public 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.

Specified by:
editOrder in interface AdminOrderMgrIf
Parameters:
order -
Throws:
java.lang.Exception

setCreditCardDetailsOnOrder

public 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):

Specified by:
setCreditCardDetailsOnOrder in interface AdminOrderMgrIf
Parameters:
creditCard - the AdminCreditCard object
Throws:
java.lang.Exception
KKAdminException

encryptCreditCard

public 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.

Specified by:
encryptCreditCard in interface AdminOrderMgrIf
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, or the encryption key is null (or empty), a null is returned.
Throws:
KKAdminException

doesOrderExist

protected boolean doesOrderExist(int orderId)
                          throws org.apache.torque.TorqueException
Returns true if the parameter orderId points to an order in the database.

Parameters:
orderId -
Returns:
Return true if the order exists
Throws:
org.apache.torque.TorqueException

insertIpnHistory

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

Specified by:
insertIpnHistory in interface AdminOrderMgrIf
Parameters:
ipnHistory -
Returns:
Id of newly created object
Throws:
java.lang.Exception

insertOrder

public int insertOrder(AdminOrder order)
                throws java.lang.Exception
Insert an order

Specified by:
insertOrder in interface AdminOrderMgrIf
Parameters:
order -
Returns:
Returns the order Id
Throws:
java.lang.Exception

isSaveCreditCardDetails

public boolean isSaveCreditCardDetails()
Description copied from interface: AdminOrderMgrIf
If true, credit card details will be saved

Specified by:
isSaveCreditCardDetails in interface AdminOrderMgrIf
Returns:
the saveCreditCardDetails

exportOrder

public com.konakart.app.ExportOrderResponse exportOrder(com.konakart.app.ExportOrderOptions options)
                                                 throws KKAdminException
Description copied from interface: AdminOrderMgrIf
Exports the Order

Specified by:
exportOrder in interface AdminOrderMgrIf
Parameters:
options - Defines the options to use for the export of the Order
Returns:
an ExportOrderResponse object
Throws:
KKAdminException

exportOrderToXmlString

public com.konakart.app.ExportOrderResponse exportOrderToXmlString(com.konakart.app.ExportOrderOptions options)
                                                            throws org.apache.torque.TorqueException,
                                                                   com.workingdogs.village.DataSetException,
                                                                   java.lang.Exception
Export an order to an XML String

Parameters:
options - export options in ExportOrderOptions
Returns:
an ExportOrderResponse object to indicate the result
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.lang.Exception

exportOrderToXml

public com.konakart.app.ExportOrderResponse exportOrderToXml(com.konakart.app.ExportOrderOptions options)
                                                      throws org.apache.torque.TorqueException,
                                                             com.workingdogs.village.DataSetException,
                                                             java.lang.Exception
Export an order to XML

Parameters:
options - export options in ExportOrderOptions
Returns:
an ExportOrderResponse object to indicate the result
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.lang.Exception

getOrderForExport

public AdminOrder getOrderForExport(int orderId)
                             throws KKAdminException
Return the AdminOrder with the specified orderId. Throws an exception if the order does not exist.

Parameters:
orderId - id of the order to retrieve
Returns:
the AdminOrder if found
Throws:
KKAdminException - if the order does not exist or there are other more serious problems

exportOrderByShippingModule

public com.konakart.app.ExportOrderResponse exportOrderByShippingModule(com.konakart.app.ExportOrderOptions options)
                                                                 throws KKAdminException
Export an order to XML by using the respective Shipping Module to export the order.

Parameters:
options - export options in ExportOrderOptions
Returns:
an ExportOrderResponse object to indicate the result
Throws:
KKAdminException

refreshConfigs

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

Specified by:
refreshConfigs in interface AdminOrderMgrIf
Overrides:
refreshConfigs in class AdminBaseMgr
Throws:
java.lang.Exception

setRewardPointReservationId

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

Specified by:
setRewardPointReservationId in interface AdminOrderMgrIf
Parameters:
orderId -
reservationId -
Throws:
java.lang.Exception


Copyright © 2011 DS Data Systems UK Ltd.