Class QueriesImpl.AbstractQuery<T>

  • Enclosing class:
    QueriesImpl

    public abstract static class QueriesImpl.AbstractQuery<T>
    extends Object
    • Constructor Detail

      • AbstractQuery

        public AbstractQuery​(org.alfresco.service.cmr.repository.NodeService nodeService,
                             org.alfresco.service.cmr.search.SearchService searchService)
    • Method Detail

      • buildQuery

        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)
        Parameters:
        query - StringBuilder into which the query should be built.
        term - to be searched for
        sp - SearchParameters
        queryTemplateName -
      • newList

        protected abstract List<T> newList​(int capacity)
        Returns a list of the correct type.
        Parameters:
        capacity - of the list
        Returns:
        a new list.
      • convert

        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.
        Parameters:
        nodeRef - to be converted
        includeParam - additional fields to be included
        Returns:
        the object
      • escapeTerm

        protected String escapeTerm​(String term)
        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,
                                    org.alfresco.service.cmr.search.SearchParameters sp)
        Adds sort order to the SearchParameters.
      • postQuerySort

        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)