Class AbstractFindIdListActionSupport<M extends Serializable,K extends Serializable,F extends AbstractForm>

java.lang.Object
org.apache.struts2.ActionSupport
com.opensymphony.xwork2.ActionSupport
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 AbstractFindIdListActionSupport<M extends Serializable,K extends Serializable,F extends AbstractForm> extends AbstractFormDrivenActionSupport<F>

Template class for creating Command objects that load an id list in the ListCache used by the target, viewer action.

Concrete subclasses must implement getFindIdListConfig(), 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 IdListFinder.

M
Record type of master list cache if loading a slave list or Object otherwise.
K
Primary key type of list cache.
F
Type of Struts action form used by this action or NullForm if Struts forms aren't used.
See Also:
  • Constructor Details

    • AbstractFindIdListActionSupport

      public AbstractFindIdListActionSupport()
  • Method Details

    • getFindCommand

      protected abstract AbstractFindIdListActionSupport.FindIdListResponse<M,K> 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
    • getFindIdListConfig

      protected abstract AbstractFindIdListActionSupport.FindIdListConfig getFindIdListConfig()
      Written by subclasses to configure behaviour of find action.
    • getListCache

      protected abstract ListCache<M,K,?> getListCache(javax.servlet.http.HttpSession session)
      Written by subclasses to return list cache that is being populated.
    • getMasterListCache

      protected abstract ListCache<?,?,M> getMasterListCache(javax.servlet.http.HttpSession session)
      Written by subclasses to return master list cache or null if the list cache is the master list.
    • translateFinderException

      protected String translateFinderException(IdListFinder<M,K> finderCommand, Exception e)
      May be overridden by subclasses to translate an exception thrown by a list finder Command into a Struts message key, so a message is displayed to the user. May return null to default to a generic error message key.
      Parameters:
      finderCommand - List finder Command.
      e - Exception thrown by IdListFinder.getIds(M) function.
    • execute

      public String execute() throws Exception
      Specified by:
      execute in interface org.apache.struts2.action.Action
      Overrides:
      execute in class org.apache.struts2.ActionSupport
      Throws:
      Exception