com.konakartadmin.bl
Class AdminBaseMgr

java.lang.Object
  extended by com.konakartadmin.bl.AdminBaseMgr
Direct Known Subclasses:
AdminAddressMgr, AdminAuditMgr, AdminBasePayment, AdminBatchBaseMgr, AdminBillingMgr, AdminBookableProductMgr, AdminCategoryMgr, AdminCommunityStoreMgr, AdminConfigurationMgr, AdminCurrencyMgr, AdminCustomerMgr, AdminCustomerTagMgr, AdminDataIntegrityMgr, AdminEmailMgr, AdminExecuteMgr, AdminFileMgr, AdminHtmlMgr, AdminLanguageMgr, AdminLDAPMgr, AdminLoginIntegrationMgr, AdminManufacturerMgr, AdminMessageMgr, AdminMiscItemMgr, AdminModulesMgr, AdminMultiStoreMgr, AdminOrderIntegrationMgr, AdminOrderMgr, AdminPdfMgr, AdminProductAttrMgr, AdminProductMgr, AdminPromotionMgr, AdminPublishProductMgr, AdminRemoteAccessMgr, AdminReportMgr, AdminReviewMgr, AdminRewardPointMgr, AdminSearchRuleMgr, AdminSecurityMgr, AdminSolrMgr, AdminStoreIntegrationMgr, AdminStoreMgr, AdminTagMgr, AdminTaxMgr, AdminValidationMgr, AdminVelocityContextMgr, AdminWishListMgr

public class AdminBaseMgr
extends java.lang.Object

The base for all Admin Managers


Nested Class Summary
protected  class AdminBaseMgr.StaticData
          Used to store the static data of this manager
 
Field Summary
protected  KKAdminIf adminEng
          Our Admin Engine
protected static java.lang.String baseMgrMutex
          mutex
protected static java.util.Map<java.lang.String,AdminBaseMgr.StaticData> baseStaticDataHM
          Hash Map that contains the static data
protected static java.lang.String cDataEnd
          CDATA end
protected static java.lang.String cDataStart
          CDATA start
protected  org.apache.commons.configuration.Configuration kkConf
          Configuration from properties file
protected static java.lang.String kkInstanceId
          The KonaKart Instance - read from the properties file
private static org.apache.commons.logging.Log log
          the log
protected  AdminMgrFactory mgrFactory
          Factory for creating managers
protected static java.lang.String STORE_ID
          store id
protected  java.lang.String templateBaseDir
          Velocity template base directory under WEB-INF/classes.
 
Constructor Summary
AdminBaseMgr()
          Constructor
 
Method Summary
protected static void addInsertAttr(org.apache.torque.util.Criteria c, java.lang.String attrName, int value)
          A utility method to not add integers that are equal to ConstantsMgr.NOT_SET
protected static void addInsertAttr(org.apache.torque.util.Criteria c, java.lang.String attrName, java.lang.Object value)
          A utility to not add null objects
protected  void checkIntIsSet(int param, java.lang.String paramType, java.lang.String paramName)
          Throws an exception if the int parameter is KKConstants.NOT_SET.
protected  void checkRequired(java.lang.Object param, java.lang.String paramType, java.lang.String paramName)
          Throws an exception with a proper message if the required parameter is null or null or empty for the case of a string.
protected  AdminAddressMgrIf getAdminAddressMgr()
           
protected  AdminAuditMgrIf getAdminAuditMgr()
           
protected  AdminBillingMgrIf getAdminBillingMgr()
           
protected  AdminBookableProductMgrIf getAdminBookableProductMgr()
           
protected  AdminCategoryMgrIf getAdminCatMgr()
           
protected  AdminConfigurationMgrIf getAdminConfigMgr()
           
protected  AdminCurrencyMgrIf getAdminCurrMgr()
           
protected  AdminCustomerMgrIf getAdminCustMgr()
           
protected  AdminCustomerTagMgrIf getAdminCustTagMgr()
           
protected  AdminEmailMgrIf getAdminEmailMgr()
           
 KKAdminIf getAdminEng()
           
 AdminHtmlMgrIf getAdminHtmlMgr()
           
protected  AdminLanguageMgrIf getAdminLanguageMgr()
           
protected  AdminManufacturerMgrIf getAdminManuMgr()
           
 AdminMessageMgrIf getAdminMessageMgr()
           
protected  AdminMiscItemMgrIf getAdminMiscItemMgr()
           
protected  AdminModulesMgrIf getAdminModulesMgr()
           
 AdminMultiStoreMgrIf getAdminMultiStoreMgr()
           
protected  AdminOrderMgrIf getAdminOrderMgr()
           
protected  AdminPdfMgrIf getAdminPdfMgr()
           
protected  AdminProdAttrMgrIf getAdminProdAttrMgr()
           
protected  AdminProductMgrIf getAdminProdMgr()
           
protected  AdminPromotionMgrIf getAdminPromMgr()
           
protected  AdminPublishProductMgrIf getAdminPublishProdMgr()
           
 AdminReviewMgrIf getAdminReviewMgr()
           
protected  AdminSearchRuleMgrIf getAdminSearchRuleMgr()
           
protected  AdminSecurityMgrIf getAdminSecMgr()
           
 AdminSolrMgrIf getAdminSolrMgr()
           
 AdminStoreMgrIf getAdminStoreMgr()
           
protected  AdminTagMgrIf getAdminTagMgr()
           
protected  AdminTaxMgrIf getAdminTaxMgr()
           
 AdminValidationMgrIf getAdminValidationMgr()
           
 AdminVelocityContextMgrIf getAdminVelocityContextMgr()
           
 AdminWishListMgrIf getAdminWishListMgr()
           
 boolean getBooleanFromString(java.lang.String value, boolean def)
          Get a boolean value for the String
protected  ExportXMLDataIf getExportXMLData()
          Finds and returns an implementation of the ExportXMLDataIf on the class path
 int getIntFromString(java.lang.String value, int def)
          Get an integer value for the String
protected  org.apache.commons.configuration.Configuration getKkConfig()
          Get the kkConf the properties file
protected  java.lang.String getKkInstanceId()
          Get the instance Id from the properties file
protected  int getMode()
          Return the engine mode
protected  java.lang.String getModeString()
          Return the engine mode - as a descriptive String for diagnostic purposes only
protected  com.konakart.mqif.MqMgrIf getMqMgr()
           
protected  com.konakart.bl.KKCriteria getNewCriteria()
          Gets a new KKCriteria object and sets the Database name.
protected  com.konakart.bl.KKCriteria getNewCriteria(boolean allStores)
          Gets a new KKCriteria object and sets the Database name.
 java.lang.String getPostSearchText()
           
 java.lang.String getPreSearchText()
           
protected  java.lang.String getPropertyValue(java.lang.String propKey)
           
protected  int getRecordCount(com.konakart.bl.KKCriteria c)
          This method is mainly used for paging...
protected  AdminRewardPointMgrIf getRewardPointMgr()
           
protected  int getSingleIntResult(com.konakart.bl.KKCriteria c)
          This method is used to run a SELECT defined by the Criteria and return the single integer value returned by the query as the result.
protected  java.lang.String getStoreId()
          Return the storeId.
protected  org.apache.velocity.Template getTemplate(org.apache.velocity.app.VelocityEngine ve, java.lang.String configDir, java.lang.String templateName)
          Helper method to search for the velocity templates under the Template Base Directory
protected  java.lang.String getTemplateBase(java.lang.String configDir)
          Returns the template base directory which is created by concatenating the following: Value of the Directory configuration variable passed in current storeId
protected  Xml_io_If getXml_io()
          Finds and returns an implementation of the Xml_io_If on the class path
protected  void init(KKAdminIf eng)
          Init method called from the super class.
protected  boolean isConfigSet(java.lang.String configKey, boolean defaultValue)
          Is the specified config key's value is set to TRUE, YES or ON (case insensitive)? If the config key's value isn't found the specified default value is returned.
protected  boolean isEnterprise()
          Returns true if we are in Enterprise Mode
protected  boolean isMultiStoreLanguagesShared()
          Returns true if we can share languages in multi-store single db mode
protected  boolean isMultiStoreMode()
          Is the engine running in one of the MultiStore modes?
protected  boolean isMultiStoreShareCategories()
          Returns true if we can share categories in multi-store single db mode.
protected  boolean isMultiStoreShareCustomers()
          Returns true if we need to share customers in multi-store single db mode
protected  boolean isMultiStoreShareProducts()
          Returns true if we can share products in multi-store single db mode
protected  boolean isMultiStoreSingleDBCSMode()
          Is the engine running in MultiStore Single DB Customers Shared mode?
protected  boolean isMultiStoreSingleDBMode()
          Is the engine running in one of the MultiStore Single DB modes?
protected  boolean isMultiStoreSingleDBNonCSMode()
          Is the engine running in MultiStore Single DB Non-Shared Customers mode?
protected  KKAdminException manageException(java.lang.Exception e)
          Common code to manage exceptions in the Admin Managers
 void refreshConfigs()
          Refresh the configuration of the Admin Base Manager
 java.lang.String removeCData(java.lang.String stringIn)
          Returns the string passed in as stringIn without the CData information.
 void setAdminEng(KKAdminIf adminEng)
           
 void setupWildCardRules(AdminBaseMgr.StaticData sd)
          Some of the managers, but not all, will want to set these Wildcard rules
 void setWildCardAfter(AdminBaseMgr.StaticData sd)
          Set the post-search string based on the configuration variable value
 void setWildCardBefore(AdminBaseMgr.StaticData sd)
          Set the pre-search string based on the configuration variable value
protected  void shutdownGracefully(java.io.BufferedWriter bw)
          Common code to shutdown gracefully for the case where there is a buffered writer for the log.
protected  void shutdownGracefully(java.util.concurrent.ExecutorService executor, java.io.BufferedWriter bw)
          Common code to shutdown gracefully for the case where eMails are being send by multiple threads and there is a buffered writer for the log.
protected  java.lang.String timestampStr()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log
the log


baseMgrMutex

protected static java.lang.String baseMgrMutex
mutex


STORE_ID

protected static final java.lang.String STORE_ID
store id

See Also:
Constant Field Values

cDataStart

protected static final java.lang.String cDataStart
CDATA start

See Also:
Constant Field Values

cDataEnd

protected static final java.lang.String cDataEnd
CDATA end

See Also:
Constant Field Values

adminEng

protected KKAdminIf adminEng
Our Admin Engine


templateBaseDir

protected java.lang.String templateBaseDir
Velocity template base directory under WEB-INF/classes. It can be cached globally since it has the same value for all stores


baseStaticDataHM

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


mgrFactory

protected AdminMgrFactory mgrFactory
Factory for creating managers


kkConf

protected org.apache.commons.configuration.Configuration kkConf
Configuration from properties file


kkInstanceId

protected static java.lang.String kkInstanceId
The KonaKart Instance - read from the properties file

Constructor Detail

AdminBaseMgr

public AdminBaseMgr()
Constructor

Method Detail

init

protected void init(KKAdminIf eng)
             throws java.lang.Exception
Init method called from the super class.

Parameters:
eng - the Admin Engine
Throws:
java.lang.Exception

getPropertyValue

protected java.lang.String getPropertyValue(java.lang.String propKey)
                                     throws KKAdminException
Parameters:
propKey -
Returns:
the property value for the specified key in the konakart configuration which was derived from the konakart properties file
Throws:
KKAdminException

getRecordCount

protected int getRecordCount(com.konakart.bl.KKCriteria c)
                      throws org.apache.torque.TorqueException,
                             com.workingdogs.village.DataSetException
This method is mainly used for paging... for getting a count of the records defined by the Criteria specified.

Parameters:
c - the Criteria
Returns:
The number of records present in the database matching the given criteria
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getSingleIntResult

protected int getSingleIntResult(com.konakart.bl.KKCriteria c)
                          throws org.apache.torque.TorqueException,
                                 com.workingdogs.village.DataSetException
This method is used to run a SELECT defined by the Criteria and return the single integer value returned by the query as the result.

Parameters:
c - the Criteria
Returns:
The integer returned by the query
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getKkConfig

protected org.apache.commons.configuration.Configuration getKkConfig()
                                                              throws KKAdminException
Get the kkConf the properties file

Returns:
A Configuration object that is created by parsing the konakart properties file that is identified on the curent engine configuration object.
Throws:
KKAdminException

getKkInstanceId

protected java.lang.String getKkInstanceId()
                                    throws KKAdminException
Get the instance Id from the properties file

Returns:
the kkInstanceId
Throws:
KKAdminException

setupWildCardRules

public void setupWildCardRules(AdminBaseMgr.StaticData sd)
Some of the managers, but not all, will want to set these Wildcard rules

Parameters:
sd - StaticData

isEnterprise

protected boolean isEnterprise()
                        throws KKAdminException
Returns true if we are in Enterprise Mode

Returns:
true for Enterprise Mode
Throws:
KKAdminException - if the engine config has not yet been defined

getBooleanFromString

public boolean getBooleanFromString(java.lang.String value,
                                    boolean def)
Get a boolean value for the String

Parameters:
value - the String value to parse
def - the default result if there's a problem parsing the String
Returns:
the boolean value of the String or the default value if there's a problem

getIntFromString

public int getIntFromString(java.lang.String value,
                            int def)
Get an integer value for the String

Parameters:
value - the String value to parse
def - the default result if there's a problem parsing the String
Returns:
the integer value of the String or the default value if there's a problem

getAdminTaxMgr

protected AdminTaxMgrIf getAdminTaxMgr()
                                throws java.lang.Exception
Returns:
Returns the AdminTaxMgr.
Throws:
java.lang.Exception

getAdminAddressMgr

protected AdminAddressMgrIf getAdminAddressMgr()
                                        throws java.lang.Exception
Returns:
Returns the AdminAddressMgr.
Throws:
java.lang.Exception

getAdminManuMgr

protected AdminManufacturerMgrIf getAdminManuMgr()
                                          throws java.lang.Exception
Returns:
Returns the AdminManufacturerMgr.
Throws:
java.lang.Exception

getAdminCustMgr

protected AdminCustomerMgrIf getAdminCustMgr()
                                      throws java.lang.Exception
Returns:
Returns the AdminCustomerMgr.
Throws:
java.lang.Exception

getAdminConfigMgr

protected AdminConfigurationMgrIf getAdminConfigMgr()
                                             throws java.lang.Exception
Returns:
Returns the AdminConfigurationMgr.
Throws:
java.lang.Exception

getAdminProdMgr

protected AdminProductMgrIf getAdminProdMgr()
                                     throws java.lang.Exception
Returns:
Returns the AdminProductMgr.
Throws:
java.lang.Exception

getAdminPublishProdMgr

protected AdminPublishProductMgrIf getAdminPublishProdMgr()
                                                   throws java.lang.Exception
Returns:
Returns the AdminPublishProductMgr.
Throws:
java.lang.Exception

getAdminPromMgr

protected AdminPromotionMgrIf getAdminPromMgr()
                                       throws java.lang.Exception
Returns:
Returns the AdminPromotionMgr.
Throws:
java.lang.Exception

getAdminModulesMgr

protected AdminModulesMgrIf getAdminModulesMgr()
                                        throws java.lang.Exception
Returns:
Returns the AdminModulesMgr.
Throws:
java.lang.Exception

getAdminTagMgr

protected AdminTagMgrIf getAdminTagMgr()
                                throws java.lang.Exception
Returns:
Returns the AdminTagMgr.
Throws:
java.lang.Exception

getAdminCurrMgr

protected AdminCurrencyMgrIf getAdminCurrMgr()
                                      throws java.lang.Exception
Returns:
Returns the AdminCurrencyMgr.
Throws:
java.lang.Exception

getAdminSecMgr

protected AdminSecurityMgrIf getAdminSecMgr()
                                     throws java.lang.Exception
Returns:
Returns the AdminSecurityMgr.
Throws:
java.lang.Exception

getAdminCatMgr

protected AdminCategoryMgrIf getAdminCatMgr()
                                     throws java.lang.Exception
Returns:
Returns the AdminCategoryMgr.
Throws:
java.lang.Exception

getAdminEmailMgr

protected AdminEmailMgrIf getAdminEmailMgr()
                                    throws java.lang.Exception
Returns:
Returns the AdminEmailMgr.
Throws:
java.lang.Exception

getAdminOrderMgr

protected AdminOrderMgrIf getAdminOrderMgr()
                                    throws java.lang.Exception
Returns:
Returns the AdminOrderMgr.
Throws:
java.lang.Exception

getAdminPdfMgr

protected AdminPdfMgrIf getAdminPdfMgr()
                                throws java.lang.Exception
Returns:
Returns the AdminPdfMgr.
Throws:
java.lang.Exception

getAdminMiscItemMgr

protected AdminMiscItemMgrIf getAdminMiscItemMgr()
                                          throws java.lang.Exception
Returns:
Returns the AdminMiscItemMgr.
Throws:
java.lang.Exception

getAdminLanguageMgr

protected AdminLanguageMgrIf getAdminLanguageMgr()
                                          throws java.lang.Exception
Returns:
Returns the AdminLanguageMgr.
Throws:
java.lang.Exception

getAdminAuditMgr

protected AdminAuditMgrIf getAdminAuditMgr()
                                    throws java.lang.Exception
Returns:
Returns the AdminAuditMgr.
Throws:
java.lang.Exception

getAdminHtmlMgr

public AdminHtmlMgrIf getAdminHtmlMgr()
                               throws java.lang.Exception
Returns:
Returns the AdminHtmlMgr.
Throws:
java.lang.Exception

getAdminReviewMgr

public AdminReviewMgrIf getAdminReviewMgr()
                                   throws java.lang.Exception
Returns:
Returns the AdminReviewMgr.
Throws:
java.lang.Exception

getAdminMessageMgr

public AdminMessageMgrIf getAdminMessageMgr()
                                     throws java.lang.Exception
Returns:
Returns the AdminMessageMgr.
Throws:
java.lang.Exception

getAdminValidationMgr

public AdminValidationMgrIf getAdminValidationMgr()
                                           throws java.lang.Exception
Returns:
Returns the AdminValidationMgr.
Throws:
java.lang.Exception

getAdminSolrMgr

public AdminSolrMgrIf getAdminSolrMgr()
                               throws java.lang.Exception
Returns:
Returns the AdminSolrMgr.
Throws:
java.lang.Exception

getAdminVelocityContextMgr

public AdminVelocityContextMgrIf getAdminVelocityContextMgr()
                                                     throws java.lang.Exception
Returns:
Returns the AdminVelocityContextMgr.
Throws:
java.lang.Exception

getAdminWishListMgr

public AdminWishListMgrIf getAdminWishListMgr()
                                       throws java.lang.Exception
Returns:
Returns the AdminWishListMgr.
Throws:
java.lang.Exception

getAdminMultiStoreMgr

public AdminMultiStoreMgrIf getAdminMultiStoreMgr()
Returns:
Returns an AdminMultiStoreMgr

getAdminStoreMgr

public AdminStoreMgrIf getAdminStoreMgr()
                                 throws java.lang.Exception
Returns:
Returns an AdminStoreMgr
Throws:
java.lang.Exception

getAdminCustTagMgr

protected AdminCustomerTagMgrIf getAdminCustTagMgr()
                                            throws java.lang.Exception
Returns:
Returns the AdminCustomerTagMgr.
Throws:
java.lang.Exception

getRewardPointMgr

protected AdminRewardPointMgrIf getRewardPointMgr()
                                           throws java.lang.Exception
Returns:
Returns the AdminRewardPointMgr.
Throws:
java.lang.Exception

getAdminSearchRuleMgr

protected AdminSearchRuleMgrIf getAdminSearchRuleMgr()
                                              throws java.lang.Exception
Returns:
Returns the AdminSearchRuleMg.
Throws:
java.lang.Exception

getAdminBillingMgr

protected AdminBillingMgrIf getAdminBillingMgr()
                                        throws java.lang.Exception
Returns:
Returns the AdminBillingMgr.
Throws:
java.lang.Exception

getAdminBookableProductMgr

protected AdminBookableProductMgrIf getAdminBookableProductMgr()
                                                        throws java.lang.Exception
Returns:
Returns the AdminBookableProductMgr.
Throws:
java.lang.Exception

getAdminProdAttrMgr

protected AdminProdAttrMgrIf getAdminProdAttrMgr()
                                          throws java.lang.Exception
Returns:
Returns the AdminProdAttrMgr.
Throws:
java.lang.Exception

getMqMgr

protected com.konakart.mqif.MqMgrIf getMqMgr()
                                      throws java.lang.Exception
Returns:
Returns the MqMgr.
Throws:
java.lang.Exception

addInsertAttr

protected static void addInsertAttr(org.apache.torque.util.Criteria c,
                                    java.lang.String attrName,
                                    int value)
A utility method to not add integers that are equal to ConstantsMgr.NOT_SET

Parameters:
c -
attrName -
value -

removeCData

public java.lang.String removeCData(java.lang.String stringIn)
Returns the string passed in as stringIn without the CData information. i.e. It removes '' from the end of the string

Parameters:
stringIn -
Returns:
stringIn without the CDATA info

addInsertAttr

protected static void addInsertAttr(org.apache.torque.util.Criteria c,
                                    java.lang.String attrName,
                                    java.lang.Object value)
A utility to not add null objects

Parameters:
c -
attrName -
value -

checkRequired

protected void checkRequired(java.lang.Object param,
                             java.lang.String paramType,
                             java.lang.String paramName)
                      throws KKAdminException
Throws an exception with a proper message if the required parameter is null or null or empty for the case of a string.

Parameters:
param -
paramType -
paramName -
Throws:
KKAdminException

checkIntIsSet

protected void checkIntIsSet(int param,
                             java.lang.String paramType,
                             java.lang.String paramName)
                      throws KKAdminException
Throws an exception if the int parameter is KKConstants.NOT_SET.

Parameters:
param -
paramType -
paramName -
Throws:
KKAdminException

setWildCardBefore

public void setWildCardBefore(AdminBaseMgr.StaticData sd)
                       throws java.lang.Exception
Set the pre-search string based on the configuration variable value

Parameters:
sd - StaticData
Throws:
java.lang.Exception

isConfigSet

protected boolean isConfigSet(java.lang.String configKey,
                              boolean defaultValue)
                       throws org.apache.torque.TorqueException,
                              KKAdminException,
                              com.workingdogs.village.DataSetException,
                              java.lang.Exception
Is the specified config key's value is set to TRUE, YES or ON (case insensitive)? If the config key's value isn't found the specified default value is returned.

Parameters:
configKey - the configuration key
defaultValue - the default value to use if the configuration key isn't found
Returns:
True if the configuration variable is TRUE, ON or YES
Throws:
java.lang.Exception
com.workingdogs.village.DataSetException
KKAdminException
org.apache.torque.TorqueException

setWildCardAfter

public void setWildCardAfter(AdminBaseMgr.StaticData sd)
                      throws java.lang.Exception
Set the post-search string based on the configuration variable value

Parameters:
sd - StaticData
Throws:
java.lang.Exception

getPreSearchText

public java.lang.String getPreSearchText()
Returns:
Returns the preSearchText.

getPostSearchText

public java.lang.String getPostSearchText()
Returns:
Returns the postSearchText.

getAdminEng

public KKAdminIf getAdminEng()
Returns:
Returns the adminEng.

setAdminEng

public void setAdminEng(KKAdminIf adminEng)
Parameters:
adminEng - The adminEng to set.

getMode

protected int getMode()
               throws KKAdminException
Return the engine mode

Returns:
Return the engine mode
Throws:
KKAdminException

getModeString

protected java.lang.String getModeString()
Return the engine mode - as a descriptive String for diagnostic purposes only

Returns:
Return the engine mode as a descriptive String

isMultiStoreMode

protected boolean isMultiStoreMode()
                            throws KKAdminException
Is the engine running in one of the MultiStore modes?

Returns:
Return true if the engine is running in MultiStore mode, otherwise false
Throws:
KKAdminException

isMultiStoreSingleDBMode

protected boolean isMultiStoreSingleDBMode()
                                    throws KKAdminException
Is the engine running in one of the MultiStore Single DB modes?

Returns:
Return true if the engine is running in MultiStore Single DB mode, otherwise false
Throws:
KKAdminException

isMultiStoreSingleDBCSMode

protected boolean isMultiStoreSingleDBCSMode()
                                      throws KKAdminException
Is the engine running in MultiStore Single DB Customers Shared mode?

Returns:
Return true if the engine is running in MultiStore Single DB Customers Shared mode, otherwise false
Throws:
KKAdminException

isMultiStoreSingleDBNonCSMode

protected boolean isMultiStoreSingleDBNonCSMode()
                                         throws KKAdminException
Is the engine running in MultiStore Single DB Non-Shared Customers mode?

Returns:
Return true if the engine is running in MultiStore Single DB Non-Shared Customers mode, otherwise false
Throws:
KKAdminException

getStoreId

protected java.lang.String getStoreId()
                               throws KKAdminException
Return the storeId. If the AdmnEngineConfig is null, or the storeId on that AdminEngineConfig is null, we return the default store id.

Returns:
Return the storeId
Throws:
KKAdminException

getNewCriteria

protected com.konakart.bl.KKCriteria getNewCriteria()
Gets a new KKCriteria object and sets the Database name. If no Engine Configuration is defined a default KKCriteria is returned.

Returns:
Returns a new KKCriteria object for the correct database.

getNewCriteria

protected com.konakart.bl.KKCriteria getNewCriteria(boolean allStores)
Gets a new KKCriteria object and sets the Database name. If no Engine Configuration is defined a default KKCriteria is returned.

Parameters:
allStores -
Returns:
Returns a new KKCriteria object for the correct database.

isMultiStoreShareCustomers

protected boolean isMultiStoreShareCustomers()
                                      throws KKAdminException
Returns true if we need to share customers in multi-store single db mode

Returns:
the multiStoreShareCustomers
Throws:
KKAdminException

isMultiStoreShareProducts

protected boolean isMultiStoreShareProducts()
                                     throws KKAdminException
Returns true if we can share products in multi-store single db mode

Returns:
true if we're in shared products mode
Throws:
KKAdminException

isMultiStoreShareCategories

protected boolean isMultiStoreShareCategories()
                                       throws KKAdminException
Returns true if we can share categories in multi-store single db mode. Shared Category mode is only available if products are shared.

Returns:
Returns true if we can share categories in multi-store single db mode
Throws:
com.konakart.app.KKException
KKAdminException

isMultiStoreLanguagesShared

protected boolean isMultiStoreLanguagesShared()
                                       throws KKAdminException
Returns true if we can share languages in multi-store single db mode

Returns:
true if languages are shared
Throws:
KKAdminException

manageException

protected KKAdminException manageException(java.lang.Exception e)
Common code to manage exceptions in the Admin Managers

Parameters:
e -
Returns:
a new KKAdminException wrapping the specified exception or the original exception if it's a KKAdminException already

refreshConfigs

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

Throws:
java.lang.Exception

shutdownGracefully

protected void shutdownGracefully(java.util.concurrent.ExecutorService executor,
                                  java.io.BufferedWriter bw)
                           throws java.io.IOException,
                                  java.lang.InterruptedException
Common code to shutdown gracefully for the case where eMails are being send by multiple threads and there is a buffered writer for the log.

Parameters:
executor -
bw -
Throws:
java.io.IOException
java.lang.InterruptedException

shutdownGracefully

protected void shutdownGracefully(java.io.BufferedWriter bw)
                           throws java.io.IOException,
                                  java.lang.InterruptedException
Common code to shutdown gracefully for the case where there is a buffered writer for the log.

Parameters:
bw -
Throws:
java.io.IOException
java.lang.InterruptedException

timestampStr

protected java.lang.String timestampStr()
Returns:
a friendly timestamp String using the format "dd-MMM HH:mm:ss"

getTemplate

protected org.apache.velocity.Template getTemplate(org.apache.velocity.app.VelocityEngine ve,
                                                   java.lang.String configDir,
                                                   java.lang.String templateName)
                                            throws org.apache.velocity.exception.ResourceNotFoundException,
                                                   org.apache.velocity.exception.ParseErrorException,
                                                   KKAdminException,
                                                   java.lang.Exception
Helper method to search for the velocity templates under the Template Base Directory

Parameters:
ve -
configDir - the configuration parameter that defines the root directory for the template
templateName -
Returns:
Returns the Velocity Template
Throws:
org.apache.velocity.exception.ResourceNotFoundException
org.apache.velocity.exception.ParseErrorException
KKAdminException
java.lang.Exception

getTemplateBase

protected java.lang.String getTemplateBase(java.lang.String configDir)
                                    throws org.apache.torque.TorqueException,
                                           com.workingdogs.village.DataSetException,
                                           KKAdminException,
                                           java.lang.Exception
Returns the template base directory which is created by concatenating the following:

If the config variable isn't available, a default value of the current directory is returned.

Parameters:
configDir - the configuration parameter that defines the root directory for the template
Returns:
Returns Returns the template base directory.
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
java.lang.Exception

getXml_io

protected Xml_io_If getXml_io()
                       throws KKAdminException
Finds and returns an implementation of the Xml_io_If on the class path

Returns:
an XML IO Manager if found or an exception is thrown if it can't be found.
Throws:
KKAdminException - if the Xml_io class cannot be loaded

getExportXMLData

protected ExportXMLDataIf getExportXMLData()
                                    throws KKAdminException
Finds and returns an implementation of the ExportXMLDataIf on the class path

Returns:
an Export XML Manager if found or an exception is thrown if it can't be found.
Throws:
KKAdminException - if the ExportXMLData class cannot be loaded


Copyright © 2011 DS Data Systems UK Ltd.