public final void page(final Map<String, Object> pRqVs,
    final IRequestData pRqDt, final OnlineBuyer pBuyr) throws Exception {
    TradingSettings ts = (TradingSettings) pRqVs.get("tradSet");
    //orders:
    int page;
    String pgSt = pRqDt.getParameter("pg");
    if (pgSt != null) {
      page = Integer.parseInt(pgSt);
    } else {
      page = 1;
    }
    String wheBr = "BUYER=" + pBuyr.getItsId();
    Integer rowCount = this.srvOrm.evalRowCountWhere(pRqVs,
      CustOrder.class, wheBr);
    Integer itemsPerPage = ts.getItemsPerPage();
    int totalPages = this.srvPage.evalPageCount(rowCount, itemsPerPage);
    if (page > totalPages) {
      page = totalPages;
    }
    int firstResult = (page - 1) * itemsPerPage; //0-20,20-40
    Integer paginationTail = Integer.valueOf(mngUvd
      .getAppSettings().get("paginationTail"));
    List<Page> pages = this.srvPage.evalPages(page, totalPages,
      paginationTail);
    pRqDt.setAttribute("pgs", pages);
    String tbn = CustOrder.class.getSimpleName();
    Set<String> ndFlNm = new HashSet<String>();
    ndFlNm.add("itsId");
    ndFlNm.add("itsName");
    pRqVs.put("PickUpPlaceneededFields", ndFlNm);
    pRqVs.put(tbn + "buyerdeepLevel", 1);
    List<CustOrder> orders = getSrvOrm().retrievePageWithConditions(pRqVs,
      CustOrder.class, "where " + wheBr, firstResult, itemsPerPage);
    pRqVs.remove(tbn + "buyerdeepLevel");
    pRqDt.setAttribute("ords", orders);
    //S.E. orders:
    pgSt = pRqDt.getParameter("spg");
    if (pgSt != null) {
      page = Integer.parseInt(pgSt);
    } else {
      page = 1;
    }
    rowCount = this.srvOrm.evalRowCountWhere(pRqVs, CuOrSe.class, wheBr);
    itemsPerPage = ts.getItemsPerPage();
    totalPages = this.srvPage.evalPageCount(rowCount, itemsPerPage);
    if (page > totalPages) {
      page = totalPages;
    }
    firstResult = (page - 1) * itemsPerPage; //0-20,20-40
    pages = this.srvPage.evalPages(1, totalPages, paginationTail);
    pRqDt.setAttribute("spgs", pages);
    tbn = CuOrSe.class.getSimpleName();
    Set<String> ndFlDc = new HashSet<String>();
    ndFlDc.add("seller");
    pRqVs.put("DebtorCreditorneededFields", ndFlNm);
    pRqVs.put("SeSellerneededFields", ndFlDc);
    pRqVs.put("CuOrSeseldeepLevel", 3);
    pRqVs.put(tbn + "buyerdeepLevel", 1);
    List<CuOrSe> sorders = getSrvOrm().retrievePageWithConditions(pRqVs,
      CuOrSe.class, "where " + wheBr, firstResult, itemsPerPage);
    pRqVs.remove(tbn + "buyerdeepLevel");
    pRqVs.remove("DebtorCreditorneededFields");
    pRqVs.remove("SeSellerneededFields");
    pRqVs.remove("CuOrSeseldeepLevel");
    pRqVs.remove("PickUpPlaceneededFields");
    pRqDt.setAttribute("sords", sorders);
  }
public final void page ( final Map < String , Object > pRqVs , final IRequestData pRqDt , final OnlineBuyer pBuyr ) throws Exception { TradingSettings ts = ( TradingSettings ) pRqVs . get ( "tradSet" ) ; int page ; String pgSt = pRqDt . getParameter ( "pg" ) ; if ( pgSt != null ) { page = Integer . parseInt ( pgSt ) ; } else { page = 1 ; } String wheBr = "BUYER=" + pBuyr . getItsId ( ) ; Integer rowCount = this . srvOrm . evalRowCountWhere ( pRqVs , CustOrder . class , wheBr ) ; Integer itemsPerPage = ts . getItemsPerPage ( ) ; int totalPages = this . srvPage . evalPageCount ( rowCount , itemsPerPage ) ; if ( page > totalPages ) { page = totalPages ; } int firstResult = ( page - 1 ) * itemsPerPage ; Integer paginationTail = Integer . valueOf ( mngUvd . getAppSettings ( ) . get ( "paginationTail" ) ) ; List < Page > pages = this . srvPage . evalPages ( page , totalPages , paginationTail ) ; pRqDt . setAttribute ( "pgs" , pages ) ; String tbn = CustOrder . class . getSimpleName ( ) ; Set < String > ndFlNm = new HashSet < String > ( ) ; ndFlNm . add ( "itsId" ) ; ndFlNm . add ( "itsName" ) ; pRqVs . put ( "PickUpPlaceneededFields" , ndFlNm ) ; pRqVs . put ( tbn + "buyerdeepLevel" , 1 ) ; List < CustOrder > orders = getSrvOrm ( ) . retrievePageWithConditions ( pRqVs , CustOrder . class , "where " + wheBr , firstResult , itemsPerPage ) ; pRqVs . remove ( tbn + "buyerdeepLevel" ) ; pRqDt . setAttribute ( "ords" , orders ) ; pgSt = pRqDt . getParameter ( "spg" ) ; if ( pgSt != null ) { page = Integer . parseInt ( pgSt ) ; } else { page = 1 ; } rowCount = this . srvOrm . evalRowCountWhere ( pRqVs , CuOrSe . class , wheBr ) ; itemsPerPage = ts . getItemsPerPage ( ) ; totalPages = this . srvPage . evalPageCount ( rowCount , itemsPerPage ) ; if ( page > totalPages ) { page = totalPages ; } firstResult = ( page - 1 ) * itemsPerPage ; pages = this . srvPage . evalPages ( 1 , totalPages , paginationTail ) ; pRqDt . setAttribute ( "spgs" , pages ) ; tbn = CuOrSe . class . getSimpleName ( ) ; Set < String > ndFlDc = new HashSet < String > ( ) ; ndFlDc . add ( "seller" ) ; pRqVs . put ( "DebtorCreditorneededFields" , ndFlNm ) ; pRqVs . put ( "SeSellerneededFields" , ndFlDc ) ; pRqVs . put ( "CuOrSeseldeepLevel" , 3 ) ; pRqVs . put ( tbn + "buyerdeepLevel" , 1 ) ; List < CuOrSe > sorders = getSrvOrm ( ) . retrievePageWithConditions ( pRqVs , CuOrSe . class , "where " + wheBr , firstResult , itemsPerPage ) ; pRqVs . remove ( tbn + "buyerdeepLevel" ) ; pRqVs . remove ( "DebtorCreditorneededFields" ) ; pRqVs . remove ( "SeSellerneededFields" ) ; pRqVs . remove ( "CuOrSeseldeepLevel" ) ; pRqVs . remove ( "PickUpPlaceneededFields" ) ; pRqDt . setAttribute ( "sords" , sorders ) ; }
<p>Retrieve page.</p>
@param pRqVs request scoped vars
@param pRqDt Request Data
@param pBuyr buyer
@throws Exception - an exception