*
*/
public ProductAssociationLinkViewBean buildViewBeanProductAssociationLink(final RequestData requestData, final ProductMarketing productMarketing) throws Exception {
final Localization localization = requestData.getMarketAreaLocalization();
final String localizationCode = localization.getCode();
final ProductAssociationLinkViewBean productAssociationLinkViewBean = new ProductAssociationLinkViewBean();
// TODO : WRONG : CROSS IS SKU not marketing
productAssociationLinkViewBean.setName(productMarketing.getI18nName(localizationCode));
productAssociationLinkViewBean.setDescription(productMarketing.getDescription());
final Asset defaultBackgroundImage = productMarketing.getDefaultBackgroundImage();
if (defaultBackgroundImage != null) {
String backgroundImage = engineSettingService.getProductMarketingImageWebPath(defaultBackgroundImage);
productAssociationLinkViewBean.setBackgroundImage(backgroundImage);
} else {
productAssociationLinkViewBean.setBackgroundImage("");
}
final Asset defaultPackshotImage = productMarketing.getDefaultPackshotImage(ImageSize.HD.name());
if (defaultPackshotImage != null) {
String carouselImage = engineSettingService.getProductMarketingImageWebPath(defaultPackshotImage);
productAssociationLinkViewBean.setCrossLinkImage(carouselImage);
} else {
productAssociationLinkViewBean.setCrossLinkImage("");
}
final Asset defaultIconImage = productMarketing.getDefaultThumbnailImage();
if (defaultIconImage != null) {
String iconImage = engineSettingService.getProductMarketingImageWebPath(defaultIconImage);
productAssociationLinkViewBean.setIconImage(iconImage);
} else {
productAssociationLinkViewBean.setIconImage("");
}
return productAssociationLinkViewBean;
}