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
  • Field Details

    • 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:
    • GROUP_ALFRESCO_SEARCH_ADMINISTRATORS_AUTHORITY

      public static final String GROUP_ALFRESCO_SEARCH_ADMINISTRATORS_AUTHORITY
      See Also:
    • nodeService

      protected NodeService nodeService
  • Constructor Details

    • SolrFacetServiceImpl

      public SolrFacetServiceImpl()
  • Method Details

    • 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: SolrFacetService
      Indicates 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:
      isSearchAdmin in interface SolrFacetService
      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: SolrFacetService
      Gets all the available facets.
      Specified by:
      getFacets in interface SolrFacetService
      Returns:
      List of SolrFacetProperties or an empty list if none exists
    • getFacetOrder

      public List<String> getFacetOrder()
      Gets the filter IDs in display order. Will not return null.
    • getFacet

      public SolrFacetProperties getFacet(String filterID)
      Description copied from interface: SolrFacetService
      Gets the facet by filter Id.
      Specified by:
      getFacet in interface SolrFacetService
      Parameters:
      filterID - the filter Id
      Returns:
      SolrFacetProperties object or null if there is no facet with the specified Id
    • getFacetNodeRef

      public NodeRef getFacetNodeRef(String filterID)
      Description copied from interface: SolrFacetService
      Gets the facet's NodeRef by filter Id.
      Specified by:
      getFacetNodeRef in interface SolrFacetService
      Parameters:
      filterID - the filter Id
      Returns:
      facet's NodeRef or null if there is no facet with the specified Id
    • createFacetNode

      public NodeRef createFacetNode(SolrFacetProperties facetProperties)
      Description copied from interface: SolrFacetService
      Creates a new facet.
      Specified by:
      createFacetNode in interface SolrFacetService
      Parameters:
      facetProperties - the facet's properties
      Returns:
      the created facet's NodeRef
    • updateFacet

      public void updateFacet(SolrFacetProperties facetProperties)
      Description copied from interface: SolrFacetService
      Updates the existing facet.
      Specified by:
      updateFacet in interface SolrFacetService
      Parameters:
      facetProperties - the facet's properties
    • deleteFacet

      public void deleteFacet(String filterID)
      Description copied from interface: SolrFacetService
      Deletes the specified facet permanently
      Specified by:
      deleteFacet in interface SolrFacetService
      Parameters:
      filterID - the filter Id
    • getFacetsRoot

      public NodeRef getFacetsRoot()
      Gets the NodeRef of the srft:facets folder, if it exists.
      Returns:
      the NodeRef if it exists, else null.
    • onBootstrap

      protected void onBootstrap(org.springframework.context.ApplicationEvent event)
      Specified by:
      onBootstrap in class org.springframework.extensions.surf.util.AbstractLifecycleBean
    • onShutdown

      protected void onShutdown(org.springframework.context.ApplicationEvent event)
      Specified by:
      onShutdown in class org.springframework.extensions.surf.util.AbstractLifecycleBean
    • onCreateNode

      public void onCreateNode(ChildAssociationRef childAssocRef)
      Description copied from interface: NodeServicePolicies.OnCreateNodePolicy
      Called when a new node has been created.
      Specified by:
      onCreateNode in interface NodeServicePolicies.OnCreateNodePolicy
      Parameters:
      childAssocRef - the created child association reference
    • beforeDeleteNode

      public void beforeDeleteNode(NodeRef nodeRef)
      Description copied from interface: NodeServicePolicies.BeforeDeleteNodePolicy
      Called before a node is deleted.
      Specified by:
      beforeDeleteNode in interface NodeServicePolicies.BeforeDeleteNodePolicy
      Parameters:
      nodeRef - the node reference
    • reorderFacets

      public void reorderFacets(List<String> facetIds)
      Description copied from interface: SolrFacetService
      Reorders existing facets to the provided order.
      Specified by:
      reorderFacets in interface SolrFacetService
      Parameters:
      facetIds - an ordered sequence of filter IDs.
    • getFacetableProperties

      public List<PropertyDefinition> getFacetableProperties()
      Description copied from interface: SolrFacetService
      This method offers a convenient access point for getting all Facetable content properties defined in the repository.
      Specified by:
      getFacetableProperties in interface SolrFacetService
      Returns:
      a collection of facetable PropertyDefinitions.
      See Also:
    • getFacetableProperties

      public List<PropertyDefinition> getFacetableProperties(QName contentClass)
      Description copied from interface: SolrFacetService
      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.
      Specified by:
      getFacetableProperties in interface SolrFacetService
      Parameters:
      contentClass - the QName of an aspect or type, whose facetable properties are sought.
      Returns:
      a collection of facetable PropertyDefinitions.
      See Also:
    • getFacetableSyntheticProperties

      public List<SolrFacetService.SyntheticPropertyDefinition> getFacetableSyntheticProperties()
      Description copied from interface: SolrFacetService
      This method gets all synthetic, facetable properties across all content models in the repository.
      Specified by:
      getFacetableSyntheticProperties in interface SolrFacetService
    • getFacetableSyntheticProperties

      public List<SolrFacetService.SyntheticPropertyDefinition> getFacetableSyntheticProperties(QName contentClass)
      Description copied from interface: SolrFacetService
      This method gets all synthetic, facetable properties defined on the specified content class (type or aspect) or any of its inherited properties.
      Specified by:
      getFacetableSyntheticProperties in interface SolrFacetService
      Parameters:
      contentClass - the QName of an aspect or type, whose synthetic, facetable properties are sought.