Creating a Domino News Aggregator
If you have reached this page directly, it might be a good idea to read this first.
The aggregator consists of two main Java agents:
- GetRss : this agent periodically downloads RDF files from the news provider websites.(requires Brazil)
- ConvertRssFeedToViewFormat: As the name suggests, this agent parses the feeds and transforms them into corresponding notes documents.
The GetRss agent simple runs through the "News Providers" view (this is a view that has documents with the details for each subscribed website ) and sequentially downloads the rss files from all the websites.
The ConvertRssFeedToViewFormat agent reads and parses all the downloaded RSS files(you should stagger the execution time to after that of the GetRss agent). The IBM XML parser is used for the XML parsing. The parsing does not involve much drama; The agent looks for <item> tags in the RSS, parses these tags and drops the information into a new news document.
The only point of note here is the <dc:date> tag. This tag indicates the date of the news item. Right now the agent recognises only UTC date formats. The UTC date is stored into a Notes datetime field in the news document. The view displaying the feeds is ordered by date and hence shows the latest news items first.
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss");
dt = session.createDateTime(sdf.parse(strDate));
The java.text.SimpleDateFormat class is used to convert the UTC date into a datetime object (as shown above). You can check the code for further detailed comments. Some feeds do not set <dc:date>, in such cases we use the current date.
The agent that expires the news items is a single line Lotus formula. Here I have the news set for a 15 day expiry.
FIELD NewsDate:=@If ( @Date(@Adjust(@Now;0;0;-15;0;0;0))-NewsDate> 0;@DeleteDocument;NewsDate);
Download a notes database containing the aggregator: Crude Domino Aggregator (488KB)