|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.query.AbstractCannedQuery
public abstract class AbstractCannedQuery
Basic support for canned query implementations.
Constructor Summary | |
---|---|
protected |
AbstractCannedQuery(CannedQueryParameters parameters)
Construct the canned query given the original parameters applied. |
Method Summary | |
---|---|
protected java.util.List |
applyPostQueryPaging(java.util.List results,
CannedQueryPageDetails pageDetails)
Called after the sorting phase to pull out results specific
to the required pages. |
protected java.util.List |
applyPostQueryPermissions(java.util.List results,
int requestedCount)
Called after the query to filter out results based on permissions. |
protected java.util.List |
applyPostQuerySorting(java.util.List results,
CannedQuerySortDetails sortDetails)
Called before #applyPostQueryPermissions(List) to allow the results to be sorted prior to permission checks. |
CannedQueryResults |
execute()
Execute the named query, which was provided to support the parameters originally provided. |
CannedQueryParameters |
getParameters()
Get the original parameters used to generate the query. |
protected Pair |
getTotalResultCount(java.util.List results)
Get the total number of available results after querying, filtering, sorting and permission checking. |
protected boolean |
isApplyPostQueryPaging()
Override to get post-query calls to do pull out paged results. |
protected boolean |
isApplyPostQueryPermissions()
Override to get post-query calls to apply permission filters. |
protected boolean |
isApplyPostQuerySorting()
Override to get post-query calls to do sorting. |
protected abstract java.util.List |
queryAndFilter(CannedQueryParameters parameters)
Implement the basic query, returning either filtered or all results. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected AbstractCannedQuery(CannedQueryParameters parameters)
parameters
- the original query parametersMethod Detail |
---|
public CannedQueryParameters getParameters()
CannedQuery
getParameters
in interface CannedQuery
public java.lang.String toString()
toString
in class java.lang.Object
public final CannedQueryResults execute()
CannedQuery
parameters
originally provided.
Note: This method can only be used once; to requery, get a new
instance from the factory
.
execute
in interface CannedQuery
protected abstract java.util.List queryAndFilter(CannedQueryParameters parameters)
AbstractCannedQuery.applyPostQuerySorting(List, CannedQuerySortDetails)
,
#applyPostQueryPermissions(List, String)
and
AbstractCannedQuery.applyPostQueryPaging(List, CannedQueryPageDetails)
) can
be used to trim the results as required.
parameters
- the full parameters to be used for executionprotected boolean isApplyPostQuerySorting()
protected java.util.List applyPostQuerySorting(java.util.List results, CannedQuerySortDetails sortDetails)
#applyPostQueryPermissions(List)
to allow the results to be sorted prior to permission checks.
Note that the #query()
implementation may optimally sort results during retrieval, in which case this method does not need to be implemented.
results
- the results to sortsortDetails
- details of the sorting requirements
protected boolean isApplyPostQueryPermissions()
protected java.util.List applyPostQueryPermissions(java.util.List results, int requestedCount)
query
to filter out results based on permissions.
Note that the #query()
implementation may optimally only select results
based on available privileges, in which case this method does not need to be implemented.
Permission evaluations should continue until the requested number of results are retrieved
or all available results have been examined.
results
- the results to apply permissions torequestedCount
- the minimum number of results to pass the permission checks
in order to fully satisfy the paging requirements
protected Pair getTotalResultCount(java.util.List results)
results
- the results after filtering and sorting, but before paging
CannedQueryParameters.getTotalResultCountMax()
protected boolean isApplyPostQueryPaging()
protected java.util.List applyPostQueryPaging(java.util.List results, CannedQueryPageDetails pageDetails)
sorting phase
to pull out results specific
to the required pages. Note that the #query()
implementation may optimally
create page-specific results, in which case this method does not need to be implemented.
The base implementation assumes that results are not paged and that the current results
are all the available results i.e. that paging still needs to be applied.
results
- full results (all or excess pages)pageDetails
- details of the paging requirements
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |