mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Rename PagingDetails to ScriptPagingDetails in preparation for merging with PagingRequest. (JS object name is unchanged, which is the main use)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28310 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -91,7 +91,7 @@ public class ModelUtil
|
||||
*
|
||||
* @param paging The paging object with total, skip, max etc
|
||||
*/
|
||||
public static Map<String, Object> buildPaging(PagingDetails paging)
|
||||
public static Map<String, Object> buildPaging(ScriptPagingDetails paging)
|
||||
{
|
||||
return buildPaging(
|
||||
paging.getTotalItems(),
|
||||
@@ -102,9 +102,9 @@ public class ModelUtil
|
||||
|
||||
public static <T> List<T> page(Collection<T> objects, int maxItems, int skipCount)
|
||||
{
|
||||
return page(objects, new PagingDetails(maxItems, skipCount));
|
||||
return page(objects, new ScriptPagingDetails(maxItems, skipCount));
|
||||
}
|
||||
public static <T> List<T> page(Collection<T> objects, PagingDetails paging)
|
||||
public static <T> List<T> page(Collection<T> objects, ScriptPagingDetails paging)
|
||||
{
|
||||
int maxItems = paging.getMaxItems();
|
||||
int skipCount = paging.getSkipCount();
|
||||
|
@@ -1,50 +0,0 @@
|
||||
package org.alfresco.util;
|
||||
|
||||
/**
|
||||
* A simple paging details wrapper, to hold things like
|
||||
* the skip count, max items and total items.
|
||||
* This is typically used with {@link ModelUtil}.
|
||||
* Note that {@link org.alfresco.repo.web.paging.Paging}
|
||||
* provides an alternate solution for other paging
|
||||
* use cases.
|
||||
*/
|
||||
public class PagingDetails
|
||||
{
|
||||
private int totalItems = -1;
|
||||
private int maxItems = -1;
|
||||
private int skipCount = -1;
|
||||
|
||||
public PagingDetails() {}
|
||||
public PagingDetails(int maxItems, int skipCount)
|
||||
{
|
||||
this.maxItems = maxItems;
|
||||
this.skipCount = skipCount;
|
||||
}
|
||||
|
||||
public int getTotalItems()
|
||||
{
|
||||
return totalItems;
|
||||
}
|
||||
public void setTotalItems(int totalItems)
|
||||
{
|
||||
this.totalItems = totalItems;
|
||||
}
|
||||
|
||||
public int getMaxItems()
|
||||
{
|
||||
return maxItems;
|
||||
}
|
||||
public void setMaxItems(int maxItems)
|
||||
{
|
||||
this.maxItems = maxItems;
|
||||
}
|
||||
|
||||
public int getSkipCount()
|
||||
{
|
||||
return skipCount;
|
||||
}
|
||||
public void setSkipCount(int skipCount)
|
||||
{
|
||||
this.skipCount = skipCount;
|
||||
}
|
||||
}
|
65
source/java/org/alfresco/util/ScriptPagingDetails.java
Normal file
65
source/java/org/alfresco/util/ScriptPagingDetails.java
Normal file
@@ -0,0 +1,65 @@
|
||||
package org.alfresco.util;
|
||||
|
||||
/**
|
||||
* A simple paging details wrapper, to hold things like the
|
||||
* skip count, max items and total items. This is typically
|
||||
* used with Scripts and WebScripts, and feeds into the
|
||||
* Repository level paging support.
|
||||
* This class is typically used with {@link ModelUtil}.
|
||||
* Note that {@link org.alfresco.repo.web.paging.Paging}
|
||||
* provides an alternate solution for other paging
|
||||
* use cases.
|
||||
*/
|
||||
public class ScriptPagingDetails
|
||||
{
|
||||
private int totalItems = -1;
|
||||
private int maxItems = -1; // TODO To PagingRequest
|
||||
private int skipCount = -1; // TODO To PagingRequest
|
||||
private String queryExecutionId = null; // TODO To PagingRequest
|
||||
|
||||
public ScriptPagingDetails() {}
|
||||
public ScriptPagingDetails(int maxItems, int skipCount)
|
||||
{
|
||||
this(maxItems, skipCount, null);
|
||||
}
|
||||
public ScriptPagingDetails(int maxItems, int skipCount, String queryExecutionId)
|
||||
{
|
||||
this.maxItems = maxItems;
|
||||
this.skipCount = skipCount;
|
||||
this.queryExecutionId = queryExecutionId;
|
||||
}
|
||||
|
||||
public int getTotalItems()
|
||||
{
|
||||
return totalItems;
|
||||
}
|
||||
public void setTotalItems(int totalItems)
|
||||
{
|
||||
this.totalItems = totalItems;
|
||||
}
|
||||
|
||||
public int getMaxItems()
|
||||
{
|
||||
return maxItems;
|
||||
}
|
||||
public void setMaxItems(int maxItems)
|
||||
{
|
||||
this.maxItems = maxItems;
|
||||
}
|
||||
|
||||
public int getSkipCount()
|
||||
{
|
||||
return skipCount;
|
||||
}
|
||||
public void setSkipCount(int skipCount)
|
||||
{
|
||||
this.skipCount = skipCount;
|
||||
}
|
||||
|
||||
public String getQueryExecutionId() {
|
||||
return queryExecutionId;
|
||||
}
|
||||
public void setQueryExecutionId(String queryExecutionId) {
|
||||
this.queryExecutionId = queryExecutionId;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user