Package org.alfresco.rest.api.impl
Class QueriesImpl.AbstractQuery<T>
java.lang.Object
org.alfresco.rest.api.impl.QueriesImpl.AbstractQuery<T>
- Enclosing class:
- QueriesImpl
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addSortOrder
(Parameters parameters, Map<String, org.alfresco.service.namespace.QName> sortParamsToQNames, List<SortColumn> defaultSortCols, SearchParameters sp) Adds sort order to the SearchParameters.protected abstract void
buildQuery
(StringBuilder query, String term, SearchParameters sp, String queryTemplateName) Builds up the query and is expected to callSearchParameters.setDefaultFieldName(String)
andSearchParameters.addQueryTemplate(String, String)
protected abstract T
Converts a nodeRef into the an object of the required type.protected String
escapeTerm
(String term) Trim and escape the term - override if neededfind
(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>
newList
(int capacity) Returns a list of the correct type.postQuerySort
(Parameters parameters, Map<String, org.alfresco.service.namespace.QName> sortParamsToQNames, List<SortColumn> defaultSortCols, List<NodeRef> nodeRefs)
-
Constructor Details
-
AbstractQuery
-
-
Method Details
-
find
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) -
buildQuery
protected abstract void buildQuery(StringBuilder query, String term, SearchParameters sp, String queryTemplateName) Builds up the query and is expected to callSearchParameters.setDefaultFieldName(String)
andSearchParameters.addQueryTemplate(String, String)
- Parameters:
query
- StringBuilder into which the query should be built.term
- to be searched forsp
- SearchParametersqueryTemplateName
-
-
newList
Returns a list of the correct type.- Parameters:
capacity
- of the list- Returns:
- a new list.
-
convert
Converts a nodeRef into the an object of the required type.- Parameters:
nodeRef
- to be convertedincludeParam
- additional fields to be included- Returns:
- the object
-
getTerm
-
escapeTerm
Trim and escape the term - override if needed- Parameters:
term
-- Returns:
-
addSortOrder
protected void addSortOrder(Parameters parameters, Map<String, org.alfresco.service.namespace.QName> sortParamsToQNames, List<SortColumn> defaultSortCols, SearchParameters sp) Adds sort order to the SearchParameters. -
postQuerySort
protected List<NodeRef> postQuerySort(Parameters parameters, Map<String, org.alfresco.service.namespace.QName> sortParamsToQNames, List<SortColumn> defaultSortCols, List<NodeRef> nodeRefs) -
listPage
-