Class PaginableAdapter<T>

All Implemented Interfaces:
AdapterResource, Resource, Adaptable
Direct Known Subclasses:
AuditAdapter, DocumentModelListPaginableAdapter, GroupMemberGroupsAdapter, GroupMemberUsersAdapter

public abstract class PaginableAdapter<T> extends DefaultAdapter
Abstract adapter to be used when one want to contribute an adapter base on PageProviders.

In order to use it, just override the getPageProviderDefinition() and getParams()

Since:
5.7.2
  • Field Details

    • currentPageIndex

      protected Long currentPageIndex
    • pageSize

      protected Long pageSize
    • maxResults

      protected String maxResults
    • sortBy

      protected String sortBy
      Sort by parameters (can be a list of sorts, separated by commas).

      Exp: dc:title,dc:modified.

      Since:
      5.9.4
    • sortOrder

      protected String sortOrder
      Sort order parameters (can be a list of sorts orders, separated by commas, matched by index to corresponding sort by parameters).

      Exp: asc,desc, or ASC,DESC. When empty, defaults to 'desc'.

      Since:
      5.9.4
  • Constructor Details

    • PaginableAdapter

      public PaginableAdapter()
  • Method Details

    • initialize

      protected void initialize(Object... args)
      Overrides:
      initialize in class AbstractResource<ResourceTypeImpl>
    • getAdapter

      public <A> A getAdapter(Class<A> adapter)
      Description copied from interface: Adaptable
      Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.
      Specified by:
      getAdapter in interface Adaptable
      Overrides:
      getAdapter in class AbstractResource<ResourceTypeImpl>
      Parameters:
      adapter - the adapter class to look up
      Returns:
      a object castable to the given class, or null if this object does not have an adapter for the given class
    • getPageProviderDefinition

      protected abstract PageProviderDefinition getPageProviderDefinition()
    • getParams

      protected Object[] getParams()
    • getSearchDocument

      protected DocumentModel getSearchDocument()
    • getPaginableEntries

      public Paginable<T> getPaginableEntries()
    • getPaginableEntries

      protected Paginable<T> getPaginableEntries(PageProvider<T> pageProvider)
    • extractLongParam

      protected Long extractLongParam(javax.servlet.http.HttpServletRequest request, String paramName, Long defaultValue)