Class I18nSolrIndexServiceExtensionHandler
java.lang.Object
org.broadleafcommerce.common.extension.AbstractExtensionHandler
org.broadleafcommerce.core.search.service.solr.index.AbstractSolrIndexServiceExtensionHandler
org.broadleafcommerce.core.search.service.solr.index.I18nSolrIndexServiceExtensionHandler
- All Implemented Interfaces:
org.broadleafcommerce.common.extension.ExtensionHandler,SolrIndexServiceExtensionHandler
@Service("blI18nSolrIndexServiceExtensionHandler")
public class I18nSolrIndexServiceExtensionHandler
extends AbstractSolrIndexServiceExtensionHandler
implements SolrIndexServiceExtensionHandler
If the field is translatable, then this method prefixes the field with supported locales.
- Author:
- bpolster
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SolrIndexServiceExtensionManagerprotected org.broadleafcommerce.common.locale.service.LocaleServiceprotected SolrHelperServiceprotected org.broadleafcommerce.common.i18n.service.TranslationServiceFields inherited from class org.broadleafcommerce.common.extension.AbstractExtensionHandler
enabled, priority -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddEntitiesToTranslationCache(List<String> entityIds, org.broadleafcommerce.common.i18n.domain.TranslatedEntity translatedEntity) org.broadleafcommerce.common.extension.ExtensionResultStatusTypeaddPropertyValues(Indexable indexable, Field field, FieldType fieldType, Map<String, Object> values, String propertyName, List<org.broadleafcommerce.common.locale.domain.Locale> locales) Given the input field, populates the values array with the fields needed for the passed in field.org.broadleafcommerce.common.extension.ExtensionResultStatusTypeendBatchEvent(List<? extends Indexable> indexables) Perform actions to end a batch event, such as closing any Contexts that have been previously created.protected org.broadleafcommerce.common.extension.ExtensionResultStatusTypegetLocalePrefix(Field field, List<String> prefixList) If the field is translatable, take the current locale and add that as a prefix.intprotected booleanvoidinit()org.broadleafcommerce.common.extension.ExtensionResultStatusTypestartBatchEvent(List<? extends Indexable> indexables) Perform actions at the start of a batch to improve performance of Solr search for the list of batch products.Methods inherited from class org.broadleafcommerce.core.search.service.solr.index.AbstractSolrIndexServiceExtensionHandler
attachAdditionalBasicFields, attachAdditionalDocumentFields, attachChildDocuments, getCategoryId, getIndexableId, modifyBuiltDocuments, populateDocumentForIndexFieldMethods inherited from class org.broadleafcommerce.common.extension.AbstractExtensionHandler
isEnabled, setEnabled, setPriorityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.broadleafcommerce.common.extension.ExtensionHandler
isEnabledMethods inherited from interface org.broadleafcommerce.core.search.service.solr.index.SolrIndexServiceExtensionHandler
attachAdditionalBasicFields, attachAdditionalDocumentFields, attachChildDocuments, getCategoryId, getIndexableId, modifyBuiltDocuments, populateDocumentForIndexField
-
Field Details
-
shs
-
extensionManager
-
translationService
protected org.broadleafcommerce.common.i18n.service.TranslationService translationService -
localeService
protected org.broadleafcommerce.common.locale.service.LocaleService localeService
-
-
Constructor Details
-
I18nSolrIndexServiceExtensionHandler
public I18nSolrIndexServiceExtensionHandler()
-
-
Method Details
-
getTranslationEnabled
protected boolean getTranslationEnabled() -
init
@PostConstruct public void init() -
addPropertyValues
public org.broadleafcommerce.common.extension.ExtensionResultStatusType addPropertyValues(Indexable indexable, Field field, FieldType fieldType, Map<String, Object> values, String propertyName, List<org.broadleafcommerce.common.locale.domain.Locale> locales) throws NoSuchMethodException, InvocationTargetException, IllegalAccessExceptionDescription copied from interface:SolrIndexServiceExtensionHandlerGiven 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:
addPropertyValuesin interfaceSolrIndexServiceExtensionHandler- Overrides:
addPropertyValuesin classAbstractSolrIndexServiceExtensionHandler- Returns:
- Throws:
NoSuchMethodExceptionInvocationTargetExceptionIllegalAccessException
-
getLocalePrefix
protected org.broadleafcommerce.common.extension.ExtensionResultStatusType getLocalePrefix(Field field, List<String> prefixList) If the field is translatable, take the current locale and add that as a prefix.- Parameters:
field-prefixList-- Returns:
-
startBatchEvent
public org.broadleafcommerce.common.extension.ExtensionResultStatusType startBatchEvent(List<? extends Indexable> indexables) Description copied from interface:SolrIndexServiceExtensionHandlerPerform actions at the start of a batch to improve performance of Solr search for the list of batch products. For example we want to get, in bulk, the SkuPriceData for each product and save these in memory by default.- Specified by:
startBatchEventin interfaceSolrIndexServiceExtensionHandler- Overrides:
startBatchEventin classAbstractSolrIndexServiceExtensionHandler- Returns:
-
addEntitiesToTranslationCache
-
endBatchEvent
public org.broadleafcommerce.common.extension.ExtensionResultStatusType endBatchEvent(List<? extends Indexable> indexables) Description copied from interface:SolrIndexServiceExtensionHandlerPerform actions to end a batch event, such as closing any Contexts that have been previously created.- Specified by:
endBatchEventin interfaceSolrIndexServiceExtensionHandler- Overrides:
endBatchEventin classAbstractSolrIndexServiceExtensionHandler- Returns:
-
getPriority
public int getPriority()- Specified by:
getPriorityin interfaceorg.broadleafcommerce.common.extension.ExtensionHandler- Overrides:
getPriorityin classorg.broadleafcommerce.common.extension.AbstractExtensionHandler
-