Class SolrFacetServiceImpl
- java.lang.Object
-
- org.springframework.extensions.surf.util.AbstractLifecycleBean
-
- org.alfresco.repo.search.impl.solr.facet.SolrFacetServiceImpl
-
- All Implemented Interfaces:
java.util.EventListener,NodeServicePolicies.BeforeDeleteNodePolicy,NodeServicePolicies.OnCreateNodePolicy,ClassPolicy,Policy,SolrFacetService,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener
public class SolrFacetServiceImpl extends org.springframework.extensions.surf.util.AbstractLifecycleBean implements SolrFacetService, NodeServicePolicies.OnCreateNodePolicy, NodeServicePolicies.BeforeDeleteNodePolicy
Solr Facet Service Implementation.- Since:
- 5.0
- Author:
- Jamal Kaabi-Mofrad
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
-
Nested classes/interfaces inherited from interface org.alfresco.repo.search.impl.solr.facet.SolrFacetService
SolrFacetService.SyntheticPropertyDefinition
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringALFRESCO_SEARCH_ADMINISTRATORS_AUTHORITYThe authority that needs to contain the users allowed to administer the faceted-search config.static java.lang.StringGROUP_ALFRESCO_SEARCH_ADMINISTRATORS_AUTHORITYprotected org.alfresco.service.cmr.repository.NodeServicenodeService-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy
QNAME
-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy
QNAME
-
-
Constructor Summary
Constructors Constructor Description SolrFacetServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)Called before a node is deleted.org.alfresco.service.cmr.repository.NodeRefcreateFacetNode(SolrFacetProperties facetProperties)Creates a new facet.voiddeleteFacet(java.lang.String filterID)Deletes the specified facet permanentlySolrFacetPropertiesgetFacet(java.lang.String filterID)Gets the facet by filter Id.java.util.List<org.alfresco.service.cmr.dictionary.PropertyDefinition>getFacetableProperties()This method offers a convenient access point for getting all Facetable content properties defined in the repository.java.util.List<org.alfresco.service.cmr.dictionary.PropertyDefinition>getFacetableProperties(org.alfresco.service.namespace.QName contentClass)This method offers a convenient access point for getting all Facetable content properties defined on the specified content class (type or aspect) or any of its inherited properties.java.util.List<SolrFacetService.SyntheticPropertyDefinition>getFacetableSyntheticProperties()This method gets all synthetic, facetable properties across all content models in the repository.java.util.List<SolrFacetService.SyntheticPropertyDefinition>getFacetableSyntheticProperties(org.alfresco.service.namespace.QName contentClass)This method gets all synthetic, facetable properties defined on the specified content class (type or aspect) or any of its inherited properties.org.alfresco.service.cmr.repository.NodeRefgetFacetNodeRef(java.lang.String filterID)Gets the facet'sNodeRefby filter Id.java.util.List<java.lang.String>getFacetOrder()Gets the filter IDs in display order.java.util.List<SolrFacetProperties>getFacets()Gets all the available facets.org.alfresco.service.cmr.repository.NodeRefgetFacetsRoot()Gets theNodeRefof thesrft:facetsfolder, if it exists.booleanisSearchAdmin(java.lang.String userName)Indicates whether the specified user is a search-administrator or not.protected voidonBootstrap(org.springframework.context.ApplicationEvent event)voidonCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)Called when a new node has been created.protected voidonShutdown(org.springframework.context.ApplicationEvent event)voidreorderFacets(java.util.List<java.lang.String> facetIds)Reorders existing facets to the provided order.voidsetAuthorityService(AuthorityService authorityService)voidsetBehaviourFilter(BehaviourFilter behaviourFilter)voidsetBootstrapView(java.util.Properties bootstrapView)voidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)voidsetFacetConfig(SolrFacetConfig facetConfig)voidsetFacetNodeRefCache(org.alfresco.repo.cache.SimpleCache<java.lang.String,org.alfresco.service.cmr.repository.NodeRef> facetNodeRefCache)voidsetFacetsRootChildName(java.lang.String facetsRootChildName)voidsetFacetsRootXPath(java.lang.String facetsRootXPath)voidsetImporterBootstrap(ImporterBootstrap importer)voidsetNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)voidsetPolicyComponent(PolicyComponent policyComponent)voidsetRepositoryHelper(Repository repository)voidsetRetryingTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)voidsetSearchService(org.alfresco.service.cmr.search.SearchService searchService)voidsetSingletonCache(org.alfresco.repo.cache.SimpleCache<java.lang.String,java.lang.Object> singletonCache)voidupdateFacet(SolrFacetProperties facetProperties)Updates the existing facet.
-
-
-
Field Detail
-
ALFRESCO_SEARCH_ADMINISTRATORS_AUTHORITY
public static final java.lang.String ALFRESCO_SEARCH_ADMINISTRATORS_AUTHORITY
The authority that needs to contain the users allowed to administer the faceted-search config.- See Also:
- Constant Field Values
-
GROUP_ALFRESCO_SEARCH_ADMINISTRATORS_AUTHORITY
public static final java.lang.String GROUP_ALFRESCO_SEARCH_ADMINISTRATORS_AUTHORITY
- See Also:
- Constant Field Values
-
nodeService
protected org.alfresco.service.cmr.repository.NodeService nodeService
-
-
Method Detail
-
setAuthorityService
public void setAuthorityService(AuthorityService authorityService)
- Parameters:
authorityService- the authorityService to set
-
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
- Parameters:
dictionaryService- the dictionaryService to set
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
- Parameters:
nodeService- the nodeService to set
-
setNamespaceService
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
- Parameters:
namespaceService- the namespaceService to set
-
setSearchService
public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
- Parameters:
searchService- the searchService to set
-
setRetryingTransactionHelper
public void setRetryingTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
- Parameters:
retryingTransactionHelper- the retryingTransactionHelper to set
-
setBehaviourFilter
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
- Parameters:
behaviourFilter- the behaviourFilter to set
-
setPolicyComponent
public void setPolicyComponent(PolicyComponent policyComponent)
- Parameters:
policyComponent- the policyComponent to set
-
setRepositoryHelper
public void setRepositoryHelper(Repository repository)
-
setFacetConfig
public void setFacetConfig(SolrFacetConfig facetConfig)
- Parameters:
facetConfig- the facetConfig to set
-
setFacetsRootXPath
public void setFacetsRootXPath(java.lang.String facetsRootXPath)
- Parameters:
facetsRootXPath- the facetsRootXPath to set
-
setFacetsRootChildName
public void setFacetsRootChildName(java.lang.String facetsRootChildName)
-
setImporterBootstrap
public void setImporterBootstrap(ImporterBootstrap importer)
-
setBootstrapView
public void setBootstrapView(java.util.Properties bootstrapView)
-
setSingletonCache
public void setSingletonCache(org.alfresco.repo.cache.SimpleCache<java.lang.String,java.lang.Object> singletonCache)
- Parameters:
singletonCache- the singletonCache to set
-
setFacetNodeRefCache
public void setFacetNodeRefCache(org.alfresco.repo.cache.SimpleCache<java.lang.String,org.alfresco.service.cmr.repository.NodeRef> facetNodeRefCache)
- Parameters:
facetNodeRefCache- the facetNodeRefCache to set
-
isSearchAdmin
public boolean isSearchAdmin(java.lang.String userName)
Description copied from interface:SolrFacetServiceIndicates whether the specified user is a search-administrator or not.Note: The super/repo admin is considered to be a search-administrator too.
- Specified by:
isSearchAdminin interfaceSolrFacetService- Parameters:
userName- The user name- Returns:
- true if the specified user is a search-administrator, false otherwise
-
getFacets
public java.util.List<SolrFacetProperties> getFacets()
Description copied from interface:SolrFacetServiceGets all the available facets.- Specified by:
getFacetsin interfaceSolrFacetService- Returns:
- List of
SolrFacetPropertiesor an empty list if none exists
-
getFacetOrder
public java.util.List<java.lang.String> getFacetOrder()
Gets the filter IDs in display order. Will not returnnull.
-
getFacet
public SolrFacetProperties getFacet(java.lang.String filterID)
Description copied from interface:SolrFacetServiceGets the facet by filter Id.- Specified by:
getFacetin interfaceSolrFacetService- Parameters:
filterID- the filter Id- Returns:
SolrFacetPropertiesobject or null if there is no facet with the specified Id
-
getFacetNodeRef
public org.alfresco.service.cmr.repository.NodeRef getFacetNodeRef(java.lang.String filterID)
Description copied from interface:SolrFacetServiceGets the facet'sNodeRefby filter Id.- Specified by:
getFacetNodeRefin interfaceSolrFacetService- Parameters:
filterID- the filter Id- Returns:
- facet's
NodeRefor null if there is no facet with the specified Id
-
createFacetNode
public org.alfresco.service.cmr.repository.NodeRef createFacetNode(SolrFacetProperties facetProperties)
Description copied from interface:SolrFacetServiceCreates a new facet.- Specified by:
createFacetNodein interfaceSolrFacetService- Parameters:
facetProperties- the facet's properties- Returns:
- the created facet's
NodeRef
-
updateFacet
public void updateFacet(SolrFacetProperties facetProperties)
Description copied from interface:SolrFacetServiceUpdates the existing facet.- Specified by:
updateFacetin interfaceSolrFacetService- Parameters:
facetProperties- the facet's properties
-
deleteFacet
public void deleteFacet(java.lang.String filterID)
Description copied from interface:SolrFacetServiceDeletes the specified facet permanently- Specified by:
deleteFacetin interfaceSolrFacetService- Parameters:
filterID- the filter Id
-
getFacetsRoot
public org.alfresco.service.cmr.repository.NodeRef getFacetsRoot()
Gets theNodeRefof thesrft:facetsfolder, if it exists.- Returns:
- the
NodeRefif it exists, elsenull.
-
onBootstrap
protected void onBootstrap(org.springframework.context.ApplicationEvent event)
- Specified by:
onBootstrapin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
onShutdown
protected void onShutdown(org.springframework.context.ApplicationEvent event)
- Specified by:
onShutdownin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
onCreateNode
public void onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
Description copied from interface:NodeServicePolicies.OnCreateNodePolicyCalled when a new node has been created.- Specified by:
onCreateNodein interfaceNodeServicePolicies.OnCreateNodePolicy- Parameters:
childAssocRef- the created child association reference
-
beforeDeleteNode
public void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from interface:NodeServicePolicies.BeforeDeleteNodePolicyCalled before a node is deleted.- Specified by:
beforeDeleteNodein interfaceNodeServicePolicies.BeforeDeleteNodePolicy- Parameters:
nodeRef- the node reference
-
reorderFacets
public void reorderFacets(java.util.List<java.lang.String> facetIds)
Description copied from interface:SolrFacetServiceReorders existing facets to the provided order.- Specified by:
reorderFacetsin interfaceSolrFacetService- Parameters:
facetIds- an ordered sequence of filter IDs.
-
getFacetableProperties
public java.util.List<org.alfresco.service.cmr.dictionary.PropertyDefinition> getFacetableProperties()
Description copied from interface:SolrFacetServiceThis method offers a convenient access point for getting all Facetable content properties defined in the repository.- Specified by:
getFacetablePropertiesin interfaceSolrFacetService- Returns:
- a collection of facetable
PropertyDefinitions. - See Also:
Facetable
-
getFacetableProperties
public java.util.List<org.alfresco.service.cmr.dictionary.PropertyDefinition> getFacetableProperties(org.alfresco.service.namespace.QName contentClass)
Description copied from interface:SolrFacetServiceThis method offers a convenient access point for getting all Facetable content properties defined on the specified content class (type or aspect) or any of its inherited properties.- Specified by:
getFacetablePropertiesin interfaceSolrFacetService- Parameters:
contentClass- the QName of an aspect or type, whose facetable properties are sought.- Returns:
- a collection of facetable
PropertyDefinitions. - See Also:
Facetable
-
getFacetableSyntheticProperties
public java.util.List<SolrFacetService.SyntheticPropertyDefinition> getFacetableSyntheticProperties()
Description copied from interface:SolrFacetServiceThis method gets all synthetic, facetable properties across all content models in the repository.- Specified by:
getFacetableSyntheticPropertiesin interfaceSolrFacetService
-
getFacetableSyntheticProperties
public java.util.List<SolrFacetService.SyntheticPropertyDefinition> getFacetableSyntheticProperties(org.alfresco.service.namespace.QName contentClass)
Description copied from interface:SolrFacetServiceThis method gets all synthetic, facetable properties defined on the specified content class (type or aspect) or any of its inherited properties.- Specified by:
getFacetableSyntheticPropertiesin interfaceSolrFacetService- Parameters:
contentClass- the QName of an aspect or type, whose synthetic, facetable properties are sought.
-
-