18 package org.turro.elephant.impl.feed;
20 import com.sun.syndication.feed.synd.SyndFeed;
21 import com.sun.syndication.io.FeedException;
22 import com.sun.syndication.io.SyndFeedInput;
23 import com.sun.syndication.io.XmlReader;
24 import java.io.IOException;
25 import java.io.PrintWriter;
27 import java.util.logging.Level;
28 import java.util.logging.Logger;
29 import org.turro.elephant.context.ElephantContext;
30 import org.turro.elephant.context.IConstructor;
31 import org.turro.elephant.impl.util.Localizer;
32 import org.turro.marker.ElephantMarker;
41 PrintWriter out =
null;
44 out = constructor.
getOut();
45 String[] url = feeds.split(
",");
46 SyndFeedInput input =
new SyndFeedInput();
48 out.print(
"<div class='rssreader'>");
49 for (
int i = 0; i < url.length; i++) {
50 feed = input.build(
new XmlReader(
new URL(url[i])));
51 renderFeed(feed, constructor);
54 }
catch (IllegalArgumentException ex) {
56 }
catch (FeedException ex) {
58 }
catch (IOException ex) {
63 private static void renderFeed(SyndFeed feed,
IConstructor constructor) {
65 marker.
put(
"feed", feed);
static String logMsg(String msg)
static void writeFeed(IConstructor constructor, String feeds)
void process(String rootTmpl, String tmpl)
Object put(Object key, Object value)