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 Object
implements ActionItemProperty, RequestParamProvider, com.opensymphony.xwork2.LocaleProvider


Field Summary
protected static org.slf4j.Logger log
           
 
Constructor Summary
ActionBase()
           
 
Method Summary
protected abstract  void addFieldError(String name, Column column, ErrorInfo error)
           
 Object getActionBean(Class<?> objClass, boolean create)
           
 Object getActionBean(Class<?> objClass, boolean create, String ownerProperty)
           
protected  String getActionBeanName(com.opensymphony.xwork2.ActionContext context, Class<?> objClass, String ownerProperty)
           
protected  Object getActionObject(String name)
           
protected  String getActionObjectName(com.opensymphony.xwork2.ActionContext context, String name)
           
protected abstract  Connection getConnection()
           
abstract  int getListPageSize()
           
protected static DBColumnExpr getRecordKeyExpr(DBRowSet rowset, 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  Object[] getRecordKeyFromString(String s)
          this method parses a key string and returns the result as an object array
 String getRecordKeyString(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.
 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(String s)
          this method checks a key string for a record new flag which indicates that the record is transient i.e.
 void putActionBean(Object obj)
           
 void putActionBean(Object obj, String ownerProperty)
           
protected  void putActionObject(String name, Object item)
           
 void removeActionBean(Class<?> objClass)
           
 void removeActionBean(Class<?> objClass, String propertyName)
           
protected  void removeActionObject(String name)
           
abstract  void setActionError(Exception exception)
           
 
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.slf4j.Logger log
Constructor Detail

ActionBase

public ActionBase()
Method Detail

getConnection

protected abstract Connection getConnection()

setActionError

public abstract void setActionError(Exception exception)

addFieldError

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

getListPageSize

public abstract int getListPageSize()

getActionObjectName

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

getActionObject

protected Object getActionObject(String name)

putActionObject

protected void putActionObject(String name,
                               Object item)

removeActionObject

protected void removeActionObject(String name)

getActionBeanName

protected String getActionBeanName(com.opensymphony.xwork2.ActionContext context,
                                   Class<?> objClass,
                                   String ownerProperty)

getActionBean

public Object getActionBean(Class<?> objClass,
                            boolean create,
                            String ownerProperty)

getActionBean

public Object getActionBean(Class<?> objClass,
                            boolean create)

putActionBean

public void putActionBean(Object obj,
                          String ownerProperty)

putActionBean

public void putActionBean(Object obj)

removeActionBean

public void removeActionBean(Class<?> objClass,
                             String propertyName)

removeActionBean

public void removeActionBean(Class<?> objClass)

getRecordKeyString

public 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 String getRecordKeyString(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,
                                               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 Object[] getRecordKeyFromString(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(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–2014 Apache Software Foundation. All rights reserved.