atg.commerce.profile
Class CommerceProfileServices

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.userprofiling.ProfileServices
              extended by atg.scenario.userprofiling.ScenarioProfileServices
                  extended by atg.commerce.profile.CommerceProfileServices
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, atg.process.ProcessConstants, atg.scenario.ScenarioConstants, atg.scenario.targeting.SlotConstants, atg.userprofiling.ProfileServiceConstants, java.util.EventListener

public class CommerceProfileServices
extends atg.scenario.userprofiling.ScenarioProfileServices

Commerce specific extensions to the ProfileServices.


Field Summary
static java.lang.String BILLING_ADDRESS_PROPERTY_NAME
          This is the name of the BasicCreditCardInfoImpl billing address property
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String DEFAULT_CONTACT_INFO_CLASS
           
static java.lang.String DEFAULT_PRICINGMODELS_PATH
           
static java.lang.String DEFAULT_SHOPPINGCART_PATH
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.scenario.ScenarioConstants
ATTR_SCENARIO_REDIRECT, PROPERTY_REFERENCE_TARGET, PROPERTY_REFERENCE_TYPE, PROPERTY_SCENARIO_INSTANCES, PROPERTY_SLOT_INSTANCES
 
Fields inherited from interface atg.process.ProcessConstants
COLLECTIVE_CLONE_PROPERTIES, DEFAULT_INITIAL_TIME_DELAY, DEFAULT_MAX_BATCH_SIZE, DEFAULT_PROCESS_FILE_EXTENSION, DEFAULT_TEMPLATE_FILE_EXTENSION, INDIVIDUAL_CLONE_PROPERTIES, INPUT_PORT_BATCH_TIMER, INPUT_PORT_COLLECTIVE_TIMER, INPUT_PORT_DISABLE_PROCESS, INPUT_PORT_GLOBAL_EVENT, INPUT_PORT_INDIVIDUAL_EVENT, INPUT_PORT_INDIVIDUAL_TIMER, INPUT_PORT_MIGRATION_UPDATE, INPUT_PORT_PROCESS_UPDATE, INPUT_PORT_SEGMENT_START_TIMER, JMS_TYPE_BATCH_TIMER, JMS_TYPE_COLLECTIVE_TIMER, JMS_TYPE_DISABLE_PROCESS, JMS_TYPE_INDIVIDUAL_TIMER, JMS_TYPE_MIGRATION_DELETE, JMS_TYPE_MIGRATION_UPDATE, JMS_TYPE_PROCESS_UPDATE, MIGRATION_STATUS_DONE, MIGRATION_STATUS_IN_PROGRESS, OUTPUT_PORT_BATCH_TIMER, OUTPUT_PORT_COLLECTIVE_TIMER, OUTPUT_PORT_INDIVIDUAL_TIMER, OUTPUT_PORT_MIGRATION_UPDATE, OUTPUT_PORT_PROCESS_UPDATE, OUTPUT_PORT_SEGMENT_START_TIMER, PROPERTY_AUTHOR, PROPERTY_COLLECTIVE_INSTANCE, PROPERTY_CONTEXT_BOOLEANS, PROPERTY_CONTEXT_DATES, PROPERTY_CONTEXT_DOUBLES, PROPERTY_CONTEXT_LONGS, PROPERTY_CONTEXT_STRINGS, PROPERTY_COUNT, PROPERTY_CREATED_BY_RECURRING_EVENT, PROPERTY_CREATION_TIME, PROPERTY_CREATOR_ID, PROPERTY_EVENT_TYPE, PROPERTY_ID, PROPERTY_LAST_MODIFIED_BY, PROPERTY_LAST_QUERY_ID, PROPERTY_MESSAGE_BEAN, PROPERTY_MIGRATION_INFO, PROPERTY_MIGRATION_INFOS, PROPERTY_MIGRATION_STATUS, PROPERTY_MODIFICATION_TIME, PROPERTY_NEW_MODIFICATION_TIME, PROPERTY_NUM_TRANSITION_RETRIES, PROPERTY_OLD_MODIFICATION_TIME, PROPERTY_PDL, PROPERTY_PROCESS_INFO, PROPERTY_PROCESS_NAME, PROPERTY_PROCESS_STATUS, PROPERTY_SEGMENT_NAME, PROPERTY_SEGMENT_NAMES, PROPERTY_SERVER_ID, PROPERTY_SERVER_TYPE, PROPERTY_STATE, PROPERTY_STATE_MACHINE_VERSION, PROPERTY_STEP, PROPERTY_SUBJECT, PROPERTY_TEMPLATE_NAME, STEP_ACTIONS_1, STEP_ACTIONS_2, STEP_NEXT_STATE_1, STEP_NEXT_STATE_2, UNDEFINED_TIMESTAMP_VALUE, WILDCARD_MATCH_ALL
 
Fields inherited from interface atg.scenario.targeting.SlotConstants
PROFILE_SLOT_TYPE, PROPERTY_ID, PROPERTY_SLOT_ITEMS, PROPERTY_SLOT_NAME, PROPERTY_SLOT_OFFSET, PROPERTY_SLOT_PRIORITIES, PROPERTY_SLOT_PROFILE, TRANS_MGR
 
Fields inherited from interface atg.userprofiling.ProfileServiceConstants
ADMIN_UPDATE_NULL_ELEMENT, AUTHENTICATE_HASHKEY_ATTRIBUTE, AUTHENTICATE_TIMER_ATTRIBUTE, CHANGE_PASSWORD_MISMATCH, COPY_NULL_ITEM, CREATE_EXISTING_ITEM_ID, CREATE_EXISTING_ITEM_LOGIN, CREATE_ID_PARAM, CREATE_ID_PARAM_NAME, CREATE_NULL_ITEM, DEFAULT_LOGIN_PROFILE_TYPE, DEFAULT_PROFILE_PATH, DEFAULT_PROFILE_TOOLS_PATH, DEFAULT_REQUEST_LOCALE_PATH, DEFAULT_USER_PATH, DYNAMIC_ALGORITHM_INDICATOR, DYNAMIC_ALGORITHM_METHOD, ENCRYPT_INVALID_PASS_CONVERSATION, ENCRYPT_INVALID_SESSION_ATTRS, ENCRYPT_NULL_HASHKEY, HASHKEY_PARAM, HASHKEY_PARAM_NAME, LOGIN_BAD_ARGS, LOGIN_PARAM, LOGIN_PARAM_NAME, LOGIN_PASSWORD_MISMATCH, LOGOUT_ID_PARAM, LOGOUT_ID_PARAM_NAME, MATCH_PROP_PARAM, MATCH_PROP_PARAM_NAME, NEW_PASSWORD_PARAM, NEW_PASSWORD_PARAM_NAME, NO_ALGORITHM_FOUND, NULL_CURRENT_PROFILE, NULL_PROFILE_BY_ID, NULL_PROFILE_REPOSITORY, NULL_REQUEST, NULL_REQUEST_LOCALE, NULL_REQUEST_PARAMETER, NULL_SENTINEL, OPERATION_END_PARAM, OPERATION_END_PARAM_NAME, PASSWORD_PARAM, PASSWORD_PARAM_NAME, PUSH_REALM_PARAM, PUSH_REALM_PARAM_NAME, PUSH_SITE_PARAM, PUSH_SITE_PARAM_NAME, REGISTER_BAD_ARGS, SERVICE_NO_TOOLS, UPDATE_EVENT_PARAM, UPDATE_EVENT_PARAM_NAME, UPDATE_ID_PARAM, UPDATE_ID_PARAM_NAME, UPDATE_INVALID_REP, UPDATE_NO_ARGS, UPDATE_NO_ITEM, XML_ITEM_PARAM, XML_ITEM_PARAM_NAME
 
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
CommerceProfileServices()
           
 
Method Summary
 void addProperty(java.lang.String pPropertyName, RepositoryItem pGuestUser, RepositoryItem pAuthenticatedUser)
          If the property being added is "activePromotions", then use promotionTools to add it, otherwise call the super class.
 java.lang.String getBillingAddressItemType()
          The item descriptor type for the billing address property
 java.lang.String getBillingAddressPropertyName()
          The name of the profile property that setDefaultBillingAddress modifies.
 java.lang.String getContantInfoClass()
          The class type for creating new ContactInfos This is used when creating a new BasicCreditCardInfoImpl.billingAddress for example
 java.lang.String getCreditCardItemType()
          The item descriptor type for the credit card property
 java.lang.String getCreditCardPropertyName()
          The name of the profile property that setDefaultCreditCard modifies.
 OrderHolder getCurrentShoppingCart()
          Gets the shopping cart of the current thread's user
 ContactInfo getDefaultBillingAddress(java.lang.String pProfileId)
          Get the billingAddressPropertyName from the profile
 atg.payment.creditcard.BasicCreditCardInfoImpl getDefaultCreditCard(java.lang.String pProfileId)
          Get the creditCardPropertyName from the profile
 ContactInfo getDefaultShippingAddress(java.lang.String pProfileId)
          Get the shippingAddressPropertyName from the profile
 java.lang.String getShippingAddressItemType()
          The item descriptor type for the shipping address property
 java.lang.String getShippingAddressPropertyName()
          The name of the profile property that setDefaultShippingAddress modifies
 java.lang.String getShoppingCartPath()
          The nucleus path to the session scoped shopping cart (of type OrderHolder)
 PricingModelHolder getUserPricingModels()
          Gets the PricingModelHolder of the current thread's user
 java.lang.String getUserPricingModelsPath()
          The nucleus path to the session scoped user pricing models (of type PricingModelHolder)
 void postCreateUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          After registration, any transient orders are made persistent through the persistShoppingCarts method of the CommerceProfileTools component
 void postLoginUser(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          After logging in the user's session cached promotions are reloaded into the PricingModelHolder.
 void setBillingAddressItemType(java.lang.String pBillingAddressItemType)
           
 void setBillingAddressPropertyName(java.lang.String pBillingAddressPropertyName)
           
 void setContantInfoClass(java.lang.String pContantInfoClass)
           
 void setCreditCardItemType(java.lang.String pCreditCardItemType)
           
 void setCreditCardPropertyName(java.lang.String pCreditCardPropertyName)
           
 java.lang.String setDefaultBillingAddress(java.lang.String pProfileId, ContactInfo pAddress)
          Sets the user's billingAddressPropertyName to the given address
 java.lang.String setDefaultCreditCard(java.lang.String pProfileId, atg.payment.creditcard.BasicCreditCardInfoImpl pCreditCard)
          Sets the user's creditCardPropertyName to the given address
 java.lang.String setDefaultShippingAddress(java.lang.String pProfileId, ContactInfo pAddress)
          Sets the user's shippingAddressPropertyName to the given address
 void setShippingAddressItemType(java.lang.String pShippingAddressItemType)
           
 void setShippingAddressPropertyName(java.lang.String pShippingAddressPropertyName)
           
 void setShoppingCartPath(java.lang.String pShoppingCartPath)
           
 void setUserPricingModelsPath(java.lang.String pUserPricingModelsPath)
           
 
Methods inherited from class atg.scenario.userprofiling.ScenarioProfileServices
addScenarioInstances, addSlotInstances, getScenarioManager, setScenarioManager
 
Methods inherited from class atg.userprofiling.ProfileServices
addProperties, addSwapEventListener, addUpdateListener, addXMLItem, canClientEncryptPasswords, commitTransaction, copyProperties, createUser, deleteUser, doCreateUser, doDeleteUser, doLoginUser, doLoginUser, doLogoutUser, doSetPassword, doStartService, doUpdateUser, encryptPassword, endOperation, endOperationValue, ensureTransaction, getBadPasswordDelay, getCreateProfileType, getCurrentProfile, getCurrentProfileId, getLoginPasswordHasher, getLoginProfileType, getLogoutProfileType, getMappingFile, getMappingManager, getMaxAuthenticationWait, getPasswordHashAlgorithm, getPasswordHashKey, getProfile, getProfile, getProfileId, getProfilePath, getProfileRealmManager, getProfileTools, getPropertiesToAddOnLogin, getPropertiesToCopyOnLogin, getRepositoryItemFromXML, getRepositoryItemFromXML, getRequestLocalePath, getTransactionManager, getUpdateEventListeners, getXmlAddService, getXmlGetService, getXMLItem, getXmlUpdateService, isAllowEncryptedPasswords, isExpireSessionOnLogout, isGenerateLoginEvents, isGenerateLogoutEvents, isGenerateRegisterEvents, isGenerateUpdateEvents, isUseDefaultMappings, isUsingLDAPProfile, loginTrustedUser, loginUser, loginUser, loginUserOnRealm, logoutUser, popRealm, postDeleteUser, postLoginUser, postLogoutUser, postSetPassword, postUpdateUser, preCreateUser, preDeleteUser, preLoginUser, preLoginUser, preLogoutUser, preSetPassword, pushRealmFromRequest, removeSwapEventListener, removeUpdateListener, sendProfileSwapEvent, sendUpdateEvent, setAllowEncryptedPasswords, setBadPasswordDelay, setContactInfo, setCreateProfileType, setExpireSessionOnLogout, setGenerateLoginEvents, setGenerateLogoutEvents, setGenerateRegisterEvents, setGenerateUpdateEvents, setLocale, setLoginProfileType, setLogoutProfileType, setMappingManager, setMaxAuthenticationWait, setPassword, setProfilePath, setProfileRealmManager, setProfileTools, setPropertiesToAddOnLogin, setPropertiesToCopyOnLogin, setRequestLocalePath, setSessionLocale, setTransactionManager, setUpdateEventListeners, setUseDefaultMappings, setUsingLDAPProfile, setXmlAddService, setXmlGetService, setXmlUpdateService, updateLDAPProfileAttributes, updateUser, updateUser, updateXMLItem
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, 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, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


DEFAULT_CONTACT_INFO_CLASS

public static java.lang.String DEFAULT_CONTACT_INFO_CLASS

BILLING_ADDRESS_PROPERTY_NAME

public static java.lang.String BILLING_ADDRESS_PROPERTY_NAME
This is the name of the BasicCreditCardInfoImpl billing address property


DEFAULT_SHOPPINGCART_PATH

public static java.lang.String DEFAULT_SHOPPINGCART_PATH

DEFAULT_PRICINGMODELS_PATH

public static java.lang.String DEFAULT_PRICINGMODELS_PATH
Constructor Detail

CommerceProfileServices

public CommerceProfileServices()
Method Detail

setShoppingCartPath

public void setShoppingCartPath(java.lang.String pShoppingCartPath)

getShoppingCartPath

public java.lang.String getShoppingCartPath()
The nucleus path to the session scoped shopping cart (of type OrderHolder)


setUserPricingModelsPath

public void setUserPricingModelsPath(java.lang.String pUserPricingModelsPath)

getUserPricingModelsPath

public java.lang.String getUserPricingModelsPath()
The nucleus path to the session scoped user pricing models (of type PricingModelHolder)


setShippingAddressPropertyName

public void setShippingAddressPropertyName(java.lang.String pShippingAddressPropertyName)

getShippingAddressPropertyName

public java.lang.String getShippingAddressPropertyName()
The name of the profile property that setDefaultShippingAddress modifies


setShippingAddressItemType

public void setShippingAddressItemType(java.lang.String pShippingAddressItemType)

getShippingAddressItemType

public java.lang.String getShippingAddressItemType()
The item descriptor type for the shipping address property


setBillingAddressPropertyName

public void setBillingAddressPropertyName(java.lang.String pBillingAddressPropertyName)

getBillingAddressPropertyName

public java.lang.String getBillingAddressPropertyName()
The name of the profile property that setDefaultBillingAddress modifies.


setBillingAddressItemType

public void setBillingAddressItemType(java.lang.String pBillingAddressItemType)

getBillingAddressItemType

public java.lang.String getBillingAddressItemType()
The item descriptor type for the billing address property


setCreditCardPropertyName

public void setCreditCardPropertyName(java.lang.String pCreditCardPropertyName)

getCreditCardPropertyName

public java.lang.String getCreditCardPropertyName()
The name of the profile property that setDefaultCreditCard modifies.


setCreditCardItemType

public void setCreditCardItemType(java.lang.String pCreditCardItemType)

getCreditCardItemType

public java.lang.String getCreditCardItemType()
The item descriptor type for the credit card property


setContantInfoClass

public void setContantInfoClass(java.lang.String pContantInfoClass)

getContantInfoClass

public java.lang.String getContantInfoClass()
The class type for creating new ContactInfos This is used when creating a new BasicCreditCardInfoImpl.billingAddress for example


setDefaultShippingAddress

public java.lang.String setDefaultShippingAddress(java.lang.String pProfileId,
                                                  ContactInfo pAddress)
                                           throws RepositoryException
Sets the user's shippingAddressPropertyName to the given address

Parameters:
pProfileId - The id of the profile being changed
pAddress - The new shipping address
Returns:
The id of the newly created address item
Throws:
RepositoryException

setDefaultBillingAddress

public java.lang.String setDefaultBillingAddress(java.lang.String pProfileId,
                                                 ContactInfo pAddress)
                                          throws RepositoryException
Sets the user's billingAddressPropertyName to the given address

Parameters:
pProfileId - The id of the profile being changed
pAddress - The new shipping address
Returns:
The id of the newly created address item
Throws:
RepositoryException

setDefaultCreditCard

public java.lang.String setDefaultCreditCard(java.lang.String pProfileId,
                                             atg.payment.creditcard.BasicCreditCardInfoImpl pCreditCard)
                                      throws RepositoryException
Sets the user's creditCardPropertyName to the given address

Parameters:
pProfileId - The id of the profile being changed
pCreditCard - The new credit card
Returns:
The id of the newly created address item
Throws:
RepositoryException

getDefaultShippingAddress

public ContactInfo getDefaultShippingAddress(java.lang.String pProfileId)
                                      throws RepositoryException
Get the shippingAddressPropertyName from the profile

Parameters:
pProfileId - The user whose address is returned
Returns:
A populated ContactInfo
Throws:
RepositoryException

getDefaultBillingAddress

public ContactInfo getDefaultBillingAddress(java.lang.String pProfileId)
                                     throws RepositoryException
Get the billingAddressPropertyName from the profile

Parameters:
pProfileId - The user whose address is returned
Returns:
A populated ContactInfo
Throws:
RepositoryException

getDefaultCreditCard

public atg.payment.creditcard.BasicCreditCardInfoImpl getDefaultCreditCard(java.lang.String pProfileId)
                                                                    throws RepositoryException
Get the creditCardPropertyName from the profile

Parameters:
pProfileId - The user whose credit card is returned
Returns:
A populated BasicCreditCardInfo
Throws:
RepositoryException

addProperty

public void addProperty(java.lang.String pPropertyName,
                        RepositoryItem pGuestUser,
                        RepositoryItem pAuthenticatedUser)
                 throws RepositoryException
If the property being added is "activePromotions", then use promotionTools to add it, otherwise call the super class.

Overrides:
addProperty in class atg.scenario.userprofiling.ScenarioProfileServices
Parameters:
pGuestUser - the user to copy values from
pAuthenticatedUser - the user to copy values to
pPropertyName - the name of a multi-valued property whose values will be copied from the guest user and added to the authenticated user
Throws:
RepositoryException

postCreateUser

public void postCreateUser(DynamoHttpServletRequest pRequest,
                           DynamoHttpServletResponse pResponse)
                    throws javax.servlet.ServletException
After registration, any transient orders are made persistent through the persistShoppingCarts method of the CommerceProfileTools component

Overrides:
postCreateUser in class ProfileServices
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Throws:
javax.servlet.ServletException - if there was an error while executing the code

postLoginUser

public void postLoginUser(DynamoHttpServletRequest pRequest,
                          DynamoHttpServletResponse pResponse)
                   throws javax.servlet.ServletException
After logging in the user's session cached promotions are reloaded into the PricingModelHolder. In addition any non-transient orders are made persistent and old shopping carts are loaded from the database.

Overrides:
postLoginUser in class ProfileServices
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Throws:
javax.servlet.ServletException - if there was an error while executing the code

getCurrentShoppingCart

public OrderHolder getCurrentShoppingCart()
Gets the shopping cart of the current thread's user

Returns:
the shopping cart of the current thread's user, or null if there is none

getUserPricingModels

public PricingModelHolder getUserPricingModels()
Gets the PricingModelHolder of the current thread's user

Returns:
the PricingModelHolder of the current thread's user, or null if there is none