com.konakartadmin.bl
Class AdminAddressMgr

java.lang.Object
  extended by com.konakartadmin.bl.AdminBaseMgr
      extended by com.konakartadmin.bl.AdminAddressMgr
All Implemented Interfaces:
AdminAddressMgrIf

public class AdminAddressMgr
extends AdminBaseMgr
implements AdminAddressMgrIf

The AdminAddressMgr - for Managing Address Objects for the Admin Application


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
AdminAddressMgr(KKAdminIf eng)
          Constructor
 
Method Summary
 void addAddressesToProduct(AdminAddress[] addresses, int productId)
          Associate an array of addresses to a product.
protected  void addAddressFormatOrderBy(com.konakart.bl.KKCriteria c, AdminAddressFormatSearch search)
           
protected  int addAddressFormatSearchCriteria(com.konakart.bl.KKCriteria c, AdminAddressFormatSearch search)
           
protected  void addAddressOrderBy(com.konakart.bl.KKCriteria c, AdminAddressSearch search)
           
protected  void addAddressSearchCriteria(com.konakart.bl.KKCriteria c, AdminAddressSearch search)
           
 void deleteAddress(int addressId)
          Deletes an AdminAddress.
 int deleteAddressFormat(int id)
          Delete an AddressFormat
 boolean doesAddressExistForId(int addrId)
          Checks to see whether an address already exists with this id
 boolean doesAddressFormatExist(int addressFormatId)
          Return true if the AddressFormat exists.
 AdminAddress getAddressById(int addressId)
          Get Addresses defined by the search criteria
 AdminAddressSearchResult getAddresses(AdminAddressSearch search, int offset, int size)
          Get Addresses defined by the search criteria
 AdminAddressFormatSearchResult getAddressFormats(AdminAddressFormatSearch search)
          This returns an AdminAddressFormatSearchResult object.
protected  int getCount(org.apache.torque.util.Criteria c, java.lang.String key)
          This method is mainly used for paging.
 int getProductCountPerAddress(int addressId)
          Returns the number of products using the address
 int insertAddress(AdminAddress address)
          Insert an AdminAddress.
 int insertAddressFormat(AdminAddressFormat taxClass)
          Insert an AdminAddressFormat object
 void refreshConfigs()
          Refresh the configuration of the Admin Currency Manager
 void removeAddressFromProduct(int addressId, int productId)
          Remove the relationship between the address and the product.
protected  void setAddressCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c)
          Common code to avoid duplication
 void updateAddress(AdminAddress address)
          Updates an AdminAddress.
 int updateAddressFormat(AdminAddressFormat taxClass)
          Update an AdminAddressFormat object
 
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
the log

Constructor Detail

AdminAddressMgr

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

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

getAddressFormats

public AdminAddressFormatSearchResult getAddressFormats(AdminAddressFormatSearch search)
                                                 throws KKAdminException
This returns an AdminAddressFormatSearchResult object.

Specified by:
getAddressFormats in interface AdminAddressMgrIf
Parameters:
search -
Returns:
Returns an AdminAddressFormatSearchResult object
Throws:
KKAdminException

deleteAddressFormat

public int deleteAddressFormat(int id)
                        throws KKAdminException
Delete an AddressFormat

Specified by:
deleteAddressFormat in interface AdminAddressMgrIf
Parameters:
id - An AddressFormat id
Returns:
returns the id of the deleted AddressFormat
Throws:
KKAdminException

insertAddressFormat

public int insertAddressFormat(AdminAddressFormat taxClass)
                        throws KKAdminException
Insert an AdminAddressFormat object

Specified by:
insertAddressFormat in interface AdminAddressMgrIf
Parameters:
taxClass - An AdminAddressFormat object
Returns:
returns the id of the inserted AdminAddressFormat object
Throws:
KKAdminException

updateAddressFormat

public int updateAddressFormat(AdminAddressFormat taxClass)
                        throws KKAdminException
Update an AdminAddressFormat object

Specified by:
updateAddressFormat in interface AdminAddressMgrIf
Parameters:
taxClass - An AdminAddressFormat object
Returns:
returns the id of the updated AdminAddressFormat object
Throws:
KKAdminException

addAddressFormatOrderBy

protected void addAddressFormatOrderBy(com.konakart.bl.KKCriteria c,
                                       AdminAddressFormatSearch search)

addAddressFormatSearchCriteria

protected int addAddressFormatSearchCriteria(com.konakart.bl.KKCriteria c,
                                             AdminAddressFormatSearch search)

doesAddressFormatExist

public boolean doesAddressFormatExist(int addressFormatId)
                               throws org.apache.torque.TorqueException,
                                      KKAdminException
Return true if the AddressFormat exists.

Specified by:
doesAddressFormatExist in interface AdminAddressMgrIf
Parameters:
addressFormatId -
Returns:
True if the category exists
Throws:
org.apache.torque.TorqueException
KKAdminException

refreshConfigs

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

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

doesAddressExistForId

public boolean doesAddressExistForId(int addrId)
                              throws org.apache.torque.TorqueException,
                                     KKAdminException
Checks to see whether an address already exists with this id

Specified by:
doesAddressExistForId in interface AdminAddressMgrIf
Parameters:
addrId -
Returns:
Returns true if the address already exists
Throws:
org.apache.torque.TorqueException
KKAdminException

getAddressById

public AdminAddress getAddressById(int addressId)
                            throws KKAdminException,
                                   org.apache.torque.TorqueException,
                                   com.workingdogs.village.DataSetException
Description copied from interface: AdminAddressMgrIf
Get Addresses defined by the search criteria

Specified by:
getAddressById in interface AdminAddressMgrIf
Parameters:
addressId - the id of the address to retrieve
Returns:
the Address with the specified Id if it exists, otherwise null.
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getAddresses

public AdminAddressSearchResult getAddresses(AdminAddressSearch search,
                                             int offset,
                                             int size)
                                      throws KKAdminException,
                                             org.apache.torque.TorqueException,
                                             com.workingdogs.village.DataSetException
Description copied from interface: AdminAddressMgrIf
Get Addresses defined by the search criteria

Specified by:
getAddresses in interface AdminAddressMgrIf
Parameters:
search - the search criteria
offset - the offset in the record set to start from
size - the maximum number of records to return
Returns:
an AdminAddressSearchResult object
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

addAddressSearchCriteria

protected void addAddressSearchCriteria(com.konakart.bl.KKCriteria c,
                                        AdminAddressSearch search)

addAddressOrderBy

protected void addAddressOrderBy(com.konakart.bl.KKCriteria c,
                                 AdminAddressSearch search)

getCount

protected int getCount(org.apache.torque.util.Criteria c,
                       java.lang.String key)
                throws org.apache.torque.TorqueException,
                       com.workingdogs.village.DataSetException
This method is mainly used for paging.

Parameters:
c -
key - we have to use a key instead of just a * when there are no search criteria
Returns:
The number of records present in the database matching the given criteria
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

setAddressCriteriaWithStandardAttributes

protected void setAddressCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c)
Common code to avoid duplication

Parameters:
c -

deleteAddress

public void deleteAddress(int addressId)
                   throws KKAdminException
Description copied from interface: AdminAddressMgrIf
Deletes an AdminAddress.

Specified by:
deleteAddress in interface AdminAddressMgrIf
Parameters:
addressId - the id of the address to delete
Throws:
KKAdminException

insertAddress

public int insertAddress(AdminAddress address)
                  throws java.lang.Exception
Description copied from interface: AdminAddressMgrIf
Insert an AdminAddress.

Specified by:
insertAddress in interface AdminAddressMgrIf
Parameters:
address - an AdminAddress object
Returns:
Returns the addresId of the newly-inserted AdminAddress
Throws:
java.lang.Exception

updateAddress

public void updateAddress(AdminAddress address)
                   throws KKAdminException
Description copied from interface: AdminAddressMgrIf
Updates an AdminAddress.

Specified by:
updateAddress in interface AdminAddressMgrIf
Parameters:
address - the AdminAddress object to update
Throws:
KKAdminException

addAddressesToProduct

public void addAddressesToProduct(AdminAddress[] addresses,
                                  int productId)
                           throws KKAdminException,
                                  org.apache.torque.TorqueException,
                                  com.workingdogs.village.DataSetException
Associate an array of addresses to a product.

Specified by:
addAddressesToProduct in interface AdminAddressMgrIf
Parameters:
addresses -
productId -
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

removeAddressFromProduct

public void removeAddressFromProduct(int addressId,
                                     int productId)
                              throws KKAdminException,
                                     org.apache.torque.TorqueException,
                                     com.workingdogs.village.DataSetException
Remove the relationship between the address and the product.

Specified by:
removeAddressFromProduct in interface AdminAddressMgrIf
Parameters:
addressId -
productId -
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getProductCountPerAddress

public int getProductCountPerAddress(int addressId)
                              throws com.workingdogs.village.DataSetException,
                                     KKAdminException,
                                     org.apache.torque.TorqueException
Returns the number of products using the address

Specified by:
getProductCountPerAddress in interface AdminAddressMgrIf
Parameters:
addressId -
Returns:
Return the number of products using the address
Throws:
com.workingdogs.village.DataSetException
KKAdminException
org.apache.torque.TorqueException


Copyright © 2011 DS Data Systems UK Ltd.