]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5457: Added code to tread page size of zero as a special case. pgSz=0 means...
authorRichard Millet <remillet@berkeley.edu>
Thu, 9 Aug 2012 22:33:14 +0000 (15:33 -0700)
committerRichard Millet <remillet@berkeley.edu>
Thu, 9 Aug 2012 22:33:14 +0000 (15:33 -0700)
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryJavaClientImpl.java

index d56bc4749ce2f036c4852d364cd2575c0c1a2f2d..3cb71c65d4b6af9b40add20bc092def465357870 100644 (file)
@@ -889,25 +889,23 @@ public class RepositoryJavaClientImpl implements RepositoryClient<PoxPayloadIn,
                int totalSize = (int)queryResult.size();
                ((DocumentModelListImpl)result).setTotalSize(totalSize);
                                // Skip the rows before our offset
-                       if(offset>0) {
-                               queryResult.skipTo(offset);
-                       }
+                               if (offset > 0) {
+                                       queryResult.skipTo(offset);
+                               }
                        int nRows = 0;
                        for (Map<String, Serializable> row : queryResult) {
-                               logger.debug(""
-                                               //                                      + " dc:title is: " + (String)row.get("dc:title")
-                                               + " Hierarchy Table ID is:" + row.get(IQueryManager.CMIS_TARGET_NUXEO_ID)
-                                               + " nuxeo:pathSegment is: " + row.get(IQueryManager.CMIS_TARGET_NAME)
-                                               //                                      + " nuxeo:lifecycleState is: " + row.get("nuxeo:lifecycleState")
-                                               );
+                               if (logger.isTraceEnabled()) {
+                                       logger.trace(" Hierarchy Table ID is:" + row.get(IQueryManager.CMIS_TARGET_NUXEO_ID)
+                                                       + " nuxeo:pathSegment is: " + row.get(IQueryManager.CMIS_TARGET_NAME));
+                               }
                                String nuxeoId = (String) row.get(IQueryManager.CMIS_TARGET_NUXEO_ID);
                                DocumentModel docModel = NuxeoUtils.getDocumentModel(repoSession, nuxeoId);
                                result.add(docModel);
                                nRows++;
-                               if(nRows >= pageSize) {
-                                       logger.debug("Got page full of items - quitting");
-                                       break;
-                               }
+                                       if (nRows >= pageSize && pageSize != 0 ) { // A page size of zero means that they want all of them
+                                               logger.debug("Got page full of items - quitting");
+                                               break;
+                                       }
                        }
                } finally {
                        queryResult.close();