logger.debug("author="+author);
logger.debug("title="+title);
logger.debug("link="+link);
logger.debug("pubDate="+pubDate);
logger.debug("feedUri="+feedUri);
SyndFeed syndFeed = new SyndFeedImpl();
syndFeed.setAuthor(author);
syndFeed.setTitle(title);
syndFeed.setUri(feedUri);
syndFeed.setLink(link);
syndFeed.setPublishedDate(pubDate);
List<SyndEntry> entries = new ArrayList<SyndEntry>();
for(Bookmark bmark : bookmarks){
SyndEntry entry = new SyndEntryImpl();
entry.setTitle(bmark.getTitle());
entry.setAuthor(bmark.getUser().getUsername());
entry.setLink(bmark.getLink().getUrl());
entry.setUri("urn:bookmark:"+bmark.getId());
entry.setUpdatedDate(bmark.getLastUpdated());
List<String> tags = bmark.getTagList();
List<SyndCategory> cats = new ArrayList<SyndCategory>();
for(String aTag : tags){
SyndCategory aCat = new SyndCategoryImpl();
aCat.setName(aTag);
cats.add(aCat);
}
if(cats.isEmpty() == false){
entry.setCategories(cats);
}
SyndContent cnt = new SyndContentImpl();
cnt.setType("text/html");
cnt.setValue(bmark.getNotes());
entry.setDescription(cnt);
entries.add(entry);
}
syndFeed.setEntries(entries);
syndFeed.setEncoding("UTF-8");
logger.debug("done initializing syndFeed object");
return syndFeed;
}