Package org.alfresco.util
Class ModelUtil
java.lang.Object
org.alfresco.util.ModelUtil
Model related utility functions.
- Since:
- 3.5
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildPaging(int totalItems, int maxItems, int skipCount) Returns representation of paging objectbuildPaging(int totalItems, int maxItems, int skipCount, ScriptPagingDetails.ItemsSizeConfidence confidence, int totalItemsRangeEnd) Returns representation of paging objectbuildPaging(ScriptPagingDetails paging) Returns representation of paging objectstatic StringgetProductName(RepoAdminService repoAdminService) Returns the name of the product currently running, determined by the current license.static <T> List<T>page(Collection<T> objects, int maxItems, int skipCount) static <T> List<T>page(Collection<T> objects, ScriptPagingDetails paging) static <T> T[]page(T[] objects, int maxItems, int skipCount)
-
Field Details
-
PAGING_MAX_ITEMS
- See Also:
-
PAGING_SKIP_COUNT
- See Also:
-
PAGING_TOTAL_ITEMS
- See Also:
-
PAGING_TOTAL_ITEMS_RANGE_END
- See Also:
-
PAGING_CONFIDENCE
- See Also:
-
-
Constructor Details
-
ModelUtil
public ModelUtil()
-
-
Method Details
-
getProductName
Returns the name of the product currently running, determined by the current license.- Parameters:
repoAdminService- The RepoAdminService- Returns:
- "Share" or "Team"
-
buildPaging
public static Map<String,Object> buildPaging(int totalItems, int maxItems, int skipCount, ScriptPagingDetails.ItemsSizeConfidence confidence, int totalItemsRangeEnd) Returns representation of paging object- Parameters:
totalItems- all count of objectmaxItems- max count of object that should be returnedskipCount- count of skipped objectsconfidence- the confidence in the total, default is exacttotalItemsRangeEnd- if the total is a range, what is the upper end of it- Returns:
- A model map of the details
-
buildPaging
Returns representation of paging object- Parameters:
totalItems- all count of objectmaxItems- max count of object that should be returnedskipCount- count of skipped objects- Returns:
- A model map of the details
-
buildPaging
Returns representation of paging object- Parameters:
paging- The paging object with total, skip, max etc
-
page
-
page
-
page
public static <T> T[] page(T[] objects, int maxItems, int skipCount)
-