|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.konakartadmin.bl.AdminBaseMgr
com.konakartadmin.bl.AdminCustomerMgr
public class AdminCustomerMgr
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
protected static final boolean DEFAULT_DELETE_REVIEWS
protected static final java.lang.String availableChars
Constructor Detail |
---|
public AdminCustomerMgr(KKAdminIf eng) throws java.lang.Exception
eng
-
java.lang.Exception
Method Detail |
---|
public int getCustomersCount(AdminCustomerSearch search) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
getCustomersCount
in interface AdminCustomerMgrIf
search
- Search criteria
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
public AdminCustomerSearchResult getCustomers(AdminCustomerSearch custSearch, int offset, int size) throws java.lang.Exception
getCustomers
in interface AdminCustomerMgrIf
custSearch
- the definition of the search for customers - can be nulloffset
- the offset in the dbsize
- the number of records from the specified offset
java.lang.Exception
public AdminCustomerSearchResult getCustomersLite(AdminCustomerSearch custSearch, int offset, int size) throws KKAdminException
getCustomersLite
in interface AdminCustomerMgrIf
custSearch
- the definition of the search for customers - can be nulloffset
- the offset in the dbsize
- the number of records from the specified offset
KKAdminException
public AdminProductNotification[] getProductNotificationsForCustomer(int customerId) throws java.lang.Exception
getProductNotificationsForCustomer
in interface AdminCustomerMgrIf
customerId
-
java.lang.Exception
public void updateCustomer(AdminCustomer cust) throws java.lang.Exception
updateCustomer
in interface AdminCustomerMgrIf
cust
- the customer - must already have a good ID
java.lang.Exception
public int deleteCustomer(int custId) throws java.lang.Exception
Removes records from :
Parameters :
deleteCustomer
in interface AdminCustomerMgrIf
custId
-
java.lang.Exception
protected boolean deleteReviews() throws KKAdminException
KKAdminException
protected void deleteCustomerReviews(int custId, java.sql.Connection con) throws java.lang.Exception
Removes records from :
Parameters :
custId
- con
-
java.lang.Exception
protected void updateCustomerReviews(int custId, java.sql.Connection con) throws java.lang.Exception
Updates records from :
Parameters :
custId
- con
-
java.lang.Exception
public int forceRegisterCustomer(AdminCustomerRegistration custReg) throws java.lang.Exception
forceRegisterCustomer
in interface AdminCustomerMgrIf
custReg
-
java.lang.Exception
public int registerCustomer(AdminCustomerRegistration custReg) throws java.lang.Exception
registerCustomer
in interface AdminCustomerMgrIf
custReg
-
java.lang.Exception
public int registerCustomerPrivate(AdminCustomerRegistration custReg, boolean force) throws java.lang.Exception
Alter table t Engine = InnoDB;
. The standard engine seems to be MyIsam which
doesn't support transactions.
custReg
- force
-
java.lang.Exception
public void resetCustomerPasswordSpecifyingEmail(int custId, java.lang.String eMailAddress) throws KKAdminException
resetCustomerPasswordSpecifyingEmail
in interface AdminCustomerMgrIf
custId
- Customer IdeMailAddress
- The eMail address to override the one from the customer object
KKAdminException
- if the customer is not found, or problems resetting the password or sending the
email.public void resetCustomerPassword(int custId) throws KKAdminException
resetCustomerPassword
in interface AdminCustomerMgrIf
custId
- Customer Id
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.protected void resetCustomerPassword(int custId, java.lang.String eMailAddr) throws KKAdminException
custId
- Customer IdeMailAddr
- The eMail address to override the one from the customer object
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.public void setCustomerPassword(int customerId, java.lang.String password) throws java.lang.Exception
setCustomerPassword
in interface AdminCustomerMgrIf
customerId
- password
-
java.lang.Exception
public java.lang.String getRandomPassword(int length) throws java.lang.Exception
getRandomPassword
in interface AdminCustomerMgrIf
length
-
java.lang.Exception
protected boolean doesZoneExist(java.lang.String zoneDesc, int countryId) throws java.lang.Exception
zoneDesc
- countryId
-
java.lang.Exception
com.konakart.app.KKException
protected void addCustomerOrderBy(com.konakart.bl.KKCriteria c, AdminCustomerSearch custSearch)
c
- custSearch
- protected int addCustomerSearchCriteria(com.konakart.bl.KKCriteria c, AdminCustomerSearch custSearch, boolean addressJoin)
c
- The KKCriteria objectcustSearch
- The AdminCustomerSearch objectaddressJoin
- Set to true if the criteria already contains a join to the address table
protected int getCount(com.konakart.bl.KKCriteria c) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
c
- the Criteria
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
protected boolean doesCountryExist(int countryId) throws org.apache.torque.TorqueException, KKAdminException
countryId
-
org.apache.torque.TorqueException
KKAdminException
public boolean doesCustomerExistForEmail(java.lang.String emailAddr) throws org.apache.torque.TorqueException, KKAdminException
doesCustomerExistForEmail
in interface AdminCustomerMgrIf
emailAddr
-
org.apache.torque.TorqueException
KKAdminException
public boolean doesCustomerExistForId(int custId) throws org.apache.torque.TorqueException, KKAdminException
doesCustomerExistForId
in interface AdminCustomerMgrIf
custId
-
org.apache.torque.TorqueException
KKAdminException
public AdminCustomer getCustomerForEmail(java.lang.String emailAddr) throws java.lang.Exception
getCustomerForEmail
in interface AdminCustomerMgrIf
emailAddr
-
java.lang.Exception
org.apache.torque.TorqueException
KKAdminException
com.workingdogs.village.DataSetException
public AdminCustomer getCustomerForId(int customerId) throws java.lang.Exception
getCustomerForId
in interface AdminCustomerMgrIf
customerId
-
java.lang.Exception
public java.lang.String getAddressFormatTemplate(int id) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
getAddressFormatTemplate
in interface AdminCustomerMgrIf
id
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
public AdminAddressFormat[] getAllAddressFormats() throws KKAdminException
getAllAddressFormats
in interface AdminCustomerMgrIf
KKAdminException
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
sendTemplateEmailToCustomers
in interface AdminCustomerMgrIf
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.
java.lang.Exception
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
java.lang.Exception
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
sendTemplateEmailToCustomersWithOptions
in interface AdminCustomerMgrIf
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
java.lang.Exception
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
java.lang.Exception
public void insertProductNotification(int custId, int prodId) throws KKAdminException
insertProductNotification
in interface AdminCustomerMgrIf
custId
- the customerIdprodId
- the productId
KKAdminException
public void deleteProductNotification(int custId, int prodId) throws KKAdminException
deleteProductNotification
in interface AdminCustomerMgrIf
custId
- the customerIdprodId
- the productId
KKAdminException
public AdminCustomerGroup[] getCustomerGroupsPerPromotion(int promotionId, int languageId) throws java.lang.Exception
getCustomerGroupsPerPromotion
in interface AdminCustomerMgrIf
promotionId
- languageId
-
java.lang.Exception
public int insertCustomerGroup(AdminCustomerGroup custGroup) throws KKAdminException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
insertCustomerGroup
in interface AdminCustomerMgrIf
custGroup
- A customer group object
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
public int insertCustomerGroups(AdminCustomerGroup[] custGroups) throws KKAdminException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
insertCustomerGroups
in interface AdminCustomerMgrIf
custGroups
- An array of AdminCustomerGroup objects
org.apache.torque.TorqueException
KKAdminException
com.workingdogs.village.DataSetException
public int updateCustomerGroup(AdminCustomerGroup custGroup) throws KKAdminException, org.apache.torque.TorqueException
updateCustomerGroup
in interface AdminCustomerMgrIf
custGroup
- A customer group object
KKAdminException
org.apache.torque.TorqueException
public int deleteCustomerGroup(int custGroupId) throws java.lang.Exception
deleteCustomerGroup
in interface AdminCustomerMgrIf
custGroupId
- The id of a customer group object
java.lang.Exception
public AdminCustomerGroupSearchResult getCustomerGroups(AdminCustomerGroupSearch search) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
getCustomerGroups
in interface AdminCustomerMgrIf
search
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
protected int addCustomerGroupSearchCriteria(com.konakart.bl.KKCriteria c, AdminCustomerGroupSearch search) throws KKAdminException
c
- search
-
KKAdminException
protected void setCustGroupCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c)
c
- protected void addCustomerGroupOrderBy(com.konakart.bl.KKCriteria c, AdminCustomerGroupSearch search)
c
- search
- public void refreshConfigs() throws java.lang.Exception
refreshConfigs
in interface AdminCustomerMgrIf
refreshConfigs
in class AdminBaseMgr
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |