Class 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 Detail

      • PagerData

        public PagerData​(org.restlet.data.Request request,
                         javax.servlet.http.HttpServletRequest j2eeRequest)
    • 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, see setCollection(Collection, boolean) method to disable internalm
        Parameters:
        collection - the Collection (if the paramter is an instance of QueryResultSet, the collectionAlreaySorted is ignored and sort is always done on QueryResultSet 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 - the Collection (if the paramter is an instance of QueryResultSet, the collectionAlreaySorted is ignored and sort is always done on QueryResultSet sort)
        collectionAlreaySorted - false is the Collection 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 interface java.lang.Iterable<java.lang.Object>
      • toXmlString

        public java.lang.String toXmlString()
      • getTotal

        public int getTotal()