Class AbstractFindIndexListActionSupport<M extends Serializable,T extends Serializable,F extends AbstractForm>
java.lang.Object
org.apache.struts2.ActionSupport
com.opensymphony.xwork2.ActionSupport
name.matthewgreet.strutscommons.action.AbstractActionSupport
name.matthewgreet.strutscommons.action.AbstractFormDrivenActionSupport<F>
name.matthewgreet.strutscommons.action.AbstractFindIndexListActionSupport<M,T,F>
- All Implemented Interfaces:
com.opensymphony.xwork2.Action,com.opensymphony.xwork2.interceptor.ValidationAware,com.opensymphony.xwork2.LocaleProvider,com.opensymphony.xwork2.ModelDriven<F>,com.opensymphony.xwork2.TextProvider,com.opensymphony.xwork2.Validateable,Serializable,BrowserTabAware,BrowserTabAware2,FormDriven<F>,org.apache.struts2.action.Action,org.apache.struts2.action.ServletRequestAware,org.apache.struts2.interceptor.ValidationAware,org.apache.struts2.ModelDriven<F>,org.apache.struts2.Validateable
public abstract class AbstractFindIndexListActionSupport<M extends Serializable,T extends Serializable,F extends AbstractForm>
extends AbstractFormDrivenActionSupport<F>
Template class for creating Command objects that load an index-based list in the ListCache used by the
target, viewer action.
Concrete subclasses must implement getFindIndexListConfig(), which defines the list being displayed from the
ListCache and a list index. Subclasses will override getFindCommand(M) to generate a Command object
that implements ListSizeFinder and PageByIndexRangeFinder.
- M
- Record type of master list cache if loading a slave list or Object otherwise.
- T
- Record type of list cache.
- F
- Type of Struts action form used by this action or NullForm if Struts forms aren't used.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConfigures list to be loaded by Struts, finder action and whether empty lists means search parameters must be rejected.static classAbstractFindIndexListActionSupport.FindIndexListResponse<M extends Serializable,T extends Serializable> Nested classes/interfaces inherited from interface com.opensymphony.xwork2.interceptor.ValidationAware
com.opensymphony.xwork2.interceptor.ValidationAware.LegacyAdapter -
Field Summary
Fields inherited from class org.apache.struts2.ActionSupport
containerFields inherited from interface org.apache.struts2.action.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute()protected abstract AbstractFindIndexListActionSupport.FindIndexListResponse<M, T> getFindCommand(M selectedMaster) Overridden by subclasses to return Command object for retrieving list (configured with any search parameters) and forwarding in the case of success.protected abstract AbstractFindIndexListActionSupport.FindIndexListConfigWritten by subclasses to configure behaviour of find action.Written by subclasses to return list cache that is being populated.Written by subclasses to return master list cache or null if the list cache is the master list.protected StringtranslateFinderException(ListSizeFinder<M> sizeFinderCommand, Exception e) May be overridden by subclasses to translate an exception thrown by a list size finder Command into a Struts message, so a message is displayed to the user.Methods inherited from class name.matthewgreet.strutscommons.action.AbstractFormDrivenActionSupport
formValidationFailed, getForm, getModel, makeForm, setForm, validateMethods inherited from class name.matthewgreet.strutscommons.action.AbstractActionSupport
getBrowserTabSession, getLogger, getServletRequest, getTabId, setBrowserTabSession, setTabId, withServletRequestMethods inherited from class org.apache.struts2.ActionSupport
addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, getActionErrors, getActionMessages, getContainer, getFieldErrors, getFormatted, getLocale, getLocaleProvider, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTextProvider, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, isValidLocale, isValidLocaleString, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors, toLocaleMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface name.matthewgreet.strutscommons.action.BrowserTabAware2
copyAttributesFromOldTabToNewTab, handleAttributeFailuresMethods inherited from interface org.apache.struts2.interceptor.ValidationAware
addActionError, addActionMessage, addFieldError, getActionErrors, getActionMessages, getFieldErrors, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, setActionErrors, setActionMessages, setFieldErrors
-
Constructor Details
-
AbstractFindIndexListActionSupport
public AbstractFindIndexListActionSupport()
-
-
Method Details
-
getFindCommand
protected abstract AbstractFindIndexListActionSupport.FindIndexListResponse<M,T> getFindCommand(M selectedMaster) throws Exception Overridden by subclasses to return Command object for retrieving list (configured with any search parameters) and forwarding in the case of success.- Parameters:
selectedMaster- Selected record of master list or null if loading master list.- Throws:
Exception
-
getFindIndexListConfig
Written by subclasses to configure behaviour of find action. -
getListCache
Written by subclasses to return list cache that is being populated. -
getMasterListCache
Written by subclasses to return master list cache or null if the list cache is the master list. -
translateFinderException
May be overridden by subclasses to translate an exception thrown by a list size finder Command into a Struts message, so a message is displayed to the user. May return null to default to a generic error message.- Parameters:
sizeFinderCommand- Size list finder Command.e- Exception thrown byListSizeFinder.getSize(M)function.
-
execute
- Specified by:
executein interfaceorg.apache.struts2.action.Action- Overrides:
executein classorg.apache.struts2.ActionSupport- Throws:
Exception
-