com.konakart.bl
Class BaseMgr

java.lang.Object
  extended by com.konakart.bl.BaseMgr
Direct Known Subclasses:
BasketMgr, BillingMgr, BookableProductMgr, CategoryMgr, ConfigurationMgr, CookieMgr, CurrencyMgr, CustomerMgr, CustomerStatsMgr, CustomerTagMgr, EmailMgr, LanguageMgr, LDAPMgr, LoginIntegrationMgr, ManufacturerMgr, MiscItemMgr, MultiStoreMgr, OrderIntegrationMgr, OrderMgr, OrderTotalMgr, PaymentMgr, ProductMgr, PromotionMgr, ReorderMgr, ReviewMgr, RewardPointMgr, SecurityMgr, ShippingMgr, SolrMgr, StoreMgr, TaxMgr, VelocityContextMgr, WishListMgr

public class BaseMgr
extends java.lang.Object

Base Manager


Field Summary
protected  java.lang.String templateBaseDir
          Velocity template base directory under WEB-INF/classes.
 
Constructor Summary
BaseMgr()
           
 
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 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  AdminEngineMgrIf getAdminEngMgr()
           
protected  BasketMgrIf getBasketMgr()
           
protected  BillingMgrIf getBillingMgr()
           
protected  BookableProductMgrIf getBookableProductMgr()
           
protected  CategoryMgrIf getCatMgr()
           
protected  ConfigurationMgrIf getConfigMgr()
           
protected  CookieMgrIf getCookieMgr()
           
protected  CurrencyMgrIf getCurrMgr()
           
protected  CustomerMgrIf getCustMgr()
           
protected  int getCustomerIdFromSession(java.lang.String sessionId)
          Throws an exception if the customer isn't valid.
protected  CustomerStatsMgrIf getCustomerStatsMgr()
           
protected  CustomerTagMgrIf getCustomerTagMgr()
           
protected  EmailMgrIf getEmailMgr()
           
 KKEngIf getEng()
           
protected  LanguageMgrIf getLangMgr()
           
protected  ManufacturerMgrIf getManuMgr()
           
protected  MiscItemMgrIf getMiscItemMgr()
           
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  MqMgrIf getMqMgr()
           
protected  MultiStoreMgrIf getMultiStoreMgr()
           
protected  KKCriteria getNewCriteria()
          Gets a new KKCriteria object
protected  KKCriteria getNewCriteria(boolean allStores)
          Gets a new KKCriteria object with the option of it being for all stores when in multi-store single db mode.
protected  OrderMgrIf getOrderMgr()
           
protected  OrderTotalMgrIf getOrderTotalMgr()
           
protected  PaymentMgrIf getPaymentMgr()
           
protected  ProductMgrIf getProdMgr()
           
protected  PromotionMgrIf getPromMgr()
           
protected  RewardPointMgrIf getRewardPointMgr()
           
protected  SecurityMgrIf getSecMgr()
           
protected  ShippingMgrIf getShippingMgr()
           
protected  SolrMgrIf getSolrMgr()
           
protected  java.lang.String getStoreId()
          Return the storeId
protected  TaxMgrIf getTaxMgr()
           
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 in the correct sub-directory within the class path.
protected  java.lang.String getTemplateRoot(java.lang.String configDir)
          Returns the template base directory which is created by concatenating the following: Value of the Directory configuration variable specified current storeId
protected  VelocityContextMgrIf getVelocityContextMgr()
           
protected  WishListMgrIf getWishListMgr()
           
protected  void init(KKEngIf eng, org.apache.commons.logging.Log log)
          Init method called from the super class.
protected  boolean isEnterprise()
          Returns true if we are in Enterprise 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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

Constructor Detail

BaseMgr

public BaseMgr()
Method Detail

init

protected void init(KKEngIf eng,
                    org.apache.commons.logging.Log log)
             throws java.lang.Exception
Init method called from the super class.

Parameters:
eng -
log -
Throws:
java.lang.Exception

getWishListMgr

protected WishListMgrIf getWishListMgr()
                                throws java.lang.Exception
Throws:
java.lang.Exception

getTaxMgr

protected TaxMgrIf getTaxMgr()
                      throws java.lang.Exception
Throws:
java.lang.Exception

getLangMgr

protected LanguageMgrIf getLangMgr()
                            throws java.lang.Exception
Throws:
java.lang.Exception

getCustMgr

protected CustomerMgrIf getCustMgr()
                            throws java.lang.Exception
Throws:
java.lang.Exception

getConfigMgr

protected ConfigurationMgrIf getConfigMgr()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

getProdMgr

protected ProductMgrIf getProdMgr()
                           throws java.lang.Exception
Throws:
java.lang.Exception

getCurrMgr

protected CurrencyMgrIf getCurrMgr()
                            throws java.lang.Exception
Throws:
java.lang.Exception

getSecMgr

protected SecurityMgrIf getSecMgr()
                           throws java.lang.Exception
Throws:
java.lang.Exception

getCatMgr

protected CategoryMgrIf getCatMgr()
                           throws java.lang.Exception
Throws:
java.lang.Exception

getEmailMgr

protected EmailMgrIf getEmailMgr()
                          throws java.lang.Exception
Throws:
java.lang.Exception

getManuMgr

protected ManufacturerMgrIf getManuMgr()
                                throws java.lang.Exception
Throws:
java.lang.Exception

getVelocityContextMgr

protected VelocityContextMgrIf getVelocityContextMgr()
                                              throws java.lang.Exception
Throws:
java.lang.Exception

getOrderMgr

protected OrderMgrIf getOrderMgr()
                          throws java.lang.Exception
Throws:
java.lang.Exception

getPromMgr

protected PromotionMgrIf getPromMgr()
                             throws java.lang.Exception
Throws:
java.lang.Exception

getBasketMgr

protected BasketMgrIf getBasketMgr()
                            throws java.lang.Exception
Throws:
java.lang.Exception

getCookieMgr

protected CookieMgrIf getCookieMgr()
                            throws java.lang.Exception
Throws:
java.lang.Exception

getShippingMgr

protected ShippingMgrIf getShippingMgr()
                                throws java.lang.Exception
Throws:
java.lang.Exception

getPaymentMgr

protected PaymentMgrIf getPaymentMgr()
                              throws java.lang.Exception
Throws:
java.lang.Exception

getOrderTotalMgr

protected OrderTotalMgrIf getOrderTotalMgr()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

getSolrMgr

protected SolrMgrIf getSolrMgr()
                        throws java.lang.Exception
Throws:
java.lang.Exception

getMiscItemMgr

protected MiscItemMgrIf getMiscItemMgr()
                                throws java.lang.Exception
Throws:
java.lang.Exception

getMultiStoreMgr

protected MultiStoreMgrIf getMultiStoreMgr()

getCustomerTagMgr

protected CustomerTagMgrIf getCustomerTagMgr()
                                      throws java.lang.Exception
Throws:
java.lang.Exception

getCustomerStatsMgr

protected CustomerStatsMgrIf getCustomerStatsMgr()
                                          throws java.lang.Exception
Throws:
java.lang.Exception

getBillingMgr

protected BillingMgrIf getBillingMgr()
                              throws java.lang.Exception
Throws:
java.lang.Exception

getBookableProductMgr

protected BookableProductMgrIf getBookableProductMgr()
                                              throws java.lang.Exception
Throws:
java.lang.Exception

getRewardPointMgr

protected RewardPointMgrIf getRewardPointMgr()
                                      throws java.lang.Exception
Throws:
java.lang.Exception

getAdminEngMgr

protected AdminEngineMgrIf getAdminEngMgr()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

getMqMgr

protected MqMgrIf getMqMgr()
                    throws java.lang.Exception
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 -

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 KKException
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:
KKException

getCustomerIdFromSession

protected int getCustomerIdFromSession(java.lang.String sessionId)
                                throws java.lang.Exception
Throws an exception if the customer isn't valid. Otherwise it returns the customerId.

Parameters:
sessionId -
Returns:
Returns the customerId if it is that of a valid customer
Throws:
java.lang.Exception

getEng

public KKEngIf getEng()
Returns:
Returns the eng.

getMode

protected int getMode()
               throws KKException
Return the engine mode

Returns:
Return the engine mode
Throws:
KKException

getModeString

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

Returns:
Return the engine mode as a descriptive String
Throws:
KKException

getStoreId

protected java.lang.String getStoreId()
                               throws KKException
Return the storeId

Returns:
Return the storeId
Throws:
KKException

getNewCriteria

protected KKCriteria getNewCriteria()
Gets a new KKCriteria object

Returns:
Returns a new KKCriteria object

getNewCriteria

protected KKCriteria getNewCriteria(boolean allStores)
Gets a new KKCriteria object with the option of it being for all stores when in multi-store single db mode.

Returns:
Returns a new KKCriteria object

isEnterprise

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

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

isMultiStoreShareCustomers

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

Returns:
the multiStoreShareCustomers
Throws:
KKException

isMultiStoreShareProducts

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

Returns:
the multiStoreShareProducts
Throws:
KKException

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,
                                                   KKException,
                                                   java.lang.Exception
Helper method to search for the velocity templates in the correct sub-directory within the class path.

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

getTemplateRoot

protected java.lang.String getTemplateRoot(java.lang.String configDir)
                                    throws org.apache.torque.TorqueException,
                                           KKException,
                                           com.workingdogs.village.DataSetException,
                                           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
KKException
com.workingdogs.village.DataSetException
java.lang.Exception


Copyright © 2011 DS Data Systems UK Ltd.