ALF-8968 - Extend ScriptAuthorityService to also allow the fetching of users, so that the JS layer can find people without needing lucene queries

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28423 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2011-06-16 11:10:58 +00:00
parent 9dd2d98dd8
commit 5aacf7e84e
5 changed files with 542 additions and 63 deletions

View File

@@ -82,30 +82,39 @@ public class ScriptPagingDetails extends PagingRequest
*/
public <R> void setTotalItems(PagingResults<R> results)
{
Integer min = results.getTotalResultCount().getFirst();
Integer max = results.getTotalResultCount().getSecond();
// Get the total count and confidence
if(min == null)
if(results.getTotalResultCount() == null)
{
// No count calculated
this.totalItems = -1;
this.confidence = ItemsSizeConfidence.UNKNOWN;
}
else if(max == null)
{
this.totalItems = min;
this.confidence = ItemsSizeConfidence.AT_LEAST;
}
else if(min == max)
{
this.totalItems = min;
this.confidence = ItemsSizeConfidence.EXACT;
}
else
{
this.totalItems = min;
this.totalItemsRangeMax = max;
this.confidence = ItemsSizeConfidence.RANGE;
// Get the total count and confidence
Integer min = results.getTotalResultCount().getFirst();
Integer max = results.getTotalResultCount().getSecond();
if(min == null)
{
this.totalItems = -1;
this.confidence = ItemsSizeConfidence.UNKNOWN;
}
else if(max == null)
{
this.totalItems = min;
this.confidence = ItemsSizeConfidence.AT_LEAST;
}
else if(min == max)
{
this.totalItems = min;
this.confidence = ItemsSizeConfidence.EXACT;
}
else
{
this.totalItems = min;
this.totalItemsRangeMax = max;
this.confidence = ItemsSizeConfidence.RANGE;
}
}
// Finally record the query execution ID