Class AbstractFindListMultiModeActionSupport<M extends Serializable,K extends Serializable,T extends Serializable,F extends Form>

Type Parameters:
M - Record type of master list cache if loading a slave list or NA otherwise.
K - Primary key of list cache.
T - Record type of list cache.
F - Type of form used by this action or NullForm if forms aren't used.
All Implemented Interfaces:
Action, ValidationAware, LocaleProvider, ModelDriven<F>, TextProvider, Validateable, Serializable, BrowserTabAware, BrowserTabAware2, FormDriven<F>, LoggingAware, ValidationAware2, Action, ServletRequestAware, ValidationAware, ModelDriven<F>, Validateable

public abstract class AbstractFindListMultiModeActionSupport<M extends Serializable,K extends Serializable,T extends Serializable,F extends Form> extends AbstractFormDrivenActionSupport<F>

Template class for creating Command objects that load a list cache in the AbstractCompositeCache by various pagination modes, whether full list, page by id, or page by index.

Concrete subclasses must implement various template functions:-

Required template functions
getFindCommand Returns a Command object used to load list cache, which can be initialized with an input form received by this Struts action.
getFindListMultiModeConfig Returns miscellaneous config, such as whether no records found means an input form rejection.
getListCache Returns list cache that stores the retrieved Value Objects.
getMasterListCache If the list cache is a slave list, returns master list cache that controls it, otherwise returns null.
See Also:
  • Constructor Details

    • AbstractFindListMultiModeActionSupport

      public AbstractFindListMultiModeActionSupport()
  • Method Details

    • getFindCommand

      protected abstract AbstractFindListMultiModeActionSupport.FindListMultiModeResponse<M,K,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
    • getFindListMultiModeConfig

      protected abstract AbstractFindListMultiModeActionSupport.FindListMultiModeConfig getFindListMultiModeConfig()
      Written by subclasses to configure behaviour of find action.
    • getItemSorter

      protected ListCacheRecordComparator<T> getItemSorter()
      Written by subclasses to return item comparator for sorting list after finding it, or null for no post-find sorting.
    • getListCache

      protected abstract ListCache<M,K,T> getListCache()
      Written by subclasses to return list cache that is being populated.
    • getMasterListCache

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

      protected String translateFinderException(ListFinder<M,T> listFinderCommand, IdListFinder<M,K> idListFinderCommand, ListSizeFinder<M> listSizeFinderCommand, Exception e)
      May be overridden by subclasses to translate an exception thrown by a list finder Command, id list finder Command or list size finder Command into message. May return null to default to a generic error message.
    • execute

      public String execute() throws Exception
      Specified by:
      execute in interface Action
      Overrides:
      execute in class ActionSupport
      Throws:
      Exception