|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.konakartadmin.bl.AdminBaseMgr
com.konakartadmin.bl.AdminOrderMgr
public class AdminOrderMgr
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
protected static java.lang.String mutex
protected static java.util.Map<java.lang.String,AdminOrderMgr.StaticData> staticDataHM
Constructor Detail |
---|
public AdminOrderMgr(KKAdminIf eng) throws java.lang.Exception
eng
-
java.lang.Exception
Method Detail |
---|
protected void setupStoreCreditCardDetails(AdminOrderMgr.StaticData sd)
sd
- StaticDatapublic int getOrderCount(int orderStatus) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
getOrderCount
in interface AdminOrderMgrIf
orderStatus
- the order status
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
protected int getCount(com.konakart.bl.KKCriteria c) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
c
- the KKCriteria
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
protected int getIpnCount(com.konakart.bl.KKCriteria c) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
c
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
public AdminOrderSearchResult getOrdersLite(AdminOrderSearch search, int offset, int size, int languageId) throws KKAdminException
getOrdersLite
in interface AdminOrderMgrIf
search
- the Orders search criteria object (can be null)offset
- offset in the dbsize
- max number of records to return from the offsetlanguageId
- the language Id - or it could be DEFAULT_LANG to use the default language
KKAdminException
public void decryptOrder(AdminOrder order) throws KKAdminException
decryptOrder
in interface AdminOrderMgrIf
order
- the order object that will be populated with the unencrypted attributes
KKAdminException
public AdminOrderSearchResult getOrders(AdminOrderSearch search, int offset, int size, int languageId) throws java.lang.Exception
getOrders
in interface AdminOrderMgrIf
search
- the Orders search criteria object (can be null)offset
- offset in the dbsize
- max number of records to return from the offsetlanguageId
- the language Id - or it could be DEFAILT_LANG to use the default language
java.lang.Exception
public AdminOrder[] getOrdersCreatedSince(java.util.Calendar since, int languageId) throws java.lang.Exception
getOrdersCreatedSince
in interface AdminOrderMgrIf
since
- the date to use to define the range of orders to returnlanguageId
- the language id
java.lang.Exception
protected void getOrderTotals(AdminOrder order) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
order
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
protected void getOrderProducts(AdminOrder order) throws java.lang.Exception
order
-
java.lang.Exception
protected void getOrderDetails(AdminOrder order, int languageId) throws java.lang.Exception
order
-
java.lang.Exception
public void updateOrder(int orderId, int orderStatus, java.lang.String comments, boolean notifyCustomer, AdminOrderUpdate updateOrder) throws java.lang.Exception
AdminOrderMgrIf
updateOrder
in interface AdminOrderMgrIf
orderId
- the order idorderStatus
- the new Order Statuscomments
- if not null, these comments are addednotifyCustomer
- if true the customer will be notified by emailupdateOrder
- contains order update data such as who updated the order
java.lang.Exception
public void updateOrderStatus(int orderId, int orderStatus, java.lang.String comments, boolean notifyCustomer) throws java.lang.Exception
updateOrderStatus
in interface AdminOrderMgrIf
orderId
- the order idorderStatus
- the new Order Statuscomments
- if not null, these comments are addednotifyCustomer
- if true the customer will be notified by email
java.lang.Exception
protected AdminOrderIntegrationMgrInterface getAdminOrderIntegrationMgr()
protected AdminOrderIntegrationMgrInterface getAdminOrderIntegMgrInstanceByName(java.lang.String className) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException
className
-
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.reflect.InvocationTargetException
java.lang.IllegalArgumentException
public AdminOrder getOrderForOrderId(int orderId) throws java.lang.Exception
getOrderForOrderId
in interface AdminOrderMgrIf
orderId
-
java.lang.Exception
public AdminOrder getOrderForOrderId(int orderId, int languageId) throws java.lang.Exception
getOrderForOrderId
in interface AdminOrderMgrIf
orderId
- languageId
-
java.lang.Exception
protected java.lang.String getEncryptionKey(int orderId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
orderId
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
protected boolean doesOrderStatusExist(int status) throws org.apache.torque.TorqueException, KKAdminException
status
-
org.apache.torque.TorqueException
KKAdminException
protected void formatOrderAddresses(AdminOrder order) throws java.lang.Exception
order
-
java.lang.Exception
protected void getStatusTrail(AdminOrder order, int languageId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
order
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
protected void getOrderCountryAndZone(AdminOrder order) throws java.lang.Exception
java.lang.Exception
public AdminOrderStatusName[] getAllOrderStatuses(int languageId) throws java.lang.Exception
getAllOrderStatuses
in interface AdminOrderMgrIf
languageId
-
java.lang.Exception
protected void addOrdersOrderBy(com.konakart.bl.KKCriteria c, AdminOrderSearch orderSearch)
protected int addOrderSearchCriteria(com.konakart.bl.KKCriteria c, AdminOrderSearch orderSearch)
protected void setCriteriaWithJoinsLite(com.konakart.bl.KKCriteria c, int languageId)
c
- Criteria to add tolanguageId
- the language Idprotected void setCriteriaWithStandardAttributesLite(com.konakart.bl.KKCriteria c, int languageId)
c
- protected void setCriteriaForEncyptionCols(com.konakart.bl.KKCriteria c)
c
- protected void setCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c, int languageId)
c
- public void calculateTotals(int scale, int taxQuantityRule, AdminOrderProduct orderProduct)
calculateTotals
in interface AdminOrderMgrIf
scale
- The scale used in the calculationstaxQuantityRule
- The tax calculation rule to useorderProduct
- public int deleteOrder(int ordId) throws KKAdminException
Removes records from :
deleteOrder
in interface AdminOrderMgrIf
ordId
- Order id of the order to delete
KKAdminException
public AdminOrderStatusNameSearchResult getOrderStatusNames(AdminOrderStatusNameSearch search) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
getOrderStatusNames
in interface AdminOrderMgrIf
search
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
public int deleteOrderStatusName(int ordStatId) throws KKAdminException
deleteOrderStatusName
in interface AdminOrderMgrIf
ordStatId
- An OrderStatusName id
KKAdminException
public int insertOrderStatusName(AdminOrderStatusName ordStat) throws KKAdminException
insertOrderStatusName
in interface AdminOrderMgrIf
ordStat
- An AdminOrderStatusName object
KKAdminException
public int insertOrderStatusNames(AdminOrderStatusName[] ordStats) throws KKAdminException
insertOrderStatusNames
in interface AdminOrderMgrIf
ordStats
- An AdminOrderStatusName array object
KKAdminException
public int updateOrderStatusName(AdminOrderStatusName ordStat) throws KKAdminException
updateOrderStatusName
in interface AdminOrderMgrIf
ordStat
- An AdminOrderStatusName object
KKAdminException
public boolean doesOrderStatusExist(int ordStatId, int langId) throws org.apache.torque.TorqueException, KKAdminException
doesOrderStatusExist
in interface AdminOrderMgrIf
ordStatId
- the order status IdlangId
- the language Id
org.apache.torque.TorqueException
KKAdminException
protected void addOrderStatusOrderBy(com.konakart.bl.KKCriteria c, AdminOrderStatusNameSearch search)
protected int addOrderStatusSearchCriteria(com.konakart.bl.KKCriteria c, AdminOrderStatusNameSearch search)
public AdminIpnHistories searchForIpnHistory(AdminDataDescriptor dataDesc, AdminIpnSearch ipnSearch) throws java.lang.Exception
AdminOrderMgrIf
searchForIpnHistory
in interface AdminOrderMgrIf
dataDesc
- ipnSearch
-
java.lang.Exception
public int insertOrderReturn(AdminOrderReturn orderRet) throws java.lang.Exception
insertOrderReturn
in interface AdminOrderMgrIf
orderRet
-
java.lang.Exception
public void editOrderReturn(AdminOrderReturn orderRet) throws java.lang.Exception
editOrderReturn
in interface AdminOrderMgrIf
orderRet
-
java.lang.Exception
public void deleteOrderReturn(int orderRetId) throws java.lang.Exception
deleteOrderReturn
in interface AdminOrderMgrIf
orderRetId
-
java.lang.Exception
protected void addOrderReturnsToOrder(AdminOrder order) throws KKAdminException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
order
-
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKAdminException
public AdminOrderReturnSearchResult getOrderReturns(AdminOrderReturnSearch retSearch, int offset, int size) throws KKAdminException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
AdminOrderMgrIf
getOrderReturns
in interface AdminOrderMgrIf
retSearch
- offset
- size
-
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
protected int getReturnsCount(com.konakart.bl.KKCriteria c) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
c
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
public void editOrder(AdminOrder order) throws java.lang.Exception
updateOrderStatus()
.
The attributes that can be modified are:
editOrder
in interface AdminOrderMgrIf
order
-
java.lang.Exception
public void setCreditCardDetailsOnOrder(AdminCreditCard creditCard) throws java.lang.Exception, KKAdminException
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:
setCreditCardDetailsOnOrder
in interface AdminOrderMgrIf
creditCard
- the AdminCreditCard object
java.lang.Exception
KKAdminException
public AdminCreditCard encryptCreditCard(AdminCreditCard creditCard, java.lang.String ek) throws KKAdminException
encryptCreditCard
in interface AdminOrderMgrIf
creditCard
- the original credit card objectek
- the encryption key
KKAdminException
protected boolean doesOrderExist(int orderId) throws org.apache.torque.TorqueException
orderId
-
org.apache.torque.TorqueException
public int insertIpnHistory(AdminIpnHistory ipnHistory) throws java.lang.Exception
insertIpnHistory
in interface AdminOrderMgrIf
ipnHistory
-
java.lang.Exception
public int insertOrder(AdminOrder order) throws java.lang.Exception
insertOrder
in interface AdminOrderMgrIf
order
-
java.lang.Exception
public boolean isSaveCreditCardDetails()
AdminOrderMgrIf
isSaveCreditCardDetails
in interface AdminOrderMgrIf
public com.konakart.app.ExportOrderResponse exportOrder(com.konakart.app.ExportOrderOptions options) throws KKAdminException
AdminOrderMgrIf
exportOrder
in interface AdminOrderMgrIf
options
- Defines the options to use for the export of the Order
KKAdminException
public com.konakart.app.ExportOrderResponse exportOrderToXmlString(com.konakart.app.ExportOrderOptions options) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, java.lang.Exception
options
- export options in ExportOrderOptions
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.lang.Exception
public com.konakart.app.ExportOrderResponse exportOrderToXml(com.konakart.app.ExportOrderOptions options) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, java.lang.Exception
options
- export options in ExportOrderOptions
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.lang.Exception
public AdminOrder getOrderForExport(int orderId) throws KKAdminException
orderId
- id of the order to retrieve
KKAdminException
- if the order does not exist or there are other more serious problemspublic com.konakart.app.ExportOrderResponse exportOrderByShippingModule(com.konakart.app.ExportOrderOptions options) throws KKAdminException
options
- export options in ExportOrderOptions
KKAdminException
public void refreshConfigs() throws java.lang.Exception
refreshConfigs
in interface AdminOrderMgrIf
refreshConfigs
in class AdminBaseMgr
java.lang.Exception
public void setRewardPointReservationId(int orderId, int reservationId) throws java.lang.Exception
orderId
.
setRewardPointReservationId
in interface AdminOrderMgrIf
orderId
- reservationId
-
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |