public class CustomerMgr extends BaseMgr
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FACEBOOK
Used for loginType
|
static java.lang.String |
GOOGLEPLUS
Used for loginType
|
static java.lang.String |
GOOGLESIGNIN
Used for loginType
|
static java.lang.String |
LDAP
Used for loginType
|
static java.lang.String |
LIFERAY
Used for loginType
|
static java.lang.String |
PAYPAL
Used for loginType
|
Modifier | Constructor and Description |
---|---|
protected |
CustomerMgr(com.konakart.appif.KKEngIf eng,
KKAppEng kkAppEng)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
addAddressToCustomer(com.konakart.appif.AddressIf addr)
Call the engine to create a new customer address which is added to the addresses of the
current customer.
|
void |
addProductNotificationsToCustomer(int productId)
Add the product notification to the currently logged in customer.
|
void |
afterLogin(boolean clearAffiliateId,
java.lang.String password)
Private method to do some housekeeping after a successful login.
|
void |
changePassword(java.lang.String currentPassword,
java.lang.String newPassword)
Calls the engine to change the current password with the new one.
|
protected void |
createGuest()
We create a customer object for a guest.
|
void |
deleteAddressFromCustomer(int addrId)
Call the engine to delete the customer address.
|
void |
deleteCustomer(int custId)
Calls the engine to delete the customer account.
|
void |
deleteProductNotificationsFromCustomer(int productId)
Delete the product notification from the customer's list of notifications.
|
void |
editCustomer(com.konakart.appif.CustomerIf cust)
Calls the engine to update the customer data with the data passed in as a parameter.
|
void |
editCustomerAddress(com.konakart.appif.AddressIf addr)
Call the engine to edit the customer address.
|
void |
editCustomerLocale(java.lang.String locale)
Calls the engine to edit the current customer's locale
|
java.lang.String |
externalLogin(com.konakart.appif.ExternalLoginInputIf loginInfo,
java.lang.String loginType)
Login using a login module (such as Facebook login) and if successful, set the current
customer object.
|
void |
fetchProductNotificationsPerCustomer()
Fetch the product notifications for a customer and language and set them on the customer
object.
|
int |
forceRegisterCustomer(com.konakart.appif.CustomerRegistrationIf cr)
Method used when a customer is allowed to checkout without registering..
|
java.lang.String |
getCatalogKey()
The catalog key used for this customer
|
com.konakart.appif.CustomerIf |
getCurrentCustomer()
Returns the current customer.
|
com.konakart.appif.StoreIf |
getCurrentStore() |
com.konakart.appif.VendorIf |
getCurrentVendor() |
protected void |
getCustomerTags(java.lang.String sessionId)
Get the customer tags for this customer and add them to the hash map
|
java.lang.String |
getLoginType()
Used to store information on how login was performed
|
com.konakart.appif.AddressIf |
getSelectedAddr()
Returns the currently selected address.
|
com.konakart.appif.CountryIf |
getSelectedCountry() |
com.konakart.appif.ZoneIf[] |
getSelectedZones() |
com.konakart.appif.CustomerTagIf |
getTag(java.lang.String key,
boolean fromDB)
Returns the customer tag for the key.
|
java.math.BigDecimal |
getTagValueAsBigDecimal(java.lang.String key)
Returns the tag value as a BigDecimal.
|
java.math.BigDecimal |
getTagValueAsBigDecimal(java.lang.String key,
boolean fromDB)
Returns the tag value as a BigDecimal.
|
java.lang.Boolean |
getTagValueAsBool(java.lang.String key,
java.lang.Boolean def)
Returns the tag value as a Boolean.
|
java.lang.Boolean |
getTagValueAsBool(java.lang.String key,
java.lang.Boolean def,
boolean fromDB)
Returns the tag value as a Boolean.
|
java.lang.String |
getTagValueAsString(java.lang.String key)
Returns the tag value as a String.
|
java.lang.String |
getTagValueAsString(java.lang.String key,
boolean fromDB)
Returns the tag value as a String.
|
boolean |
isCanChangeAddress() |
boolean |
isCustomerTagsAvailable()
Set to true if customer tag functionality is installed
|
boolean |
isNoAddress()
True when a customer hasn't created an address yet
|
boolean |
isNoBirthDate()
True when a customer hasn't added a date of birth yet
|
boolean |
isNoGender()
True when a customer hasn't added a gender yet
|
boolean |
isNoName()
True when a customer hasn't added a name yet
|
boolean |
isNoTelephone()
True when a customer hasn't added a telephone number yet
|
com.konakart.appif.LoginResultIf |
login(java.lang.String loginUsername,
java.lang.String password)
Login and if successful, set the current customer object.
|
java.lang.String |
loginByAdmin(java.lang.String adminSession,
int customerId)
Login for the customer identified by customerId and if successful, set the current customer
object.
|
void |
loginBySession(java.lang.String sessionId)
This method is used to enter the store-front application using the session of a logged in
user.
|
void |
logout()
Log-off and reset some variables.
|
com.konakart.appif.CustomerIf |
populateCurrentCustomerAddresses(boolean force)
Ensures that the currentCustomer object has his default address and array of addresses
populated
|
void |
refreshCustomerCachedData()
Normally called after a login to get and cache customer relevant data such as the customer's
basket, the customer's orders and the customer's order history.
|
int |
registerCustomer(com.konakart.appif.CustomerRegistrationIf cr)
Register a new customer.
|
protected void |
resetCatalogKey()
When a customer logs out we set the catalog key back to the default value
|
void |
sendNewPassword(java.lang.String emailAddr)
Calls the engine to send a new password to the user.
|
void |
sendNewPasswordWithPassword(java.lang.String emailAddr,
java.lang.String newPassword)
Calls the engine to send a new password resetted to the user.
|
void |
setCanChangeAddress(boolean canChangeAddress) |
void |
setCatalogKey(java.lang.String catalogKey)
The catalog key used for this customer
|
protected void |
setCatalogKeyForCustomer()
Set the catalog key whenever the customer logs in if tags are enabled and the customer has a
B2B_CATALOG_KEY customer tag containing the catalog key which is different to the current
key.
|
void |
setCurrentCustomer(com.konakart.appif.CustomerIf currentCustomer) |
void |
setCurrentStore(com.konakart.appif.StoreIf currentStore) |
void |
setCurrentVendor(com.konakart.appif.VendorIf currentVendor) |
void |
setLoginType(java.lang.String loginType)
Used to store information on how login was performed
|
void |
setNoAddress(boolean noAddress)
True when a customer hasn't created an address yet
|
void |
setNoBirthDate(boolean noBirthDate)
True when a customer hasn't added a date of birth yet
|
void |
setNoGender(boolean noGender)
True when a customer hasn't added a gender yet
|
void |
setNoName(boolean noName)
True when a customer hasn't added a name yet
|
void |
setNoTelephone(boolean noTelephone)
True when a customer hasn't added a telephone number yet
|
void |
setSelectedAddr(com.konakart.appif.AddressIf selectedAddr)
Sets the selected address to the one passed in as a parameter.
|
void |
setSelectedAddrFromId(int addrId)
Ensures that the selectedAddr attribute is populated.
|
void |
setSelectedCountry(com.konakart.appif.CountryIf selectedCountry)
This also sets the selected zones if the country has an array of zones.
|
void |
setSelectedCountry(int countryId)
Sets the selected country from its id.
|
void |
setSelectedZones(com.konakart.appif.ZoneIf[] selectedZones) |
getEng, getKkAppEng, getPages, isMgrReady, setEng, setKkAppEng
public static final java.lang.String FACEBOOK
public static final java.lang.String GOOGLEPLUS
public static final java.lang.String GOOGLESIGNIN
public static final java.lang.String PAYPAL
public static final java.lang.String LDAP
public static final java.lang.String LIFERAY
protected CustomerMgr(com.konakart.appif.KKEngIf eng, KKAppEng kkAppEng)
eng
- the engkkAppEng
- the kkAppEngpublic void setSelectedAddrFromId(int addrId) throws KKAppException, com.konakart.app.KKException
addrId
- Address Id of one of the addresses of the current customerKKAppException
- an unexpected KKAppException exceptioncom.konakart.app.KKException
- an unexpected KKException exceptionpublic void editCustomerAddress(com.konakart.appif.AddressIf addr) throws com.konakart.app.KKException, KKAppException
addr
- The address object to be editedcom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void deleteAddressFromCustomer(int addrId) throws com.konakart.app.KKException, KKAppException
addrId
- The address Id of the address to be deleted.com.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic int addAddressToCustomer(com.konakart.appif.AddressIf addr) throws com.konakart.app.KKException, KKAppException
addr
- The address to be addedcom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic com.konakart.appif.AddressIf getSelectedAddr()
public void setSelectedAddr(com.konakart.appif.AddressIf selectedAddr)
selectedAddr
- The selectedAddr to set.public void fetchProductNotificationsPerCustomer() throws com.konakart.app.KKException
com.konakart.app.KKException
- an unexpected KKException exceptionpublic void addProductNotificationsToCustomer(int productId) throws com.konakart.app.KKException
productId
- The id of the product to be addedcom.konakart.app.KKException
- an unexpected KKException exceptionpublic void deleteProductNotificationsFromCustomer(int productId) throws com.konakart.app.KKException
productId
- The id of the product to be removedcom.konakart.app.KKException
- an unexpected KKException exceptionpublic void editCustomerLocale(java.lang.String locale) throws com.konakart.app.KKException
locale
- The new localecom.konakart.app.KKException
- an unexpected KKException exceptionpublic void editCustomer(com.konakart.appif.CustomerIf cust) throws com.konakart.app.KKException
cust
- The Customer object to be editedcom.konakart.app.KKException
- an unexpected KKException exceptionpublic com.konakart.appif.CustomerIf populateCurrentCustomerAddresses(boolean force) throws com.konakart.app.KKException, KKAppException
force
- If set to true the addresses will be refreshed even if they already existcom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionprotected void createGuest() throws com.konakart.app.KKException
com.konakart.app.KKException
- an unexpected KKException exceptionpublic com.konakart.appif.CustomerIf getCurrentCustomer()
public int registerCustomer(com.konakart.appif.CustomerRegistrationIf cr) throws com.konakart.app.KKException
cr
- The CustomerRegistration objectcom.konakart.app.KKException
- an unexpected KKException exceptionpublic int forceRegisterCustomer(com.konakart.appif.CustomerRegistrationIf cr) throws com.konakart.app.KKException
cr
- The CustomerRegistration objectcom.konakart.app.KKException
- an unexpected KKException exceptionpublic com.konakart.appif.LoginResultIf login(java.lang.String loginUsername, java.lang.String password) throws com.konakart.app.KKException, KKAppException
loginUsername
- The user id used for login (email or username)password
- The passwordcom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic java.lang.String externalLogin(com.konakart.appif.ExternalLoginInputIf loginInfo, java.lang.String loginType) throws com.konakart.app.KKException, KKAppException
loginInfo
- the loginInfologinType
- the loginTypecom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic java.lang.String loginByAdmin(java.lang.String adminSession, int customerId) throws com.konakart.app.KKException, KKAppException
adminSession
- Valid session belonging to an administratorcustomerId
- Id of the customer being logged incom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void loginBySession(java.lang.String sessionId) throws com.konakart.app.KKException, KKAppException
sessionId
- the sessionIdcom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void afterLogin(boolean clearAffiliateId, java.lang.String password) throws com.konakart.app.KKException, KKAppException
clearAffiliateId
- the clearAffiliateIdpassword
- the passwordcom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void refreshCustomerCachedData() throws com.konakart.app.KKException, KKAppException
com.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionprotected void getCustomerTags(java.lang.String sessionId) throws com.konakart.app.KKException
sessionId
- the sessionIdcom.konakart.app.KKException
- an unexpected KKException exceptionprotected void setCatalogKeyForCustomer() throws com.konakart.app.KKException
com.konakart.app.KKException
- an unexpected KKException exceptionprotected void resetCatalogKey() throws com.konakart.app.KKException
com.konakart.app.KKException
- an unexpected KKException exceptionpublic com.konakart.appif.CustomerTagIf getTag(java.lang.String key, boolean fromDB) throws com.konakart.app.KKException
key
- the keyfromDB
- Bypass the cache and get the tag value from the databasecom.konakart.app.KKException
- an unexpected KKException exceptionpublic java.lang.Boolean getTagValueAsBool(java.lang.String key, java.lang.Boolean def) throws com.konakart.app.KKException
key
- the keydef
- Default valuecom.konakart.app.KKException
- an unexpected KKException exceptionpublic java.lang.Boolean getTagValueAsBool(java.lang.String key, java.lang.Boolean def, boolean fromDB) throws com.konakart.app.KKException
key
- the keydef
- Default valuefromDB
- Bypass the cache and get the tag value from the databasecom.konakart.app.KKException
- an unexpected KKException exceptionpublic java.math.BigDecimal getTagValueAsBigDecimal(java.lang.String key) throws com.konakart.app.KKException
key
- the keycom.konakart.app.KKException
- an unexpected KKException exceptionpublic java.math.BigDecimal getTagValueAsBigDecimal(java.lang.String key, boolean fromDB) throws com.konakart.app.KKException
key
- the keyfromDB
- Bypass the cache and get the tag value from the databasecom.konakart.app.KKException
- an unexpected KKException exceptionpublic java.lang.String getTagValueAsString(java.lang.String key) throws com.konakart.app.KKException
key
- the keycom.konakart.app.KKException
- an unexpected KKException exceptionpublic java.lang.String getTagValueAsString(java.lang.String key, boolean fromDB) throws com.konakart.app.KKException
key
- the keyfromDB
- Bypass the cache and get the tag value from the databasecom.konakart.app.KKException
- an unexpected KKException exceptionpublic void logout() throws com.konakart.app.KKException
com.konakart.app.KKException
- an unexpected KKException exceptionpublic void changePassword(java.lang.String currentPassword, java.lang.String newPassword) throws com.konakart.app.KKException
currentPassword
- The current passwordnewPassword
- The new passwordcom.konakart.app.KKException
- an unexpected KKException exceptionpublic void sendNewPassword(java.lang.String emailAddr) throws com.konakart.app.KKException
emailAddr
- The email address where the new password will be sentcom.konakart.app.KKException
- an unexpected KKException exceptionpublic void sendNewPasswordWithPassword(java.lang.String emailAddr, java.lang.String newPassword) throws com.konakart.app.KKException
emailAddr
- The email address where the new password will be sentnewPassword
- The new password to setcom.konakart.app.KKException
- an unexpected KKException exceptionpublic com.konakart.appif.CountryIf getSelectedCountry()
public void setSelectedCountry(com.konakart.appif.CountryIf selectedCountry) throws com.konakart.app.KKException
selectedCountry
- the selectedCountry to setcom.konakart.app.KKException
- an unexpected KKException exceptionpublic void setSelectedCountry(int countryId) throws com.konakart.app.KKException
countryId
- the countryIdcom.konakart.app.KKException
- an unexpected KKException exceptionpublic com.konakart.appif.ZoneIf[] getSelectedZones()
public void setSelectedZones(com.konakart.appif.ZoneIf[] selectedZones)
selectedZones
- the selectedZones to setpublic java.lang.String getLoginType()
public void setLoginType(java.lang.String loginType)
loginType
- the loginType to setpublic boolean isNoAddress()
public void setNoAddress(boolean noAddress)
noAddress
- the noAddress to setpublic boolean isNoTelephone()
public void setNoTelephone(boolean noTelephone)
noTelephone
- the noTelephone to setpublic void setCurrentCustomer(com.konakart.appif.CustomerIf currentCustomer)
currentCustomer
- the currentCustomer to setpublic void deleteCustomer(int custId) throws com.konakart.app.KKException
custId
- The Customer object to be editedcom.konakart.app.KKException
- an unexpected KKException exceptionpublic boolean isNoName()
public void setNoName(boolean noName)
noName
- the noName to setpublic boolean isNoGender()
public void setNoGender(boolean noGender)
noGender
- the noGender to setpublic boolean isNoBirthDate()
public void setNoBirthDate(boolean noBirthDate)
noBirthDate
- the noBirthDate to setpublic boolean isCustomerTagsAvailable()
public boolean isCanChangeAddress()
public void setCanChangeAddress(boolean canChangeAddress)
canChangeAddress
- the canChangeAddress to setpublic java.lang.String getCatalogKey()
public void setCatalogKey(java.lang.String catalogKey)
catalogKey
- the catalogKey to setpublic com.konakart.appif.VendorIf getCurrentVendor()
public void setCurrentVendor(com.konakart.appif.VendorIf currentVendor)
currentVendor
- the currentVendor to setpublic com.konakart.appif.StoreIf getCurrentStore()
public void setCurrentStore(com.konakart.appif.StoreIf currentStore)
currentStore
- the currentStore to setCopyright © 2018 DS Data Systems UK Ltd.