return null;
}
private void copyProperties(ContentMaintActionForm form, Content content) throws Exception {
ContentLanguage defaultContentLanguage = null;
for (ContentLanguage language : content.getContentLanguages()) {
if (language.getSiteProfileClass().getSiteProfileClassId().equals(form.getSiteProfileClassDefaultId())) {
defaultContentLanguage = language;
}
}
form.setContentId(Format.getLong(content.getContentId()));
form.setContentTitle(defaultContentLanguage.getContentTitle());
form.setContentShortDesc(defaultContentLanguage.getContentShortDesc());
form.setContentDesc(defaultContentLanguage.getContentDesc());
form.setPageTitle(defaultContentLanguage.getPageTitle());
form.setMetaKeywords(defaultContentLanguage.getMetaKeywords());
form.setMetaDescription(defaultContentLanguage.getMetaDescription());
form.setContentHitCounter(Format.getIntObj(content.getContentHitCounter()));
form.setContentRating(Format.getFloatObj(content.getContentRating()));
form.setContentRatingCount(Format.getIntObj(content.getContentRatingCount()));
form.setPublished(content.getPublished() == 'Y' ? true : false);
form.setContentPublishOn(Format.getDate(content.getContentPublishOn()));
form.setContentExpireOn(Format.getDate(content.getContentExpireOn()));
form.setRemoveImages(null);
form.setRemoveMenus(null);
form.setMenuWindowMode("");
ContentImage contentImage = defaultContentLanguage.getImage();
if (contentImage != null) {
LabelValueBean bean = new LabelValueBean();
bean.setLabel(contentImage.getImageName());
bean.setValue(Format.getLong(contentImage.getImageId()));
form.setDefaultImageId(bean);
}
else {
form.setDefaultImageId(null);
}
form.setRecUpdateBy(content.getRecUpdateBy());
form.setRecUpdateDatetime(Format.getFullDatetime(content.getRecUpdateDatetime()));
form.setRecCreateBy(content.getRecCreateBy());
form.setRecCreateDatetime(Format.getFullDatetime(content.getRecCreateDatetime()));
if (!form.isSiteProfileClassDefault()) {
form.setContentImageOverride(false);
form.setContentTitleLangFlag(false);
form.setContentDescLangFlag(false);
form.setContentShortDescLangFlag(false);
form.setPageTitleLangFlag(false);
form.setMetaKeywordsLangFlag(false);
form.setMetaDescriptionLangFlag(false);
form.setContentTitleLang(defaultContentLanguage.getContentTitle());
form.setContentDescLang(defaultContentLanguage.getContentDesc());
form.setContentShortDescLang(defaultContentLanguage.getContentShortDesc());
form.setPageTitleLang(defaultContentLanguage.getPageTitle());
form.setMetaKeywordsLang(defaultContentLanguage.getMetaKeywords());
form.setMetaDescriptionLang(defaultContentLanguage.getMetaDescription());
Iterator<?> iterator = content.getContentLanguages().iterator();
boolean found = false;
ContentLanguage contentLanguage = null;
Long siteProfileClassId = form.getSiteProfileClassId();
while (iterator.hasNext()) {
contentLanguage = (ContentLanguage) iterator.next();
if (contentLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
found = true;
break;
}
}
if (found) {
if (contentLanguage.getContentTitle() != null) {
form.setContentTitleLangFlag(true);
form.setContentTitleLang(contentLanguage.getContentTitle());
}
if (contentLanguage.getContentDesc() != null) {
form.setContentDescLangFlag(true);
form.setContentDescLang(contentLanguage.getContentDesc());
}
if (contentLanguage.getContentShortDesc() != null) {
form.setContentShortDescLangFlag(true);
form.setContentShortDescLang(contentLanguage.getContentShortDesc());
}
if (contentLanguage.getPageTitle() != null) {
form.setPageTitleLangFlag(true);
form.setPageTitleLang(contentLanguage.getPageTitle());
}
if (contentLanguage.getMetaKeywords() != null) {
form.setMetaKeywordsLangFlag(true);
form.setMetaKeywordsLang(contentLanguage.getPageTitle());
}
if (contentLanguage.getMetaDescription() != null) {
form.setMetaDescriptionLangFlag(true);
form.setMetaDescriptionLang(contentLanguage.getMetaDescription());
}
if (contentLanguage.getContentImageOverride().equalsIgnoreCase(String.valueOf(Constants.VALUE_YES))) {
form.setContentImageOverride(true);
}
}
}
}