atg.projects.store.profile
Class StoreProfileTools

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.userprofiling.ProfileTools
              extended by atg.commerce.profile.CommerceProfileTools
                  extended by atg.projects.store.profile.StoreProfileTools
All Implemented Interfaces:
atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener
Direct Known Subclasses:
InternationalStoreProfileTools

public class StoreProfileTools
extends atg.commerce.profile.CommerceProfileTools

Extensions to CommerceProfileTools.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string.
static java.lang.String ID_PROPERTY_NAME
           
static java.lang.String UNKNOWN_STATE_CODE
           
 
Fields inherited from class atg.commerce.profile.CommerceProfileTools
CREDIT_CARD_PROPERTIES, LOCK_NAME_ATTRIBUTE_NAME, mProfilePath, mShoppingCartPath, mUserPricingModelsPath, NO_CREDIT_CARD, ONE, TWO, ZERO
 
Fields inherited from class atg.userprofiling.ProfileTools
DPS_VERSION, DPS_VERSION_NUM, mPasswordGenerator, mPasswordRuleChecker, mPreviousNPasswordManager
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
StoreProfileTools()
           
 
Method Summary
 void copyAddress(atg.repository.MutableRepositoryItem pAddress, atg.repository.MutableRepositoryItem pNewAddress, java.util.Iterator pAddressIterator)
          Utility method to copy one address repoitory item to another repository item.
 void copyEmailToLogin(atg.userprofiling.Profile pProfile)
          Utility method to copy over the profile email to the login field.
 atg.repository.MutableRepositoryItem createEmailRecipient(atg.repository.RepositoryItem pProfile, java.lang.String pEmail, java.lang.String pSourceCode)
          Create new EmailRecipient in repository.
 atg.repository.MutableRepositoryItem createEmailRecipient(java.lang.String pEmail, java.lang.String pSourceCode)
          Create new EmailRecipient in repository.
 java.lang.String createProfileCreditCard(atg.userprofiling.Profile pProfile, java.util.Map pNewCreditCard, java.lang.String pCreditCardNickname, java.util.Map pBillingAddress, java.lang.String pAddressNickname, boolean pIsNewAddress)
          This method constructs a new credit card and the address object that is on the credit card.
 atg.core.util.Address getAddressFromRepositoryItem(atg.repository.RepositoryItem pItem)
          This method creates an address object and sets the property values to values in the repository item passed in.
 java.lang.String getBillingAddressClassName()
           
 java.lang.String getCreditCardNickname(atg.repository.RepositoryItem pProfile, atg.commerce.order.CreditCard pCreditCard)
          Finds profile's credit card that corresponds to the given credit card payment group and returns its nickname.
 java.util.Map getCreditCards(atg.repository.RepositoryItem pProfile)
          Obtains all credit cards associated with user profile.
 atg.repository.RepositoryItem getDefaultCreditCard(atg.repository.RepositoryItem pProfile)
          Gets the default credit card for a user.
 java.lang.String getDefaultCreditCardNickname(atg.repository.RepositoryItem pProfile)
          Gets the default credit card nickname for a user.
 java.lang.String getDefaultShippingAddressNickname(atg.repository.RepositoryItem pProfile)
          Gets the default shipping address nickname for a user.
 java.lang.String getDefaultShippingMethod(atg.repository.RepositoryItem pProfile)
          Gets the default shipping method for a user.
 java.lang.String getEmailFormat()
           
 java.lang.String getInvalidContextRoot()
           
 int getMaxPasswordLength()
           
 int getMinPasswordLength()
           
 atg.commerce.util.PlaceUtils getPlaceUtils()
           
 java.lang.String getProfileAddressName(atg.repository.RepositoryItem pProfile, atg.core.util.Address pAddress)
          Gets nickname for the given profile's address.
 java.lang.String getShippingAddressClassName()
           
 StoreConfiguration getStoreConfiguration()
           
 java.lang.String getUrlContextStoreCommerce()
           
 boolean isDuplicateEmailAddress(java.lang.String pEmail)
          Determines if a profile already exists with the email address.
 boolean isValidCountryStateCombination(java.lang.String pCountry, java.lang.String pState)
          Validates country-state combination for the given address properties map.
 boolean isValidPasswordLength(java.lang.String pPassword)
          Utility method to check if user's password meets the min & max length.
protected  void postCreateUser(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse, atg.repository.RepositoryItem pProfile, atg.commerce.order.OrderHolder pShoppingCart)
          
protected  void postLoginUser(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse, atg.repository.RepositoryItem pProfile, atg.commerce.order.OrderHolder pShoppingCart, atg.commerce.pricing.PricingModelHolder pPricingModelHolder)
          Override the OOTB method so that we can determine whether or not to merge a user's cart after they login.
 void removeEmailRecipient(java.lang.String pEmail)
          Remove the EmailRecipient from repository.
 atg.repository.RepositoryItem retrieveEmailRecipient(java.lang.String pEmail)
          Checks repository to see if user has already subscribed to receive emails.
 void setBillingAddressClassName(java.lang.String pBillingAddressClassName)
           
 boolean setDefaultCreditCard(atg.repository.RepositoryItem pProfile, java.lang.String pNickname)
          This method gets the credit card with parameter (pNickname) and makes it the default credit card for this profile.
 boolean setDefaultShippingAddress(atg.repository.RepositoryItem pProfile, java.lang.String pAddressName)
          This implementation makes a reference to an existing address (should be located in a secondaryAddresses set) with the shippingAddress property.
 void setEmailFormat(java.lang.String pEmailformat)
           
 void setInvalidContextRoot(java.lang.String string)
           
 void setMaxPasswordLength(int pMaxPasswordLength)
           
 void setMinPasswordLength(int pMinPasswordLength)
           
 void setPlaceUtils(atg.commerce.util.PlaceUtils pPlaceUtils)
          Sets place utils
 void setShippingAddressClassName(java.lang.String pShippingAddressClassName)
           
 void setStoreConfiguration(StoreConfiguration pStoreConfiguration)
           
 void setUrlContextStoreCommerce(java.lang.String string)
           
 void updateEmailRecipient(atg.repository.RepositoryItem pProfile, java.lang.String pEmail, java.lang.String pNewEmail, java.lang.String pSourceCode)
          Updates email recipient's email and userId properties if corresponding repository item is found.
 boolean validateEmailAddress(java.lang.String pEmail)
          Validates an email address for correctness.
 
Methods inherited from class atg.commerce.profile.CommerceProfileTools
acquireTransactionLock, addActivePromotions, addAddressesFromMapProperties, addCreditCardToUsersMap, addCreditCardToUsersMap, addProfileGiftlistAddress, addProfileRepositoryAddress, addUniqueAddressToAddressList, areAddressesEqual, areAddressesEqual, changeCreditCardNickname, changeSecondaryAddressName, cloneContactInfoItem, copyCreditCard, copyCreditCard, copyCreditCardToPaymentGroup, copyCreditCardToProfile, copyCreditCardToProfile, copyShallowCreditCardProperties, createCreditCardItem, createProfileCreditCard, createProfileRepositoryPrimaryAddress, createProfileRepositorySecondaryAddress, findOrderToLoad, generateUniqueNickname, getAllAvailableAddresses, getAllBillingAddresses, getAllShippingAddresses, getBillingAddressMapProperties, getCompareAddressPropertyNames, getCreditCardById, getCreditCardByNickname, getCreditCardNickname, getCreditCardProperties, getDefaultBillingAddress, getDefaultLocale, getDefaultShippingAddress, getEmptyAddressPropertyNames, getLocaleService, getOrderItemDescriptorName, getOrderManager, getPricingParameters, getPricingTools, getProfileAddress, getProfileAddressById, getProfileAddresses, getProfileAddressName, getProfileAddressNames, getProfileForOrder, getProfileForOrder, getProfileIdPropertyName, getProfileItem, getProfilePath, getPromotionTools, getRepriceOrderPricingOp, getShippingAddressMapProperties, getShoppingCartPath, getSiteGroupManager, getSortOrdersByProperty, getTransactionLockFactory, getUniqueAddressNickname, getUniqueCreditCardNickname, getUniqueCreditCardNickname, getUniqueNickname, getUniqueNicknameSeparator, getUniqueShippingAddressNickname, getUserLocale, getUserPricingModelsPath, getUsersCreditCardMap, isAddressEmpty, isAddressEmpty, isAscendingOrder, isCreditCardEmpty, isDuplicateAddressNickName, isDuplicateCreditCardNickname, isDuplicateNickname, isMergeOrders, isRepriceOrderOnLogin, isSelectLastModifiedOrder, isUseRequestLocale, loadShoppingCarts, loadShoppingCartsWithLock, loadUserShoppingCartForLogin, loadUserShoppingCartForLogin, loadUserShoppingCartForLogin, persistOrderIfNeeded, persistShoppingCarts, persistShoppingCartsWithLock, releaseTransactionLock, removeProfileCreditCard, removeProfileRepositoryAddress, removeProfileRepositoryAddress, repriceOrder, repriceShoppingCarts, repriceShoppingCarts, repriceShoppingCarts, repriceShoppingCartsWithLock, setAscendingOrder, setBillingAddressMapProperties, setCompareAddressPropertyNames, setCreditCardProperties, setDefaultCreditCardIfNull, setDefaultLocale, setDefaultShippingAddressIfNull, setEmptyAddressPropertyNames, setItemPropertyToAddress, setItemPropertyToAddress, setLocaleService, setMergeOrders, setOrderItemDescriptorName, setOrderManager, setPricingTools, setProfileIdPropertyName, setProfilePath, setPromotionTools, setRepriceOrderOnLogin, setRepriceOrderPricingOp, setSelectLastModifiedOrder, setShippingAddressMapProperties, setShoppingCartPath, setSiteGroupManager, setSortOrdersByProperty, setTransactionLockFactory, setUniqueNicknameSeparator, setUseRequestLocale, setUserPricingModelsPath, shouldLoadShoppingCarts, updateOrderProfileId, updateProfileCreditCard, updateProfileRepositoryAddress
 
Methods inherited from class atg.userprofiling.ProfileTools
addMultiPropertyValues, assumeSecurityIdentity, assumeSecurityIdentity, buildPropertyUpdatesForDictionary, buildPropertyUpdatesForRepositoryFormList, buildPropertyUpdatesForRepositoryFormMap, buildUpdateMessage, buildUpdateMessage, changePassword, convertNewValueToString, convertOldValueToString, convertPropertyUpdateValueToString, createNewUser, createNewUser, createPropertyUpdate, doStartService, formatMultiValueUpdateString, generateEmailQuery, generateLoginQuery, generateNameQuery, generateNewPasswordForProfile, getAutoLogin, getCookieManager, getDefaultProfileType, getGroupContainer, getIllegalPasswordChecker, getItem, getItem, getItemFromEmail, getItemFromEmail, getItems, getItems, getItemsFromEmail, getItemsFromEmail, getLoggingIdentifier, getLogin, getLoginUserAuthority, getMutableItem, getPassword, getPasswordGenerationTriesLimit, getPasswordGenerator, getPasswordRuleChecker, getPreviousNPasswordManager, getProfileEventTrigger, getProfileItemFinder, getProfileRepository, getPropertyManager, getSecurityStatus, getUserLoginManager, isAutoLoginSecurityStatus, isEnableSecurityStatus, isValidCredentials, isValidCredentials, isValidCredentials, isValidCredentials, isValidCredentialsEncrypted, locateUserFromEmail, locateUserFromEmail, locateUserFromId, locateUserFromId, locateUserFromLogin, locateUserFromLogin, locateUserFromLogin, locateUserFromLogin, main, prefixPropertyNames, propagateLocale, revokeSecurityIdentity, revokeSecurityIdentity, sendEmailToUser, setAutoLoginSecurityStatus, setCookieManager, setDefaultProfileType, setEnableSecurityStatus, setGroupContainer, setIllegalPasswordChecker, setLoginSecurityStatus, setLoginUserAuthority, setPasswordGenerationTriesLimit, setPasswordGenerator, setPasswordRuleChecker, setPreviousNPasswordManager, setProfileEventTrigger, setProfileItemFinder, setProfileRepository, setPropertyManager, setSecurityStatus, setUserLoginManager, shouldSendProfileCookies, toString, updateProperties, updateProperty
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string.


ID_PROPERTY_NAME

public static java.lang.String ID_PROPERTY_NAME

UNKNOWN_STATE_CODE

public static java.lang.String UNKNOWN_STATE_CODE
Constructor Detail

StoreProfileTools

public StoreProfileTools()
Method Detail

getMaxPasswordLength

public int getMaxPasswordLength()
Returns:
maximum password length.

setMaxPasswordLength

public void setMaxPasswordLength(int pMaxPasswordLength)
Parameters:
pMaxPasswordLength - - maximum password length.

getMinPasswordLength

public int getMinPasswordLength()
Returns:
minimum password length.

setMinPasswordLength

public void setMinPasswordLength(int pMinPasswordLength)
Parameters:
pMinPasswordLength - - minimum password length.

getEmailFormat

public java.lang.String getEmailFormat()
Returns:
the Email Format Regular Expression.

setEmailFormat

public void setEmailFormat(java.lang.String pEmailformat)
Parameters:
pEmailformat - The Email Format Regular Expression.

getPlaceUtils

public atg.commerce.util.PlaceUtils getPlaceUtils()
Returns:
place utils

setPlaceUtils

public void setPlaceUtils(atg.commerce.util.PlaceUtils pPlaceUtils)
Sets place utils

Parameters:
pPlaceUtils -

getStoreConfiguration

public StoreConfiguration getStoreConfiguration()
Returns:
store configuration.

setStoreConfiguration

public void setStoreConfiguration(StoreConfiguration pStoreConfiguration)
Parameters:
pStoreConfiguration - - store configuration.

getShippingAddressClassName

public java.lang.String getShippingAddressClassName()
Returns:
the String

setShippingAddressClassName

public void setShippingAddressClassName(java.lang.String pShippingAddressClassName)
Parameters:
ShippingAddressClassName - the String to set

getBillingAddressClassName

public java.lang.String getBillingAddressClassName()
Returns:
the String

setBillingAddressClassName

public void setBillingAddressClassName(java.lang.String pBillingAddressClassName)
Parameters:
BillingAddressClassName - the String to set

retrieveEmailRecipient

public atg.repository.RepositoryItem retrieveEmailRecipient(java.lang.String pEmail)
Checks repository to see if user has already subscribed to receive emails.

Parameters:
pEmail - - email address to be checked
Returns:
True if email has already signed up for emails False is email was not found in ditribution list

createEmailRecipient

public atg.repository.MutableRepositoryItem createEmailRecipient(java.lang.String pEmail,
                                                                 java.lang.String pSourceCode)
                                                          throws atg.repository.RepositoryException
Create new EmailRecipient in repository.

Parameters:
pEmail - - Email Address
pSourceCode - - Source Code
Returns:
EmailRecipient - Repository Item
Throws:
atg.repository.RepositoryException

createEmailRecipient

public atg.repository.MutableRepositoryItem createEmailRecipient(atg.repository.RepositoryItem pProfile,
                                                                 java.lang.String pEmail,
                                                                 java.lang.String pSourceCode)
                                                          throws atg.repository.RepositoryException
Create new EmailRecipient in repository.

Parameters:
pProfile - - user's profile
pEmail - - Email Address
pSourceCode - - Source Code
Returns:
EmailRecipient - Repository Item
Throws:
atg.repository.RepositoryException

updateEmailRecipient

public void updateEmailRecipient(atg.repository.RepositoryItem pProfile,
                                 java.lang.String pEmail,
                                 java.lang.String pNewEmail,
                                 java.lang.String pSourceCode)
                          throws atg.repository.RepositoryException
Updates email recipient's email and userId properties if corresponding repository item is found. Otherwise does nothing.

Parameters:
pProfile - profile repository item
pEmail - email of email recipient to update
pNewEmail - new email
Throws:
atg.repository.RepositoryException

removeEmailRecipient

public void removeEmailRecipient(java.lang.String pEmail)
                          throws atg.repository.RepositoryException
Remove the EmailRecipient from repository.

Parameters:
pEmail - - Email Address
Throws:
atg.repository.RepositoryException - if exception occurs while attemptiong to retirve email recipient item

postLoginUser

protected void postLoginUser(atg.servlet.DynamoHttpServletRequest pRequest,
                             atg.servlet.DynamoHttpServletResponse pResponse,
                             atg.repository.RepositoryItem pProfile,
                             atg.commerce.order.OrderHolder pShoppingCart,
                             atg.commerce.pricing.PricingModelHolder pPricingModelHolder)
                      throws javax.servlet.ServletException
Override the OOTB method so that we can determine whether or not to merge a user's cart after they login. If they login from the checkout flow. the cart is not merged. Otherwise merge the cart with the persisted cart.

Overrides:
postLoginUser in class atg.commerce.profile.CommerceProfileTools
Throws:
javax.servlet.ServletException

copyEmailToLogin

public void copyEmailToLogin(atg.userprofiling.Profile pProfile)
Utility method to copy over the profile email to the login field.

Parameters:
pProfile - - Profile Object

postCreateUser

protected void postCreateUser(atg.servlet.DynamoHttpServletRequest pRequest,
                              atg.servlet.DynamoHttpServletResponse pResponse,
                              atg.repository.RepositoryItem pProfile,
                              atg.commerce.order.OrderHolder pShoppingCart)
                       throws javax.servlet.ServletException

Overrides:
postCreateUser in class atg.commerce.profile.CommerceProfileTools
Throws:
javax.servlet.ServletException
See Also:
CommerceProfileTools.postCreateUser(atg.servlet.DynamoHttpServletRequest, atg.servlet.DynamoHttpServletResponse, atg.repository.RepositoryItem, atg.commerce.order.OrderHolder)

getCreditCards

public java.util.Map getCreditCards(atg.repository.RepositoryItem pProfile)
Obtains all credit cards associated with user profile.

Parameters:
pProfile - the user profile
Returns:
Map of CreditCard or null if no credit cards are specified on the profile

setDefaultCreditCard

public boolean setDefaultCreditCard(atg.repository.RepositoryItem pProfile,
                                    java.lang.String pNickname)
This method gets the credit card with parameter (pNickname) and makes it the default credit card for this profile. It just returns false if this fails, exception handling is up to the caller.

Overrides:
setDefaultCreditCard in class atg.commerce.profile.CommerceProfileTools
Parameters:
pProfile - to get the credit card from, and set default to.
pNickname - credit card to copy from Map of credit cards
Returns:
boolean success or failure

getDefaultCreditCard

public atg.repository.RepositoryItem getDefaultCreditCard(atg.repository.RepositoryItem pProfile)
Gets the default credit card for a user.

Overrides:
getDefaultCreditCard in class atg.commerce.profile.CommerceProfileTools
Parameters:
pProfile - the user profile
Returns:
CreditCard object. Returns null if no default credit card exists for the user.

getCreditCardNickname

public java.lang.String getCreditCardNickname(atg.repository.RepositoryItem pProfile,
                                              atg.commerce.order.CreditCard pCreditCard)
Finds profile's credit card that corresponds to the given credit card payment group and returns its nickname.

Parameters:
pProfile - profile object
pCreditCard - credit card payment group
Returns:

getDefaultCreditCardNickname

public java.lang.String getDefaultCreditCardNickname(atg.repository.RepositoryItem pProfile)
Gets the default credit card nickname for a user.

Parameters:
pProfile - the user profile
Returns:
default Credit cart nickname for a user.

getDefaultShippingMethod

public java.lang.String getDefaultShippingMethod(atg.repository.RepositoryItem pProfile)
Gets the default shipping method for a user.

Parameters:
pProfile - the user profile
Returns:
the default shipping method for a user.

getProfileAddressName

public java.lang.String getProfileAddressName(atg.repository.RepositoryItem pProfile,
                                              atg.core.util.Address pAddress)
Gets nickname for the given profile's address.

Parameters:
pProfile - The profile repository item
pAddress - Address object
Returns:
nickname for secondary address repository item

getDefaultShippingAddressNickname

public java.lang.String getDefaultShippingAddressNickname(atg.repository.RepositoryItem pProfile)
Gets the default shipping address nickname for a user.

Parameters:
pProfile - the user profile
Returns:
the default shipping address nickname for a user.

isValidPasswordLength

public boolean isValidPasswordLength(java.lang.String pPassword)
Utility method to check if user's password meets the min & max length.

Parameters:
pPassword - is password string
Returns:
True if password meets min/max requirements False if password fails min/max requirements

getUrlContextStoreCommerce

public java.lang.String getUrlContextStoreCommerce()
Returns:
UrlContextStoreCommerce property.

getInvalidContextRoot

public java.lang.String getInvalidContextRoot()
Returns:
InvalidContextRoot property.

setUrlContextStoreCommerce

public void setUrlContextStoreCommerce(java.lang.String string)
Parameters:
string - UrlContextShopCommerce property.

setInvalidContextRoot

public void setInvalidContextRoot(java.lang.String string)
Parameters:
string - UrlContextShopWithConsultant property.

copyAddress

public void copyAddress(atg.repository.MutableRepositoryItem pAddress,
                        atg.repository.MutableRepositoryItem pNewAddress,
                        java.util.Iterator pAddressIterator)
Utility method to copy one address repoitory item to another repository item.

Parameters:
pAddress - - source address
pNewAddress - - target address
pAddressIterator - - address iterator

isDuplicateEmailAddress

public boolean isDuplicateEmailAddress(java.lang.String pEmail)
Determines if a profile already exists with the email address.

Parameters:
pEmail - - e-mail address
Returns:
true if a profile exists with the given email

getAddressFromRepositoryItem

public atg.core.util.Address getAddressFromRepositoryItem(atg.repository.RepositoryItem pItem)
                                                   throws atg.repository.RepositoryException
This method creates an address object and sets the property values to values in the repository item passed in.

Overrides:
getAddressFromRepositoryItem in class atg.commerce.profile.CommerceProfileTools
Parameters:
pItem - the repository item
Returns:
address the address object with data from repository
Throws:
atg.repository.RepositoryException - if there was an error when creating the new repository item.

validateEmailAddress

public boolean validateEmailAddress(java.lang.String pEmail)
Validates an email address for correctness.

Parameters:
pEmail - email address
Returns:
boolean true if email address is valid

isValidCountryStateCombination

public boolean isValidCountryStateCombination(java.lang.String pCountry,
                                              java.lang.String pState)
Validates country-state combination for the given address properties map. Checks if state is required for the given country.

Parameters:
pCountry - country code
pState - state code
Returns:
true if country-state combination is valid

createProfileCreditCard

public java.lang.String createProfileCreditCard(atg.userprofiling.Profile pProfile,
                                                java.util.Map pNewCreditCard,
                                                java.lang.String pCreditCardNickname,
                                                java.util.Map pBillingAddress,
                                                java.lang.String pAddressNickname,
                                                boolean pIsNewAddress)
                                         throws atg.repository.RepositoryException,
                                                java.lang.InstantiationException,
                                                java.lang.IllegalAccessException,
                                                java.lang.ClassNotFoundException,
                                                java.beans.IntrospectionException,
                                                atg.beans.PropertyNotFoundException
This method constructs a new credit card and the address object that is on the credit card. pIsNewAddress indicates new secondary address should be created or existed one should be used. If new secondary address should be created then its properties are populated from pShippingAddress map. Created credit card repository item is added to user's map of credit cards. If user's default billing address is null than new credit card's billing address is set as default billing address. If user's default credit card is null that new credit card is set as default credit card for this user.

Parameters:
pProfile - user's profile object
pNewCreditCard - map of credit cards properties' values
pCreditCardNickname - nickname for credit card
pBillingAddress - map of shipping address properties' values
pAddressNickname - shipping address nickname for shipping address to be created or for existed one
pIsNewAddress - indicated if new address should be created or existed one should be used
Returns:
created credit card's nickname
Throws:
atg.repository.RepositoryException - if there was an error accessing the repository
java.beans.IntrospectionException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
atg.beans.PropertyNotFoundException

setDefaultShippingAddress

public boolean setDefaultShippingAddress(atg.repository.RepositoryItem pProfile,
                                         java.lang.String pAddressName)
                                  throws atg.repository.RepositoryException
This implementation makes a reference to an existing address (should be located in a secondaryAddresses set) with the shippingAddress property.

Overrides:
setDefaultShippingAddress in class atg.commerce.profile.CommerceProfileTools
Throws:
atg.repository.RepositoryException