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
 void afterInsertSubscription(SubscriptionIf subscription)
          Called after a Subscription object has been saved in the database.
 void afterUpdateSubscription(SubscriptionIf subscription)
          Called after a Subscription object has been updated in the database.
 SubscriptionIf beforeInsertSubscription(SubscriptionIf subscription)
          Called just before a subscription is inserted.
 OrderIf beforeSaveOrder(OrderIf order)
          Called just before an order is saved.
 SubscriptionIf beforeUpdateSubscription(SubscriptionIf subscription)
          Called just before a subscription is updated.
 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, executeQuery, executeQuery, getAdminEngMgr, getBasketMgr, getBillingMgr, getBookableProductMgr, getCatMgr, getConfigMgr, getCookieMgr, getCurrMgr, getCustMgr, getCustomerIdFromSession, getCustomerStatsMgr, getCustomerTagMgr, getEmailMgr, getEng, getLangMgr, getManuMgr, getMiscItemMgr, getMode, getModeString, getMqMgr, getMultiStoreMgr, getNewCriteria, getNewCriteria, getOrderIntegrationMgr, getOrderMgr, getOrderTotalMgr, getPaymentMgr, getProdMgr, getPromMgr, getPunchOutMgr, getRewardPointMgr, getSecMgr, getShippingMgr, getSolrMgr, getStoreId, getTaxMgr, getTemplate, getTemplateRoot, getVelocityContextMgr, getWishListMgr, init, isDeadlockException, isEnterprise, isMultiStoreShareCategories, 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 is 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.

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

beforeInsertSubscription

public SubscriptionIf beforeInsertSubscription(SubscriptionIf subscription)
                                        throws java.lang.Exception
Called just before a subscription is inserted. This method gives the opportunity to modify any detail of the subscription before it is inserted. If null is returned, then no action is taken. If a non null subscription is returned, then this is the subscription that will be saved.

Specified by:
beforeInsertSubscription in interface OrderIntegrationMgrInterface
Parameters:
subscription -
Returns:
Returns a Subscription
Throws:
java.lang.Exception

afterInsertSubscription

public void afterInsertSubscription(SubscriptionIf subscription)
                             throws java.lang.Exception
Called after a Subscription object has been saved in the database. The id of the object has a valid value.

Specified by:
afterInsertSubscription in interface OrderIntegrationMgrInterface
Parameters:
subscription -
Throws:
java.lang.Exception

beforeUpdateSubscription

public SubscriptionIf beforeUpdateSubscription(SubscriptionIf subscription)
                                        throws java.lang.Exception
Called just before a subscription is updated. This method gives the opportunity to modify any detail of the subscription before it is updated. If null is returned, then no action is taken. If a non null subscription is returned, then this is the subscription that will be saved.

Specified by:
beforeUpdateSubscription in interface OrderIntegrationMgrInterface
Parameters:
subscription -
Returns:
Returns a Subscription
Throws:
java.lang.Exception

afterUpdateSubscription

public void afterUpdateSubscription(SubscriptionIf subscription)
                             throws java.lang.Exception
Called after a Subscription object has been updated in the database.

Specified by:
afterUpdateSubscription in interface OrderIntegrationMgrInterface
Parameters:
subscription -
Throws:
java.lang.Exception

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.