}
Long defaultSiteCurrencyClassId = contentBean.getContentSessionBean().getSiteDomain().getSite().getSiteCurrencyClassDefault().getSiteCurrencyClassId();
ItemInfo itemInfo = new ItemInfo();
ItemLanguage masterLanguageDefault = master.getItemLanguage();
itemInfo.setItemShortDesc(masterLanguageDefault.getItemShortDesc());
itemInfo.setItemDesc(masterLanguageDefault.getItemDesc());
if (Format.isNullOrEmpty(masterLanguageDefault.getPageTitle())) {
itemInfo.setPageTitle(masterLanguageDefault.getItemShortDesc());
}
else {
itemInfo.setPageTitle(masterLanguageDefault.getPageTitle());
}
if (Format.isNullOrEmpty(masterLanguageDefault.getMetaKeywords())) {
itemInfo.setMetaKeywords(masterLanguageDefault.getItemShortDesc());
}
else {
itemInfo.setMetaKeywords(masterLanguageDefault.getMetaKeywords());
}
if (Format.isNullOrEmpty(masterLanguageDefault.getMetaDescription())) {
itemInfo.setMetaDescription(masterLanguageDefault.getItemShortDesc());
}
else {
itemInfo.setMetaDescription(masterLanguageDefault.getMetaDescription());
}
itemInfo.setItemDefaultImageUrl(null);
if (masterLanguageDefault.getImage() != null) {
String imageUrl = imageUrlPrefix + "?type=I&imageId=" + masterLanguageDefault.getImage().getImageId();
itemInfo.setItemDefaultImageUrl(imageUrl);
}
Vector<String> itemImages = new Vector<String>();
Iterator<?> iterator = masterLanguageDefault.getImages().iterator();
while (iterator.hasNext()) {
ItemImage image = (ItemImage) iterator.next();
String imageUrl = imageUrlPrefix + "?type=I&imageId=" + image.getImageId();
itemImages.add(imageUrl);
}
itemInfo.setItemImageUrls(itemImages);
if (!contentBean.getContentSessionKey().isSiteProfileClassDefault()) {
ItemLanguage masterLanguage = master.getItemLanguage();
for (ItemLanguage language : master.getItemLanguages()) {
if (language.getSiteProfileClass().getSiteProfileClassId().equals(siteProfile.getSiteProfileClass().getSiteProfileClassId())) {
masterLanguage = language;
break;
}
}
if (masterLanguage != null) {
if (masterLanguage.getItemShortDesc() != null) {
itemInfo.setItemShortDesc(masterLanguage.getItemShortDesc());
}
if (masterLanguage.getItemDesc() != null) {
itemInfo.setItemDesc(masterLanguage.getItemDesc());
}
if (masterLanguage.getPageTitle() != null) {
itemInfo.setPageTitle(masterLanguage.getPageTitle());
}
if (masterLanguage.getMetaKeywords() != null) {
itemInfo.setMetaKeywords(masterLanguage.getMetaKeywords());
}
if (masterLanguage.getMetaDescription() != null) {
itemInfo.setMetaDescription(masterLanguage.getMetaDescription());
}
if (masterLanguage.getItemImageOverride().equals(String.valueOf(Constants.VALUE_YES))) {
String url = null;
itemInfo.setItemDefaultImageUrl(null);
if (masterLanguage.getImage() != null) {
url = "?type=I&imageId=" + masterLanguage.getImage().getImageId();
itemInfo.setItemDefaultImageUrl(imageUrlPrefix + url);
}
itemImages = new Vector<String>();
Iterator<?> images = masterLanguage.getImages().iterator();
while (images.hasNext()) {
ItemImage image = (ItemImage) images.next();
url = "?type=I&imageId=" + image.getImageId();
itemImages.add(imageUrlPrefix + url);
}