atg.servlet.security
Class AdminFormHandler

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.servlet.security.AdminFormHandler
All Implemented Interfaces:
DropletFormHandler, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener
Direct Known Subclasses:
AdminLoginFormHandler

public class AdminFormHandler
extends GenericFormHandler

Base implementation of a Generic Form Handler done for Admin-like tasks


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String RESOURCE_BUNDLE
           
protected static java.util.ResourceBundle sResources
          The resource bundle and errors
static int STATUS_ERROR_REDIRECT
          Constant to indicate that the state of the form errors, but that the form should perform a redirect.
static int STATUS_ERROR_STAY
          Constant to indicate that the state of the form errors, but that the form should not perform a redirect.
static int STATUS_SUCCESS
          Constant to indicate that the state of the form has no errors.
 
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
AdminFormHandler()
          Empty as all bean consructors usually are.
 
Method Summary
protected  int checkFormError(java.lang.String pErrorURL, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Check to see if there were errors during the submit operation.
protected  java.lang.String formatUserMessage(java.lang.String pKey, DynamoHttpServletRequest pRequest)
          Utility method to format a message with no arguments using the Locale of the user
protected  java.lang.String formatUserMessage(java.lang.String pKey, java.lang.Object pParam, DynamoHttpServletRequest pRequest)
          Utility method to format a message with no arguments using the Locale of the user
protected  java.lang.String generatePropertyPath(java.lang.String pPropertyName)
          Returns a Nucleus property path which can be used in a DropletFormException
 java.lang.String getErrorRedirect()
          Returns URL to which the user will be re-directed if an error has occured
protected  java.util.Locale getLocale(DynamoHttpServletRequest pRequest)
           
 void setErrorRedirect(java.lang.String pErrorRedirect)
          Sets URL to which the user will be re-directed if an error has occured
 
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, 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


RESOURCE_BUNDLE

public static final java.lang.String RESOURCE_BUNDLE
See Also:
Constant Field Values

STATUS_SUCCESS

public static final int STATUS_SUCCESS
Constant to indicate that the state of the form has no errors. Used in the decision process during the form handling. Returned by the checkFormError method.

See Also:
Constant Field Values

STATUS_ERROR_STAY

public static final int STATUS_ERROR_STAY
Constant to indicate that the state of the form errors, but that the form should not perform a redirect. Used in the decision process during the form handling. Returned by the checkFormError method.

See Also:
Constant Field Values

STATUS_ERROR_REDIRECT

public static final int STATUS_ERROR_REDIRECT
Constant to indicate that the state of the form errors, but that the form should perform a redirect. Used in the decision process during the form handling. Returned by the checkFormError method.

See Also:
Constant Field Values

sResources

protected static java.util.ResourceBundle sResources
The resource bundle and errors

Constructor Detail

AdminFormHandler

public AdminFormHandler()
Empty as all bean consructors usually are. All of the initial values are provided within the .properties file

Method Detail

setErrorRedirect

public void setErrorRedirect(java.lang.String pErrorRedirect)
Sets URL to which the user will be re-directed if an error has occured


getErrorRedirect

public java.lang.String getErrorRedirect()
Returns URL to which the user will be re-directed if an error has occured


checkFormError

protected int checkFormError(java.lang.String pErrorURL,
                             DynamoHttpServletRequest pRequest,
                             DynamoHttpServletResponse pResponse)
                      throws javax.servlet.ServletException,
                             java.io.IOException
Check to see if there were errors during the submit operation. If so, redirect to the supplied error url if possible.

Parameters:
pErrorURL - the URL to redirect to if there are any form errors
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
the status of the form
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io
See Also:
STATUS_SUCCESS, STATUS_ERROR_STAY, STATUS_ERROR_REDIRECT

generatePropertyPath

protected java.lang.String generatePropertyPath(java.lang.String pPropertyName)
Returns a Nucleus property path which can be used in a DropletFormException

Parameters:
pPropertyName - the string reprsentation of a property
Returns:
the string presentation of the full path to the provide property

getLocale

protected java.util.Locale getLocale(DynamoHttpServletRequest pRequest)
Parameters:
pRequest - the request object which can be used to extract the user's locale
Returns:
Returns the Locale for the user given the request

formatUserMessage

protected java.lang.String formatUserMessage(java.lang.String pKey,
                                             DynamoHttpServletRequest pRequest)
Utility method to format a message with no arguments using the Locale of the user

Parameters:
pKey - the identifier for the message to retrieve out of the ResourceBundle
pRequest - the request object which can be used to extract the user's locale
Returns:
the formatted message

formatUserMessage

protected java.lang.String formatUserMessage(java.lang.String pKey,
                                             java.lang.Object pParam,
                                             DynamoHttpServletRequest pRequest)
Utility method to format a message with no arguments using the Locale of the user

Parameters:
pKey - the identifier for the message to retrieve out of the ResourceBundle
pRequest - the request object which can be used to extract the user's locale
Returns:
the formatted message