ItemComparePageInfo itemComparePageInfo = new ItemComparePageInfo();
ContentSessionBean contentSessionBean = contentBean.getContentSessionBean();
SiteProfile siteProfile = contentSessionBean.getSiteProfile();
Vector<CustomAttributeInfo> attributeVector = new Vector<CustomAttributeInfo>();
for (String itemId: ContentLookupDispatchAction.getItemCompareList(request)) {
Item item = ItemDAO.load(siteDomain.getSite().getSiteId(), Format.getLong(itemId));
for (ItemAttributeDetail itemAttributeDetail: item.getItemAttributeDetails()) {
CustomAttribute customAttribute = itemAttributeDetail.getCustomAttributeDetail().getCustomAttribute();
if (customAttribute.getItemCompare() != Constants.VALUE_YES) {
continue;
}
if (customAttribute.getSystemRecord() == Constants.VALUE_YES) {
continue;
}
boolean found = false;
for (CustomAttributeInfo customAttributeInfo: attributeVector) {
if (customAttributeInfo.getCustomAttribId().equals(customAttribute.getCustomAttribId().toString())) {
found = true;
break;
}
}
if (!found) {
CustomAttributeInfo customAttributeInfo = new CustomAttributeInfo();
customAttributeInfo.setCustomAttribId(customAttribute.getCustomAttribId().toString());
customAttributeInfo.setCustomAttribDesc(customAttribute.getCustomAttributeLanguage().getCustomAttribDesc());
for (CustomAttributeLanguage customAttributeLang: customAttribute.getCustomAttributeLanguages()) {
if (customAttributeLang.getSiteProfileClass().getSiteProfileClassId().equals(siteProfile.getSiteProfileClass().getSiteProfileClassId())) {
if (customAttributeLang.getCustomAttribDesc() != null) {
customAttributeInfo.setCustomAttribDesc(customAttributeLang.getCustomAttribDesc());
}
break;
}
}
attributeVector.add(customAttributeInfo);
}
}
}
CustomAttributeInfo customAttributeInfos[] = new CustomAttributeInfo[attributeVector.size()];
attributeVector.copyInto(customAttributeInfos);
itemComparePageInfo.setCustomAttributeInfos(customAttributeInfos);
Vector<ItemCompareItemInfo> itemCompareItemVector = new Vector<ItemCompareItemInfo>();
for (String itemId: ContentLookupDispatchAction.getItemCompareList(request)) {
Item item = ItemDAO.load(siteDomain.getSite().getSiteId(), Format.getLong(itemId));
ItemCompareItemInfo itemCompareItemInfo = new ItemCompareItemInfo();
ItemInfo itemInfo = formatItem(item);
itemCompareItemInfo.setItemInfo(itemInfo);
String itemAttribValues[] = new String[customAttributeInfos.length];
for (int i = 0; i < itemAttribValues.length; i++) {
itemAttribValues[i] = "";
}
itemCompareItemInfo.setItemAttribValues(itemAttribValues);
for (ItemAttributeDetail itemAttributeDetail: item.getItemAttributeDetails()) {
CustomAttribute customAttribute = itemAttributeDetail.getCustomAttributeDetail().getCustomAttribute();
int pos = 0;
boolean found = false;
for (pos = 0; pos < customAttributeInfos.length; pos++) {
if (customAttributeInfos[pos].getCustomAttribId().equals(customAttribute.getCustomAttribId().toString())) {