image.setTitle("OLAT - Online Learning And Training");
image.setLink(getLink());
setImage(image);
List<SyndEntry> entries = new ArrayList<SyndEntry>();
SyndEntry entry = new SyndEntryImpl();
entry.setTitle(translator.translate("rss.olat.title", new String[] { NotificationHelper.getFormatedName(identity) }));
entry.setLink(getLink());
SyndContent description = new SyndContentImpl();
description.setType("text/plain");
description.setValue(translator.translate("rss.olat.description"));
entry.setDescription(description);
entries.add(entry);
// bookmark news
for (Bookmark bookmark : bookmarks) {
SyndEntry item = new SyndEntryImpl();
item.setTitle(translator.translate("rss.bookmark.title", new String[] { bookmark.getTitle() }));
// create jump in link with factory method from manager
String itemLink = BookmarkManager.getInstance().createJumpInURL(bookmark);
item.setLink(itemLink);
SyndContent itemDescription = new SyndContentImpl();
itemDescription.setType("text/plain");
itemDescription.setValue(bookmark.getDescription());
item.setDescription(itemDescription);
entries.add(item);
}
// notification news
// we are only interested in subscribers which listen to a valid publisher
List<Subscriber> subs = man.getValidSubscribers(identity);
for (Subscriber subscriber : subs) {
SubscriptionItem si = man.createSubscriptionItem(subscriber, locale, SubscriptionInfo.MIME_PLAIN, SubscriptionInfo.MIME_HTML);
if (si != null) {
SyndEntry item = new SyndEntryImpl();
item.setTitle(si.getTitle());
item.setLink(si.getLink());
SyndContent itemDescription = new SyndContentImpl();
itemDescription.setType(SubscriptionInfo.MIME_HTML);
itemDescription.setValue(si.getDescription());
item.setDescription(itemDescription);
entries.add(item);
}
}
setEntries(entries);
}