org.broadleafcommerce.core.search.service.solr
Class I18nSolrSearchServiceExtensionHandler

java.lang.Object
  extended by org.broadleafcommerce.core.extension.AbstractExtensionHandler
      extended by org.broadleafcommerce.core.search.service.solr.AbstractSolrSearchServiceExtensionHandler
          extended by org.broadleafcommerce.core.search.service.solr.I18nSolrSearchServiceExtensionHandler
All Implemented Interfaces:
ExtensionHandler, SolrSearchServiceExtensionHandler

@Service(value="blI18nSolrSearchServiceExtensionHandler")
public class I18nSolrSearchServiceExtensionHandler
extends AbstractSolrSearchServiceExtensionHandler
implements SolrSearchServiceExtensionHandler

If the field is translatable, then this method prefixes the field with supported locales.

Author:
bpolster

Field Summary
protected  SolrSearchServiceExtensionManager extensionManager
           
protected  SolrHelperService shs
           
protected  boolean translationEnabled
           
protected  TranslationService translationService
           
 
Constructor Summary
I18nSolrSearchServiceExtensionHandler()
           
 
Method Summary
 ExtensionResultStatusType addPropertyValues(Product product, Field field, FieldType fieldType, Map<String,Object> values, String propertyName, List<Locale> locales)
          Given the input field, populates the values array with the fields needed for the passed in field.
 ExtensionResultStatusType buildPrefixListForSearchableFacet(Field field, List<String> prefixList)
          Returns a prefix if required for the passed in facet.
 ExtensionResultStatusType buildPrefixListForSearchableField(Field field, FieldType searchableFieldType, List<String> prefixList)
          Returns a prefix if required for the passed in searchable field.
protected  ExtensionResultStatusType getLocalePrefix(Field field, List<String> prefixList)
          If the field is translatable, take the current locale and add that as a prefix.
 int getPriority()
          Determines the priority of this extension handler.
 void init()
           
 
Methods inherited from class org.broadleafcommerce.core.search.service.solr.AbstractSolrSearchServiceExtensionHandler
attachAdditionalBasicFields, filterSearchFacetRanges, modifySolrQuery
 
Methods inherited from class org.broadleafcommerce.core.extension.AbstractExtensionHandler
isEnabled, setEnabled, setPriority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.broadleafcommerce.core.search.service.solr.SolrSearchServiceExtensionHandler
attachAdditionalBasicFields, filterSearchFacetRanges, modifySolrQuery
 
Methods inherited from interface org.broadleafcommerce.core.extension.ExtensionHandler
isEnabled
 

Field Detail

shs

protected SolrHelperService shs

extensionManager

protected SolrSearchServiceExtensionManager extensionManager

translationService

protected TranslationService translationService

translationEnabled

@Value(value="${i18n.translation.enabled}")
protected boolean translationEnabled
Constructor Detail

I18nSolrSearchServiceExtensionHandler

public I18nSolrSearchServiceExtensionHandler()
Method Detail

init

@PostConstruct
public void init()

buildPrefixListForSearchableFacet

public ExtensionResultStatusType buildPrefixListForSearchableFacet(Field field,
                                                                   List<String> prefixList)
Description copied from interface: SolrSearchServiceExtensionHandler
Returns a prefix if required for the passed in facet.

Specified by:
buildPrefixListForSearchableFacet in interface SolrSearchServiceExtensionHandler
Overrides:
buildPrefixListForSearchableFacet in class AbstractSolrSearchServiceExtensionHandler

buildPrefixListForSearchableField

public ExtensionResultStatusType buildPrefixListForSearchableField(Field field,
                                                                   FieldType searchableFieldType,
                                                                   List<String> prefixList)
Description copied from interface: SolrSearchServiceExtensionHandler
Returns a prefix if required for the passed in searchable field.

Specified by:
buildPrefixListForSearchableField in interface SolrSearchServiceExtensionHandler
Overrides:
buildPrefixListForSearchableField in class AbstractSolrSearchServiceExtensionHandler

addPropertyValues

public ExtensionResultStatusType addPropertyValues(Product product,
                                                   Field field,
                                                   FieldType fieldType,
                                                   Map<String,Object> values,
                                                   String propertyName,
                                                   List<Locale> locales)
                                            throws NoSuchMethodException,
                                                   InvocationTargetException,
                                                   IllegalAccessException
Description copied from interface: SolrSearchServiceExtensionHandler
Given the input field, populates the values array with the fields needed for the passed in field. For example, a handler might create multiple fields for the given passed in field.

Specified by:
addPropertyValues in interface SolrSearchServiceExtensionHandler
Overrides:
addPropertyValues in class AbstractSolrSearchServiceExtensionHandler
Returns:
Throws:
NoSuchMethodException
InvocationTargetException
IllegalAccessException

getLocalePrefix

protected ExtensionResultStatusType getLocalePrefix(Field field,
                                                    List<String> prefixList)
If the field is translatable, take the current locale and add that as a prefix.

Parameters:
context -
field -
Returns:

getPriority

public int getPriority()
Description copied from class: AbstractExtensionHandler
Determines the priority of this extension handler.

Specified by:
getPriority in interface ExtensionHandler
Overrides:
getPriority in class AbstractExtensionHandler
Returns:


Copyright © 2013. All Rights Reserved.