logo

A Better Way To Create RSS Feeds in Domino

Look again in the root of the database I talked about last Friday and you'll see there's now an extra view listed, called RSS. Open this view and you'll see that it's XML! The same is true if you open the view using its alias of feed.xml.

The reason for this is simple - the page you're looking at is simply the $$ViewTemplate for that view. Just like the calendar "view" this form has a rich text field on it and, once again, uses a WQO to print out the content *.

Why?

Well, creating RSS feeds in Domino is and always has been a real faff. The RSS definition calls for fairly strictly-defined output, requiring dates in RFC822 format, absolute URLs for all entries as well as displaying the date that the last overall entry was added. Until now I've always used a Page with an embedded view on it, as per Mike Golding's example from all that time ago.

The trouble with that approach being:

  • The Page has to do an @Subset(@DBColumn("rss"); 1) just to get the date of the last update, which never sat well with me.
  • Any document that appears in RSS feeds needs a computed field on it to store the RFC822 date format.
  • The view has to use an absolute URL which is hard-coded in the view design **.

Now though we can work round all this using a really simple WQO! There's no need to hard code anything or to store dates in documents in any particular format - we can do it all in the WQO agent. Simple, clean and effective. Best of all it's a Form, rather than a Page, and so we get the benefit of things like fields. So the Agent can now get the value of fields such as Server_Name to help it work out what URL to produce.

WQO is the way forward for RSS in Domino! May I never hard code another URL in a view again...

* Not all of the content I hasten to add. The skeleton of the page is defined as text on the form. Only certain bits are populated by the agent. We could of course create the whole page from the agent, but this is an approach I never use and strongly discourage.

** With this site's RSS feed I've always been happy to hard code the http://www.codestore.net/store.nsf/ part of the feed in the RSS view's column formula, but it's always been an issue with clients who've requested RSS feeds in their applications.

Comments

  1. Hey Jake,

    At least your in one of the best positions to determine if there are any lingering performance issues with WQO agents as I bet your RSS feed gets hit a wee few times ;-)

    Any chance you could give us some stats on daily hits to that agent?

    Mark

    • avatar
    • Jake Howlett
    • Mon 13 Aug 2007 05:24 AM

    Hi Mark,

    I've not had chance to update codestore's RSS feed to use this approach just yet, so can't say either way.

    If I get chance I'd like to do some "load testing" of a form with a WQO. Maybe by writing a PHP script on my remote LAMP server to send it continued requests and see how it handles it. If codestore goes down this might be why ;o)

    Jake

  2. More amazing stuff Jake. IBM is accepting abstracts for Lotusphere 2008 (hint-hint)

    • avatar
    • Jake Howlett
    • Mon 13 Aug 2007 05:58 AM

    Thanks Ed.

    What do you get from watching me stand on stage and bumble my way through an hour long presentation that you don't already get here though?! That's always been my reason for never being that bothered about presenting anywhere. Plus I hate public speaking.

  3. Hi Jake, have you had a look at the RSS feed generator database that comes with 7.0.2?

    Would be interesting to hear your thoughts on how that stacks up from an app dev point of view.

  4. Jake, Your work is well known in the blogosphere, but I always wish that it could be seen by a larger audience. Too many people hear Lotus Notes and immediately dismiss it due to a fixed image of R 4.5 traumatically burned in their minds. As for the public speaking... a screen shot is worth a thousand words. In your case the code and UI speaks for itself. Now as for having to travel to Disney Orlando I have no encouraging words for you.

    • avatar
    • Jake Howlett
    • Mon 13 Aug 2007 07:17 AM

    Simon. Just took a look. Not sure what they're goal is with that database. Maybe just to cater for sites that host open blogs?

    All it does is use an agent anyway to print out all the XML. Much like what I'm suggesting but not as good ;o)

    Personally I'd always prefer to use my approach as it keeps all the design central and, as it's in the same database, under the control of the same ACL etc.

  5. Good thinking Jake.

    BTW: what the heck is a "faff"?

  6. "Personally I'd always prefer to use my approach as it keeps all the design central and, as it's in the same database, under the control of the same ACL etc."

    I think there are some circumstances where you would not want the RSS feed to be behind the same ACL as the main database. We've added some feeds to databases that use the Notes SSO login setup, this unfortunately does not play nicely with RSS feed readers. Some can be configured with a username and password if it is behind standard authentication, but not the Notes form. By putting it into a separate database, we can drop the authentication requirements and allow access to the feed. Obviously we're careful about what information is available there, and require that they click a link and actually log into the database if it needs to be confidential.

  7. Rich - 7.0.2 also added functionality to allow you to overide the SSO authentication for certain elements of your design. So the RSS code can be kept in the database where the data is.

    This is achieved via web rule: "Overide Session Authentication with Basic Authentication"

    • avatar
    • Jake Howlett
    • Mon 13 Aug 2007 12:21 PM

    Jeff. To faff about is basically wasting time. I wondered if it was a British term when I wrote that and it turns out it is {Link}

    Rich/Steve. You can get round this with an rss. subdomain, as described here {Link}

  8. None of my readers are able to access my new feed.

    I'm getting:

    "No feed found"

    "DTD Declaration outside of DTD"

    what am I doing wrong?

    • avatar
    • Jake Howlett
    • Thu 30 Aug 2007 12:28 PM

    Hi Chris. As the feed is XML it has to be formatted and laid out in a certain way. If you look at the feed form in the download DB i've since made available you'll see what I had to do to get Domino to produce XML without a blank line at the top.

    Not sure what the DTD error is though. Sorry.

    • avatar
    • Jake Howlett
    • Thu 30 Aug 2007 12:35 PM

    Chris. Thinking about it. It sounds like you've not made the Page output as text/xml content-type. Have you?

    • avatar
    • Chris Joseph
    • Thu 30 Aug 2007 12:43 PM

    Here is the strange thing. I can pull it up in IE and Domino 8. But I get the errors in RSSreader, Feedreader, and OMEA.

    Funny thing is, when I was trying to use the Feed Generator template it was just the opposite.

    Thanks for the input. I'll keep plugging away.

    BTW - I'm a new developer, my boss passed me the like to Codestore and I was up all night reading. Kudos! Great information!

    • avatar
    • Chris Joseph
    • Thu 30 Aug 2007 12:44 PM

    I have made the output text/xml. We're talking about the $$ViewTemplate form right?

    • avatar
    • Chris Joseph
    • Thu 30 Aug 2007 12:52 PM

    Ok. I'll blame the late night reading. I forgot to change my override SA rule path to the new feed. It appears to be working now.

  9. Great way to generate RSS feeds.

    However, there is one small issue with the format of yourRSS. The last item <guid>entry.UniversalID</guid> should be a full URL not just document UNID or you must include the attribute isPermaLink="false" in the guid tag. Read about it at {Link}

    Most feed readers will ignore wrong format. The only one I know to be picky enough to break the feed is Opera's internal feed reader.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Mon 13 Aug 2007

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

Elsewhere

Here are the external links posted on the same day.

More links are available in the archive »

More Content