public abstract class PortletFormHandler extends GenericService implements atg.droplet.ObjectFormHandler
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
protected java.util.List |
mFormExceptions |
java.lang.String |
PARAM_USE_FORWARDS
The name of a parameter that represents whether to use forwards.
|
protected static javax.transaction.TransactionManager |
sTransactionManager |
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
PortletFormHandler() |
Modifier and Type | Method and Description |
---|---|
void |
addFormException(java.lang.Throwable pFormException)
Set the formExceptions property.
|
void |
afterGet(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse) |
void |
afterGet(java.lang.Object pRequest,
java.lang.Object pResponse) |
void |
afterGet(javax.portlet.PortletRequest pRequest,
javax.portlet.PortletResponse pResponse) |
boolean |
afterSet(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse) |
boolean |
afterSet(java.lang.Object pRequest,
java.lang.Object pResponse) |
boolean |
afterSet(javax.portlet.PortletRequest pRequest,
javax.portlet.PortletResponse pResponse) |
void |
beforeGet(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse) |
void |
beforeGet(java.lang.Object pRequest,
java.lang.Object pResponse) |
void |
beforeGet(javax.portlet.PortletRequest pRequest,
javax.portlet.PortletResponse pResponse) |
boolean |
beforeSet(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse) |
boolean |
beforeSet(java.lang.Object pRequest,
java.lang.Object pResponse) |
boolean |
beforeSet(javax.portlet.PortletRequest pRequest,
javax.portlet.PortletResponse pResponse) |
boolean |
checkFormRedirect(java.lang.String pSuccessURL,
java.lang.String pFailureURL,
DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
If NO form errors are found, redirect to the SuccessURL.
|
boolean |
getCheckForValidSession() |
protected DynamoHttpServletRequest |
getCurrentDynamoRequest(javax.portlet.PortletRequest pRequest) |
protected DynamoHttpServletResponse |
getCurrentDynamoResponse(DynamoHttpServletRequest pRequest) |
boolean |
getFormError()
Return true if there are any formExceptions, otherwise return false
|
java.util.List |
getFormExceptions()
Return the formExceptions property.
|
java.util.Dictionary |
getPropertyExceptions()
Returns the propertyExceptions property.
|
protected TransactionDemarcation |
getTransactionDemarcation()
Returns property TransactionDemarcation.
|
void |
handleFormException(DropletFormException pException,
java.lang.Object pRequest,
java.lang.Object pResponse) |
void |
handleUncheckedFormException(java.lang.Throwable exception,
java.lang.Object request,
java.lang.Object response) |
boolean |
hasFormExceptions()
Return true if there are any formExceptions, otherwise return false
|
boolean |
isEnsureTransaction()
Returns property EnsureTransaction, if false then no transaction management is performed
|
boolean |
isRestorableForm() |
protected boolean |
isRollbackTransaction()
Returns property RollbackTransaction.
|
boolean |
isUseForwards()
Get whether to use forwards rather then redirects
|
boolean |
isValidSession(DynamoHttpServletRequest pRequest)
Returns true if this is a valid session for processing the form.
|
protected void |
redirectOrForward(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse,
java.lang.String pURL)
Forward or redirect, as required.
|
void |
resetFormExceptions()
Clears out all form exceptions
|
void |
setCheckForValidSession(boolean pCheckForValidSession)
Sets the property CheckForValidSession.
|
void |
setEnsureTransaction(boolean pEnsureTransaction)
Sets property EnsureTransaction
|
void |
setRestorableForm(boolean pRestorableForm)
Sets the property RestorableForm.
|
protected void |
setRollbackTransaction(boolean pRollbackTransaction)
Sets property RollbackTransaction
|
protected void |
setTransactionDemarcation(TransactionDemarcation pTransactionDemarcation)
Sets property TransactionDemarcation
Since this component can be session scoped,
multiple requests using the same session scoped form handler can collide
with their use of the form handler.
|
void |
setUseForwards(boolean pUseForwards)
Set whether to use forwards rather then redirects.
|
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
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
public final java.lang.String PARAM_USE_FORWARDS
protected static javax.transaction.TransactionManager sTransactionManager
protected java.util.List mFormExceptions
public void setEnsureTransaction(boolean pEnsureTransaction)
public boolean isEnsureTransaction()
protected void setTransactionDemarcation(TransactionDemarcation pTransactionDemarcation)
protected TransactionDemarcation getTransactionDemarcation()
beforeSet
and afterSet
methods. This is created in the
beforeSet
method and set to null in afterSet
.protected void setRollbackTransaction(boolean pRollbackTransaction)
protected boolean isRollbackTransaction()
afterSet
method. This defaults to false and is
reset to false in afterSet
.public void setCheckForValidSession(boolean pCheckForValidSession)
If you set this property to true and use the checkFormRedirect method, it will add a form exception with the code "sessionExpired" and redirect to the supplied errorURL if the session expired between when the form was rendered and submitted.
Note that if the session backup feature is enabled, you should be sure to set the RestorableForm property to true if your form can work properly on a restored session.
pCheckForValidSession
- new value to setpublic boolean getCheckForValidSession()
public boolean isValidSession(DynamoHttpServletRequest pRequest)
public void setRestorableForm(boolean pRestorableForm)
You should set this property to true, if you are using the checkFormRedirect method in your handleX method, and all of the data needed to process this form in your session is restored by the session backup process.
Note that if your form does not rely on any data in the session at all for processing, you do not need to worry about setting this property. Instead, make sure to set the checkForValidSession property to false.
pRestorableForm
- new value to setpublic boolean isRestorableForm()
public void setUseForwards(boolean pUseForwards)
public boolean isUseForwards()
public boolean hasFormExceptions()
public boolean getFormError()
public java.util.List getFormExceptions()
public void addFormException(java.lang.Throwable pFormException)
pErrorURL
- public void resetFormExceptions()
public java.util.Dictionary getPropertyExceptions()
protected DynamoHttpServletRequest getCurrentDynamoRequest(javax.portlet.PortletRequest pRequest)
protected DynamoHttpServletResponse getCurrentDynamoResponse(DynamoHttpServletRequest pRequest)
public boolean beforeSet(java.lang.Object pRequest, java.lang.Object pResponse) throws DropletFormException
beforeSet
in interface atg.droplet.ObjectFormHandler
DropletFormException
public boolean beforeSet(javax.portlet.PortletRequest pRequest, javax.portlet.PortletResponse pResponse) throws DropletFormException
DropletFormException
public boolean beforeSet(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws DropletFormException
DropletFormException
public boolean afterSet(java.lang.Object pRequest, java.lang.Object pResponse) throws DropletFormException
afterSet
in interface atg.droplet.ObjectFormHandler
DropletFormException
public boolean afterSet(javax.portlet.PortletRequest pRequest, javax.portlet.PortletResponse pResponse) throws DropletFormException
DropletFormException
public boolean afterSet(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws DropletFormException
DropletFormException
public void beforeGet(java.lang.Object pRequest, java.lang.Object pResponse)
beforeGet
in interface atg.droplet.ObjectFormHandler
public void beforeGet(javax.portlet.PortletRequest pRequest, javax.portlet.PortletResponse pResponse)
public void beforeGet(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
public void afterGet(java.lang.Object pRequest, java.lang.Object pResponse)
afterGet
in interface atg.droplet.ObjectFormHandler
public void afterGet(javax.portlet.PortletRequest pRequest, javax.portlet.PortletResponse pResponse)
public void afterGet(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
public void handleFormException(DropletFormException pException, java.lang.Object pRequest, java.lang.Object pResponse)
handleFormException
in interface atg.droplet.ObjectFormHandler
public void handleUncheckedFormException(java.lang.Throwable exception, java.lang.Object request, java.lang.Object response)
handleUncheckedFormException
in interface atg.droplet.ObjectFormHandler
public boolean checkFormRedirect(java.lang.String pSuccessURL, java.lang.String pFailureURL, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pNoErrorsURL
- The URL to redirect to if there were no form errors.
If a null value is passed in, no redirect occurs.pErrorsURL
- The URL to redirect to if form errors were found.
If a null value is passed in, no redirect occurs.pRequest
- the servlet's requestpResponse
- the servlet's responsejavax.servlet.ServletException
- if there was an error while executing the codejava.io.IOException
- if there was an error with servlet ioprotected void redirectOrForward(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, java.lang.String pURL) throws java.io.IOException, javax.servlet.ServletException
pRequest
- the servlet's requestpResponse
- the servlet's responsepURL
- the url to redirect or forward to.java.io.IOException
javax.servlet.ServletException