Package com.jalios.jcms.rest
Class PagerData
- java.lang.Object
-
- com.jalios.jcms.rest.PagerData
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.Object>
public class PagerData extends java.lang.Object implements java.lang.Iterable<java.lang.Object>
This object contains the business logic that takes parameters in j2eeRequest and create the pagerHandler associated. It is iterable, and the iteration is done through objects contained in the colelction set by setCollection() and for the scope computed by the parameters.- Since:
- JCMS-6.0
- Author:
- dissert
-
-
Constructor Summary
Constructors Constructor Description PagerData(org.restlet.data.Request request, javax.servlet.http.HttpServletRequest j2eeRequest)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>
getCollectionTagAttributeMap()
java.lang.String
getCollectionTagAttributes()
java.lang.String
getCollectionTagName()
java.lang.String
getItemTagName()
int
getPageSize()
java.lang.String
getSort()
int
getStart()
int
getTotal()
boolean
hasRequestPagerData()
void
initFromFormParameters(java.util.LinkedHashMap<java.lang.String,java.util.List<java.lang.String>> parametersMap)
boolean
isCollection()
boolean
isPagerAll()
boolean
isReverse()
java.util.Iterator
iterator()
void
setCollection(java.util.Collection collection)
Set the collection associated with this page, the collection must be sorted, so a sort is done by default inside.void
setCollection(java.util.Collection collection, boolean collectionAlreaySorted)
Set the collection associated with this page, the collection must be sorted, so a sort is done by default.void
setCollectionTagAttributeMap(java.util.Map<java.lang.String,java.lang.String> collectionAttributeMap)
void
setCollectionTagName(java.lang.String collectionTagName)
void
setFromPageResult(PageResult<?> pageResult)
void
setItemTagName(java.lang.String itemTagName)
void
setReverse(boolean reverse)
void
setSort(java.lang.String sort)
void
setStart(int start)
java.lang.String
toXmlString()
-
-
-
Method Detail
-
initFromFormParameters
public void initFromFormParameters(java.util.LinkedHashMap<java.lang.String,java.util.List<java.lang.String>> parametersMap)
-
getPageSize
public int getPageSize()
-
isPagerAll
public boolean isPagerAll()
-
hasRequestPagerData
public boolean hasRequestPagerData()
-
getStart
public int getStart()
-
setStart
public void setStart(int start)
-
getSort
public java.lang.String getSort()
-
setSort
public void setSort(java.lang.String sort)
-
isReverse
public boolean isReverse()
-
setReverse
public void setReverse(boolean reverse)
-
isCollection
public boolean isCollection()
-
setFromPageResult
public void setFromPageResult(PageResult<?> pageResult)
-
setCollection
public void setCollection(java.util.Collection collection)
Set the collection associated with this page, the collection must be sorted, so a sort is done by default inside. if another sort should be done, seesetCollection(Collection, boolean)
method to disable internalm- Parameters:
collection
- theCollection
(if the paramter is an instance ofQueryResultSet
, the collectionAlreaySorted is ignored and sort is always done onQueryResultSet
sort)
-
setCollection
public void setCollection(java.util.Collection collection, boolean collectionAlreaySorted)
Set the collection associated with this page, the collection must be sorted, so a sort is done by default. The collectionAlreaySorted parameter is present to disable the default sort if needed.- Parameters:
collection
- theCollection
(if the paramter is an instance ofQueryResultSet
, the collectionAlreaySorted is ignored and sort is always done onQueryResultSet
sort)collectionAlreaySorted
- false is theCollection
is a Data collection which has already been sorted previously
-
getCollectionTagName
public java.lang.String getCollectionTagName()
-
setCollectionTagName
public void setCollectionTagName(java.lang.String collectionTagName)
-
getCollectionTagAttributeMap
public java.util.Map<java.lang.String,java.lang.String> getCollectionTagAttributeMap()
-
setCollectionTagAttributeMap
public void setCollectionTagAttributeMap(java.util.Map<java.lang.String,java.lang.String> collectionAttributeMap)
-
getCollectionTagAttributes
public java.lang.String getCollectionTagAttributes()
-
getItemTagName
public java.lang.String getItemTagName()
-
setItemTagName
public void setItemTagName(java.lang.String itemTagName)
-
iterator
public java.util.Iterator iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.Object>
-
toXmlString
public java.lang.String toXmlString()
-
getTotal
public int getTotal()
-
-