Package org.alfresco.util
Class ScriptPagingDetails
- java.lang.Object
-
- org.alfresco.query.PagingRequest
-
- org.alfresco.util.ScriptPagingDetails
-
public class ScriptPagingDetails extends org.alfresco.query.PagingRequestA 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 withModelUtil. Note thatorg.alfresco.repo.web.util.paging.Pagingprovides an alternate solution for other paging use cases. TODO Set a value forPagingRequest.setRequestTotalCountMax(int)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScriptPagingDetails.ItemsSizeConfidence
-
Constructor Summary
Constructors Constructor Description ScriptPagingDetails()ScriptPagingDetails(int maxItems, int skipCount)ScriptPagingDetails(int maxItems, int skipCount, java.lang.String queryExecutionId)ScriptPagingDetails(org.alfresco.query.PagingRequest paging)ScriptPagingDetails(org.springframework.extensions.webscripts.WebScriptRequest req, int maxResultCount)Creates a newPagingRequestobject (in the form ofScriptPagingDetails), based on the standard URL parameters for webscript paging.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.alfresco.query.PagingRequestbuildPagingRequest(org.springframework.extensions.webscripts.WebScriptRequest req, int maxResultCount)Creates a newPagingRequestobject, based on the standard URL parameters for webscript paging.ScriptPagingDetails.ItemsSizeConfidencegetConfidence()intgetTotalItems()Get the total number of items.intgetTotalItemsRangeMax()Where the confidence isScriptPagingDetails.ItemsSizeConfidence.RANGE, returns the upper bound of the range.voidsetMaxItems(int maxItems)voidsetQueryExecutionId(java.lang.String queryExecutionId)voidsetSkipCount(int skipCount)voidsetTotalItems(int totalItems)Records the total number of items that were found.<R> voidsetTotalItems(org.alfresco.query.PagingResults<R> results)Records the total number of results found, and the confidence in this, from the Paging Results
-
-
-
Constructor Detail
-
ScriptPagingDetails
public ScriptPagingDetails()
-
ScriptPagingDetails
public ScriptPagingDetails(int maxItems, int skipCount)
-
ScriptPagingDetails
public ScriptPagingDetails(int maxItems, int skipCount, java.lang.String queryExecutionId)
-
ScriptPagingDetails
public ScriptPagingDetails(org.alfresco.query.PagingRequest paging)
-
ScriptPagingDetails
public ScriptPagingDetails(org.springframework.extensions.webscripts.WebScriptRequest req, int maxResultCount) throws org.springframework.extensions.webscripts.WebScriptExceptionCreates a newPagingRequestobject (in the form ofScriptPagingDetails), based on the standard URL parameters for webscript paging.- Parameters:
req- The request object to extract parameters frommaxResultCount- The maximum results count if none is specified- Throws:
org.springframework.extensions.webscripts.WebScriptException
-
-
Method Detail
-
buildPagingRequest
public static org.alfresco.query.PagingRequest buildPagingRequest(org.springframework.extensions.webscripts.WebScriptRequest req, int maxResultCount) throws org.springframework.extensions.webscripts.WebScriptExceptionCreates a newPagingRequestobject, based on the standard URL parameters for webscript paging.- Parameters:
req- The request object to extract parameters frommaxResultCount- The maximum results count if none is specified- Throws:
org.springframework.extensions.webscripts.WebScriptException
-
getConfidence
public ScriptPagingDetails.ItemsSizeConfidence getConfidence()
-
getTotalItems
public int getTotalItems()
Get the total number of items. SeegetConfidence()for an idea of the accuracy/confidence on this value.
-
setTotalItems
public void setTotalItems(int totalItems)
Records the total number of items that were found. If the value is -1, then the confidence is set toScriptPagingDetails.ItemsSizeConfidence.UNKNOWN, otherwise the confidence isScriptPagingDetails.ItemsSizeConfidence.EXACT- Parameters:
totalItems- The total number of items the search found
-
setTotalItems
public <R> void setTotalItems(org.alfresco.query.PagingResults<R> results)
Records the total number of results found, and the confidence in this, from the Paging Results- Parameters:
results- The PagingResults to extract the information from
-
getTotalItemsRangeMax
public int getTotalItemsRangeMax()
Where the confidence isScriptPagingDetails.ItemsSizeConfidence.RANGE, returns the upper bound of the range.
-
setMaxItems
public void setMaxItems(int maxItems)
- Overrides:
setMaxItemsin classorg.alfresco.query.PagingRequest
-
setSkipCount
public void setSkipCount(int skipCount)
- Overrides:
setSkipCountin classorg.alfresco.query.PagingRequest
-
setQueryExecutionId
public void setQueryExecutionId(java.lang.String queryExecutionId)
- Overrides:
setQueryExecutionIdin classorg.alfresco.query.PagingRequest
-
-