com.konakartadmin.bl
Class AdminCustomerMgr

java.lang.Object
  extended by com.konakartadmin.bl.AdminBaseMgr
      extended by com.konakartadmin.bl.AdminCustomerMgr
All Implemented Interfaces:
AdminCustomerMgrIf

public class AdminCustomerMgr
extends AdminBaseMgr
implements AdminCustomerMgrIf

The AdminCustomerMgr - for Managing Customer Objects for the Admin Application


Nested Class Summary
 
Nested classes/interfaces inherited from class com.konakartadmin.bl.AdminBaseMgr
AdminBaseMgr.StaticData
 
Field Summary
protected static java.lang.String availableChars
          Used for password generation
protected static boolean DEFAULT_DELETE_REVIEWS
          default is to delete reviews
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
AdminCustomerMgr(KKAdminIf eng)
          Constructor
 
Method Summary
protected  void addCustomerGroupOrderBy(com.konakart.bl.KKCriteria c, AdminCustomerGroupSearch search)
          Add CustomerGroup OrderBy
protected  int addCustomerGroupSearchCriteria(com.konakart.bl.KKCriteria c, AdminCustomerGroupSearch search)
           
protected  void addCustomerOrderBy(com.konakart.bl.KKCriteria c, AdminCustomerSearch custSearch)
          Add Customer OrderBy
protected  int addCustomerSearchCriteria(com.konakart.bl.KKCriteria c, AdminCustomerSearch custSearch, boolean addressJoin)
          Adds search criteria to the query depending on what is in the custSearch object
 int deleteCustomer(int custId)
          Deletes a customer from the database.
 int deleteCustomerGroup(int custGroupId)
          Delete a Customer Group.
protected  void deleteCustomerReviews(int custId, java.sql.Connection con)
          Deletes a customer's reviews from the database.
 void deleteProductNotification(int custId, int prodId)
          Delete a Product Notification record for the specified customer and product if it's found.
protected  boolean deleteReviews()
          Utility method to return the konakart.delete_reviews property value
protected  boolean doesCountryExist(int countryId)
           
 boolean doesCustomerExistForEmail(java.lang.String emailAddr)
          Checks to see whether a customer already exists with this email address.
 boolean doesCustomerExistForId(int custId)
          Checks to see whether a customer already exists with this id
protected  boolean doesZoneExist(java.lang.String zoneDesc, int countryId)
          If a country has at least one zone defined in the database, then we assume that all zones are defined and ensure that we only allow zones that are defined in the database.
 int forceRegisterCustomer(AdminCustomerRegistration custReg)
          Calls RegisterCustomerPrivate() with force set to true
 java.lang.String getAddressFormatTemplate(int id)
          Does a query on the address_format table
 AdminAddressFormat[] getAllAddressFormats()
          This returns an array of all the address formats
protected  int getCount(com.konakart.bl.KKCriteria c)
          This method is mainly used for paging.
 AdminCustomer getCustomerForEmail(java.lang.String emailAddr)
          Checks to see whether a customer already exists with this email address and returns the customer object if it does exist.
 AdminCustomer getCustomerForId(int customerId)
          Returns the customer object for the customer defined by the given id.
 AdminCustomerGroupSearchResult getCustomerGroups(AdminCustomerGroupSearch search)
          This returns an AdminCustomerGroupSearchResult object.
 AdminCustomerGroup[] getCustomerGroupsPerPromotion(int promotionId, int languageId)
          Returns all of the customer groups for the promotion
 AdminCustomerSearchResult getCustomers(AdminCustomerSearch custSearch, int offset, int size)
          Returns a set of Customers that match the search criteria
 int getCustomersCount(AdminCustomerSearch search)
          Returns a count of the number of Customers
 AdminCustomerSearchResult getCustomersLite(AdminCustomerSearch custSearch, int offset, int size)
          Returns a set of "Lite" Customers that match the search criteria.
 AdminProductNotification[] getProductNotificationsForCustomer(int customerId)
          Get an array of product notifications for the customer
 java.lang.String getRandomPassword(int length)
          If length == 0, the configuration value ENTRY_PASSWORD_MIN_LENGTH is used.
 int insertCustomerGroup(AdminCustomerGroup custGroup)
          Insert a customer group
 int insertCustomerGroups(AdminCustomerGroup[] custGroups)
          Insert an array of AdminCustomerGroup objects.
 void insertProductNotification(int custId, int prodId)
          Insert a Product Notification record for the specified customer and product.
 void refreshConfigs()
          Refresh the configuration of the Admin Currency Manager
 int registerCustomer(AdminCustomerRegistration custReg)
          Calls RegisterCustomerPrivate() with force set to false
 int registerCustomerPrivate(AdminCustomerRegistration custReg, boolean force)
          A new customer is added to the system.
 void resetCustomerPassword(int custId)
          Reset a customer's password.
protected  void resetCustomerPassword(int custId, java.lang.String eMailAddr)
          Reset a customer's password.
 void resetCustomerPasswordSpecifyingEmail(int custId, java.lang.String eMailAddress)
          Reset a customer's password using the eMail address specified.
 void sendTemplateEmailToCustomers(AdminCustomerSearch custSearch, java.lang.String templateName, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4, java.lang.Object obj5, int numberEmailThreads)
          Calls sendTemplateEmailToCustomersWithOptions() with null options.
 void sendTemplateEmailToCustomersWithOptions(AdminCustomerSearch custSearch, java.lang.String templateName, java.lang.Object obj1, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4, java.lang.Object obj5, int numberEmailThreads, AdminEmailOptions options)
          An email is sent to the customer.
protected  void setCustGroupCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c)
          Set CustomerGroup criteria with standard attributes
 void setCustomerPassword(int customerId, java.lang.String password)
          Sets the customer password.
 void updateCustomer(AdminCustomer cust)
          We must update the following tables: customers, address_book (for the default address) and customers_info
 int updateCustomerGroup(AdminCustomerGroup custGroup)
          Update a customer group
protected  void updateCustomerReviews(int custId, java.sql.Connection con)
          Updates a customer's reviews by setting the custId to null.
 
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


DEFAULT_DELETE_REVIEWS

protected static final boolean DEFAULT_DELETE_REVIEWS
default is to delete reviews

See Also:
Constant Field Values

availableChars

protected static final java.lang.String availableChars
Used for password generation

See Also:
Constant Field Values
Constructor Detail

AdminCustomerMgr

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

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

getCustomersCount

public int getCustomersCount(AdminCustomerSearch search)
                      throws org.apache.torque.TorqueException,
                             com.workingdogs.village.DataSetException,
                             KKAdminException
Returns a count of the number of Customers

Specified by:
getCustomersCount in interface AdminCustomerMgrIf
Parameters:
search - Search criteria
Returns:
A count of the number of Customers
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getCustomers

public AdminCustomerSearchResult getCustomers(AdminCustomerSearch custSearch,
                                              int offset,
                                              int size)
                                       throws java.lang.Exception
Returns a set of Customers that match the search criteria

Specified by:
getCustomers in interface AdminCustomerMgrIf
Parameters:
custSearch - the definition of the search for customers - can be null
offset - the offset in the db
size - the number of records from the specified offset
Returns:
a set of customers matching the search criteria
Throws:
java.lang.Exception

getCustomersLite

public AdminCustomerSearchResult getCustomersLite(AdminCustomerSearch custSearch,
                                                  int offset,
                                                  int size)
                                           throws KKAdminException
Returns a set of "Lite" Customers that match the search criteria. ONly a few attributes are populated on "Lite" Customers

Specified by:
getCustomersLite in interface AdminCustomerMgrIf
Parameters:
custSearch - the definition of the search for customers - can be null
offset - the offset in the db
size - the number of records from the specified offset
Returns:
a set of customers matching the search criteria within an AdminCustomerSearchResult object
Throws:
KKAdminException

getProductNotificationsForCustomer

public AdminProductNotification[] getProductNotificationsForCustomer(int customerId)
                                                              throws java.lang.Exception
Get an array of product notifications for the customer

Specified by:
getProductNotificationsForCustomer in interface AdminCustomerMgrIf
Parameters:
customerId -
Returns:
an array of product notifications for the customer
Throws:
java.lang.Exception

updateCustomer

public void updateCustomer(AdminCustomer cust)
                    throws java.lang.Exception
We must update the following tables: customers, address_book (for the default address) and customers_info

Specified by:
updateCustomer in interface AdminCustomerMgrIf
Parameters:
cust - the customer - must already have a good ID
Throws:
java.lang.Exception

deleteCustomer

public int deleteCustomer(int custId)
                   throws java.lang.Exception
Deletes a customer from the database. If the property "delete_reviews" is set to "on" the reviews created by this customer will be removed. If not, the customerID associated with the reviews will be set to null but the reviews will remain.

Removes records from :

Parameters :

Specified by:
deleteCustomer in interface AdminCustomerMgrIf
Parameters:
custId -
Returns:
returns the id of the deleted customer
Throws:
java.lang.Exception

deleteReviews

protected boolean deleteReviews()
                         throws KKAdminException
Utility method to return the konakart.delete_reviews property value

Returns:
Value of the property value (true or false)
Throws:
KKAdminException

deleteCustomerReviews

protected void deleteCustomerReviews(int custId,
                                     java.sql.Connection con)
                              throws java.lang.Exception
Deletes a customer's reviews from the database. This is a dependent transaction - commits, rollbacks should be handled by the caller.

Removes records from :

Parameters :

Parameters:
custId -
con -
Throws:
java.lang.Exception

updateCustomerReviews

protected void updateCustomerReviews(int custId,
                                     java.sql.Connection con)
                              throws java.lang.Exception
Updates a customer's reviews by setting the custId to null. This is a dependent transaction - commits, rollbacks should be handled by the caller.

Updates records from :

Parameters :

Parameters:
custId -
con -
Throws:
java.lang.Exception

forceRegisterCustomer

public int forceRegisterCustomer(AdminCustomerRegistration custReg)
                          throws java.lang.Exception
Calls RegisterCustomerPrivate() with force set to true

Specified by:
forceRegisterCustomer in interface AdminCustomerMgrIf
Parameters:
custReg -
Returns:
Returns the customer id of the registered customer
Throws:
java.lang.Exception

registerCustomer

public int registerCustomer(AdminCustomerRegistration custReg)
                     throws java.lang.Exception
Calls RegisterCustomerPrivate() with force set to false

Specified by:
registerCustomer in interface AdminCustomerMgrIf
Parameters:
custReg -
Returns:
Returns the customer id of the registered customer
Throws:
java.lang.Exception

registerCustomerPrivate

public int registerCustomerPrivate(AdminCustomerRegistration custReg,
                                   boolean force)
                            throws java.lang.Exception
A new customer is added to the system. The process for adding a new customer is to :
  1. Insert information in the Customers table where a new primary key is generated
  2. Insert address information in the address_book table
  3. Update the customer record with the address id
  4. Insert a customers_info record with the same PK as the customer
All of the above actions are performed as a transaction. In the case of MySQL, the transaction doesn't work unless the tables are defined as using the InnoDB or BDB engines. A table can be transformed using the following syntax : Alter table t Engine = InnoDB;. The standard engine seems to be MyIsam which doesn't support transactions.

Parameters:
custReg -
force -
Returns:
int : Customer Id
Throws:
java.lang.Exception

resetCustomerPasswordSpecifyingEmail

public void resetCustomerPasswordSpecifyingEmail(int custId,
                                                 java.lang.String eMailAddress)
                                          throws KKAdminException
Reset a customer's password using the eMail address specified. A new password is generated for the specified customer and an email is sent to the customer to inform him of this new password.

Specified by:
resetCustomerPasswordSpecifyingEmail in interface AdminCustomerMgrIf
Parameters:
custId - Customer Id
eMailAddress - The eMail address to override the one from the customer object
Throws:
KKAdminException - if the customer is not found, or problems resetting the password or sending the email.

resetCustomerPassword

public void resetCustomerPassword(int custId)
                           throws KKAdminException
Reset a customer's password. A new password is generated for the specified customer and an email is sent to the customer to inform him of this new password.

Specified by:
resetCustomerPassword in interface AdminCustomerMgrIf
Parameters:
custId - Customer Id
Throws:
KKAdminException - if the customer is not found, the customer has no email address (which is used as the username), or problems resetting the password or sending the email.

resetCustomerPassword

protected void resetCustomerPassword(int custId,
                                     java.lang.String eMailAddr)
                              throws KKAdminException
Reset a customer's password. A new password is generated for the specified customer and an email is sent to the customer to inform him of this new password.

Parameters:
custId - Customer Id
eMailAddr - The eMail address to override the one from the customer object
Throws:
KKAdminException - if the customer is not found, the customer has no email address (which is used as the username), or problems resetting the password or sending the email.

setCustomerPassword

public void setCustomerPassword(int customerId,
                                java.lang.String password)
                         throws java.lang.Exception
Sets the customer password.

Specified by:
setCustomerPassword in interface AdminCustomerMgrIf
Parameters:
customerId -
password -
Throws:
java.lang.Exception

getRandomPassword

public java.lang.String getRandomPassword(int length)
                                   throws java.lang.Exception
If length == 0, the configuration value ENTRY_PASSWORD_MIN_LENGTH is used.

Specified by:
getRandomPassword in interface AdminCustomerMgrIf
Parameters:
length -
Returns:
Returns a random password
Throws:
java.lang.Exception

doesZoneExist

protected boolean doesZoneExist(java.lang.String zoneDesc,
                                int countryId)
                         throws java.lang.Exception
If a country has at least one zone defined in the database, then we assume that all zones are defined and ensure that we only allow zones that are defined in the database. Otherwise we allow the user to register an address with any string as the zone.

Parameters:
zoneDesc -
countryId -
Returns:
True if the zone exists in the country referenced by countryId or the country has no zones defined. Otherwise return false.
Throws:
java.lang.Exception
com.konakart.app.KKException

addCustomerOrderBy

protected void addCustomerOrderBy(com.konakart.bl.KKCriteria c,
                                  AdminCustomerSearch custSearch)
Add Customer OrderBy

Parameters:
c -
custSearch -

addCustomerSearchCriteria

protected int addCustomerSearchCriteria(com.konakart.bl.KKCriteria c,
                                        AdminCustomerSearch custSearch,
                                        boolean addressJoin)
Adds search criteria to the query depending on what is in the custSearch object

Parameters:
c - The KKCriteria object
custSearch - The AdminCustomerSearch object
addressJoin - Set to true if the criteria already contains a join to the address table
Returns:
returns a count of the constraints added

getCount

protected int getCount(com.konakart.bl.KKCriteria c)
                throws org.apache.torque.TorqueException,
                       com.workingdogs.village.DataSetException
This method is mainly used for paging.

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

doesCountryExist

protected boolean doesCountryExist(int countryId)
                            throws org.apache.torque.TorqueException,
                                   KKAdminException
Parameters:
countryId -
Returns:
True if the country referenced by countryId exists. Otherwise return false.
Throws:
org.apache.torque.TorqueException
KKAdminException

doesCustomerExistForEmail

public boolean doesCustomerExistForEmail(java.lang.String emailAddr)
                                  throws org.apache.torque.TorqueException,
                                         KKAdminException
Checks to see whether a customer already exists with this email address.

Specified by:
doesCustomerExistForEmail in interface AdminCustomerMgrIf
Parameters:
emailAddr -
Returns:
Returns true if the customer already exists
Throws:
org.apache.torque.TorqueException
KKAdminException

doesCustomerExistForId

public boolean doesCustomerExistForId(int custId)
                               throws org.apache.torque.TorqueException,
                                      KKAdminException
Checks to see whether a customer already exists with this id

Specified by:
doesCustomerExistForId in interface AdminCustomerMgrIf
Parameters:
custId -
Returns:
Returns true if the customer already exists
Throws:
org.apache.torque.TorqueException
KKAdminException

getCustomerForEmail

public AdminCustomer getCustomerForEmail(java.lang.String emailAddr)
                                  throws java.lang.Exception
Checks to see whether a customer already exists with this email address and returns the customer object if it does exist.

Specified by:
getCustomerForEmail in interface AdminCustomerMgrIf
Parameters:
emailAddr -
Returns:
Returns a Customer object if the customer already exists
Throws:
java.lang.Exception
org.apache.torque.TorqueException
KKAdminException
com.workingdogs.village.DataSetException

getCustomerForId

public AdminCustomer getCustomerForId(int customerId)
                               throws java.lang.Exception
Returns the customer object for the customer defined by the given id.

Specified by:
getCustomerForId in interface AdminCustomerMgrIf
Parameters:
customerId -
Returns:
Customer Object or Null if the customer doesn't exist.
Throws:
java.lang.Exception

getAddressFormatTemplate

public java.lang.String getAddressFormatTemplate(int id)
                                          throws org.apache.torque.TorqueException,
                                                 com.workingdogs.village.DataSetException,
                                                 KKAdminException
Does a query on the address_format table

Specified by:
getAddressFormatTemplate in interface AdminCustomerMgrIf
Parameters:
id -
Returns:
Returns the template referenced by the id parameter
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getAllAddressFormats

public AdminAddressFormat[] getAllAddressFormats()
                                          throws KKAdminException
This returns an array of all the address formats

Specified by:
getAllAddressFormats in interface AdminCustomerMgrIf
Returns:
Returns an array of all the address formats
Throws:
KKAdminException

sendTemplateEmailToCustomers

public void sendTemplateEmailToCustomers(AdminCustomerSearch custSearch,
                                         java.lang.String templateName,
                                         java.lang.Object obj1,
                                         java.lang.Object obj2,
                                         java.lang.Object obj3,
                                         java.lang.Object obj4,
                                         java.lang.Object obj5,
                                         int numberEmailThreads)
                                  throws org.apache.torque.TorqueException,
                                         com.workingdogs.village.DataSetException,
                                         java.lang.Exception
Calls sendTemplateEmailToCustomersWithOptions() with null options.

Specified by:
sendTemplateEmailToCustomers in interface AdminCustomerMgrIf
Parameters:
custSearch - The AdminCustomerSearch object which determines the customers that are selected.
templateName - The name of the template. The country code and .vm will be appended automatically. i.e. If the template name is newsletter and the country code is en, then we will look for a file called newsletter_en.vm. This file should be in the classpath.
obj1 - This object will be passed to the velocity template with the name obj1.
obj2 - This object will be passed to the velocity template with the name obj2.
obj3 - This object will be passed to the velocity template with the name obj3.
obj4 - This object will be passed to the velocity template with the name obj4.
obj5 - This object will be passed to the velocity template with the name obj5.
numberEmailThreads - The number of concurrent threads that will be used to send the emails.
Throws:
java.lang.Exception
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
java.lang.Exception

sendTemplateEmailToCustomersWithOptions

public void sendTemplateEmailToCustomersWithOptions(AdminCustomerSearch custSearch,
                                                    java.lang.String templateName,
                                                    java.lang.Object obj1,
                                                    java.lang.Object obj2,
                                                    java.lang.Object obj3,
                                                    java.lang.Object obj4,
                                                    java.lang.Object obj5,
                                                    int numberEmailThreads,
                                                    AdminEmailOptions options)
                                             throws org.apache.torque.TorqueException,
                                                    com.workingdogs.village.DataSetException,
                                                    java.lang.Exception
An email is sent to the customer. The email is generated by the template called templateName and the objects obj1-obj5 are passed to the template. The subject of the eMail is picked up from the first line of the template.

Specified by:
sendTemplateEmailToCustomersWithOptions in interface AdminCustomerMgrIf
Parameters:
custSearch - The AdminCustomerSearch object which determines the customers that are selected.
templateName - The name of the template. The country code and .vm will be appended automatically. i.e. If the template name is newsletter and the country code is en, then we will look for a file called newsletter_en.vm. This file should be in the classpath.
obj1 - This object will be passed to the velocity template with the name obj1.
obj2 - This object will be passed to the velocity template with the name obj2.
obj3 - This object will be passed to the velocity template with the name obj3.
obj4 - This object will be passed to the velocity template with the name obj4.
obj5 - This object will be passed to the velocity template with the name obj5.
numberEmailThreads - The number of concurrent threads that will be used to send the emails.
options - An object used to configure options used when sending eMails from the AdminApp
Throws:
java.lang.Exception
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
java.lang.Exception

insertProductNotification

public void insertProductNotification(int custId,
                                      int prodId)
                               throws KKAdminException
Insert a Product Notification record for the specified customer and product.

Specified by:
insertProductNotification in interface AdminCustomerMgrIf
Parameters:
custId - the customerId
prodId - the productId
Throws:
KKAdminException

deleteProductNotification

public void deleteProductNotification(int custId,
                                      int prodId)
                               throws KKAdminException
Delete a Product Notification record for the specified customer and product if it's found.

Specified by:
deleteProductNotification in interface AdminCustomerMgrIf
Parameters:
custId - the customerId
prodId - the productId
Throws:
KKAdminException

getCustomerGroupsPerPromotion

public AdminCustomerGroup[] getCustomerGroupsPerPromotion(int promotionId,
                                                          int languageId)
                                                   throws java.lang.Exception
Returns all of the customer groups for the promotion

Specified by:
getCustomerGroupsPerPromotion in interface AdminCustomerMgrIf
Parameters:
promotionId -
languageId -
Returns:
Array of AdminCustomerGroup Objects
Throws:
java.lang.Exception

insertCustomerGroup

public int insertCustomerGroup(AdminCustomerGroup custGroup)
                        throws KKAdminException,
                               org.apache.torque.TorqueException,
                               com.workingdogs.village.DataSetException
Insert a customer group

Specified by:
insertCustomerGroup in interface AdminCustomerMgrIf
Parameters:
custGroup - A customer group object
Returns:
returns the id of the inserted customer group
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

insertCustomerGroups

public int insertCustomerGroups(AdminCustomerGroup[] custGroups)
                         throws KKAdminException,
                                org.apache.torque.TorqueException,
                                com.workingdogs.village.DataSetException
Insert an array of AdminCustomerGroup objects. We calculate and use the same id for all of the items in the array so you must ensure that each item has a unique language id, otherwise the DB will throw an exception.

Specified by:
insertCustomerGroups in interface AdminCustomerMgrIf
Parameters:
custGroups - An array of AdminCustomerGroup objects
Returns:
returns the id of the inserted objects
Throws:
org.apache.torque.TorqueException
KKAdminException
com.workingdogs.village.DataSetException

updateCustomerGroup

public int updateCustomerGroup(AdminCustomerGroup custGroup)
                        throws KKAdminException,
                               org.apache.torque.TorqueException
Update a customer group

Specified by:
updateCustomerGroup in interface AdminCustomerMgrIf
Parameters:
custGroup - A customer group object
Returns:
Returns the id of the customer group
Throws:
KKAdminException
org.apache.torque.TorqueException

deleteCustomerGroup

public int deleteCustomerGroup(int custGroupId)
                        throws java.lang.Exception
Delete a Customer Group. The method may actually delete multiple database records if the customer group has entries for different languages.

Specified by:
deleteCustomerGroup in interface AdminCustomerMgrIf
Parameters:
custGroupId - The id of a customer group object
Returns:
returns the id of the deleted customer group
Throws:
java.lang.Exception

getCustomerGroups

public AdminCustomerGroupSearchResult getCustomerGroups(AdminCustomerGroupSearch search)
                                                 throws org.apache.torque.TorqueException,
                                                        com.workingdogs.village.DataSetException,
                                                        KKAdminException
This returns an AdminCustomerGroupSearchResult object.

Specified by:
getCustomerGroups in interface AdminCustomerMgrIf
Parameters:
search -
Returns:
Returns an AdminCustomerGroupSearchResult object
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

addCustomerGroupSearchCriteria

protected int addCustomerGroupSearchCriteria(com.konakart.bl.KKCriteria c,
                                             AdminCustomerGroupSearch search)
                                      throws KKAdminException
Parameters:
c -
search -
Returns:
number of constraints added to the criteria
Throws:
KKAdminException

setCustGroupCriteriaWithStandardAttributes

protected void setCustGroupCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c)
Set CustomerGroup criteria with standard attributes

Parameters:
c -

addCustomerGroupOrderBy

protected void addCustomerGroupOrderBy(com.konakart.bl.KKCriteria c,
                                       AdminCustomerGroupSearch search)
Add CustomerGroup OrderBy

Parameters:
c -
search -

refreshConfigs

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

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


Copyright © 2011 DS Data Systems UK Ltd.