Class AdvSearchServiceImpl

java.lang.Object
fr.becpg.repo.search.impl.AdvSearchServiceImpl
All Implemented Interfaces:
AdvSearchService

@Service("advSearchService") public class AdvSearchServiceImpl extends Object implements AdvSearchService
This class do a search on the repository (association, properties and productLists), for the UI so it respects rights.
Version:
$Id: $Id
Author:
querephi
  • Field Details

    • logger

      private static final org.apache.commons.logging.Log logger
    • namespaceService

      @Autowired private org.alfresco.service.namespace.NamespaceService namespaceService
    • advSearchPlugins

      @Autowired(required=false) private AdvSearchPlugin[] advSearchPlugins
    • nodeService

      @Autowired private org.alfresco.service.cmr.repository.NodeService nodeService
    • entityDictionaryService

      @Autowired private EntityDictionaryService entityDictionaryService
    • beCPGCacheService

      @Autowired private BeCPGCacheService beCPGCacheService
    • contentService

      @Autowired private org.alfresco.service.cmr.repository.ContentService contentService
    • repository

      @Autowired private org.alfresco.repo.model.Repository repository
    • CONFIG_PATH

      public static final String CONFIG_PATH
      Constant CONFIG_PATH="/app:company_home/cm:System/cm:Config/c"{trunked}
      See Also:
    • SEARCH_CONFIG_CACHE_KEY

      public static final String SEARCH_CONFIG_CACHE_KEY
      Constant SEARCH_CONFIG_CACHE_KEY="SEARCH_CONFIG"
      See Also:
  • Constructor Details

    • AdvSearchServiceImpl

      public AdvSearchServiceImpl()
  • Method Details

    • getSearchConfig

      public SearchConfig getSearchConfig()

      getSearchConfig.

      getSearchConfig.

      Specified by:
      getSearchConfig in interface AdvSearchService
      Returns:
      a SearchConfig object.
    • queryAdvSearch

      public List<org.alfresco.service.cmr.repository.NodeRef> queryAdvSearch(org.alfresco.service.namespace.QName datatype, BeCPGQueryBuilder beCPGQueryBuilder, Map<String,String> criteria, int maxResults)

      queryAdvSearch.

      Specified by:
      queryAdvSearch in interface AdvSearchService
      Parameters:
      datatype - a QName object.
      beCPGQueryBuilder - a BeCPGQueryBuilder object.
      criteria - a Map object.
      maxResults - a int.
      Returns:
      a List object.
    • replaceIndexedAssocs

      private void replaceIndexedAssocs(Map<String,String> criteria)
    • createSearchQuery

      public BeCPGQueryBuilder createSearchQuery(org.alfresco.service.namespace.QName datatype, String term, String tag, boolean isRepo, String siteId, String containerId)

      createSearchQuery.

      Specified by:
      createSearchQuery in interface AdvSearchService
      Parameters:
      datatype - a QName object.
      term - a String object.
      tag - a String object.
      isRepo - a boolean.
      siteId - a String object.
      containerId - a String object.
      Returns:
      a BeCPGQueryBuilder object.
    • addCriteriaMap

      private void addCriteriaMap(BeCPGQueryBuilder queryBuilder, Map<String,String> criteriaMap, Set<String> ignoredFields)
    • cleanFTSQuery

      private String cleanFTSQuery(String query)
    • cleanValue

      private String cleanValue(String propValue)
    • escapeValue

      protected String escapeValue(String value)

      escapeValue.

      Parameters:
      value - a String object.
      Returns:
      a String object.
    • getHierarchyQuery

      private String getHierarchyQuery(String propName, String hierarchyName)
    • getHierarchyLevel

      private Integer getHierarchyLevel(org.alfresco.service.cmr.repository.NodeRef hierarchyNodeRef)
    • isSearchFiltered

      private boolean isSearchFiltered(Map<String,String> criteria)
    • isMultiValueProperty

      boolean isMultiValueProperty(String propValue, String modePropValue)
    • processMultiValue

      String processMultiValue(String propName, String propValue, String operand, boolean pseudo)
      Helper method used to construct lucene query fragment for a multi-valued property.
      Parameters:
      propName - property name
      propValue - property value (comma separated)
      operand - logical operand that should be used
      pseudo - is it a pseudo property
      Returns:
      lucene query with multi-valued property
    • isListProperty

      private boolean isListProperty(Map<String,String> criteriaMap, String prop)
    • isCategoryProperty

      private boolean isCategoryProperty(Map<String,String> criteriaMap, String prop)
      Helper method used to determine whether the property is tied to categories.
      Parameters:
      criteriaMap - the list of the properties provided to the form
      prop - property name
      Returns:
      true if it is tied to categories, false otherwise
    • processDefaultCategoryProperty

      private String processDefaultCategoryProperty(String[] cats, boolean useSubCats)
      Helper method used to construct lucene query fragment for a default category property.
      Parameters:
      cats - the selected categories (array of string noderef)
      useSubCats - boolean that indicates if should search also in subcategories
      Returns:
      lucene query with default category property
    • processDefaultTagProperty

      private String processDefaultTagProperty(String[] cats)
      Helper method used to construct lucene query fragment for tag property.
      Parameters:
      cats - the selected categories (array of string NodeRef)
      Returns:
      lucene query with custom tag property