Class PaginableAdapter<T>
- java.lang.Object
-
- org.nuxeo.ecm.webengine.model.impl.AbstractResource<ResourceTypeImpl>
-
- org.nuxeo.ecm.webengine.model.impl.DefaultAdapter
-
- org.nuxeo.ecm.restapi.server.jaxrs.adapters.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()
andgetParams()
- Since:
- 5.7.2
-
-
Field Summary
Fields Modifier and Type Field Description protected Long
currentPageIndex
protected String
maxResults
protected Long
pageSize
protected String
sortBy
Sort by parameters (can be a list of sorts, separated by commas).protected String
sortOrder
Sort order parameters (can be a list of sorts orders, separated by commas, matched by index to corresponding sort by parameters).
-
Constructor Summary
Constructors Constructor Description PaginableAdapter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Long
extractLongParam(javax.servlet.http.HttpServletRequest request, String paramName, Long defaultValue)
<A> A
getAdapter(Class<A> adapter)
Returns an object which is an instance of the given class associated with this object.protected abstract PageProviderDefinition
getPageProviderDefinition()
Paginable<T>
getPaginableEntries()
protected Paginable<T>
getPaginableEntries(PageProvider<T> pageProvider)
protected Object[]
getParams()
protected DocumentModel
getSearchDocument()
protected void
initialize(Object... args)
-
Methods inherited from class org.nuxeo.ecm.webengine.model.impl.DefaultAdapter
disptachAdapter, getTarget, isAdapter
-
Methods inherited from class org.nuxeo.ecm.webengine.model.impl.AbstractResource
checkGuard, dispose, getActiveAdapter, getContext, getFacets, getLinks, getModule, getName, getNext, getNextSegment, getPath, getPrevious, getTemplate, getTrailingPath, getType, getURL, getView, hasFacet, initialize, isInstanceOf, isRoot, newAdapter, newObject, redirect, setNext, setPrevious, setRoot, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.webengine.model.Resource
checkGuard, dispose, getActiveAdapter, getContext, getFacets, getLinks, getModule, getName, getNext, getNextSegment, getPath, getPrevious, getTemplate, getTrailingPath, getType, getURL, getView, hasFacet, initialize, isInstanceOf, isRoot, newAdapter, newObject, redirect, setNext, setPrevious, setRoot
-
-
-
-
Field Detail
-
currentPageIndex
protected Long currentPageIndex
-
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
-
-
Constructor Detail
-
PaginableAdapter
public PaginableAdapter()
-
-
Method Detail
-
initialize
protected void initialize(Object... args)
- Overrides:
initialize
in classAbstractResource<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. Returnsnull
if no such object can be found.- Specified by:
getAdapter
in interfaceAdaptable
- Overrides:
getAdapter
in classAbstractResource<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()
-
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)
-
-