Package fr.becpg.repo.search.impl
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 Summary
FieldsModifier and TypeFieldDescriptionprivate AdvSearchPlugin[]private BeCPGCacheServicestatic final StringConstantCONFIG_PATH="/app:company_home/cm:System/cm:Config/c"{trunked}private org.alfresco.service.cmr.repository.ContentServiceprivate EntityDictionaryServiceprivate static final org.apache.commons.logging.Logprivate org.alfresco.service.namespace.NamespaceServiceprivate org.alfresco.service.cmr.repository.NodeServiceprivate org.alfresco.repo.model.Repositorystatic final StringConstantSEARCH_CONFIG_CACHE_KEY="SEARCH_CONFIG"Fields inherited from interface fr.becpg.repo.search.AdvSearchService
IGNORED_FIELDS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddCriteriaMap(BeCPGQueryBuilder queryBuilder, Map<String, String> criteriaMap, Set<String> ignoredFields) private StringcleanFTSQuery(String query) private StringcleanValue(String propValue) createSearchQuery(org.alfresco.service.namespace.QName datatype, String term, String tag, boolean isRepo, String siteId, String containerId) createSearchQuery.protected StringescapeValue(String value) escapeValue.private IntegergetHierarchyLevel(org.alfresco.service.cmr.repository.NodeRef hierarchyNodeRef) private StringgetHierarchyQuery(String propName, String hierarchyName) getSearchConfig.private booleanisCategoryProperty(Map<String, String> criteriaMap, String prop) Helper method used to determine whether the property is tied to categories.private booleanisListProperty(Map<String, String> criteriaMap, String prop) (package private) booleanisMultiValueProperty(String propValue, String modePropValue) private booleanisSearchFiltered(Map<String, String> criteria) private StringprocessDefaultCategoryProperty(String[] cats, boolean useSubCats) Helper method used to construct lucene query fragment for a default category property.private StringprocessDefaultTagProperty(String[] cats) Helper method used to construct lucene query fragment for tag property.(package private) StringprocessMultiValue(String propName, String propValue, String operand, boolean pseudo) Helper method used to construct lucene query fragment for a multi-valued property.List<org.alfresco.service.cmr.repository.NodeRef>queryAdvSearch(org.alfresco.service.namespace.QName datatype, BeCPGQueryBuilder beCPGQueryBuilder, Map<String, String> criteria, int maxResults) queryAdvSearch.private voidreplaceIndexedAssocs(Map<String, String> criteria)
-
Field Details
-
logger
private static final org.apache.commons.logging.Log logger -
namespaceService
@Autowired private org.alfresco.service.namespace.NamespaceService namespaceService -
advSearchPlugins
-
nodeService
@Autowired private org.alfresco.service.cmr.repository.NodeService nodeService -
entityDictionaryService
-
beCPGCacheService
-
contentService
@Autowired private org.alfresco.service.cmr.repository.ContentService contentService -
repository
@Autowired private org.alfresco.repo.model.Repository repository -
CONFIG_PATH
ConstantCONFIG_PATH="/app:company_home/cm:System/cm:Config/c"{trunked}- See Also:
-
SEARCH_CONFIG_CACHE_KEY
ConstantSEARCH_CONFIG_CACHE_KEY="SEARCH_CONFIG"- See Also:
-
-
Constructor Details
-
AdvSearchServiceImpl
public AdvSearchServiceImpl()
-
-
Method Details
-
getSearchConfig
getSearchConfig.
getSearchConfig.
- Specified by:
getSearchConfigin interfaceAdvSearchService- Returns:
- a
SearchConfigobject.
-
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:
queryAdvSearchin interfaceAdvSearchService- Parameters:
datatype- aQNameobject.beCPGQueryBuilder- aBeCPGQueryBuilderobject.criteria- aMapobject.maxResults- a int.- Returns:
- a
Listobject.
-
replaceIndexedAssocs
-
createSearchQuery
public BeCPGQueryBuilder createSearchQuery(org.alfresco.service.namespace.QName datatype, String term, String tag, boolean isRepo, String siteId, String containerId) createSearchQuery.
- Specified by:
createSearchQueryin interfaceAdvSearchService- Parameters:
datatype- aQNameobject.term- aStringobject.tag- aStringobject.isRepo- a boolean.siteId- aStringobject.containerId- aStringobject.- Returns:
- a
BeCPGQueryBuilderobject.
-
addCriteriaMap
-
cleanFTSQuery
-
cleanValue
-
escapeValue
escapeValue.
-
getHierarchyQuery
-
getHierarchyLevel
-
isSearchFiltered
-
isMultiValueProperty
-
processMultiValue
Helper method used to construct lucene query fragment for a multi-valued property.- Parameters:
propName- property namepropValue- property value (comma separated)operand- logical operand that should be usedpseudo- is it a pseudo property- Returns:
- lucene query with multi-valued property
-
isListProperty
-
isCategoryProperty
Helper method used to determine whether the property is tied to categories.- Parameters:
criteriaMap- the list of the properties provided to the formprop- property name- Returns:
- true if it is tied to categories, false otherwise
-
processDefaultCategoryProperty
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
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
-