Monday, May 28, 2007

RSS Feeds For Notes Documents

(Editor's Note: This tip was initially published on SearchDomino and was a Hall of Fame Tip of the Month winner. It was modified slightly to address new links, etc.)

Many Lotus Notes developers have started adding the construction of RSS feeds to their repertoire. There are already many great resources on how to do this available on the Internet, so that won't be covered here.

Using whatever method you choose to generate your RSS, you can present an RSS feed to documents stored in a Lotus Notes database. Usually, RSS feeds point to content that is accessed via a web browser. However, I had the need to pull up the documents in the Notes client instead. This is very easy to do, since you can use the Notes URI format in place of the standard HTTP URI.

Here is a snippet of XML code from a feed that demonstrates this:

<title>Spellcheck the Memo Body Only</title>
<pubDate>Thu, 24 Feb 2005 10:39:25 PM -0400</pubDate>
<description>I posted this R4.x tip to SearchDomino way back in 1999 and it was the winner for one month!</description>

Notice the <link> element references a Notes identifier rather than a URI using HTTP. When users view this feed in their RSS aggregator, it will open the proper document in your Notes client.

The <link> element of your feed can be constructed using the following formula (usually calculated in the document or in the view column):

"<link>notes:///" + @ReplaceSubstring(@ReplicaID; ":"; "") + "/AllDocuments/" +
@Text(@DocumentUniqueID) + "</link>"

You can replace "AllDocuments" with the name of your view or use its design ID.

For an "All Notes" experience, you can use a Notes-based aggregator such as Steve Castledine's ProjectDX Feed Reader or Studio Blog Reader from OpenNTF along with your feed.

This is a simple yet powerful way to increase the value of using RSS within your organization. I hope you find it useful.


John said...

Chris - why not use the new RSS tool that comes with 7.0.2? It works out of the box and you do not have to write any code :)

Chris Blatnick said...

@John...ah, but that assumes you are actually using 7.0.2! :-)

Color me clueless on that since I'm in an R6 environment. I'll put this as a disclaimer then: This technique will work for pre-R7, but post whenever they put the Notes URI support in. How's that for covering my butt! :-D

Chris Blatnick said...

Oh yeah...thanks for pointing that out to me, John! :-)

Theo Heselmans said...

You can use '0' (zero) instead of 'AllDocuments'.
Saves you from having to make an extra view with unids.