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 *.
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.