com.konakart.bl
Class OrderIntegrationMgr

java.lang.Object
  extended by com.konakart.bl.BaseMgr
      extended by com.konakart.bl.OrderIntegrationMgr
All Implemented Interfaces:
OrderIntegrationMgrInterface

public class OrderIntegrationMgr
extends BaseMgr
implements OrderIntegrationMgrInterface

Used to provide integration points when orders are saved and when the status of an order is changed.


Field Summary
protected static org.apache.commons.logging.Log log
          the log
 
Fields inherited from class com.konakart.bl.BaseMgr
templateBaseDir
 
Constructor Summary
OrderIntegrationMgr(KKEngIf eng)
          Constructor
 
Method Summary
 OrderIf beforeSaveOrder(OrderIf order)
          Called just before an order has been saved.
 void changeOrderStatus(int orderId, int currentStatus, int newStatus)
          Called whenever the status of an order is changed.
 PdfResult createInvoice(OrderIf order)
          Creates the PDF invoice using the AdminPdfMgr if the code is present.
 java.lang.String createOrderNumber(OrderIf order)
          This method allows you to introduce a proprietary algorithm for creating the order number for an order just before the order is saved.
 java.lang.String createTrackingNumber(OrderIf order)
          This method allows you to generate a tracking number for an order just before the order is saved.
 void saveOrder(OrderIf order)
          Called whenever an order is saved.
 
Methods inherited from class com.konakart.bl.BaseMgr
addInsertAttr, addInsertAttr, checkRequired, getAdminEngMgr, getBasketMgr, getBillingMgr, getBookableProductMgr, getCatMgr, getConfigMgr, getCookieMgr, getCurrMgr, getCustMgr, getCustomerIdFromSession, getCustomerStatsMgr, getCustomerTagMgr, getEmailMgr, getEng, getLangMgr, getManuMgr, getMiscItemMgr, getMode, getModeString, getMqMgr, getMultiStoreMgr, getNewCriteria, getNewCriteria, getOrderMgr, getOrderTotalMgr, getPaymentMgr, getProdMgr, getPromMgr, getRewardPointMgr, getSecMgr, getShippingMgr, getSolrMgr, getStoreId, getTaxMgr, getTemplate, getTemplateRoot, getVelocityContextMgr, getWishListMgr, init, isEnterprise, isMultiStoreShareCustomers, isMultiStoreShareProducts
 
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

Constructor Detail

OrderIntegrationMgr

public OrderIntegrationMgr(KKEngIf eng)
                    throws java.lang.Exception
Constructor

Parameters:
eng -
Throws:
java.lang.Exception
Method Detail

beforeSaveOrder

public OrderIf beforeSaveOrder(OrderIf order)
Called just before an order has been saved. This method gives the opportunity to modify any detail of the order before it is saved. If null is returned, then no action is taken. If a non null Order is returned, then this is the order that will be saved. The method can also be used to save credit card details temporarily in memory so that they can be passed to the manageSubscriptions() method but not saved in the database. i.e. They can be read from the order at this point and stored in a temporary object before removing the sensitive data from the order so that it doesn't get saved.

Specified by:
beforeSaveOrder in interface OrderIntegrationMgrInterface
Parameters:
order -
Returns:
Returns an order object which will be saved

saveOrder

public void saveOrder(OrderIf order)
Called whenever an order is saved. In order to improve performance, you may comment out API calls from this method if the relative functionality isn't being used. i.e. comment out manageRewardPoints() if reward points aren't being used.

Specified by:
saveOrder in interface OrderIntegrationMgrInterface

changeOrderStatus

public void changeOrderStatus(int orderId,
                              int currentStatus,
                              int newStatus)
Called whenever the status of an order is changed. In order to improve performance, you may comment out API calls from this method if the relative functionality isn't being used. i.e. comment out manageRewardPoints() if reward points aren't being used. If all calls are commented out, then you should also comment out the API call to get the order.

Specified by:
changeOrderStatus in interface OrderIntegrationMgrInterface

createInvoice

public PdfResult createInvoice(OrderIf order)
Creates the PDF invoice using the AdminPdfMgr if the code is present. This is normally available only for the enterprise version of KonaKart.

The order record is updated in the database with the invoice_filename if the invoice is created successfully.

Parameters:
order -
Returns:
a PdfResult object which can be null if the invoice cold not be created

createOrderNumber

public java.lang.String createOrderNumber(OrderIf order)
                                   throws java.lang.Exception
This method allows you to introduce a proprietary algorithm for creating the order number for an order just before the order is saved. It is called by the saveOrder() method. The value returned by this method populates the orderNumber attribute of the order when it is saved.

If a null value is returned, then the order number of the order is left unchanged.
If an exception is thrown, the exception will be also thrown by the saveOrder() method and the order will not be saved.

Specified by:
createOrderNumber in interface OrderIntegrationMgrInterface
Parameters:
order -
Returns:
Return the order number for the new order
Throws:
java.lang.Exception

createTrackingNumber

public java.lang.String createTrackingNumber(OrderIf order)
                                      throws java.lang.Exception
This method allows you to generate a tracking number for an order just before the order is saved. It is called by the saveOrder() method. The value returned by this method populates the trackingNumber attribute of the order when it is saved.
If a null value is returned, then the tracking number of the order is left unchanged.
If an exception is thrown, the exception will be also thrown by the saveOrder() method and the order will not be saved.

Specified by:
createTrackingNumber in interface OrderIntegrationMgrInterface
Parameters:
order -
Returns:
Return the tracking number for the new order
Throws:
java.lang.Exception


Copyright © 2011 DS Data Systems UK Ltd.