SyndicationDisplayForm displayForms[] = form.getSyns();
for (int i = 0; i < displayForms.length; i++) {
SyndicationDisplayForm displayForm = displayForms[i];
if (displayForm.getSynId().length() > 0) {
Syndication syndication = SyndicationDAO.load(site.getSiteId(), Format.getLong(displayForm.getSynId()));
if (displayForm.getSynUrl().trim().length() == 0) {
displayForm.setSynId("");
em.remove(syndication);
}
else {
syndication.setSeqNum(i);
syndication.setSynUrl(displayForm.getSynUrl().trim());
syndication.setActive(displayForm.isActive() ? Constants.ACTIVE_YES : Constants.ACTIVE_NO);
syndication.setRecUpdateBy(adminBean.getUser().getUserId());
syndication.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
// em.update(syndication);
}
}
else {
if (displayForm.getSynUrl().trim().length() > 0) {
Syndication syndication = new Syndication();
syndication.setSite(site);
syndication.setSeqNum(i);
syndication.setSynUrl(displayForm.getSynUrl().trim());
syndication.setActive(displayForm.isActive() ? Constants.ACTIVE_YES : Constants.ACTIVE_NO);
syndication.setRecUpdateBy(adminBean.getUser().getUserId());
syndication.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
syndication.setRecCreateBy(adminBean.getUser().getUserId());
syndication.setRecCreateDatetime(new Date(System.currentTimeMillis()));
em.persist(syndication);
}
}
}
if (SyndReader.hasInstance(site.getSiteId())) {