org.apache.empire.struts2.actionsupport
Class ActionBase

java.lang.Object
  extended by org.apache.empire.struts2.actionsupport.ActionBase
All Implemented Interfaces:
com.opensymphony.xwork2.LocaleProvider, ActionItemProperty, RequestParamProvider
Direct Known Subclasses:
WebAction

public abstract class ActionBase
extends java.lang.Object
implements ActionItemProperty, RequestParamProvider, com.opensymphony.xwork2.LocaleProvider


Field Summary
protected static org.apache.commons.logging.Log log
           
 
Constructor Summary
ActionBase()
           
 
Method Summary
protected abstract  void addFieldError(java.lang.String name, Column column, ErrorInfo error)
           
 java.lang.Object getActionBean(java.lang.Class objClass, boolean create)
           
 java.lang.Object getActionBean(java.lang.Class objClass, boolean create, java.lang.String ownerProperty)
           
protected  java.lang.String getActionBeanName(com.opensymphony.xwork2.ActionContext context, java.lang.Class objClass, java.lang.String ownerProperty)
           
protected  java.lang.Object getActionObject(java.lang.String name)
           
protected  java.lang.String getActionObjectName(com.opensymphony.xwork2.ActionContext context, java.lang.String name)
           
protected abstract  java.sql.Connection getConnection()
           
abstract  int getListPageSize()
           
protected static DBColumnExpr getRecordKeyExpr(DBRowSet rowset, java.lang.String aliasName)
          returns a DBColumnExpr that assembles a key for the given rowset/ table this method should be used when selecting the id column of a table whith a non simple primary key i.e.
protected  java.lang.Object[] getRecordKeyFromString(java.lang.String s)
          this method parses a key string and returns the result as an object array
 java.lang.String getRecordKeyString(java.lang.Object[] key, boolean isNew)
          this method assembles all key values to a combined string The key parts will be separated by forward slashes (KEY_SEP_CHAR) thus the key parts must not contain forward slashes.
 java.lang.String getRecordKeyString(Record record)
          this method assembles all key values to a combined string The key parts will be separated by forward slashes (KEY_SEP_CHAR) thus the key parts must not contain forward slashes.
protected  boolean getRecordNewFlagFromString(java.lang.String s)
          this method checks a key string for a record new flag which indicates that the record is transient i.e.
 void putActionBean(java.lang.Object obj)
           
 void putActionBean(java.lang.Object obj, java.lang.String ownerProperty)
           
protected  void putActionObject(java.lang.String name, java.lang.Object item)
           
 void removeActionBean(java.lang.Class objClass)
           
 void removeActionBean(java.lang.Class objClass, java.lang.String propertyName)
           
protected  void removeActionObject(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.empire.struts2.action.ActionItemProperty
getItemPropertyName
 
Methods inherited from interface org.apache.empire.struts2.action.RequestParamProvider
getRequestArrayParam, getRequestParam, getRequestParameters, hasRequestParam
 
Methods inherited from interface com.opensymphony.xwork2.LocaleProvider
getLocale
 

Field Detail

log

protected static org.apache.commons.logging.Log log
Constructor Detail

ActionBase

public ActionBase()
Method Detail

getConnection

protected abstract java.sql.Connection getConnection()

addFieldError

protected abstract void addFieldError(java.lang.String name,
                                      Column column,
                                      ErrorInfo error)

getListPageSize

public abstract int getListPageSize()

getActionObjectName

protected java.lang.String getActionObjectName(com.opensymphony.xwork2.ActionContext context,
                                               java.lang.String name)

getActionObject

protected java.lang.Object getActionObject(java.lang.String name)

putActionObject

protected void putActionObject(java.lang.String name,
                               java.lang.Object item)

removeActionObject

protected void removeActionObject(java.lang.String name)

getActionBeanName

protected java.lang.String getActionBeanName(com.opensymphony.xwork2.ActionContext context,
                                             java.lang.Class objClass,
                                             java.lang.String ownerProperty)

getActionBean

public java.lang.Object getActionBean(java.lang.Class objClass,
                                      boolean create,
                                      java.lang.String ownerProperty)

getActionBean

public java.lang.Object getActionBean(java.lang.Class objClass,
                                      boolean create)

putActionBean

public void putActionBean(java.lang.Object obj,
                          java.lang.String ownerProperty)

putActionBean

public void putActionBean(java.lang.Object obj)

removeActionBean

public void removeActionBean(java.lang.Class objClass,
                             java.lang.String propertyName)

removeActionBean

public void removeActionBean(java.lang.Class objClass)

getRecordKeyString

public java.lang.String getRecordKeyString(Record record)
this method assembles all key values to a combined string The key parts will be separated by forward slashes (KEY_SEP_CHAR) thus the key parts must not contain forward slashes. Additionally the functions adds an asterisk if the record is new i.e. has not yet been inserted into the database

Parameters:
record - the record for which to create a key string
Returns:
the record key string

getRecordKeyString

public java.lang.String getRecordKeyString(java.lang.Object[] key,
                                           boolean isNew)
this method assembles all key values to a combined string The key parts will be separated by forward slashes (KEY_SEP_CHAR) thus the key parts must not contain forward slashes. Additionally the functions adds an asterisk if the record is new i.e. has not yet been inserted into the database

Parameters:
key - the key values of the record
isNew - flag indicating wether or not the record is a new record
Returns:
the record key string

getRecordKeyExpr

protected static DBColumnExpr getRecordKeyExpr(DBRowSet rowset,
                                               java.lang.String aliasName)
returns a DBColumnExpr that assembles a key for the given rowset/ table this method should be used when selecting the id column of a table whith a non simple primary key i.e. a key which consists of more than one column

Parameters:
rowset - the table for which go create a record key expression
aliasName - the name of the key expression in the resultset ( ... AS aliasName)
Returns:
a DBColumnExpr for the DBCommand select phrase

getRecordKeyFromString

protected java.lang.Object[] getRecordKeyFromString(java.lang.String s)
this method parses a key string and returns the result as an object array

Parameters:
s - the key string (e.g. taken from the request)
Returns:
the record key

getRecordNewFlagFromString

protected boolean getRecordNewFlagFromString(java.lang.String s)
this method checks a key string for a record new flag which indicates that the record is transient i.e. has not yet been inserted into the database

Parameters:
s - the key string (e.g. taken from the request)
Returns:
true if the record is new or false otherwise


Copyright © 2008-2009 Apache Software Foundation. All Rights Reserved.