details:   https://code.openbravo.com/erp/devel/pi/rev/71d43f621ba5
changeset: 29952:71d43f621ba5
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Wed Aug 31 08:37:02 2016 +0200
summary:   related to issue 33622: added javadoc to explain how the new methods 
work

diffstat:

 
modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
 |  29 ++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diffs (46 lines):

diff -r 431e5474cee7 -r 71d43f621ba5 
modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
--- 
a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
     Tue Aug 30 12:34:23 2016 +0000
+++ 
b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
     Wed Aug 31 08:37:02 2016 +0200
@@ -312,6 +312,18 @@
     }
   }
 
+  /**
+   * Used on requests received from pick and execute windows in order to avoid 
losing the selection.
+   * It checks if the request has a criteria that contains the selected 
records. In that case, if
+   * the amount of selected records is higher than the page size, then the end 
row is increased so
+   * that all the selected records can be returned within the same page.
+   * 
+   * @param parameters
+   *          map of request parameters
+   * @param startRowStr
+   *          start row of the page
+   * @return the new value for the end row
+   */
   private String getEndRowForSelectedRecords(Map<String, String> parameters, 
String startRowStr) {
     String endRowStr = parameters.get(JsonConstants.ENDROW_PARAMETER);
     if (startRowStr == null || endRowStr == null) {
@@ -326,6 +338,23 @@
     return endRowStr;
   }
 
+  /**
+   * Used on requests received from pick and execute windows in order to avoid 
losing the selection.
+   * It is used when the request does not contain information about the 
selected records. In that
+   * case, this method decides if the query should be done again with a higher 
page size, according
+   * to the the selection status of the last record returned by the database 
query and the current
+   * page size.
+   * 
+   * @param parameters
+   *          map of request parameters
+   * @param bobs
+   *          list of objects returned by the database query
+   * @param startRowStr
+   *          start row of the page
+   * @param endRowStr
+   *          end row of the page
+   * @return true if the page size should be increased, false otherwise
+   */
   private boolean shouldIncreasePageSize(Map<String, String> parameters, 
List<BaseOBObject> bobs,
       String startRowStr, String endRowStr) {
     if (startRowStr == null || endRowStr == null) {

------------------------------------------------------------------------------
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to