Interface CharacteristicsTranslationService
- All Known Implementing Classes:
DefaultCharacteristicsTranslationService
public interface CharacteristicsTranslationService
Service interface responsible for applying translations to product characteristics. This includes
applying translations defined at both the product level and the characteristic level.
- Since:
- Catalog Service 2.3.0, Release Train 2.3.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidapplyBaseCharacteristicsTranslations(Product product, ResolvedProductReferences foundItems, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Handle finding and applying translations of aCharacteristicValuedefined on the baseCharacteristicentityvoidapplyConsolidatedCharacteristicsTranslationsToProduct(Product product, ResolvedProductReferences foundItems, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Handle finding and applying translations for anyProductCharacteristic.getValue()where theProductCharacteristicValue.getSourceCharacteristicValueId()is present.voidapplyDirectProductCharacteristicsTranslations(Product product, ResolvedProductReferences foundItems, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Handle finding and applying translations for anyProductCharacteristic.getValue()where theProductCharacteristicValue.getSourceCharacteristicValueId()is present.voidfindTranslationsForProductsCharacteristics(ProductReferences references, ResolvedProductReferences resolved, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds thetranslationsfor theproducts characteristicvalues andcharacteristicvalues translations.
-
Method Details
-
applyConsolidatedCharacteristicsTranslationsToProduct
void applyConsolidatedCharacteristicsTranslationsToProduct(Product product, ResolvedProductReferences foundItems, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Handle finding and applying translations for anyProductCharacteristic.getValue()where theProductCharacteristicValue.getSourceCharacteristicValueId()is present. If there is a translation directly defined under theProductfor itsProductCharacteristicelements, then they will be used with higher priority. As a fallback, if there is aCharacteristicValuetranslation defined on the baseCharacteristicentity, it will be applied.- Parameters:
product- The product instance with its characteristics already hydratedfoundItems- the pre-fetched data that should be used for hydration. At a minimum, this must include:ResolvedProductReferences.getCharacteristicValueTranslationsByCharacteristicId()(for all the product characteristics),ResolvedProductReferences.getProductCharacteristicTranslationsByProductId()(for all the product's product characteristics)contextInfo- context surrounding sandboxing and multitenant state
-
applyDirectProductCharacteristicsTranslations
void applyDirectProductCharacteristicsTranslations(Product product, ResolvedProductReferences foundItems, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Handle finding and applying translations for anyProductCharacteristic.getValue()where theProductCharacteristicValue.getSourceCharacteristicValueId()is present.- Parameters:
product- The product instance with its characteristics already hydratedfoundItems- the pre-fetched data that should be used for hydration. At a minimum, this must include:ResolvedProductReferences.getProductCharacteristicTranslationsByProductId()(for all the product's product characteristics)contextInfo- context surrounding sandboxing and multitenant state
-
applyBaseCharacteristicsTranslations
void applyBaseCharacteristicsTranslations(Product product, ResolvedProductReferences foundItems, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Handle finding and applying translations of aCharacteristicValuedefined on the baseCharacteristicentity- Parameters:
product- The product instance with its characteristics already hydratedfoundItems- the pre-fetched data that should be used for hydration. At a minimum, this must include:ResolvedProductReferences.getCharacteristicValueTranslationsByCharacteristicId()(for all the products characteristics)contextInfo- context surrounding sandboxing and multitenant state
-
findTranslationsForProductsCharacteristics
void findTranslationsForProductsCharacteristics(ProductReferences references, ResolvedProductReferences resolved, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds thetranslationsfor theproducts characteristicvalues andcharacteristicvalues translations. This method populatesResolvedProductReferences.getCharacteristicValueTranslationsByCharacteristicId()andResolvedProductReferences.getProductCharacteristicTranslationsByProductId()- Parameters:
references- the product references containing theProductReferences.getProductIdsToFindProductCharacteristicsFor()productIds to find characteristics forresolved- the resolved product references to populate, also need to containResolvedProductReferences.getProductCharacteristicsByProductId()contextInfo- context information surrounding sandboxing and multitenant state
-