atg.commerce.csr.order.scheduled
Class LoadAndExecuteAction

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.svc.agent.environment.EnvironmentChangeFormHandler
                      extended by atg.commerce.csr.order.scheduled.LoadAndExecuteAction
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 LoadAndExecuteAction
extends atg.svc.agent.environment.EnvironmentChangeFormHandler

This form handler is used to perform the one click schedule activate/deactivate actions from the scheduled order view page.

The scheduled order template is first loaded into the global context before the state is changed on the schedule.


Field Summary
static java.lang.String ACTION_ACTIVATE
          the action that will cause the schedule to be activated
static java.lang.String ACTION_DEACTIVATE
          the action that will cause the schedule to be deactivated
static atg.nucleus.naming.ParameterName ACTION_PARAM_NAME
          The parameter name used to specify if the scheduled should be activatived or deactivated
static java.lang.String CLASS_VERSION
          Class version string
protected  boolean mAutoSendEmail
           
protected  ConfirmationInfo mConfirmationInfo
           
protected  CSRAgentTools mCSRAgentTools
           
protected  CSRScheduledOrderTools mCSRScheduledOrderTools
           
static atg.nucleus.naming.ParameterName SCHEDULED_ORDER_ID_PARAM_NAME
          The parameter name used to specify the scheduled order id
 
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
LoadAndExecuteAction()
           
 
Method Summary
protected  void activateSchedule()
          Activates the schedule and re-calculates the next run time
protected  boolean changeEnvironment(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Executes the action against the scheduled order item.
protected  void deactivateSchedule()
          Deactivates the schedule
 ConfirmationInfo getConfirmationInfo()
          Returns the confirmation info object used for sending email confirmations.
 CSRAgentTools getCSRAgentTools()
          Returns a reference to the CSRAgentTools component
 CSRScheduledOrderTools getCSRScheduledOrderTools()
          Returns a reference to the CSRScheduledOrderTools component
protected  void initializeConfirmationInfoForScheduleUpdate(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Initializes the confirmation info object when a new order is submitted
 boolean isAutoSendEmail()
          Gets the AutoSendEmail
protected  void performAction(java.lang.String pAction)
          Performs the requested action against the scheduled order item
protected  boolean postChangeEnvironment(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Post environment change processing.
 void setAutoSendEmail(boolean pAutoSendEmail)
          Sets the AutoSendEmail
 void setConfirmationInfo(ConfirmationInfo pConfirmationInfo)
           
 void setCSRAgentTools(CSRAgentTools pAgentTools)
           
 void setCSRScheduledOrderTools(CSRScheduledOrderTools pCSRScheduledOrderTools)
           
 
Methods inherited from class atg.svc.agent.environment.EnvironmentChangeFormHandler
addRedirectURLParams, 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, preChangeEnvironment, setApplicationName, setConfirmPromptURL, setConfirmURL, setDoTicketDispositionPrompt, setDoWarnings, setEnvironmentChangeKey, setEnvironmentChangeState, setEnvironmentTools, setErrorURL, setInitChangeState, setInputParameters, setMessageTools, setSuccessURL, setTicketDispositionChangeHandler, setTicketDispositionOptions, setTicketingTools, setTransactionManager, setupInputParameters
 
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, 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

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


SCHEDULED_ORDER_ID_PARAM_NAME

public static final atg.nucleus.naming.ParameterName SCHEDULED_ORDER_ID_PARAM_NAME
The parameter name used to specify the scheduled order id


ACTION_PARAM_NAME

public static final atg.nucleus.naming.ParameterName ACTION_PARAM_NAME
The parameter name used to specify if the scheduled should be activatived or deactivated


ACTION_ACTIVATE

public static final java.lang.String ACTION_ACTIVATE
the action that will cause the schedule to be activated

See Also:
Constant Field Values

ACTION_DEACTIVATE

public static final java.lang.String ACTION_DEACTIVATE
the action that will cause the schedule to be deactivated

See Also:
Constant Field Values

mConfirmationInfo

protected ConfirmationInfo mConfirmationInfo

mAutoSendEmail

protected boolean mAutoSendEmail

mCSRAgentTools

protected CSRAgentTools mCSRAgentTools

mCSRScheduledOrderTools

protected CSRScheduledOrderTools mCSRScheduledOrderTools
Constructor Detail

LoadAndExecuteAction

public LoadAndExecuteAction()
Method Detail

getConfirmationInfo

public ConfirmationInfo getConfirmationInfo()
Returns the confirmation info object used for sending email confirmations.

Returns:
ConfirmationInfo

setConfirmationInfo

public void setConfirmationInfo(ConfirmationInfo pConfirmationInfo)

isAutoSendEmail

public boolean isAutoSendEmail()
Gets the AutoSendEmail

Returns:
the AutoSendEmail

setAutoSendEmail

public void setAutoSendEmail(boolean pAutoSendEmail)
Sets the AutoSendEmail

Parameters:
pAutoSendEmail - The AutoSendEmail to set

getCSRAgentTools

public CSRAgentTools getCSRAgentTools()
Returns a reference to the CSRAgentTools component


setCSRAgentTools

public void setCSRAgentTools(CSRAgentTools pAgentTools)

getCSRScheduledOrderTools

public CSRScheduledOrderTools getCSRScheduledOrderTools()
Returns a reference to the CSRScheduledOrderTools component


setCSRScheduledOrderTools

public void setCSRScheduledOrderTools(CSRScheduledOrderTools pCSRScheduledOrderTools)

changeEnvironment

protected boolean changeEnvironment(atg.servlet.DynamoHttpServletRequest pRequest,
                                    atg.servlet.DynamoHttpServletResponse pResponse)
                             throws javax.servlet.ServletException,
                                    java.io.IOException
Executes the action against the scheduled order item.

Overrides:
changeEnvironment in class atg.svc.agent.environment.EnvironmentChangeFormHandler
Throws:
javax.servlet.ServletException
java.io.IOException
See Also:
performAction(String)

performAction

protected void performAction(java.lang.String pAction)
                      throws atg.commerce.CommerceException
Performs the requested action against the scheduled order item
Parameters:
pAction -
Throws:
atg.commerce.CommerceException
See Also:
ACTION_ACTIVATE, ACTION_DEACTIVATE

postChangeEnvironment

protected boolean postChangeEnvironment(atg.servlet.DynamoHttpServletRequest pRequest,
                                        atg.servlet.DynamoHttpServletResponse pResponse)
                                 throws javax.servlet.ServletException,
                                        java.io.IOException
Post environment change processing.

Overrides:
postChangeEnvironment in class atg.svc.agent.environment.EnvironmentChangeFormHandler
Parameters:
pRequest -
pResponse -
Returns:
false if redirected
Throws:
javax.servlet.ServletException
java.io.IOException

initializeConfirmationInfoForScheduleUpdate

protected void initializeConfirmationInfoForScheduleUpdate(atg.servlet.DynamoHttpServletRequest pRequest,
                                                           atg.servlet.DynamoHttpServletResponse pResponse)
Initializes the confirmation info object when a new order is submitted

Parameters:
pRequest -
pResponse -

activateSchedule

protected void activateSchedule()
                         throws atg.commerce.CommerceException
Activates the schedule and re-calculates the next run time

Throws:
atg.commerce.CommerceException
See Also:
CSRScheduledOrderTools.activateSchedule(String)

deactivateSchedule

protected void deactivateSchedule()
                           throws atg.commerce.CommerceException
Deactivates the schedule

Throws:
atg.commerce.CommerceException