Class ProductMetadataPopulator
- java.lang.Object
-
- com.hybris.merchandising.converters.populators.ProductMetadataPopulator
-
- All Implemented Interfaces:
Populator<ProductIndexContainer,Product>
public class ProductMetadataPopulator extends java.lang.Object implements Populator<ProductIndexContainer,Product>
PopulatesProductMetadataPopulatorfromProductIndexContainerwhich encapsulates the information regarding the indexed product details
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringDESCRIPTION_KEYprotected static java.lang.StringNAME_KEYprotected static java.lang.StringSUMMARY_KEY
-
Constructor Summary
Constructors Constructor Description ProductMetadataPopulator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ProductMetadatabuildMetaData(ProductIndexContainer source, LanguageModel language)buildMetaData is a method for building anProductMetadataobject from the source object.protected java.lang.StringextractFieldValue(ProductIndexContainer source, LanguageModel language, java.lang.String fieldName)Helper method to extract the merchandising properties based on given languageprotected java.lang.StringextractLanguage(java.lang.String translatedField)voidpopulate(ProductIndexContainer source, Product target)Populate the target instance with values from the source instance.protected java.lang.StringsanitiseField(java.lang.String field)Sanitise field is a method for URL encoding a field which may contain HTML characters.
-
-
-
Field Detail
-
NAME_KEY
protected static final java.lang.String NAME_KEY
- See Also:
- Constant Field Values
-
DESCRIPTION_KEY
protected static final java.lang.String DESCRIPTION_KEY
- See Also:
- Constant Field Values
-
SUMMARY_KEY
protected static final java.lang.String SUMMARY_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
populate
public void populate(ProductIndexContainer source, Product target) throws ConversionException
Populate the target instance with values from the source instance.- Specified by:
populatein interfacePopulator<ProductIndexContainer,Product>- Parameters:
source- the source objecttarget- the target to fill- Throws:
ConversionException- if an error occurs
-
extractFieldValue
protected java.lang.String extractFieldValue(ProductIndexContainer source, LanguageModel language, java.lang.String fieldName)
Helper method to extract the merchandising properties based on given language- Parameters:
source-ProductIndexContainerrepresenting the Solr index operation.language- theLanguageModelwe wish to retrieve products for.fieldName- the name of the field we wish to retrieve.- Returns:
-
buildMetaData
protected ProductMetadata buildMetaData(ProductIndexContainer source, LanguageModel language)
buildMetaData is a method for building anProductMetadataobject from the source object.- Parameters:
source- theProductIndexContainerrepresenting the Solr index operation.language- theLanguageModelwe wish to retrieve these fields for.- Returns:
- the
ProductMetadataobject representing the metadata.
-
sanitiseField
protected java.lang.String sanitiseField(java.lang.String field)
Sanitise field is a method for URL encoding a field which may contain HTML characters.- Parameters:
field- the field to encode.- Returns:
- the sanitised version.
-
extractLanguage
protected java.lang.String extractLanguage(java.lang.String translatedField)
-
-