com.konakartadmin.blif
Interface AdminCustomerMgrIf

All Known Implementing Classes:
AdminCustomerMgr

public interface AdminCustomerMgrIf

AdminCustomerMgrIf


Method Summary
 int deleteCustomer(int custId)
          Deletes a customer from the database.
 int deleteCustomerGroup(int custGroupId)
          Delete a Customer Group.
 void deleteProductNotification(int custId, int prodId)
          Delete a Product Notification record for the specified customer and product if it's found.
 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
 int forceRegisterCustomer(AdminCustomerRegistration custReg)
          A new customer is added to the system.
 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
 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)
          A new customer is added to the system.
 void resetCustomerPassword(int custId)
          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.
 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
 

Method Detail

getCustomersCount

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

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

getCustomers

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

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

getProductNotificationsForCustomer

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

Parameters:
customerId - Id of the customer whose product notifications will be returned
Returns:
an array of product notifications for the customer
Throws:
java.lang.Exception

updateCustomer

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

Parameters:
cust - the customer - must already have a good ID
Throws:
java.lang.Exception

deleteCustomer

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 :

Parameters:
custId -
Returns:
returns the id of the deleted customer
Throws:
java.lang.Exception

registerCustomer

int registerCustomer(AdminCustomerRegistration custReg)
                     throws java.lang.Exception
A new customer is added to the system. If an admin user or registered customer already exists with the same eMail address, then an exception is thrown. 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 -
Returns:
int : Customer Id
Throws:
java.lang.Exception

forceRegisterCustomer

int forceRegisterCustomer(AdminCustomerRegistration custReg)
                          throws java.lang.Exception
A new customer is added to the system. If an admin user already exists with the same eMail address, it is deleted. If a registered customer already exists with the same eMail address, then an exception is thrown. 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 -
Returns:
int : Customer Id
Throws:
java.lang.Exception

resetCustomerPasswordSpecifyingEmail

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.

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

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.

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.

setCustomerPassword

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

Parameters:
customerId -
password -
Throws:
java.lang.Exception

getRandomPassword

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

Parameters:
length -
Returns:
Returns a random password
Throws:
java.lang.Exception

doesCustomerExistForEmail

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

Parameters:
emailAddr -
Returns:
Returns true if the customer already exists
Throws:
org.apache.torque.TorqueException
KKAdminException

doesCustomerExistForId

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

Parameters:
custId -
Returns:
Returns true if the customer already exists
Throws:
org.apache.torque.TorqueException
KKAdminException

getCustomerForEmail

AdminCustomer getCustomerForEmail(java.lang.String emailAddr)
                                  throws org.apache.torque.TorqueException,
                                         KKAdminException,
                                         com.workingdogs.village.DataSetException,
                                         java.lang.Exception
Checks to see whether a customer already exists with this email address and returns the customer object if it does exist.

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

getCustomerForId

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

Parameters:
customerId -
Returns:
Customer Object or Null if the customer doesn't exist.
Throws:
java.lang.Exception

getAddressFormatTemplate

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

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

getAllAddressFormats

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

Returns:
Returns an array of all the address formats
Throws:
KKAdminException

sendTemplateEmailToCustomers

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.

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

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.

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

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

Parameters:
custId - the customerId
prodId - the productId
Throws:
KKAdminException

deleteProductNotification

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

Parameters:
custId - the customerId
prodId - the productId
Throws:
KKAdminException

getCustomerGroupsPerPromotion

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

Parameters:
promotionId -
languageId -
Returns:
Array of AdminCustomerGroup Objects
Throws:
java.lang.Exception

insertCustomerGroup

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

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

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.

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

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

Parameters:
custGroup - A customer group object
Returns:
Returns the id of the customer group
Throws:
KKAdminException
org.apache.torque.TorqueException

deleteCustomerGroup

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.

Parameters:
custGroupId - The id of a customer group object
Returns:
returns the id of the deleted customer group
Throws:
java.lang.Exception

getCustomerGroups

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

Parameters:
search -
Returns:
Returns an AdminCustomerGroupSearchResult object
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

refreshConfigs

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

Throws:
java.lang.Exception

getCustomersLite

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

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


Copyright © 2011 DS Data Systems UK Ltd.