org.jaffa.presentation.portlet
Class FormBase

java.lang.Object
  extended byorg.apache.struts.action.ActionForm
      extended byorg.jaffa.presentation.portlet.FormBase
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ComponentDetailsForm, ComponentExplorerForm, FinderCriteriaForm, FinderForm, MaintForm, SessionExplorerForm

public class FormBase
extends ActionForm

This is the base class for all the 'Form' classes

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet
 
Constructor Summary
FormBase()
           
 
Method Summary
 void cleanup()
          The form should override this method for destroying any references that it holds
 void clearErrors(HttpServletRequest request)
          This clears all the errors generated while processing this Form
 Component getComponent()
          Returns the Component to which this Form belongs
 ActionErrors getErrors(HttpServletRequest request)
          Returns the errors generated while processing this Form
 WidgetCache getWidgetCache()
          Returns the WidgetCache of all the models for the Component
 boolean hasErrors(HttpServletRequest request)
          Checks if any errors have been generated
 void initForm()
          The form should override this method for defaulting the data in the form-bean
 void raiseError(HttpServletRequest request, String property, ActionError error)
          Record an error
 void raiseError(HttpServletRequest request, String property, ApplicationException appExp)
          Record an error.
 void raiseError(HttpServletRequest request, String property, ApplicationExceptions appExps)
          Record an error.
 void raiseError(HttpServletRequest request, String property, String key)
          Record an error.
 void raiseError(HttpServletRequest request, String property, String key, Object value0)
          Record an error.
 void raiseError(HttpServletRequest request, String property, String key, Object[] values)
          Record an error.
 void raiseError(HttpServletRequest request, String property, String key, Object value0, Object value1)
          Record an error.
 void raiseError(HttpServletRequest request, String property, String key, Object value0, Object value1, Object value2)
          Record an error.
 void raiseError(HttpServletRequest request, String property, String key, Object value0, Object value1, Object value2, Object value3)
          Record an error.
 void reset(ActionMapping mapping, HttpServletRequest request)
          This sets the Component & the WidgetCache fields
 void setComponent(Component component)
          Sets the Component for the Form
 
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, reset, setMultipartRequestHandler, setServlet, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormBase

public FormBase()
Method Detail

getComponent

public Component getComponent()
Returns the Component to which this Form belongs

Returns:
The Component for this Form

setComponent

public void setComponent(Component component)
Sets the Component for the Form

Parameters:
component - The Component object

getWidgetCache

public WidgetCache getWidgetCache()
Returns the WidgetCache of all the models for the Component

Returns:
The WidgetCache object

initForm

public void initForm()
The form should override this method for defaulting the data in the form-bean


cleanup

public void cleanup()
The form should override this method for destroying any references that it holds


reset

public void reset(ActionMapping mapping,
                  HttpServletRequest request)
This sets the Component & the WidgetCache fields

Parameters:
mapping - The mapping used to select this instance
request - The servlet request we are processing

clearErrors

public void clearErrors(HttpServletRequest request)
This clears all the errors generated while processing this Form

Parameters:
request - The servlet request we are processing

getErrors

public ActionErrors getErrors(HttpServletRequest request)
Returns the errors generated while processing this Form

Parameters:
request - The servlet request we are processing
Returns:
If no errors are found, return null or an ActionErrors object with recorded error messages

hasErrors

public boolean hasErrors(HttpServletRequest request)
Checks if any errors have been generated

Parameters:
request - The servlet request we are processing
Returns:
true if errors exist

raiseError

public void raiseError(HttpServletRequest request,
                       String property,
                       ActionError error)
Record an error

Parameters:
request - The servlet request we are processing
property - Property name (or ActionErrors.GLOBAL_ERROR)
error - The error message to be added

raiseError

public void raiseError(HttpServletRequest request,
                       String property,
                       String key)
Record an error. This implicitly creates an ActionError for the input key

Parameters:
request - The servlet request we are processing
property - Property name (or ActionErrors.GLOBAL_ERROR)
key - Message key for this error message

raiseError

public void raiseError(HttpServletRequest request,
                       String property,
                       String key,
                       Object value0)
Record an error. This implicitly creates an ActionError for the input key & replacement values

Parameters:
request - The servlet request we are processing
property - Property name (or ActionErrors.GLOBAL_ERROR)
key - Message key for this error message
value0 - First replacement value

raiseError

public void raiseError(HttpServletRequest request,
                       String property,
                       String key,
                       Object value0,
                       Object value1)
Record an error. This implicitly creates an ActionError for the input key & replacement values

Parameters:
request - The servlet request we are processing
property - Property name (or ActionErrors.GLOBAL_ERROR)
key - Message key for this error message
value0 - First replacement value
value1 - Second replacement value

raiseError

public void raiseError(HttpServletRequest request,
                       String property,
                       String key,
                       Object value0,
                       Object value1,
                       Object value2)
Record an error. This implicitly creates an ActionError for the input key & replacement values

Parameters:
request - The servlet request we are processing
property - Property name (or ActionErrors.GLOBAL_ERROR)
key - Message key for this error message
value0 - First replacement value
value1 - Second replacement value
value2 - Third replacement value

raiseError

public void raiseError(HttpServletRequest request,
                       String property,
                       String key,
                       Object value0,
                       Object value1,
                       Object value2,
                       Object value3)
Record an error. This implicitly creates an ActionError for the input key & replacement values

Parameters:
request - The servlet request we are processing
property - Property name (or ActionErrors.GLOBAL_ERROR)
key - Message key for this error message
value0 - First replacement value
value1 - Second replacement value
value2 - Third replacement value
value3 - Fourth replacement value

raiseError

public void raiseError(HttpServletRequest request,
                       String property,
                       String key,
                       Object[] values)
Record an error. This implicitly creates an ActionError for the input key & replacement values

Parameters:
request - The servlet request we are processing
property - Property name (or ActionErrors.GLOBAL_ERROR)
key - Message key for this error message
values - Array of replacement values

raiseError

public void raiseError(HttpServletRequest request,
                       String property,
                       ApplicationException appExp)
Record an error. This implicitly creates an ActionError for the input key & replacement values.

Parameters:
request - The servlet request we are processing
property - Property name (or ActionErrors.GLOBAL_ERROR)
appExp - the exception against which the error is being raised. This exception will have the errorToken and arguments, if any.

raiseError

public void raiseError(HttpServletRequest request,
                       String property,
                       ApplicationExceptions appExps)
Record an error. This implicitly creates an ActionError for the input key & replacement values.

Parameters:
request - The servlet request we are processing
property - Property name (or ActionErrors.GLOBAL_ERROR)
appExps - Error will raised against each ApplicationException passed in this parameter.


Copyright © 2002-2004 JAFFA Project.