atg.commerce.csr.profile
Class CreateStoreCreditFormHandler

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.droplet.EmptyFormHandler
              extended by atg.droplet.GenericFormHandler
                  extended by atg.userprofiling.ProfileForm
                      extended by atg.commerce.csr.profile.CreateStoreCreditFormHandler
All Implemented Interfaces:
atg.droplet.DropletFormHandler, 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

public class CreateStoreCreditFormHandler
extends atg.userprofiling.ProfileForm

This class is used to grant store credits for a profile


Nested Class Summary
 
Nested classes/interfaces inherited from class atg.userprofiling.ProfileForm
atg.userprofiling.ProfileForm.ProfileFormHashtableWrapper
 
Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  CSRAgentTools mCSRAgentTools
           
protected static java.lang.String PROFILEFORMRESOURCES
          Resources file
 
Fields inherited from class atg.userprofiling.ProfileForm
CONFIRMPASSWORD_PARAM, DEFAULT_CREATE_PROFILE_TYPE, DEFAULT_LOGIN_PROFILE_TYPE, DEFAULT_LOGOUT_PROFILE_TYPE, HANDLE_CREATE, HANDLE_CREATE_PARAM, HANDLE_FAILURE, HANDLE_LOGIN, HANDLE_LOGIN_PARAM, HANDLE_SUCCESS, ID_NAME, mBadPasswordDelay, mChangePasswordErrorURL, mChangePasswordSuccessURL, mCheckForRequiredParameters, mCheckForRequiredProperties, mCheckForRequiredPropertiesAfterUpdate, mCompareValueInCopyPropertiesOnLogin, mConfirmOldPassword, mConfirmPassword, mCreateErrorURL, mCreateProfileType, mCreateSuccessURL, mDeleteErrorURL, mDeleteSuccessURL, mExpireSessionOnLogout, mExtractDefaultValuesFromProfile, mLoginErrorURL, mLoginProfileType, mLoginSuccessURL, mLogoutErrorURL, mLogoutProfileType, mLogoutSuccessURL, mProfileTools, mPropertiesToAddOnLogin, mPropertiesToCopyOnLogin, mRepositoryId, MSG_ERR_CREATING_PROFILE, MSG_ERR_DELETING_PROFILE, MSG_ERR_UPDATING_PROFILE, MSG_ILLEGAL_ARGUMENT, MSG_INVALID_ADD_PROPERTY, MSG_INVALID_LOGIN, MSG_INVALID_PASSWORD, MSG_MISSING_LOGIN, MSG_MISSING_OLD_PASSWORD, MSG_MISSING_PASSWORD, MSG_MISSING_PROFILE, MSG_MISSING_PROFILE_TOOLS, MSG_MISSING_REQUIRED_PROPERTY, MSG_NO_SUCH_PROFILE_PROPERTY, MSG_NO_TYPE_CONVERTER, MSG_PASSWORD_SAME_AS_OLD_PASSWORD, MSG_PASSWORDS_DO_NOT_MATCH, MSG_PERMISSION_DEFINED_PASSWORD_CHANGE, MSG_READ_ONLY_PROFILE_PROPERTY, MSG_TYPE_CONVERSION_ERR, MSG_USER_ALREADY_EXISTS, MSG_WARNING_PROFILE_TOOLS, mSwapEventListeners, mTrimProperties, mUpdateErrorURL, mUpdateSuccessURL, mUserLoginManager, mUsingLdapProfile, mValue, NULL_SENTINEL, OLDPASSWORD_PARAM, REPOSITORY_ID_PROPERTY_NAME, RESOURCE_BUNDLE_NAME, sResourceBundle, STATUS_ERROR_REDIRECT, STATUS_ERROR_STAY, STATUS_SUCCESS
 
Fields inherited from class atg.droplet.GenericFormHandler
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
 
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
CreateStoreCreditFormHandler()
          Constructs an instanceof CreateStoreCreditFormHandler
 
Method Summary
 CSRAgentMessagingTools getAgentMessagingTools()
          Returns property AgentMessagingTools
 atg.userprofiling.Profile getAgentProfile()
          Returns the session scoped Agent profile object
 atg.commerce.claimable.ClaimableManager getClaimableManager()
           
 CSRAgentTools getCSRAgentTools()
           
 java.util.Map getEditValue()
           
 atg.userprofiling.Profile getProfile()
           
 java.lang.String getRepositoryId()
          Overrides ProfileForm.getRepositoryId() to extract from the profile if the property is empty
 java.lang.String getTicketId()
          Returns the Id of the current ticket
 boolean handleCreateStoreCredit(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Creates a store credit for a customer.
 boolean isSendAgentEvents()
           
 void setAgentMessagingTools(CSRAgentMessagingTools pAgentMessagingTools)
          Sets property AgentMessagingTools
 void setAgentProfile(atg.userprofiling.Profile pAgentProfile)
           
 void setClaimableManager(atg.commerce.claimable.ClaimableManager pClaimableManager)
          Set the ClaimableManager property.
 void setCSRAgentTools(CSRAgentTools pCSRAgentTools)
          Sets the property CSRAgentTools.
 void setProfile(atg.userprofiling.Profile pProfile)
          Sets the property Profile.
 void setSendAgentEvents(boolean pSendAgentEvents)
          Property for enabling/disabling agent events.
protected  void validateStoreCreditAmount(java.lang.String pProfileId, double pAmount)
          This method is called prior to issuing the store credit.
 
Methods inherited from class atg.userprofiling.ProfileForm
addMulti, addPropertiesOnLogin, addProperty, addSwapEventListener, addUser, changePassword, checkFormError, checkFormSuccess, checkForRequiredParameters, checkForRequiredProperties, checkForRequiredProperties, commitTransaction, copyPropertiesOnLogin, createProfileItem, createUser, doStartService, ensureTransaction, findUser, findUser, formatUserMessage, formatUserMessage, formatUserMessage, formatUserMessage, generatePropertyPath, getAddMultiPropertyName, getAddMultiPropertyValue, getBadPasswordDelay, getChangePasswordErrorURL, getChangePasswordSuccessURL, getCheckForRequiredParameters, getCheckForRequiredProperties, getCheckForRequiredPropertiesAfterUpdate, getCreateErrorURL, getCreateProfileType, getCreateSuccessURL, getDeleteErrorURL, getDeleteSuccessURL, getDescriptor, getExpireSessionOnLogout, getLoginErrorURL, getLoginProfileType, getLoginSuccessURL, getLogoutErrorURL, getLogoutProfileType, getLogoutSuccessURL, getProcessPropertyNames, getProfileItem, getProfileTools, getPropertiesToAddOnLogin, getPropertiesToCopyOnLogin, getStringValueProperty, getTransactionDemarcation, getTransactionManager, getTrimProperties, getUpdateErrorURL, getUpdateSuccessURL, getUserLocale, getUserLoginManager, getValue, getValueFromArrayString, getValueFromObject, getValueFromObjectArray, getValueFromString, getValueFromStringArray, getValueMap, getValueProperty, handleAddMulti, handleChangePassword, handleCreate, handleDelete, handleLogin, handleLogout, handleUpdate, handleValueDictionaryByParameters, isCompareValueInCopyPropertiesOnLogin, isConfirmOldPassword, isConfirmPassword, isExtractDefaultValuesFromProfile, isTrimProperty, isUsingLdapProfile, postAddMulti, postChangePassword, postCreateUser, postDeleteUser, postLoginUser, postLogoutUser, postUpdateUser, postValueDictionaryByParameters, preAddMulti, preChangePassword, preCreateUser, preDeleteUser, preLoginUser, preLogoutUser, preUpdateUser, preValueDictionaryByParameters, removeSwapEventListener, removeUser, sendProfileSwapEvent, setBadPasswordDelay, setChangePasswordErrorURL, setChangePasswordSuccessURL, setCheckForRequiredParameters, setCheckForRequiredProperties, setCheckForRequiredPropertiesAfterUpdate, setCompareValueInCopyPropertiesOnLogin, setConfirmOldPassword, setConfirmPassword, setCreateErrorURL, setCreateProfileType, setCreateSuccessURL, setDeleteErrorURL, setDeleteSuccessURL, setExpireSessionOnLogout, setExtractDefaultValuesFromProfile, setLoginErrorURL, setLoginProfileType, setLoginSuccessURL, setLogoutErrorURL, setLogoutProfileType, setLogoutSuccessURL, setProfileTools, setPropertiesToAddOnLogin, setPropertiesToCopyOnLogin, setRepositoryId, setTrimProperties, setUpdateErrorURL, setUpdateSuccessURL, setUserLoginManager, setUsingLdapProfile, setValueDictionaryByParameters, setValueProperty, updateLDAPProfileAttributes, updatePasswordValue, updateProfileAttributes, updateProfileAttributes, updateUser, userAlreadyExists, valueIsEmpty
 
Methods inherited from class atg.droplet.GenericFormHandler
addFormException, addUncheckedFormException, afterSet, beforeSet, checkFormRedirect, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleCancel, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, setCancelURL, setCheckForValidSession, setDeferForwardsAndRedirects, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages, setUseForwards
 
Methods inherited from class atg.droplet.EmptyFormHandler
afterGet, beforeGet
 
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, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


PROFILEFORMRESOURCES

protected static final java.lang.String PROFILEFORMRESOURCES
Resources file

See Also:
Constant Field Values

mCSRAgentTools

protected CSRAgentTools mCSRAgentTools
Constructor Detail

CreateStoreCreditFormHandler

public CreateStoreCreditFormHandler()
Constructs an instanceof CreateStoreCreditFormHandler

Method Detail

getAgentProfile

public atg.userprofiling.Profile getAgentProfile()
Returns the session scoped Agent profile object

Returns:
the agent profile object

setAgentProfile

public void setAgentProfile(atg.userprofiling.Profile pAgentProfile)

setSendAgentEvents

public void setSendAgentEvents(boolean pSendAgentEvents)
Property for enabling/disabling agent events.

Parameters:
pSendAgentEvents - new value to set

isSendAgentEvents

public boolean isSendAgentEvents()
Returns:
The value of the property SendAgentEvents.

setAgentMessagingTools

public void setAgentMessagingTools(CSRAgentMessagingTools pAgentMessagingTools)
Sets property AgentMessagingTools


getAgentMessagingTools

public CSRAgentMessagingTools getAgentMessagingTools()
Returns property AgentMessagingTools


setClaimableManager

public void setClaimableManager(atg.commerce.claimable.ClaimableManager pClaimableManager)
Set the ClaimableManager property.

Parameters:
pClaimableManager - the claimable manager - used for store credits

getClaimableManager

public atg.commerce.claimable.ClaimableManager getClaimableManager()
Returns:
the ClaimableManager

setCSRAgentTools

public void setCSRAgentTools(CSRAgentTools pCSRAgentTools)
Sets the property CSRAgentTools.


getCSRAgentTools

public CSRAgentTools getCSRAgentTools()
Returns:
The CSRAgentTools component used to manipulate the profile

getEditValue

public java.util.Map getEditValue()
Returns:
The value of the property EditValue. This is a map that stores the pending values for an editing operations on the profile

setProfile

public void setProfile(atg.userprofiling.Profile pProfile)
Sets the property Profile. This is set to the user Profile to edit.


getProfile

public atg.userprofiling.Profile getProfile()
Overrides:
getProfile in class atg.userprofiling.ProfileForm
Returns:
the Profile to be acted upon

getRepositoryId

public java.lang.String getRepositoryId()
Overrides ProfileForm.getRepositoryId() to extract from the profile if the property is empty

Overrides:
getRepositoryId in class atg.userprofiling.ProfileForm
Returns:
the repositoryId from the current Profile

handleCreateStoreCredit

public boolean handleCreateStoreCredit(atg.servlet.DynamoHttpServletRequest pRequest,
                                       atg.servlet.DynamoHttpServletResponse pResponse)
                                throws javax.servlet.ServletException,
                                       java.io.IOException
Creates a store credit for a customer.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

validateStoreCreditAmount

protected void validateStoreCreditAmount(java.lang.String pProfileId,
                                         double pAmount)
This method is called prior to issuing the store credit.

Extend this method to add custom validation of the store credit amount.

Parameters:
pProfileId - the profile that will receive the store credit
pAmount - the amount of the store credit.

getTicketId

public java.lang.String getTicketId()
Returns the Id of the current ticket