com.konakartadmin.modules
Class ShippingModule

java.lang.Object
  extended by com.konakartadmin.modules.Module
      extended by com.konakartadmin.modules.ShippingModule
All Implemented Interfaces:
ModuleInterface, ShippingModuleInterface
Direct Known Subclasses:
DigitalDownload, Fedex, Flat, Free, FreeProduct, Item, PickUpInStore, Table, Ups, Usps, Uspsint, Zones

public class ShippingModule
extends Module
implements ShippingModuleInterface

Implements the ShippingModule interface


Field Summary
private static java.lang.String classPrefix
           
 
Fields inherited from class com.konakartadmin.modules.Module
configKeyStub, configs, implementationFileName, keys, log
 
Fields inherited from interface com.konakartadmin.modules.ModuleInterface
MODULE_SUB_TYPE_PROMOTION, MODULE_TYPE_ORDER_TOTAL, MODULE_TYPE_OTHER, MODULE_TYPE_PAYMENT, MODULE_TYPE_SHIPPING
 
Constructor Summary
ShippingModule()
          Constructor
 
Method Summary
 com.konakart.app.ExportOrderResponse exportOrderForShipping(AdminOrder order, com.konakart.app.ExportOrderOptions options, KKAdminIf adminEng)
          Export the order for shipping.
protected  AdminOrderMgrIf getAdminOrderMgr(KKAdminIf adminEng)
          Retrieve a new AndminOrderMgr object
 java.lang.String getClassPrefix()
           
 java.lang.String getConfigKeyStub()
           
protected  java.lang.String getConfigVariable(KKAdminIf adminEng, java.lang.String key)
          Retrieve the value of the configuration variable with the specified key
 int getModuleType()
           
protected  java.lang.String getOrderExportBase(KKAdminIf adminEng)
          Retrieve the base directory for the exported orders.
protected  java.math.BigDecimal getWeightOfOrder(AdminOrder order)
          Calculate the total weight of the order
 java.lang.String toString()
           
 
Methods inherited from class com.konakartadmin.modules.Module
getConfigs, getImplementationFileName, getKeys, getModuleCode, getModuleSubType, getModuleTitle, getMsgs, init, install, installed, remove, setConfigKeyStub, setConfigs, setImplementationFileName, setKeys, setMsgs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.konakartadmin.modules.ModuleInterface
getConfigs, getImplementationFileName, getKeys, getModuleCode, getModuleSubType, getModuleTitle, init, install, installed, remove, setConfigKeyStub
 

Field Detail

classPrefix

private static java.lang.String classPrefix
Constructor Detail

ShippingModule

public ShippingModule()
Constructor

Method Detail

getClassPrefix

public java.lang.String getClassPrefix()
Specified by:
getClassPrefix in interface ModuleInterface
Overrides:
getClassPrefix in class Module
Returns:
the class prefix

getModuleType

public int getModuleType()
Specified by:
getModuleType in interface ModuleInterface
Overrides:
getModuleType in class Module
Returns:
the module type

getConfigKeyStub

public java.lang.String getConfigKeyStub()
Specified by:
getConfigKeyStub in interface ModuleInterface
Overrides:
getConfigKeyStub in class Module
Returns:
the config key stub

toString

public java.lang.String toString()
Specified by:
toString in interface ModuleInterface
Overrides:
toString in class java.lang.Object
Returns:
a string representing the module - for diagnostics

exportOrderForShipping

public com.konakart.app.ExportOrderResponse exportOrderForShipping(AdminOrder order,
                                                                   com.konakart.app.ExportOrderOptions options,
                                                                   KKAdminIf adminEng)
                                                            throws KKAdminException
Description copied from interface: ShippingModuleInterface
Export the order for shipping. This is typically used to create a file that is imported into a 3rd Party shipping application. The format of the file to import will (could?) be different for each shipping system so there is an implementation for each shipping module.

Specified by:
exportOrderForShipping in interface ShippingModuleInterface
Parameters:
order - AdminOrder object to export for shipping
options - Defines the options to use for the export of the Order
adminEng - A KKAdmin engine which may be useful for accessing configuration variables etc.
Returns:
an ExportOrderResponse object to indicate the result
Throws:
KKAdminException

getWeightOfOrder

protected java.math.BigDecimal getWeightOfOrder(AdminOrder order)
Calculate the total weight of the order

Parameters:
order - the Order
Returns:
the weight of the order in the units of the store
Throws:
KKAdminException

getOrderExportBase

protected java.lang.String getOrderExportBase(KKAdminIf adminEng)
                                       throws KKAdminException
Retrieve the base directory for the exported orders. Create it if it doesn't already exist.

Parameters:
adminEng - the admin engine
Returns:
the order export base directory as a String... the storeId and order export mode of KKConstants.EXP_ORDER_BY_SHIPPING_MODULE are added to the "EXPORT_ORDERS_BASE_DIRECTORY" configuration variable followed by always ending with a file separator. Hence the return String is:

EXPORT_ORDERS_BASE_DIRECTORY/storeId/KKConstants.EXP_ORDER_BY_SHIPPING_MODULE/code

Throws:
KKAdminException - when there are problems accessing the configuration variable

getConfigVariable

protected java.lang.String getConfigVariable(KKAdminIf adminEng,
                                             java.lang.String key)
                                      throws KKAdminException
Retrieve the value of the configuration variable with the specified key

Parameters:
adminEng - the admin engine
Returns:
the Configuration valriable as a String
Throws:
KKAdminException - when there are problems accessing the configuration variable

getAdminOrderMgr

protected AdminOrderMgrIf getAdminOrderMgr(KKAdminIf adminEng)
                                    throws KKAdminException
Retrieve a new AndminOrderMgr object

Parameters:
adminEng - the admin engine
Returns:
an AdminOrderMgr object
Throws:
KKAdminException - when there are problems creating an AdminOrderMgr object


Copyright © 2011 DS Data Systems UK Ltd.