public abstract static class QueriesImpl.AbstractQuery<T> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
QueriesImpl.AbstractQuery.Sort |
Constructor and Description |
---|
AbstractQuery(org.alfresco.service.cmr.repository.NodeService nodeService,
org.alfresco.service.cmr.search.SearchService searchService) |
Modifier and Type | Method and Description |
---|---|
protected void |
addSortOrder(Parameters parameters,
Map<String,org.alfresco.service.namespace.QName> sortParamsToQNames,
List<SortColumn> defaultSortCols,
org.alfresco.service.cmr.search.SearchParameters sp)
Adds sort order to the SearchParameters.
|
protected abstract void |
buildQuery(StringBuilder query,
String term,
org.alfresco.service.cmr.search.SearchParameters sp,
String queryTemplateName)
Builds up the query and is expected to call
SearchParameters.setDefaultFieldName(String)
and SearchParameters.addQueryTemplate(String, String) |
protected abstract T |
convert(org.alfresco.service.cmr.repository.NodeRef nodeRef,
List<String> includeParam)
Converts a nodeRef into the an object of the required type.
|
protected String |
escapeTerm(String term)
Trim and escape the term - override if needed
|
CollectionWithPagingInfo<T> |
find(Parameters parameters,
String termName,
int minTermLength,
String queryTemplateName,
QueriesImpl.AbstractQuery.Sort sort,
Map<String,org.alfresco.service.namespace.QName> sortParamsToQNames,
SortColumn... defaultSort) |
protected String |
getTerm(Parameters parameters,
String termName,
int minTermLength) |
protected static <T> CollectionWithPagingInfo<T> |
listPage(List<T> result,
Paging paging) |
protected abstract List<T> |
newList(int capacity)
Returns a list of the correct type.
|
protected List<org.alfresco.service.cmr.repository.NodeRef> |
postQuerySort(Parameters parameters,
Map<String,org.alfresco.service.namespace.QName> sortParamsToQNames,
List<SortColumn> defaultSortCols,
List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs) |
public AbstractQuery(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.search.SearchService searchService)
public CollectionWithPagingInfo<T> find(Parameters parameters, String termName, int minTermLength, String queryTemplateName, QueriesImpl.AbstractQuery.Sort sort, Map<String,org.alfresco.service.namespace.QName> sortParamsToQNames, SortColumn... defaultSort)
protected abstract void buildQuery(StringBuilder query, String term, org.alfresco.service.cmr.search.SearchParameters sp, String queryTemplateName)
SearchParameters.setDefaultFieldName(String)
and SearchParameters.addQueryTemplate(String, String)
query
- StringBuilder into which the query should be built.term
- to be searched forsp
- SearchParametersqueryTemplateName
- protected abstract List<T> newList(int capacity)
capacity
- of the listprotected abstract T convert(org.alfresco.service.cmr.repository.NodeRef nodeRef, List<String> includeParam)
nodeRef
- to be convertedincludeParam
- additional fields to be includedprotected String getTerm(Parameters parameters, String termName, int minTermLength)
protected String escapeTerm(String term)
term
- protected void addSortOrder(Parameters parameters, Map<String,org.alfresco.service.namespace.QName> sortParamsToQNames, List<SortColumn> defaultSortCols, org.alfresco.service.cmr.search.SearchParameters sp)
protected List<org.alfresco.service.cmr.repository.NodeRef> postQuerySort(Parameters parameters, Map<String,org.alfresco.service.namespace.QName> sortParamsToQNames, List<SortColumn> defaultSortCols, List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs)
protected static <T> CollectionWithPagingInfo<T> listPage(List<T> result, Paging paging)
Copyright © 2005–2017 Alfresco Software. All rights reserved.