org.moremotion.datasrc
Class Paging

java.lang.Object
  extended by org.moremotion.datasrc.Paging

public class Paging
extends java.lang.Object

Objects of this class are created by the PageGenerator and passed to DataService classes to let them generate only the requested part of their data.

Version:
$Id: Paging.java 51 2008-03-10 11:46:54Z erkan $

Constructor Summary
Paging(MoreMotionRequest request, java.lang.String adomName, DataSourceConfig dsconfig)
          Creates a new instance of Paging
 
Method Summary
 void addPagingInfo(ADOM result)
          Adds the paging information of this object to the given ADOM object.
 int getCurrentPage()
          Returns the current page number
 int getItemsPerPage()
          Returns the items-per-page value.
 boolean getLastPage()
          Returns the value of the last-page flag.
 boolean getMorePages()
          Returns the value of the more-pages flag.
 boolean getNeedsRefresh()
          Returns the value of the new-page-required flag.
 int getNumberOfItems()
          Returns the number of items available in the datasource.
 int getPageCount()
          Returns the total page count.
 int getPagesPerBlock()
          Returns pages-per-block value.
 java.lang.String getPagingInfo()
           
 int getSkipAmount()
          Returns how many items to be skipped from the beginning to locate the first item to be included in page XML data.
 int getTotalNumberOfItems()
          Returns the total number of items available in the datasource.
 void setCurrentPage(int value)
          Sets the current page number.
 void setItemsPerPage(int value)
          Sets the items-per-page value.
 void setLastPage(boolean value)
          Sets the last-page flag.
 void setMorePages(boolean value)
          Sets the more-pages flag.
 void setNeedsRefresh(boolean value)
          Sets the new-page-required flag.
 void setNumberOfItems(int value)
          Sets the total number of items available in the datasource.
 void setPagesPerBlock(int value)
           
 void setTotalNumberOfItems(int value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Paging

public Paging(MoreMotionRequest request,
              java.lang.String adomName,
              DataSourceConfig dsconfig)
       throws ConfigurationException
Creates a new instance of Paging

Parameters:
request - MoreMotionRequest object
adomName - ADOM Name.
dsconfig - DataSourceConfig object this Paging object linked.
Throws:
ConfigurationException
Method Detail

setCurrentPage

public void setCurrentPage(int value)
Sets the current page number.


getCurrentPage

public int getCurrentPage()
Returns the current page number


setItemsPerPage

public void setItemsPerPage(int value)
Sets the items-per-page value. items-per-page indicates how many item will be included in the page XML for a page.


getItemsPerPage

public int getItemsPerPage()
Returns the items-per-page value. items-per-page indicates how many items will be included in the page XML for a page.


setPagesPerBlock

public void setPagesPerBlock(int value)

getPagesPerBlock

public int getPagesPerBlock()
Returns pages-per-block value.


setNumberOfItems

public void setNumberOfItems(int value)
Sets the total number of items available in the datasource.


setTotalNumberOfItems

public void setTotalNumberOfItems(int value)

getNumberOfItems

public int getNumberOfItems()
Returns the number of items available in the datasource.


getTotalNumberOfItems

public int getTotalNumberOfItems()
Returns the total number of items available in the datasource. If all the items not yet processed then returns -1.


setNeedsRefresh

public void setNeedsRefresh(boolean value)
Sets the new-page-required flag.


getNeedsRefresh

public boolean getNeedsRefresh()
Returns the value of the new-page-required flag.


setMorePages

public void setMorePages(boolean value)
Sets the more-pages flag.


getMorePages

public boolean getMorePages()
Returns the value of the more-pages flag.


setLastPage

public void setLastPage(boolean value)
Sets the last-page flag.


getLastPage

public boolean getLastPage()
Returns the value of the last-page flag.


getPageCount

public int getPageCount()
Returns the total page count. The page count is calcuated by number-of-items / items-per-page formula.


getSkipAmount

public int getSkipAmount()
Returns how many items to be skipped from the beginning to locate the first item to be included in page XML data.


addPagingInfo

public void addPagingInfo(ADOM result)
Adds the paging information of this object to the given ADOM object.


getPagingInfo

public java.lang.String getPagingInfo()


Copyright © 2002-2008 MOR YAZILIM. All Rights Reserved.