org.apache.empire.struts2.actionsupport
Class RecordFormActionSupport

java.lang.Object
  extended by org.apache.empire.struts2.actionsupport.FormActionSupport
      extended by org.apache.empire.struts2.actionsupport.RecordFormActionSupport
Direct Known Subclasses:
BeanActionSupport, RecordActionSupport

public abstract class RecordFormActionSupport
extends FormActionSupport


Field Summary
protected  SessionPersistence persistence
           
 
Fields inherited from class org.apache.empire.struts2.actionsupport.FormActionSupport
action, log, propertyName
 
Constructor Summary
protected RecordFormActionSupport(ActionBase action, SessionPersistence persistence)
           
protected RecordFormActionSupport(ActionBase action, SessionPersistence persistence, String propertyName)
           
 
Method Summary
protected  boolean compareKey(Object[] currentKey, Object[] updateKey)
          this method compares two primary key objects
 Object[] getActionParamKey()
          Returns the record key.
 boolean getActionParamNewFlag()
          Returns a flag whether or not the current record is a new record.
 SessionPersistence getPersistence()
           
abstract  Record getRecord()
           
protected  Record getRecordFromSession()
           
 String getRecordKeyString()
           
 String getRequestFieldName(Column column)
          returns the name of a field as used in the form
 boolean hasActionKey(boolean acceptSessionKey)
          Checks wether or not the record key is supplied
 boolean isNewRecord()
           
 boolean loadFormData()
          loads the data from the form into the current record object
protected  void persistOnSession()
           
protected  void removeFromSession()
           
protected  boolean setRecordFieldValue(int i, Object value, boolean verify)
          overridable: sets the value of single field
protected  boolean setUpdateFields(Record record)
          adds all fields found in the HTTP-JSPRequest for this table to the record
 
Methods inherited from class org.apache.empire.struts2.actionsupport.FormActionSupport
addFieldError, getActionParam, getRecordPropertyName, isEnableFieldErrors, setEnableFieldErrors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

persistence

protected SessionPersistence persistence
Constructor Detail

RecordFormActionSupport

protected RecordFormActionSupport(ActionBase action,
                                  SessionPersistence persistence)

RecordFormActionSupport

protected RecordFormActionSupport(ActionBase action,
                                  SessionPersistence persistence,
                                  String propertyName)
Method Detail

getPersistence

public SessionPersistence getPersistence()

getRecord

public abstract Record getRecord()

getRecordKeyString

public String getRecordKeyString()

isNewRecord

public boolean isNewRecord()

getRequestFieldName

public String getRequestFieldName(Column column)
returns the name of a field as used in the form

Parameters:
column -
Returns:
the form name of the record field

getRecordFromSession

protected Record getRecordFromSession()

persistOnSession

protected void persistOnSession()

removeFromSession

protected void removeFromSession()

hasActionKey

public boolean hasActionKey(boolean acceptSessionKey)
Checks wether or not the record key is supplied

Parameters:
acceptSessionKey - true if a key supplied on the session is acceptable or false otherwise
Returns:
true if the record has a bean associated with it or false otherwiese

getActionParamKey

public Object[] getActionParamKey()
Returns the record key. The key may be supplied with the request or with the session.

Returns:
the record key

getActionParamNewFlag

public boolean getActionParamNewFlag()
Returns a flag whether or not the current record is a new record.

Returns:
true if the record is a new unsaved record.

loadFormData

public boolean loadFormData()
loads the data from the form into the current record object

Specified by:
loadFormData in class FormActionSupport
Returns:
true if all fields supplied with the request have been successfully set on the record

setRecordFieldValue

protected boolean setRecordFieldValue(int i,
                                      Object value,
                                      boolean verify)
overridable: sets the value of single field


setUpdateFields

protected boolean setUpdateFields(Record record)
adds all fields found in the HTTP-JSPRequest for this table to the record

Parameters:
record - the Record object, contains all fields and the field properties
Returns:
true if all values have been set successfully or otherwise false

compareKey

protected final boolean compareKey(Object[] currentKey,
                                   Object[] updateKey)
this method compares two primary key objects

Parameters:
currentKey - the current key object
updateKey - the comparative value


Copyright © 2008–2014 Apache Software Foundation. All rights reserved.