mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
57144: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3) 56927: Merged V4.1-BUG-FIX (4.1.7) to V4.2-BUG-FIX (4.2.1) 56870: Merged DEV to V4.1-BUG-FIX (4.1.7) 50589 : MNT-8908 : Incorrect display number of post in blog pagination. - The functionality was introduced to display the "pagination.template.page-report.more" (Showing items {startRecord} - {endRecord} of {totalRecords}++) message for pagination in Share UI, when items (blogs) more than limited (default is 100). git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61769 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -60,6 +60,7 @@ public abstract class AbstractGetBlogWebScript extends AbstractBlogWebScript
|
||||
|
||||
// process additional parameters. <index, count>
|
||||
PagingRequest pagingReq = parsePagingParams(req);
|
||||
pagingReq.setRequestTotalCountMax(pagingReq.getSkipCount() + pagingReq.getRequestTotalCountMax());
|
||||
|
||||
// begin and end date.
|
||||
// Legacy note: these dates are URL query parameters in int form.
|
||||
@@ -126,12 +127,26 @@ public abstract class AbstractGetBlogWebScript extends AbstractBlogWebScript
|
||||
Map<String, Object> blogPostsData = new HashMap<String, Object>();
|
||||
|
||||
final Pair<Integer, Integer> totalResultCount = blogPostList.getTotalResultCount();
|
||||
int total = blogPostList.getPage().size();
|
||||
if (totalResultCount != null && totalResultCount.getFirst() != null)
|
||||
{
|
||||
total = totalResultCount.getFirst();
|
||||
}
|
||||
//FIXME What to do? null
|
||||
blogPostsData.put("total", totalResultCount.getFirst());
|
||||
blogPostsData.put("total", total);
|
||||
blogPostsData.put("pageSize", pagingReq.getMaxItems());
|
||||
blogPostsData.put("startIndex", pagingReq.getSkipCount());
|
||||
blogPostsData.put("itemCount", blogPostList.getPage().size());
|
||||
|
||||
if (total == pagingReq.getRequestTotalCountMax())
|
||||
{
|
||||
blogPostsData.put("totalRecordsUpper", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
blogPostsData.put("totalRecordsUpper", false);
|
||||
}
|
||||
|
||||
List<Map<String, Object>> blogPostDataSets = new ArrayList<Map<String, Object>>(blogPostList.getPage().size());
|
||||
for (BlogPostInfo postInfo : blogPostList.getPage())
|
||||
{
|
||||
|
Reference in New Issue
Block a user