Class ProductConverter
- java.lang.Object
-
- de.hybris.platform.converters.impl.AbstractConverter<org.springframework.messaging.Message<ProductModel>,Product>
-
- de.hybris.platform.acceleratorservices.dataexport.googlelocal.converter.ProductConverter
-
- All Implemented Interfaces:
Populator<org.springframework.messaging.Message<ProductModel>,Product>,Converter<org.springframework.messaging.Message<ProductModel>,Product>,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean,org.springframework.core.convert.converter.Converter<org.springframework.messaging.Message<ProductModel>,Product>
public class ProductConverter extends AbstractConverter<org.springframework.messaging.Message<ProductModel>,Product>
ConvertsProductModeltoProduct.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceProductConverter.ConditionConstans with product condition.
-
Field Summary
Fields Modifier and Type Field Description static intMAXIMUM_ADDITIONAL_IMAGES
-
Constructor Summary
Constructors Constructor Description ProductConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ProductcreateTarget()protected java.lang.StringgenerateGoogleProductCategory(ProductModel productModel)protected java.lang.StringgenerateProductType(ProductModel productModel)protected java.lang.StringgetAdditionalImages(java.lang.String mediaUrl, ProductModel productModel)protected CategoryServicegetCategoryService()protected CommercePriceServicegetCommercePriceService()protected java.lang.StringgetItemGroupId(ProductModel productModel)All items that are color/material/pattern/size variants of the same product must have the same item group id.protected java.lang.StringgetProductCondition(ProductModel productModel)protected UrlResolver<ProductModel>getProductModelUrlResolver()protected SiteBaseUrlResolutionServicegetSiteBaseUrlResolutionService()voidpopulate(org.springframework.messaging.Message<ProductModel> message, Product product)Override this method to populate the target from the sourcevoidsetCategoryService(CategoryService categoryService)voidsetCommercePriceService(CommercePriceService commercePriceService)voidsetProductModelUrlResolver(UrlResolver<ProductModel> productModelUrlResolver)voidsetSiteBaseUrlResolutionService(SiteBaseUrlResolutionService siteBaseUrlResolutionService)-
Methods inherited from class de.hybris.platform.converters.impl.AbstractConverter
afterPropertiesSet, convert, convert, createFromClass, getMyBeanName, setBeanName, setTargetClass
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.servicelayer.dto.converter.Converter
convertAll, convertAllIgnoreExceptions, getLogger
-
-
-
-
Field Detail
-
MAXIMUM_ADDITIONAL_IMAGES
public static final int MAXIMUM_ADDITIONAL_IMAGES
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProductModelUrlResolver
protected UrlResolver<ProductModel> getProductModelUrlResolver()
-
setProductModelUrlResolver
public void setProductModelUrlResolver(UrlResolver<ProductModel> productModelUrlResolver)
-
getCommercePriceService
protected CommercePriceService getCommercePriceService()
-
setCommercePriceService
public void setCommercePriceService(CommercePriceService commercePriceService)
-
getCategoryService
protected CategoryService getCategoryService()
-
setCategoryService
public void setCategoryService(CategoryService categoryService)
-
getSiteBaseUrlResolutionService
protected SiteBaseUrlResolutionService getSiteBaseUrlResolutionService()
-
setSiteBaseUrlResolutionService
public void setSiteBaseUrlResolutionService(SiteBaseUrlResolutionService siteBaseUrlResolutionService)
-
getItemGroupId
protected java.lang.String getItemGroupId(ProductModel productModel)
All items that are color/material/pattern/size variants of the same product must have the same item group id. If you have a "Parent SKU" that is shared by all variants of a product, you can provide that as the value for 'item group id'.- Parameters:
productModel- the product- Returns:
- groupId
-
generateProductType
protected java.lang.String generateProductType(ProductModel productModel)
-
getProductCondition
protected java.lang.String getProductCondition(ProductModel productModel)
-
getAdditionalImages
protected java.lang.String getAdditionalImages(java.lang.String mediaUrl, ProductModel productModel)
-
generateGoogleProductCategory
protected java.lang.String generateGoogleProductCategory(ProductModel productModel)
-
createTarget
protected Product createTarget()
- Overrides:
createTargetin classAbstractConverter<org.springframework.messaging.Message<ProductModel>,Product>
-
populate
public void populate(org.springframework.messaging.Message<ProductModel> message, Product product)
Description copied from class:AbstractConverterOverride this method to populate the target from the source- Specified by:
populatein interfacePopulator<org.springframework.messaging.Message<ProductModel>,Product>- Specified by:
populatein classAbstractConverter<org.springframework.messaging.Message<ProductModel>,Product>- Parameters:
message- the source instanceproduct- the target instance to fill- See Also:
AbstractConverter.setTargetClass(Class)
-
-