public SearchStoreItemViewBean buildViewBeanSearchStoreItem(final RequestData requestData, final StoreSolr storeSolr) throws Exception {
final String storeCode = storeSolr.getCode();
final Store store = retailerService.getStoreByCode(storeCode);
final SearchStoreItemViewBean searchItemViewBean = new SearchStoreItemViewBean();
searchItemViewBean.setName(storeSolr.getName());
searchItemViewBean.setCode(storeCode);
searchItemViewBean.setDetailsUrl(urlService.generateUrl(FoUrls.STORE_DETAILS, requestData, store));
final Asset defaultBackgroundImage = store.getDefaultBackgroundImage();
if (defaultBackgroundImage != null) {
final String backgroundImage = engineSettingService.getRetailerOrStoreImageWebPath(defaultBackgroundImage);
searchItemViewBean.setBackgroundImage(backgroundImage);
} else {
searchItemViewBean.setBackgroundImage("");
}
final Asset defaultIconImage = store.getDefaultThumbnailImage();
if (defaultIconImage != null) {
final String iconImage = engineSettingService.getRetailerOrStoreImageWebPath(defaultIconImage);
searchItemViewBean.setIconImage(iconImage);
} else {
searchItemViewBean.setIconImage("");
}
final Asset carouselImage = store.getDefaultPackshotImage(ImageSize.SMALL.name());
if (carouselImage != null) {
final String iconImage = engineSettingService.getRetailerOrStoreImageWebPath(carouselImage);
searchItemViewBean.setCarouselImage(iconImage);
} else {
searchItemViewBean.setIconImage("");
}
return searchItemViewBean;
}