java.lang.Object
com.broadleafcommerce.search.core.service.locale.LocaleHelper

public class LocaleHelper extends Object
Helper for retrieving the locale String value for an indexable type and context.
  • Constructor Details

    • LocaleHelper

      public LocaleHelper(com.broadleafcommerce.translation.mapping.ContextLocaleHelper contextLocaleHelper)
  • Method Details

    • getLocale

      @Nullable public String getLocale(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context, com.broadleafcommerce.search.api.type.IndexableType indexableType)
      Get the String representation of a locale for the context and indexable type.
      Parameters:
      context - The context information surrounding sandboxing/multitenant state
      indexableType - the indexable type in this context
      Returns:
      the locale String
    • getQueryLocale

      @Nullable public String getQueryLocale(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @Nullable Locale locale, @Nullable String defaultLocale)
      Get the String representation of a locale to be used in a query for the context and passed locale.
      Parameters:
      context - The context information surrounding sandboxing/multitenant state
      locale - The locale to extract info from
      defaultLocale - The default locale to return if the passed locale is null or matches the tenant locale
      Returns:
      the locale String
    • useDefaultTenantLocale

      protected boolean useDefaultTenantLocale(Locale contextLocale, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • getContextLocaleHelper

      protected com.broadleafcommerce.translation.mapping.ContextLocaleHelper getContextLocaleHelper()
    • getTranslationProperties

      protected com.broadleafcommerce.search.autoconfigure.SearchCommonTranslationProperties getTranslationProperties()
    • setTranslationProperties

      @Autowired public void setTranslationProperties(com.broadleafcommerce.search.autoconfigure.SearchCommonTranslationProperties translationProperties)
    • getTenantProvider

      protected SearchTenantProvider getTenantProvider()
    • setTenantProvider

      @Autowired public void setTenantProvider(SearchTenantProvider tenantProvider)