com.konakartadmin.bl
Class AdminOrderIntegrationMgr

java.lang.Object
  extended by com.konakartadmin.bl.AdminBaseMgr
      extended by com.konakartadmin.bl.AdminOrderIntegrationMgr
All Implemented Interfaces:
AdminOrderIntegrationMgrInterface

public class AdminOrderIntegrationMgr
extends AdminBaseMgr
implements AdminOrderIntegrationMgrInterface

A default implementation of the AdminOrderIntegrationMgrInterface


Nested Class Summary
 
Nested classes/interfaces inherited from class com.konakartadmin.bl.AdminBaseMgr
AdminBaseMgr.StaticData
 
Field Summary
protected static org.apache.commons.logging.Log log
          the log
 
Fields inherited from class com.konakartadmin.bl.AdminBaseMgr
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir
 
Constructor Summary
AdminOrderIntegrationMgr(KKAdminIf eng)
          Constructor
 
Method Summary
 void changeOrderStatus(int orderId, int currentStatus, int newStatus)
          Called just after an order status change
protected  void createInvoice(int orderId)
          Creates the PDF invoice using the AdminPdfMgr if the code is present.
private  com.konakart.appif.ExportOrderResponseIf createOrderExportForShipping(int orderId)
          Creates an Order Export file for the order.
private  com.konakart.appif.ExportOrderResponseIf createXmlOrderExport(int orderId)
          Creates an XML Order Export file for the order.
private  java.lang.String getCouponCode()
          Method returns a random coupon code.
private  java.lang.String getGiftCertificateFilePath(AdminOrderProduct op, java.lang.String couponCode)
          Creates and returns the path of the file that contains the code of the gift certificate that can be downloaded.
private  void manageBookings(int orderId)
          We get the order from the database and check whether any of the ordered products are bookable products.
protected  void manageDigitalDownloads(int orderId)
          We get the order from the database and check whether any of the ordered products are digital downloads.
private  void manageGiftCertificates(int orderId)
          We get the order from the database and check whether any of the ordered products are gift certificates.
private  void manageGiftRegistries(int orderId)
          We get the order from the database and check whether any of the ordered products were ordered from a gift registry.
private  void manageRewardPoints(int orderId)
          We get the order from the database, and depending on the state of the order, reward points are assigned to the customer and / or removed from the customer's total.
private  void manageTaxCloud(int orderId)
          The order details are sent to the tax cloud tax service.
private  void postOrderToQueue(int orderId)
          Posts the order to the Order Message Queue
 
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, refreshConfigs, 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

Constructor Detail

AdminOrderIntegrationMgr

public AdminOrderIntegrationMgr(KKAdminIf eng)
                         throws java.lang.Exception
Constructor

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

changeOrderStatus

public void changeOrderStatus(int orderId,
                              int currentStatus,
                              int newStatus)
Description copied from interface: AdminOrderIntegrationMgrInterface
Called just after an order status change

Specified by:
changeOrderStatus in interface AdminOrderIntegrationMgrInterface

createInvoice

protected void createInvoice(int orderId)
Creates the PDF invoice using the AdminPdfMgr if the code is present.

Parameters:
orderId -

manageDigitalDownloads

protected void manageDigitalDownloads(int orderId)
We get the order from the database and check whether any of the ordered products are digital downloads. For each digital download product we insert a DigitalDownload object in the DB. This is read by the application in order to provide the download link for the customer. The status of the order is modified if DigitalDownloads exist.

Parameters:
orderId -

manageGiftRegistries

private void manageGiftRegistries(int orderId)
We get the order from the database and check whether any of the ordered products were ordered from a gift registry. If they were, we have to update the gift registry item (wish list item) quantity received attribute to reflect how many items have been received.

Parameters:
orderId -

manageGiftCertificates

private void manageGiftCertificates(int orderId)
We get the order from the database and check whether any of the ordered products are gift certificates. If they are we need to process them:
  1. Find the promotion attached to the gift certificate
  2. Create a coupon code
  3. Create a coupon with the new code
  4. Attach the coupon to the promotion
  5. Insert the coupon code into a downloadable product that can be downloaded by the customer. This becomes the gift certificate that the customer can forward on to the receiver of the gift.

Parameters:
orderId -

getGiftCertificateFilePath

private java.lang.String getGiftCertificateFilePath(AdminOrderProduct op,
                                                    java.lang.String couponCode)
                                             throws java.io.IOException
Creates and returns the path of the file that contains the code of the gift certificate that can be downloaded. This example creates a simple text file. For your store you may want to create a stylish pdf document or an HTML file that the customer can download and send on.

Parameters:
op -
couponCode -
Returns:
Return the file path of the file containing the certificate code
Throws:
java.io.IOException

getCouponCode

private java.lang.String getCouponCode()
Method returns a random coupon code. You may change this code to implement a different algorithm or to call out to an external system.

Returns:
Returns the coupon code

manageRewardPoints

private void manageRewardPoints(int orderId)
We get the order from the database, and depending on the state of the order, reward points are assigned to the customer and / or removed from the customer's total. The language for the description of the reward point transaction may be determined by the locale attribute of the order.

Parameters:
orderId -

createOrderExportForShipping

private com.konakart.appif.ExportOrderResponseIf createOrderExportForShipping(int orderId)
Creates an Order Export file for the order.

Typically this would be used to create an import file for the purposes of integrating KonaKart with a 3rd Party system such as UPS WorldShip

Parameters:
orderId -
Returns:
a ExportOrderResponse object which can be null if the export was unsuccessful

createXmlOrderExport

private com.konakart.appif.ExportOrderResponseIf createXmlOrderExport(int orderId)
Creates an XML Order Export file for the order.

Parameters:
orderId -
Returns:
a ExportOrderResponse object which can be null if the export was unsuccessful

postOrderToQueue

private void postOrderToQueue(int orderId)
Posts the order to the Order Message Queue

Parameters:
orderId - the id of the order to post to the Message Queue

manageTaxCloud

private void manageTaxCloud(int orderId)
The order details are sent to the tax cloud tax service.

Parameters:
orderId -

manageBookings

private void manageBookings(int orderId)
We get the order from the database and check whether any of the ordered products are bookable products. For each bookable product we insert a Booking object in the DB. At the moment we assume that the name of the person in the Booking object is the name of the customer. For the case where a customer may make multiple bookings providing the names of the people, these names will have to be encoded into a custom field of the order product and read from the custom field in this method, so that a Booking object may be inserted for each person.

Parameters:
orderId -


Copyright © 2011 DS Data Systems UK Ltd.