com.konakartadmin.bl
Class AdminModulesMgr

java.lang.Object
  extended by com.konakartadmin.bl.AdminBaseMgr
      extended by com.konakartadmin.bl.AdminModulesMgr
All Implemented Interfaces:
AdminModulesMgrIf

public class AdminModulesMgr
extends AdminBaseMgr
implements AdminModulesMgrIf

Manages the add-on-modules... currently three types: Payment, Order Total and Shipping


Nested Class Summary
protected  class AdminModulesMgr.StaticData
          Used to store the static data of this manager
 
Field Summary
protected static org.apache.commons.logging.Log log
           
protected static java.lang.String mutex
           
protected static java.util.Map<java.lang.String,AdminModulesMgr.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
AdminModulesMgr(KKAdminIf eng)
          Constructor
 
Method Summary
 com.konakart.app.NameValue[] callPaymentModule(java.lang.String moduleClassName, com.konakart.app.PaymentOptions options)
          This method is used to call a payment module from the Admin App.
 void fetchModules()
          Initialise the modules - regardless of the setting of initDone
protected  ModuleInterface getModuleInstanceByName(java.lang.String moduleName)
          Called to instantiate a module.
 KKModule[] getModules(int moduleType)
          Returns an array of Module objects for the module type specified
 int getNumOrderTotalModules()
          Returns the number of Order Total modules that can be set up
 int getNumOtherModules()
          Returns the number of Other modules that can be set up
 int getNumPaymentModules()
          Returns the number of payment modules that can be set up
 int getNumShippingModules()
          Returns the number of shipping modules that can be set up
 OrderTotalModule[] getOrderTotalModules()
          Returns an array of Order Total Modules
 OtherModule[] getOtherModules()
          Returns an array of Other Modules
protected  AdminPaymentIf getPaymentModuleForName(java.lang.String moduleClassName)
          Called to instantiate a payment module.
 PaymentModule[] getPaymentModules()
          Returns an array of payment modules
 ShippingModuleInterface getShippingModuleByCode(java.lang.String code)
          Get a ShippingModuleInterface with the specified code
 ShippingModule[] getShippingModules()
          Returns an array of Shipping Modules
private  AdminModulesMgr.StaticData getStaticDataForStore()
           
 void init()
          Initialise the modules - if not already initialised
protected  ModuleInterface[] loadModules(java.lang.String classesStr, int moduleType)
          Load up the modules identified in the classesStr.
 void refreshConfigs()
          Refresh the configuration of the Admin Currency Manager
 void setNumOrderTotalModules(int numOrderTotalModules)
          Set the number of modules that can be set up
 void setNumOtherModules(int numOtherModules)
          Set the number of Other modules that can be set up
 void setNumPaymentModules(int numberPaymentModules)
          Set the number of modules that can be set up
 void setNumShippingModules(int numShippingModules)
          Set the number of modules that can be set up
 void setOrderTotalModules(OrderTotalModule[] orderTotalModules)
          *Sets an array of Order Total modules
 void setOtherModules(OtherModule[] otherModules)
          Sets an array of Other modules
 void setPaymentModules(PaymentModule[] paymentModules)
          Sets an array of payment modules
 void setShippingModules(ShippingModule[] shippingModules)
          Sets an array of Shipping modules
 
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, 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

mutex

protected static java.lang.String mutex

staticDataHM

protected static java.util.Map<java.lang.String,AdminModulesMgr.StaticData> staticDataHM
Hash Map that contains the static data

Constructor Detail

AdminModulesMgr

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

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

init

public void init()
          throws KKAdminException
Initialise the modules - if not already initialised

Specified by:
init in interface AdminModulesMgrIf
Throws:
KKAdminException

fetchModules

public void fetchModules()
                  throws KKAdminException
Initialise the modules - regardless of the setting of initDone

Specified by:
fetchModules in interface AdminModulesMgrIf
Throws:
KKAdminException

loadModules

protected ModuleInterface[] loadModules(java.lang.String classesStr,
                                        int moduleType)
                                 throws KKAdminException
Load up the modules identified in the classesStr.

Parameters:
classesStr -
moduleType - the type of module
Returns:
the module interface array
Throws:
KKAdminException

getModuleInstanceByName

protected ModuleInterface getModuleInstanceByName(java.lang.String moduleName)
                                           throws java.lang.InstantiationException,
                                                  java.lang.IllegalAccessException,
                                                  java.lang.ClassNotFoundException,
                                                  java.lang.IllegalArgumentException,
                                                  java.lang.reflect.InvocationTargetException
Called to instantiate a module. It determines whether the module has a constructor where KKAdmin is passed in and if it does, then this constructor is used. Otherwise the empty constructor is used.

Parameters:
moduleName -
Returns:
Returns an instantiated Module
Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.reflect.InvocationTargetException
java.lang.IllegalArgumentException

getModules

public KKModule[] getModules(int moduleType)
                      throws com.konakart.app.KKException,
                             KKAdminException
Returns an array of Module objects for the module type specified

Specified by:
getModules in interface AdminModulesMgrIf
Parameters:
moduleType - the module type
Returns:
Array of Module objects
Throws:
com.konakart.app.KKException
KKAdminException

getShippingModuleByCode

public ShippingModuleInterface getShippingModuleByCode(java.lang.String code)
Get a ShippingModuleInterface with the specified code

Specified by:
getShippingModuleByCode in interface AdminModulesMgrIf
Parameters:
code - the code for the Shipping Module
Returns:
the ShippingModule or null if it isn't found

callPaymentModule

public com.konakart.app.NameValue[] callPaymentModule(java.lang.String moduleClassName,
                                                      com.konakart.app.PaymentOptions options)
                                               throws java.lang.Exception
Description copied from interface: AdminModulesMgrIf
This method is used to call a payment module from the Admin App. The payment module which must implement the com.konakartadmin.modules.AdminPaymentIf interface, is instantiated and the execute method is called.

Specified by:
callPaymentModule in interface AdminModulesMgrIf
Parameters:
moduleClassName - The full class name such as com.konakartadmin.modules.payment.authorizenet.AdminPayment
options - An object containing all of the parameters required for the transaction
Returns:
Returns an array of name value pairs
Throws:
java.lang.Exception

getPaymentModuleForName

protected AdminPaymentIf getPaymentModuleForName(java.lang.String moduleClassName)
                                          throws java.lang.IllegalArgumentException,
                                                 java.lang.InstantiationException,
                                                 java.lang.IllegalAccessException,
                                                 java.lang.reflect.InvocationTargetException,
                                                 java.lang.ClassNotFoundException
Called to instantiate a payment module. It determines whether the module has a constructor where KKAdminEng is passed in and if it does, then this constructor is used. Otherwise the empty constructor is used.

Parameters:
moduleClassName -
Returns:
Returns an instantiated Payment Module
Throws:
java.lang.IllegalArgumentException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.ClassNotFoundException

getStaticDataForStore

private AdminModulesMgr.StaticData getStaticDataForStore()

getNumOrderTotalModules

public int getNumOrderTotalModules()
Description copied from interface: AdminModulesMgrIf
Returns the number of Order Total modules that can be set up

Specified by:
getNumOrderTotalModules in interface AdminModulesMgrIf
Returns:
the numOrderTotalModules

getNumPaymentModules

public int getNumPaymentModules()
Description copied from interface: AdminModulesMgrIf
Returns the number of payment modules that can be set up

Specified by:
getNumPaymentModules in interface AdminModulesMgrIf
Returns:
Returns the number of payment modules that can be set up

getNumShippingModules

public int getNumShippingModules()
Description copied from interface: AdminModulesMgrIf
Returns the number of shipping modules that can be set up

Specified by:
getNumShippingModules in interface AdminModulesMgrIf
Returns:
the numShippingModules

getNumOtherModules

public int getNumOtherModules()
Description copied from interface: AdminModulesMgrIf
Returns the number of Other modules that can be set up

Specified by:
getNumOtherModules in interface AdminModulesMgrIf
Returns:
the numOtherModules

getOrderTotalModules

public OrderTotalModule[] getOrderTotalModules()
Description copied from interface: AdminModulesMgrIf
Returns an array of Order Total Modules

Specified by:
getOrderTotalModules in interface AdminModulesMgrIf
Returns:
the orderTotalModules

getOtherModules

public OtherModule[] getOtherModules()
Description copied from interface: AdminModulesMgrIf
Returns an array of Other Modules

Specified by:
getOtherModules in interface AdminModulesMgrIf
Returns:
the OtherModules

getPaymentModules

public PaymentModule[] getPaymentModules()
Description copied from interface: AdminModulesMgrIf
Returns an array of payment modules

Specified by:
getPaymentModules in interface AdminModulesMgrIf
Returns:
the paymentModules

getShippingModules

public ShippingModule[] getShippingModules()
Description copied from interface: AdminModulesMgrIf
Returns an array of Shipping Modules

Specified by:
getShippingModules in interface AdminModulesMgrIf
Returns:
the shippingModules

setNumOrderTotalModules

public void setNumOrderTotalModules(int numOrderTotalModules)
Description copied from interface: AdminModulesMgrIf
Set the number of modules that can be set up

Specified by:
setNumOrderTotalModules in interface AdminModulesMgrIf
Parameters:
numOrderTotalModules - the numOrderTotalModules to set

setNumPaymentModules

public void setNumPaymentModules(int numberPaymentModules)
Description copied from interface: AdminModulesMgrIf
Set the number of modules that can be set up

Specified by:
setNumPaymentModules in interface AdminModulesMgrIf
Parameters:
numberPaymentModules - set the number of modules that can be set up

setNumShippingModules

public void setNumShippingModules(int numShippingModules)
Description copied from interface: AdminModulesMgrIf
Set the number of modules that can be set up

Specified by:
setNumShippingModules in interface AdminModulesMgrIf
Parameters:
numShippingModules - the numShippingModules to set

setNumOtherModules

public void setNumOtherModules(int numOtherModules)
Description copied from interface: AdminModulesMgrIf
Set the number of Other modules that can be set up

Specified by:
setNumOtherModules in interface AdminModulesMgrIf

setOrderTotalModules

public void setOrderTotalModules(OrderTotalModule[] orderTotalModules)
Description copied from interface: AdminModulesMgrIf
*Sets an array of Order Total modules

Specified by:
setOrderTotalModules in interface AdminModulesMgrIf
Parameters:
orderTotalModules - the orderTotalModules to set

setPaymentModules

public void setPaymentModules(PaymentModule[] paymentModules)
Description copied from interface: AdminModulesMgrIf
Sets an array of payment modules

Specified by:
setPaymentModules in interface AdminModulesMgrIf
Parameters:
paymentModules - the paymentModules to set

setShippingModules

public void setShippingModules(ShippingModule[] shippingModules)
Description copied from interface: AdminModulesMgrIf
Sets an array of Shipping modules

Specified by:
setShippingModules in interface AdminModulesMgrIf
Parameters:
shippingModules - the shippingModules to set

setOtherModules

public void setOtherModules(OtherModule[] otherModules)
Description copied from interface: AdminModulesMgrIf
Sets an array of Other modules

Specified by:
setOtherModules in interface AdminModulesMgrIf
Parameters:
otherModules - the otherModules to set

refreshConfigs

public void refreshConfigs()
                    throws java.lang.Exception
Refresh the configuration of the Admin Currency Manager

Specified by:
refreshConfigs in interface AdminModulesMgrIf
Overrides:
refreshConfigs in class AdminBaseMgr
Throws:
java.lang.Exception


Copyright © 2011 DS Data Systems UK Ltd.