Class SearchSettingsUtils

java.lang.Object
com.broadleafcommerce.search.core.utils.SearchSettingsUtils

public class SearchSettingsUtils extends Object
Utilities to help when working or resolving SearchSettings and related entities.
Author:
Nathan Moore (nathandmoore)
  • Constructor Summary

    Constructors
    Constructor
    Description
    SearchSettingsUtils(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils, SearchSettingsService<com.broadleafcommerce.search.api.domain.SearchSettings> searchSettingsService, com.broadleafcommerce.data.tracking.core.web.ContextRequestHydrator hydrator)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.broadleafcommerce.data.tracking.core.context.ContextInfo
    buildSearchSettingsBasedContextInfo(@NonNull com.broadleafcommerce.search.api.domain.SearchSettings searchSettings, com.broadleafcommerce.data.tracking.core.context.ContextInfo originalContext)
    Establish a new ContextInfo based on the resolved SearchSettings.
    Optional<com.broadleafcommerce.search.api.domain.SearchSettings>
    determineSearchSettingsForContext(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Determines the correct SearchSettings for the context, whether Admin or Storefront.
    protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils
     
    protected com.broadleafcommerce.data.tracking.core.web.ContextRequestHydrator
     
    protected SearchSettingsService<com.broadleafcommerce.search.api.domain.SearchSettings>
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SearchSettingsUtils

      public SearchSettingsUtils(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils, SearchSettingsService<com.broadleafcommerce.search.api.domain.SearchSettings> searchSettingsService, com.broadleafcommerce.data.tracking.core.web.ContextRequestHydrator hydrator)
  • Method Details

    • buildSearchSettingsBasedContextInfo

      public com.broadleafcommerce.data.tracking.core.context.ContextInfo buildSearchSettingsBasedContextInfo(@NonNull @NonNull com.broadleafcommerce.search.api.domain.SearchSettings searchSettings, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo originalContext)
      Establish a new ContextInfo based on the resolved SearchSettings. This is useful to correctly filter related facets in the correct Catalog when searching for Products since the Product Catalog passed on the request is different from the Search Group Catalog containing the Search Settings entities.
      Parameters:
      searchSettings - The SearchSettings resolved for the context
      originalContext - The original context info to base some information on for the new one.
      Returns:
      A new ContextInfo for reading search settings entities.
    • determineSearchSettingsForContext

      public Optional<com.broadleafcommerce.search.api.domain.SearchSettings> determineSearchSettingsForContext(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Determines the correct SearchSettings for the context, whether Admin or Storefront.
      Parameters:
      contextInfo - Additional context information regarding the current API request.
      Returns:
      The correct SearchSettings for the context, whether Admin or Storefront.
    • getAuthenticationUtils

      protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils getAuthenticationUtils()
    • getSearchSettingsService

      protected SearchSettingsService<com.broadleafcommerce.search.api.domain.SearchSettings> getSearchSettingsService()
    • getHydrator

      protected com.broadleafcommerce.data.tracking.core.web.ContextRequestHydrator getHydrator()