org.apache.empire.struts2.websample.web.actiontypes
Class BeanDetailAction<T>
java.lang.Object
org.apache.empire.struts2.actionsupport.ActionBase
org.apache.empire.struts2.action.WebAction
org.apache.empire.struts2.websample.web.actiontypes.Action
org.apache.empire.struts2.websample.web.actiontypes.DetailAction
org.apache.empire.struts2.websample.web.actiontypes.BeanDetailAction<T>
- All Implemented Interfaces:
- com.opensymphony.xwork2.interceptor.NoParameters, com.opensymphony.xwork2.LocaleProvider, com.opensymphony.xwork2.TextProvider, ActionAccessValidator, ActionErrorProvider, ActionItemProperty, Disposable, ExceptionAware, RequestParamProvider, SampleContext
public abstract class BeanDetailAction<T>
- extends DetailAction
- implements com.opensymphony.xwork2.interceptor.NoParameters
BeanDetailAction
This class allows using a JavaBean or Data Transfer Object (DTO) for form data processing.
Metadata for the Beans should be provided using the BeanClass and BeanProperty classes.
- Author:
- Rainer
Fields inherited from class org.apache.empire.struts2.websample.web.actiontypes.Action |
log |
Method Summary |
protected abstract T |
createBean()
Returns the bean for the supplied object key. |
protected abstract boolean |
deleteBean(java.lang.Object[] key)
Deletes a bean object |
java.lang.String |
doCreate()
|
java.lang.String |
doDelete()
|
java.lang.String |
doLoad()
|
java.lang.String |
doSave()
|
Record |
getRecord()
Returns the Record interface implmentation for the bean. |
protected abstract T |
loadBean(java.lang.Object[] key)
Returns the bean for the supplied object key. |
protected abstract boolean |
saveBean(T bean,
boolean isNew)
Saves a bean object |
Methods inherited from class org.apache.empire.struts2.websample.web.actiontypes.DetailAction |
doCancel |
Methods inherited from class org.apache.empire.struts2.action.WebAction |
addFieldError, addItemError, clearActionErrors, clearItem, dispose, getActionParam, getActionURL, getItem, getItemErrors, getItemKey, getItemNewFlag, getItemPropertyName, getLastActionError, getLastActionMessage, getListPageSize, getLocalizedErrorMessage, getRequestArrayParam, getRequestIntParam, getRequestParam, getRequestParameters, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTexts, getTexts, handleException, hasAccess, hasActionError, hasItem, hasKey, hasRequestParam, init, isNewItem, putRequestParam, setActionError, setActionError, setActionError, setActionError, setActionMessage, setItem |
Methods inherited from class org.apache.empire.struts2.actionsupport.ActionBase |
getActionBean, getActionBean, getActionBeanName, getActionObject, getActionObjectName, getRecordKeyExpr, getRecordKeyFromString, getRecordKeyString, getRecordKeyString, getRecordNewFlagFromString, putActionBean, putActionBean, putActionObject, removeActionBean, removeActionBean, removeActionObject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
beanSupport
protected final BeanActionSupport<T> beanSupport
BeanDetailAction
public BeanDetailAction(BeanRecordProxy<T> record,
SessionPersistence persistence)
- Constructs a BeanDetailAction from a BeanRecordProxy object
- Parameters:
record
- the BeanRecordProxy for the beanpersistence
- persistence level
BeanDetailAction
public BeanDetailAction(BeanClass beanClass,
SessionPersistence persistence)
- Constructs a BeanDetailAction from a BeanClass definition
- Parameters:
beanClass
- the bean class defining the bean's metadatapersistence
- persistence level
getRecord
public Record getRecord()
- Returns the Record interface implmentation for the bean.
- Returns:
- the Record interface implmentation for the bean.
doCreate
public java.lang.String doCreate()
- Specified by:
doCreate
in class DetailAction
doLoad
public java.lang.String doLoad()
- Specified by:
doLoad
in class DetailAction
doDelete
public java.lang.String doDelete()
- Specified by:
doDelete
in class DetailAction
doSave
public java.lang.String doSave()
- Specified by:
doSave
in class DetailAction
createBean
protected abstract T createBean()
- Returns the bean for the supplied object key.
If an error occurs the fuction must set an action error and return null.
- Returns:
- the bean object
loadBean
protected abstract T loadBean(java.lang.Object[] key)
- Returns the bean for the supplied object key.
If an error occurs the fuction must set an action error and return null.
- Parameters:
key
- the bean's key values
- Returns:
- the bean object
saveBean
protected abstract boolean saveBean(T bean,
boolean isNew)
- Saves a bean object
- Parameters:
bean
- isNew
- true the bean is a newly created object or false otherwise
- Returns:
- true if the bean has been stored sucessfully or false otherwise
deleteBean
protected abstract boolean deleteBean(java.lang.Object[] key)
- Deletes a bean object
- Parameters:
bean
-
- Returns:
- true if the bean has been stored sucessfully or false otherwise
Copyright © 2008-2009 Apache Software Foundation. All Rights Reserved.