atg.svc.ui.formhandlers
Class ServiceFormHandler

java.lang.Object
  extended by atg.nucleus.GenericService
      extended by atg.droplet.EmptyFormHandler
          extended by atg.droplet.GenericFormHandler
              extended by atg.droplet.TransactionalFormHandler
                  extended by atg.web.formhandlers.ApplicationFormHandler
                      extended by atg.svc.ui.formhandlers.ServiceFormHandler
All Implemented Interfaces:
atg.droplet.DropletFormHandler, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, FormHandlerConstants, java.util.EventListener
Direct Known Subclasses:
FrameworkBaseFormHandler, RatingFormHandler

public class ServiceFormHandler
extends atg.web.formhandlers.ApplicationFormHandler
implements FormHandlerConstants

Base FormHandler for service applications that adds some additional error handling and transaction management. By default transactions are enabled for all setters/handle method calls on the form. The transaction encapsulates all setter and handle calls together and then ends the transaction in afterSet. Also, by default transactions are not rolled back.

Version:
$Id: //application/service/version/2007.3/common-ui/src/classes/atg/svc/ui/formhandlers/ServiceFormHandler.java#2 $$Change: 632007 $
Author:
Doug Kenyon

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.web.formhandlers.ApplicationFormHandler
EQUALS, PARAM_DELIMITER, QUERY_DELIMITER, STATUS_ERROR_REDIRECT, STATUS_ERROR_STAY, STATUS_SUCCESS
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.svc.ui.formhandlers.FormHandlerConstants
OPTIONS_ANSWER_DISPLAY, OPTIONS_ANSWER_DISPLAY_CURRENT_WINDOW, OPTIONS_ANSWER_DISPLAY_MULTIPLE_WINDOWS, OPTIONS_ANSWER_DISPLAY_SINGLE_WINDOW, OPTIONS_ANSWERS_PER_PAGE, OPTIONS_FAQS_PER_PAGE, OPTIONS_FILTER_BY, OPTIONS_FILTER_BY_DOC_SET, OPTIONS_FILTER_BY_FORMAT, OPTIONS_FILTER_BY_SOURCE, OPTIONS_FILTER_BY_TITLE, OPTIONS_FILTER_OR_GROUPING, OPTIONS_FILTER_OR_GROUPING_FILTER, OPTIONS_FILTER_OR_GROUPING_GROUP, OPTIONS_FILTER_OR_GROUPING_NONE, OPTIONS_GROUP_BY, OPTIONS_QUERY_LANGUAGE, OPTIONS_RESULT_LANGUAGE, OPTIONS_SHOW_ANSWERS_AS, OPTIONS_SHOW_ANSWERS_BY_DOC, OPTIONS_SHOW_ANSWERS_INDIVIDUAL, OPTIONS_SHOW_FAQS_AS, OPTIONS_SHOW_FAQS_AS_QUESTIONS, OPTIONS_SHOW_FAQS_AS_QUESTIONS_AND_ANSWERS, PARAM_SITE_ID
 
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
ServiceFormHandler()
           
 
Method Summary
 void handleUncheckedFormException(java.lang.Throwable exception, atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Logs all unhandled exceptions if the formhandler is configured to do so in the loggingUncheckedError property.
 boolean isLoggingUncheckedException()
          Gets the value of the loggingUncheckedException property.
 boolean isRollbackTransactionOnFormError()
          Gets the isRollbackTransactionOnFormError property.
protected  boolean isTransactionMarkedAsRollback()
          Returns true if there has been a form error or unchecked exception thrown in the handle method so that the transaction can be been marked for rollback.
 void processException(java.lang.Exception pException, java.lang.String pMsgId, atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Override processException to force all exceptions to be logged if isLoggingError=true
 void processException(java.lang.Exception pException, java.lang.String pMsgId, atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse, java.lang.Object[] pParam)
          Override processException to force all exceptions to be logged if isLoggingError=true
 void setLoggingUncheckedException(boolean pLoggingUncheckedException)
          Sets the value of the loggingUncheckedException property.
 void setRollbackTransactionOnFormError(boolean pRollbackTransactionOnFormError)
          Set the isRollbackTransactionOnFormError property.
 
Methods inherited from class atg.web.formhandlers.ApplicationFormHandler
addParameterToURLString, beforeGet, beforeSet, checkFormError, checkFormRedirect, checkFormSuccess, formHandlerBeforeGet, formHandlerBeforeSet, formHandlerInit, getErrorURL, getRedirectDelayMS, getString, getString, getString, getSuccessURL, getUserMessagesResourceBundle, handleCancel, processException, processException, processExceptionAndLog, processExceptionAndLog, redirect, setErrorURL, setRedirectDelayMS, setSuccessURL, setUserMessagesResourceBundle
 
Methods inherited from class atg.droplet.TransactionalFormHandler
afterSet, commitTransaction, getTransactionDemarcation, isEnsureTransaction, isRollbackTransaction, setEnsureTransaction, setRollbackTransaction, setTransactionDemarcation
 
Methods inherited from class atg.droplet.GenericFormHandler
addFormException, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, handleFormException, isRestorableForm, isValidSession, resetFormExceptions, setCancelURL, setCheckForValidSession, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages
 
Methods inherited from class atg.droplet.EmptyFormHandler
afterGet
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingWarning, setServiceInfo, startService, stopService
 
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

Constructor Detail

ServiceFormHandler

public ServiceFormHandler()
Method Detail

isRollbackTransactionOnFormError

public boolean isRollbackTransactionOnFormError()
Gets the isRollbackTransactionOnFormError property.

Returns:
true if the transaction should rollback when there are form errors.

setRollbackTransactionOnFormError

public void setRollbackTransactionOnFormError(boolean pRollbackTransactionOnFormError)
Set the isRollbackTransactionOnFormError property.

Parameters:
pRollbackTransactionOnFormError - true if the transaction should rollback when there are form errors.

isLoggingUncheckedException

public boolean isLoggingUncheckedException()
Gets the value of the loggingUncheckedException property.

Returns:
true if unchecked exceptions passed to handleUncheckedException should be logged.

setLoggingUncheckedException

public void setLoggingUncheckedException(boolean pLoggingUncheckedException)
Sets the value of the loggingUncheckedException property.

Parameters:
pLoggingUncheckedException - true if unchecked exceptions passed to handleUncheckedException should be logged.

handleUncheckedFormException

public void handleUncheckedFormException(java.lang.Throwable exception,
                                         atg.servlet.DynamoHttpServletRequest pRequest,
                                         atg.servlet.DynamoHttpServletResponse pResponse)
Logs all unhandled exceptions if the formhandler is configured to do so in the loggingUncheckedError property.

Parameters:
exception - The unchecked exception to log.
pRequest - The request
pResponse - The response

processException

public void processException(java.lang.Exception pException,
                             java.lang.String pMsgId,
                             atg.servlet.DynamoHttpServletRequest pRequest,
                             atg.servlet.DynamoHttpServletResponse pResponse)
Override processException to force all exceptions to be logged if isLoggingError=true

Parameters:
pException -
pMsgId -
pRequest -
pResponse -

processException

public void processException(java.lang.Exception pException,
                             java.lang.String pMsgId,
                             atg.servlet.DynamoHttpServletRequest pRequest,
                             atg.servlet.DynamoHttpServletResponse pResponse,
                             java.lang.Object[] pParam)
Override processException to force all exceptions to be logged if isLoggingError=true

Parameters:
pException -
pMsgId -
pRequest -
pResponse -
pParam -

isTransactionMarkedAsRollback

protected boolean isTransactionMarkedAsRollback()
Returns true if there has been a form error or unchecked exception thrown in the handle method so that the transaction can be been marked for rollback.

Overrides:
isTransactionMarkedAsRollback in class atg.droplet.TransactionalFormHandler
Returns:
True if the transaction is marked for rollback.