org.figure8.join.control
Class JoinForm

java.lang.Object
  extended by org.apache.struts.action.ActionForm
      extended by org.figure8.join.control.JoinForm
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AssemblyForm, BuildForm, ComponentForm, ComponentTypeForm, ConsumerForm, DefaultForm, DeliverableForm, DeliverableTypeForm, DeploymentForm, DeploymentsForm, EISMappingForm, EnvironmentMappingForm, LogicalEnvironmentForm, LoginForm, MachineForm, MailingListForm, MessageForm, ParameterForm, ParameterValueForm, PermissionForm, PhysicalEnvironmentForm, QuartzCronForm, ReleaseForm, ResourceForm, ResourceMappingForm, ResourceTypeForm, ResourceUpdateForm, ResourceVersionForm, ScriptLogForm, SetupForm, StatusForm, StepForm, TargetForm, UserForm

public abstract class JoinForm
extends org.apache.struts.action.ActionForm
implements java.io.Serializable

An abstract ActinoForm class that all Join form classes should extend. This class implements Struts validate() method as a wrapper to a new doValidate() abstract method. This wrapper is intended to perform some pre-processing (such as retrieving the specified operation to invoke and initializing errors array) and providing some helpful methods (such as retrieving resource bundles and adding validation errors to array).

Version:
$Revision: 1.2 $
Author:
Laurent Broudoux
See Also:
Serialized Form

Field Summary
protected  org.apache.struts.action.ActionErrors errors
          The ActionErrors associated to this form validation.
 
Fields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet
 
Constructor Summary
JoinForm()
           
 
Method Summary
protected  void addActionError(java.lang.String errorType, java.lang.String param1)
          Add an action validation error to current error array.
protected  void addActionError(java.lang.String errorType, java.lang.String param1, java.lang.String param2)
          Add an action validation error to current error array.
protected  void addActionError(java.lang.String errorType, java.lang.String param1, java.lang.String param2, java.lang.String param3)
          Add an action validation error to current error array.
abstract  void doValidate(java.lang.String operation, org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
          Abstract method that subclasses must implement.
 org.apache.struts.util.MessageResources getGuiMessageResources()
           
 long getId()
           
 java.lang.String getIdStr()
           
 org.apache.struts.util.MessageResources getMessageResources()
           
 void reset(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
          Reset form attributes.
 void setId(long id)
           
 void setIdStr(java.lang.String idStr)
           
 org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
          Validation of the form attributes.
protected  void validateEntityObjectId()
          Validate the identifier of EntityObject associated with this form.
 
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, reset, setMultipartRequestHandler, setServlet, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

errors

protected org.apache.struts.action.ActionErrors errors
The ActionErrors associated to this form validation.

Constructor Detail

JoinForm

public JoinForm()
Method Detail

doValidate

public abstract void doValidate(java.lang.String operation,
                                org.apache.struts.action.ActionMapping mapping,
                                javax.servlet.http.HttpServletRequest request)
Abstract method that subclasses must implement. The real validation must be done here, according to the operation and using the helpful addActionError() methods.

Parameters:
operation - String representing the operation to invoke on Action
mapping - Mapping between forwards name and path for this action
request - The servlet container request wrapper

getMessageResources

public org.apache.struts.util.MessageResources getMessageResources()
Returns:
Retrieve the default resource bundle.

getGuiMessageResources

public org.apache.struts.util.MessageResources getGuiMessageResources()
Returns:
Retrieve the resource bundle containing GUI resources.

getId

public long getId()
Returns:
Identifier of EntityObject associated with this form

setId

public void setId(long id)
Parameters:
id - Identifier of EntityObject associated with this form

getIdStr

public java.lang.String getIdStr()
Returns:
Identifier of EntityObject associated with form (should be a long)

setIdStr

public void setIdStr(java.lang.String idStr)
Parameters:
idStr - String representation of EntityObject identifier (must be a long)

addActionError

protected void addActionError(java.lang.String errorType,
                              java.lang.String param1)
Add an action validation error to current error array.

Parameters:
errorType - Key representing the error type into default resource bundle
param1 - Parameter to inject into error type label

addActionError

protected void addActionError(java.lang.String errorType,
                              java.lang.String param1,
                              java.lang.String param2)
Add an action validation error to current error array.

Parameters:
errorType - Key representing the error type into default resource bundle
param1 - Parameter to inject into error type label
param2 - Parameter to inject into error type label

addActionError

protected void addActionError(java.lang.String errorType,
                              java.lang.String param1,
                              java.lang.String param2,
                              java.lang.String param3)
Add an action validation error to current error array.

Parameters:
errorType - Key representing the error type into default resource bundle
param1 - Parameter to inject into error type label
param2 - Parameter to inject into error type label
param3 - Parameter to inject into error type label

validateEntityObjectId

protected void validateEntityObjectId()
Validate the identifier of EntityObject associated with this form. This takes place in 2 step : ensure that string representation of if is not null nor empty, ensure that it represents a long value.


validate

public org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping,
                                                      javax.servlet.http.HttpServletRequest request)
Validation of the form attributes. This method acts as a wrapper around doValidate() abstract method. First, it initializes ActionErrors and retrieves operation to invoke onto Action (if any). Then, it calls doValidate() passing around this operation. Lastly, it returns ActionErros that has been completed by doValidate() implementation.

Overrides:
validate in class org.apache.struts.action.ActionForm
Parameters:
mapping - Mapping between forwards name and path for this action
request - The servlet container request wrapper
Returns:
The ActionErrors list raised during validation

reset

public void reset(org.apache.struts.action.ActionMapping mapping,
                  javax.servlet.http.HttpServletRequest request)
Reset form attributes.

Overrides:
reset in class org.apache.struts.action.ActionForm
Parameters:
mapping - Mapping between forwards name and path for this action
request - The servlet container request wrapper


Copyright © 2005-2008 Join. All Rights Reserved.