|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.droplet.EmptyFormHandler
atg.droplet.GenericFormHandler
atg.svc.agent.environment.EnvironmentChangeFormHandler
atg.commerce.csr.approvals.order.OrderApprovalFormHandler
public class OrderApprovalFormHandler
This form handler is used to execute the approval process for an Order Approval.
It also integrates an update of the agent's environment with the approval process. To complete the approval, the Approval's customer profile and ticket are loaded into global context.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
static java.lang.String |
INPUT_PARAM_APPROVAL
input parameter name used to store the Approval object that's loaded from the id |
static java.lang.String |
INPUT_PARAM_APPROVAL_ID
input parameter used to store the approvalId |
protected static java.lang.String |
LOCK_NAME_ATTRIBUTE_NAME
|
protected java.lang.String |
mApprovalId
|
protected ApprovalsManager |
mApprovalsManager
|
protected boolean |
mAutoSendApprovalAcceptedEmail
|
protected boolean |
mAutoSendApprovalRejectedEmail
|
protected ConfirmationInfo |
mConfirmationInfo
|
protected CSRAgentTools |
mCSRAgentTools
|
protected java.lang.String |
mCustomerEmail
|
protected java.lang.String |
mCustomerProfileIdParameterName
|
protected boolean |
mEnsureTransaction
|
protected OrderApprovalTools |
mOrderApprovalTools
|
protected atg.userprofiling.Profile |
mProfile
|
protected static java.lang.String |
PARAM_TRANSACTION_CREATED
|
protected static java.lang.String |
PARAM_VALUE_TRUE
|
Fields inherited from class atg.svc.agent.environment.EnvironmentChangeFormHandler |
---|
AGENTRESOURCES, AGENTUSERRESOURCES, mApplicationName, mDoTicketDispositionPrompt, mDoWarnings, mEnvironmentChangeKey, mEnvironmentChangeState, mEnvironmentTools, mInitChangeState, mInputParameters, mMessageTools, mTicketDispositionChangeHandler, mTicketDispositionOptions, mTicketingTools, mTransactionManager, sBundle |
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 | |
---|---|
OrderApprovalFormHandler()
|
Method Summary | |
---|---|
protected void |
acquireTransactionLock(atg.servlet.DynamoHttpServletRequest pRequest)
Attempt to acquire a local lock before creating a transaction that may modify the order, but only if useLocksAroundTransactions is set to true. |
boolean |
afterSet(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Called after any setX methods on this form are set when a form that modifies properties of this form handler is submitted. |
protected boolean |
approve(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Executes the changeEnvironment method to complete the environment
change process. |
boolean |
beforeSet(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Called before any setX methods on this form are set when a form that modifies properties of this form handler is submitted. |
protected void |
commitTransaction(javax.transaction.Transaction pTransaction)
Commits the supplied transaction |
protected javax.transaction.Transaction |
ensureTransaction()
This method ensures that a transaction exists before returning. |
java.lang.String |
getApprovalId()
Returns the Approval ID, used in the approval and rejection process. |
ApprovalsManager |
getApprovalsManager()
reference to the ApprovalsManager component used to execute the approval process. |
boolean |
getAutoSendApprovalAcceptedEmail()
Returns the auto send approval accepted email configuration |
boolean |
getAutoSendApprovalRejectedEmail()
Returns the auto send approval rejected email configuration |
ConfirmationInfo |
getConfirmationInfo()
Returns the confirmation info component used to send emails |
CSRAgentTools |
getCSRAgentTools()
|
javax.transaction.Transaction |
getCurrentTransaction()
Returns property currentTransaction |
java.lang.String |
getCustomerEmail()
Returns the customer email as a String. |
java.lang.String |
getCustomerProfileIdParameterName()
Returns the customer profile ID parameter name as a String. |
OrderApprovalTools |
getOrderApprovalTools()
Returns the order approval tools |
atg.userprofiling.Profile |
getProfile()
reference to the current profile, used to get the approving agent |
atg.commerce.util.TransactionLockFactory |
getTransactionLockFactory()
The transactionLockFactory is used to get the locks if useLocksArountTransactions is true |
boolean |
handleApprove(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Executes the environment change and approval process. |
boolean |
handleReject(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Executes the environment change and rejection process. |
protected boolean |
initializeConfirmationInfoForApprove(Approval pApproval)
Initializes the confirmation info object when an order is approved |
protected boolean |
initializeConfirmationInfoForReject(Approval pApproval)
Initializes the confirmation info object when an order is rejected |
boolean |
isEnsureTransaction()
Enables and disables the ensure transaction check. |
protected boolean |
isTransactionCreated(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
|
protected boolean |
isTransactionMarkedAsRollBack()
Returns true if the transaction associated with the current thread is marked for rollback. |
protected boolean |
postApprove(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
If there are no errors, adds a success message to the message bar. |
protected boolean |
postReject(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
If there are no errors, adds a rejection success message to the message bar. |
protected boolean |
preApprove(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Performed before the approve() method. |
protected boolean |
preReject(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Performed before the reject() method. |
void |
processException(java.lang.Exception pException,
atg.commerce.order.Order pOrder)
Checks for a concurrent update in the exception |
protected boolean |
reject(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Executes the changeEnvironment method to complete the environment
change process. |
protected void |
releaseTransactionLock(atg.servlet.DynamoHttpServletRequest pRequest)
Attempt to release the local lock that was acquired before creating a transaction that may have modified the order, but only if useLocksAroundTransactions is set to true. |
void |
setApprovalId(java.lang.String pApprovalId)
Sets the Approval ID, used in the approval and rejection process. |
void |
setApprovalsManager(ApprovalsManager pApprovalsManager)
Sets the Approvals Manager |
void |
setAutoSendApprovalAcceptedEmail(boolean pAutoSendApprovalAcceptedEmail)
Sets the auto send approval accepted email configuration |
void |
setAutoSendApprovalRejectedEmail(boolean pAutoSendApprovalRejectedEmail)
Sets the auto send approval rejected email configuration |
void |
setConfirmationInfo(ConfirmationInfo pConfirmationInfo)
Sets the confirmation info component used to send emails |
void |
setCSRAgentTools(CSRAgentTools pCSRAgentTools)
Sets the property CSRAgentTools. |
void |
setCustomerEmail(java.lang.String pCustomerEmail)
Sets the customer email as a String. |
void |
setCustomerProfileIdParameterName(java.lang.String pCustomerProfileIdParameterName)
Sets the customer profile ID parameter name as a String. |
void |
setEnsureTransaction(boolean pEnsureTransaction)
Enables and disables the ensure transaction check |
void |
setOrderApprovalTools(OrderApprovalTools pOrderApprovalTools)
Sets the order approval tools |
void |
setProfile(atg.userprofiling.Profile pProfile)
Sets the profile |
protected void |
setTransactionCreated(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
|
void |
setTransactionLockFactory(atg.commerce.util.TransactionLockFactory pTransactionLockFactory)
The transactionLockFactory is used to get the locks if useLocksArountTransactions is true |
protected void |
setupInputParameters(java.util.Map pInputParameters,
atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
Extended to load the approval object based on the id and determine the environment objects: customer profile and ticket, that should be loaded into global context before the approval is executed. |
protected void |
unsetTransactionCreated(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
|
Methods inherited from class atg.svc.agent.environment.EnvironmentChangeFormHandler |
---|
addRedirectURLParams, changeEnvironment, conformRedirectURL, getApplicationName, getConfirmPromptURL, getConfirmURL, getEnvironmentChangeKey, getEnvironmentChangeState, getEnvironmentTools, getErrorURL, getInputParameters, getMessageTools, getSuccessURL, getTicketDispositionChangeHandler, getTicketDispositionOptions, getTicketingTools, getTransactionManager, getUserLocale, getUserMessage, getUserMessage, handleChangeEnvironment, initChangeState, initChangeState, isDoTicketDispositionPrompt, isDoWarnings, isInitChangeState, isShowDispositionPrompt, postChangeEnvironment, preChangeEnvironment, setApplicationName, setConfirmPromptURL, setConfirmURL, setDoTicketDispositionPrompt, setDoWarnings, setEnvironmentChangeKey, setEnvironmentChangeState, setEnvironmentTools, setErrorURL, setInitChangeState, setInputParameters, setMessageTools, setSuccessURL, setTicketDispositionChangeHandler, setTicketDispositionOptions, setTicketingTools, setTransactionManager |
Methods inherited from class atg.droplet.GenericFormHandler |
---|
addFormException, addUncheckedFormException, 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, doStartService, 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 |
---|
public static java.lang.String CLASS_VERSION
public static final java.lang.String INPUT_PARAM_APPROVAL_ID
public static final java.lang.String INPUT_PARAM_APPROVAL
protected static final java.lang.String PARAM_TRANSACTION_CREATED
protected static final java.lang.String PARAM_VALUE_TRUE
protected static final java.lang.String LOCK_NAME_ATTRIBUTE_NAME
protected ApprovalsManager mApprovalsManager
protected atg.userprofiling.Profile mProfile
protected CSRAgentTools mCSRAgentTools
protected boolean mAutoSendApprovalAcceptedEmail
protected boolean mAutoSendApprovalRejectedEmail
protected ConfirmationInfo mConfirmationInfo
protected OrderApprovalTools mOrderApprovalTools
protected java.lang.String mApprovalId
protected java.lang.String mCustomerEmail
protected boolean mEnsureTransaction
protected java.lang.String mCustomerProfileIdParameterName
Constructor Detail |
---|
public OrderApprovalFormHandler()
Method Detail |
---|
public ApprovalsManager getApprovalsManager()
public void setApprovalsManager(ApprovalsManager pApprovalsManager)
public atg.userprofiling.Profile getProfile()
public void setProfile(atg.userprofiling.Profile pProfile)
public void setCSRAgentTools(CSRAgentTools pCSRAgentTools)
public CSRAgentTools getCSRAgentTools()
public void setAutoSendApprovalAcceptedEmail(boolean pAutoSendApprovalAcceptedEmail)
pAutoSendApprovalAcceptedEmail
- the AutoSendApprovalAcceptedEmail to setpublic boolean getAutoSendApprovalAcceptedEmail()
public void setAutoSendApprovalRejectedEmail(boolean pAutoSendApprovalRejectedEmail)
pAutoSendApprovalRejectedEmail
- the AutoSendApprovalRejectedEmail to setpublic boolean getAutoSendApprovalRejectedEmail()
public void setConfirmationInfo(ConfirmationInfo pConfirmationInfo)
pConfirmationInfo
- the ConfirmationInfo to setpublic ConfirmationInfo getConfirmationInfo()
public void setOrderApprovalTools(OrderApprovalTools pOrderApprovalTools)
pOrderApprovalTools
- the OrderApprovalTools to setpublic OrderApprovalTools getOrderApprovalTools()
public void setApprovalId(java.lang.String pApprovalId)
pApprovalId
- the ApprovalId to setpublic java.lang.String getApprovalId()
public void setCustomerEmail(java.lang.String pCustomerEmail)
pCustomerEmail
- the Customer Email to setpublic java.lang.String getCustomerEmail()
public void setEnsureTransaction(boolean pEnsureTransaction)
public boolean isEnsureTransaction()
public void setTransactionLockFactory(atg.commerce.util.TransactionLockFactory pTransactionLockFactory)
useLocksArountTransactions
is true
public atg.commerce.util.TransactionLockFactory getTransactionLockFactory()
useLocksArountTransactions
is true
public void setCustomerProfileIdParameterName(java.lang.String pCustomerProfileIdParameterName)
pCustomerProfileIdParameterName
- the CustomerProfileIdParameterName to setpublic java.lang.String getCustomerProfileIdParameterName()
protected void setupInputParameters(java.util.Map pInputParameters, atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws atg.svc.agent.environment.EnvironmentException
setupInputParameters
in class atg.svc.agent.environment.EnvironmentChangeFormHandler
pInputParameters
- - a map of input parameterspRequest
- pResponse
-
atg.svc.agent.environment.EnvironmentException
protected boolean preApprove(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- pResponse
-
javax.servlet.ServletException
java.io.IOException
protected boolean preReject(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- pResponse
-
javax.servlet.ServletException
java.io.IOException
public boolean handleApprove(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- pResponse
-
javax.servlet.ServletException
java.io.IOException
public boolean handleReject(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- pResponse
-
javax.servlet.ServletException
java.io.IOException
protected boolean postApprove(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- pResponse
-
javax.servlet.ServletException
java.io.IOException
protected boolean initializeConfirmationInfoForApprove(Approval pApproval)
Approval
- - the approval to use in the confirmation message
protected boolean initializeConfirmationInfoForReject(Approval pApproval)
Approval
- - the approval to use in the confirmation message
protected boolean postReject(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- pResponse
-
javax.servlet.ServletException
java.io.IOException
protected boolean approve(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
changeEnvironment
method to complete the environment
change process. After which, the ApprovalsManager is called to execute the
approval process.
pRequest
- pResponse
-
javax.servlet.ServletException
java.io.IOException
protected boolean reject(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
changeEnvironment
method to complete the environment
change process. After which, the ApprovalsManager is called to execute the
rejection process.
pRequest
- pResponse
-
javax.servlet.ServletException
java.io.IOException
public boolean beforeSet(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws atg.droplet.DropletFormException
beforeSet
in interface atg.droplet.DropletFormHandler
beforeSet
in class atg.droplet.GenericFormHandler
pRequest
- a DynamoHttpServletRequest
valuepResponse
- a DynamoHttpServletResponse
value
boolean
value
atg.droplet.DropletFormException
- if an error occursafterSet(atg.servlet.DynamoHttpServletRequest, atg.servlet.DynamoHttpServletResponse)
,
ensureTransaction()
,
#setUseLocksAroundTransactions
public boolean afterSet(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws atg.droplet.DropletFormException
afterSet
in interface atg.droplet.DropletFormHandler
afterSet
in class atg.droplet.GenericFormHandler
pRequest
- a DynamoHttpServletRequest
valuepResponse
- a DynamoHttpServletResponse
value
boolean
value
atg.droplet.DropletFormException
- if an error occursbeforeSet(atg.servlet.DynamoHttpServletRequest, atg.servlet.DynamoHttpServletResponse)
,
ensureTransaction()
,
#setUseLocksAroundTransactions
protected javax.transaction.Transaction ensureTransaction()
Transaction
valuepublic javax.transaction.Transaction getCurrentTransaction()
protected void commitTransaction(javax.transaction.Transaction pTransaction)
pTransaction
- a Transaction
valuepublic void processException(java.lang.Exception pException, atg.commerce.order.Order pOrder)
pException
- an Exception
valuepOrder
- a DynamoHttpServletResponse
valueprotected boolean isTransactionMarkedAsRollBack()
boolean
valueprotected void setTransactionCreated(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
protected void unsetTransactionCreated(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
protected boolean isTransactionCreated(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
protected void acquireTransactionLock(atg.servlet.DynamoHttpServletRequest pRequest) throws atg.service.lockmanager.DeadlockException
useLocksAroundTransactions
is set to true.
pRequest
-
atg.service.lockmanager.DeadlockException
protected void releaseTransactionLock(atg.servlet.DynamoHttpServletRequest pRequest) throws atg.service.lockmanager.LockManagerException
useLocksAroundTransactions
is set to true.
pRequest
-
atg.service.lockmanager.LockManagerException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |