Class SolrFacetServiceImpl
- java.lang.Object
-
- org.springframework.extensions.surf.util.AbstractLifecycleBean
-
- org.alfresco.repo.search.impl.solr.facet.SolrFacetServiceImpl
-
- All Implemented Interfaces:
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 StringALFRESCO_SEARCH_ADMINISTRATORS_AUTHORITYThe authority that needs to contain the users allowed to administer the faceted-search config.static StringGROUP_ALFRESCO_SEARCH_ADMINISTRATORS_AUTHORITYprotected 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(NodeRef nodeRef)Called before a node is deleted.NodeRefcreateFacetNode(SolrFacetProperties facetProperties)Creates a new facet.voiddeleteFacet(String filterID)Deletes the specified facet permanentlySolrFacetPropertiesgetFacet(String filterID)Gets the facet by filter Id.List<PropertyDefinition>getFacetableProperties()This method offers a convenient access point for getting all Facetable content properties defined in the repository.List<PropertyDefinition>getFacetableProperties(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.List<SolrFacetService.SyntheticPropertyDefinition>getFacetableSyntheticProperties()This method gets all synthetic, facetable properties across all content models in the repository.List<SolrFacetService.SyntheticPropertyDefinition>getFacetableSyntheticProperties(QName contentClass)This method gets all synthetic, facetable properties defined on the specified content class (type or aspect) or any of its inherited properties.NodeRefgetFacetNodeRef(String filterID)Gets the facet'sNodeRefby filter Id.List<String>getFacetOrder()Gets the filter IDs in display order.List<SolrFacetProperties>getFacets()Gets all the available facets.NodeRefgetFacetsRoot()Gets theNodeRefof thesrft:facetsfolder, if it exists.booleanisSearchAdmin(String userName)Indicates whether the specified user is a search-administrator or not.protected voidonBootstrap(org.springframework.context.ApplicationEvent event)voidonCreateNode(ChildAssociationRef childAssocRef)Called when a new node has been created.protected voidonShutdown(org.springframework.context.ApplicationEvent event)voidreorderFacets(List<String> facetIds)Reorders existing facets to the provided order.voidsetAuthorityService(AuthorityService authorityService)voidsetBehaviourFilter(BehaviourFilter behaviourFilter)voidsetBootstrapView(Properties bootstrapView)voidsetDictionaryService(DictionaryService dictionaryService)voidsetFacetConfig(SolrFacetConfig facetConfig)voidsetFacetNodeRefCache(SimpleCache<String,NodeRef> facetNodeRefCache)voidsetFacetsRootChildName(String facetsRootChildName)voidsetFacetsRootXPath(String facetsRootXPath)voidsetImporterBootstrap(ImporterBootstrap importer)voidsetNamespaceService(NamespaceService namespaceService)voidsetNodeService(NodeService nodeService)voidsetPolicyComponent(PolicyComponent policyComponent)voidsetRepositoryHelper(Repository repository)voidsetRetryingTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)voidsetSearchService(SearchService searchService)voidsetSingletonCache(SimpleCache<String,Object> singletonCache)voidupdateFacet(SolrFacetProperties facetProperties)Updates the existing facet.
-
-
-
Field Detail
-
ALFRESCO_SEARCH_ADMINISTRATORS_AUTHORITY
public static final 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 String GROUP_ALFRESCO_SEARCH_ADMINISTRATORS_AUTHORITY
- See Also:
- Constant Field Values
-
nodeService
protected NodeService nodeService
-
-
Method Detail
-
setAuthorityService
public void setAuthorityService(AuthorityService authorityService)
- Parameters:
authorityService- the authorityService to set
-
setDictionaryService
public void setDictionaryService(DictionaryService dictionaryService)
- Parameters:
dictionaryService- the dictionaryService to set
-
setNodeService
public void setNodeService(NodeService nodeService)
- Parameters:
nodeService- the nodeService to set
-
setNamespaceService
public void setNamespaceService(NamespaceService namespaceService)
- Parameters:
namespaceService- the namespaceService to set
-
setSearchService
public void setSearchService(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(String facetsRootXPath)
- Parameters:
facetsRootXPath- the facetsRootXPath to set
-
setFacetsRootChildName
public void setFacetsRootChildName(String facetsRootChildName)
-
setImporterBootstrap
public void setImporterBootstrap(ImporterBootstrap importer)
-
setBootstrapView
public void setBootstrapView(Properties bootstrapView)
-
setSingletonCache
public void setSingletonCache(SimpleCache<String,Object> singletonCache)
- Parameters:
singletonCache- the singletonCache to set
-
setFacetNodeRefCache
public void setFacetNodeRefCache(SimpleCache<String,NodeRef> facetNodeRefCache)
- Parameters:
facetNodeRefCache- the facetNodeRefCache to set
-
isSearchAdmin
public boolean isSearchAdmin(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 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 List<String> getFacetOrder()
Gets the filter IDs in display order. Will not returnnull.
-
getFacet
public SolrFacetProperties getFacet(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 NodeRef getFacetNodeRef(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 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(String filterID)
Description copied from interface:SolrFacetServiceDeletes the specified facet permanently- Specified by:
deleteFacetin interfaceSolrFacetService- Parameters:
filterID- the filter Id
-
getFacetsRoot
public 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(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(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(List<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 List<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 List<PropertyDefinition> getFacetableProperties(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 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 List<SolrFacetService.SyntheticPropertyDefinition> getFacetableSyntheticProperties(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.
-
-