7.1. RSS

RSS (Really Simple Syndication) is an XML document specification used as a generic approach to exposing data to other tools for reading. Many sites now use RSS to deliver content such as search results, weblogs, and news.

Due to the simplicity and usefulness of RSS, it is one of the largest implementations of XML worldwide. People consume the feeds to keep up to date with a wide range of content via subscriptions so that they don't need to remember to visit the sites of interest. Without RSS, web users are required to visit web sites over and over throughout the day or hour to keep them informed of the most current data. This process can lead to a lot of repetitive reading as well as missing timely information. RSS resolves these issues. When paired with an aggregator, and the surfing is done, you can read new items as they arrive automatically.

This approach is somewhat similar to receiving email but uses a very different delivery technique. Unlike email, an RSS feed is hosted by the information provider, instead of delivered to the subscriber. Email typically uses a protocol called Simple Mail Transfer Protocol (SMTP) to communicate with the recipient through an email server. An RSS feed is generated directly by a web site and uses the Hypertext Transfer Protocol (HTTP) as its delivery protocol.

7.1.1. Overview of RSS

RSS is a simple XML format that defines a channel containing items that carry the actual information being delivered to the RSS consumer. These items use various XML elements to describe the title, content, and other metadata useful to whatever tools the consumer employs to process the RSS feed. The most common consumer of RSS is a tool known as an aggregator.

Aggregators consume several RSS feeds via subscriptions and pull the data from each feed on a regular interval, typically 60 minutes. Once the aggregator parses the XML, it will highlight the changes found from the previous pull. With tooling like this, users can easily see what is different from the last time they checked. Later, this chapter demonstrates how to use Outlook 2007 to subscribe to RSS feeds from SharePoint. Listing 7-1 is an example of an RSS feed based on a SharePoint list and the items of that list.

Example 7.1. A sample RSS feed generated by a document repository
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Document Center: Announcements</title>
    <link>http://w2k3base/Docs/Lists/Announcements/AllItems.aspx</link>
    <description>RSS feed for the Announcements list.</description>
    <lastBuildDate>Sun, 15 Oct 2006 16:00:42 GMT</lastBuildDate>
    <generator>Windows SharePoint Services V3 RSS Generator</generator>
    <ttl>60</ttl>
    <image>
      <title>Document Center: Announcements</title>
      <url>/Docs/_layouts/images/homepage.gif</url>
      <link>http://w2k3base/Docs/Lists/Announcements/AllItems.aspx</link>
    </image>
    <item>
      <title>Welcome to the managed document repository site.</title>
      <link>http://w2k3base/Docs/Lists/Announcements/DispForm.aspx?ID=1</link>
      <description><![CDATA[<div><b>Body:</b> <div
        class=ExternalClassDA26385B52A04A558486A1CC03599E76>
        Welcome to your new managed document repository site. Use this
        site to centrally manage documents in your enterprise.</div></div>]]>
      </description>
      <author>W2K3BASEadministrator</author>
      <pubDate>Mon, 02 Oct 2006 16:36:35 GMT</pubDate>
      <guid isPermaLink="true">
        http://w2k3base/Docs/Lists/Announcements/DispForm.aspx?ID=1
      </guid>
    </item>
  </channel>
</rss>

7.1.1.1. Structure of an RSS Document

RSS documents have a top-level element, known as the document element, to define the document. This document element is named rss and has an attribute named version that indicates which version of the RSS specification is being used.

Inside the document element, the element named channel is used to hold the RSS items, but it can also contain other elements such as title, description, and link to describe the document in more detail (see the following table).

NameDescription
titleThe title of the SharePoint page
linkThe URL of the corresponding page
descriptionBasic text that describes the RSS feed
lastBuildDateDate the feed was generated
generatorDescribes the RSS generation tool used to build the feed
ttlHow long this feed will be cached in minutes from the last time it was built

The item elements hold the data for each piece of information shared within the RSS feed. As in the channel element, each item can contain title, link, and description elements to describe the item. In addition, an item can include several other descriptive elements, as shown in the following table. The author element indicates who created the item, and in SharePoint this will be a user account name. The pubDate element specifies the creation date of the item. The guid element is a unique identifier for the item. RSS readers typically use this key to find the correct item in the local cache even if its title or description has changed. If the guid value is a URL the attribute isPermalink will be true to indicate that the guid is actually a link to the item. Often this link will point to an expanded version of the article if the item contains only a summary.

Since RSS can be implemented differently depending on the source, review the official specification for the RSS 2.0 at http://blogs.law.harvard.edu/tech/rss.

NameDescription
titleThe title of the item represented
linkThe URL of the item
descriptionInformation about the item
authorThe account of the item's creator
pubDateDate the item was published
guidThe unique identifier of this item. Hyperlinks are used in SharePoint, since they are always unique.

7.1.1.2. News Aggregators

RSS is a fairly simple XML dialect. To harness its real power, you need a tool that can read RSS documents and present the items in a useful way. In addition, the tool must have the ability to check one or more RSS feeds on a regular interval and update the display accordingly. This type of tool is often called a news aggregator.

The typical news aggregator has a similar interface to a mail reader and allows users to easily add their RSS feeds for subscription. In Office 2007, Outlook has news aggregation features, providing the typical office worker with an aggregator without additional downloading. Many news aggregators are available as free downloads or as packaged software, and several of these are written as .NET applications, such as RSS Bandit and NewsGator.

Other forms of news aggregators take the form of a browser. These aggregators display the content of a feed using HTML rendering and allow you to view the content of a feed without the need to understand XML. These tools are typically web applications and can be used from any computer that has an Internet connection. In Microsoft's Internet Explorer 7, the ability to subscribe to RSS feeds is built into the core functionality and plays a major part in compelling users to upgrade. The following table lists examples of news aggregators:

NameURL
Internet Explorer 7http://www.microsoft.com/windows/ie
Microsoft Office Outlook 2007http://office.microsoft.com
RSS Bandithttp://www.rssbandit.org
NewsGatorhttp://www.newsgator.com
Bloglineshttp://www.bloglines.com
Live.comhttp://www.live.com
SharpReaderhttp://www.sharpreader.net
Pluckhttp://www.pluck.com
FeedReaderhttp://www.feedreader.com

Thanks to the simple mechanics of a news aggregator, it is fairly easy for a developer to create their own. First, the tool must have a data store for retaining the different feeds of a user's subscription. They can use a database, XML file, or other proprietary form of storage. Next, the aggregator must have the ability to retrieve the feeds from the web. This process is typically multi-threaded to allow for multiple feeds to be pulled at the same time. Finally, the aggregator needs the ability to remember what items the user has read and to show the items that have not been reviewed.

7.1.1.3. Using RSS in Office Outlook 2007 and Internet Explorer

Internet Explorer 7 and Outlook 2007 now have built-in support for aggregating RSS feeds. Since both applications use the same RSS data store, you will see the same items regardless of whether you are running Outlook or Internet Explorer.

The ability of Outlook 2007 to include RSS feeds in its classic email view is a boon for those of us who "live in Outlook." In a SharePoint environment, you can use this feature to keep abreast of changes in your collaborative sites as you deal with your normal email tasks. Figure 7-1 shows the Outlook 2007 view of an RSS feed from a SharePoint document library.

Figure 7.1. Figure 7-1

7.1.2. Uses of RSS within SharePoint

The addition of RSS to SharePoint couldn't come at a better time. Now that RSS is a proven medium for syndication and with Microsoft releasing tools to view and subscribe to the feeds, SharePoint needs the ability to publish RSS. Since lists are used to store the data in SharePoint, this is the perfect place to expose them to users of the content. The channel element of RSS represents the list in the feed and each piece of content inside the list defines the item elements.

For developers, RSS is a great data source they can use inside their applications where this type of data is needed. These applications can be client-based or web applications as long as they have the ability to call out and load the content over HTTP. Using simple XML parsing, developers can load the feeds they need and display the data in their user interfaces. In SharePoint, every list has the ability to host an RSS feed. By default, the RSS feed is turned on and can be managed through the list's Action menu as shown in Figure 7-2.

Figure 7.2. Figure 7-2

Here are the steps for accessing an RSS feed for a document library. You will learn about RSS feeds for blogs later in this chapter.

  1. Click on a document library link from the Quick Launch bar on a SharePoint site.

  2. At the top of the library, click the Action link.

  3. From the list (see Figure 7-2), select View RSS Feed.

To subscribe, copy the URL and import it into your aggregator.

7.1.3. Configuring RSS Settings

In your SharePoint site, the content of some list might be too sensitive for allowing RSS access. Other lists might be updated so frequently that you need to include up to the maximum items. These are features you can manipulate via administration for every list or library that offers RSS. In the following steps, you will walk through how to configure the RSS feeds for a Task list that is part of the Team Site template for SharePoint:

  1. Click the link for Task under Lists from the Quick Launch bar.

  2. Click the Settings link at the top of the list.

  3. Under the Communications section, click the RSS settings link. This screen will resemble Figure 7-3.

  4. To modify whether the list offers RSS, click the Yes or No radio button under Allow RSS for this list? in the List RSS section.

  5. To set a maximum length for the content description, click the Yes or No radio button under Truncate multi-line text fields to 256 characters? in the RSS Channel Information section.

  6. To change the title of the RSS feed, edit the text box labeled Title in the RSS Channel Information section.

  7. To change the description of the RSS feed, modify the description text box in the RSS Channel Information section.

  8. RSS feeds can use an image to better identify the feed in aggregators. To change the default image, enter the image URL in the text box labeled Image Url in the RSS Channel Information section. To test the image for correctness, click the Click here to test link next to the Image Url text box.

  9. From the list of columns available for this list, select the columns you would like to display as part of the RSS feed in the Columns section. These columns will show up as different elements of the item field or embedded in the description field.

  10. To alter the number of items in the feed, change the value of the Maximum items to include text box in the Item Limit section.

  11. To add or subtract the amount of days an item will appear in the feed, change the value of the Maximum days to include text box in the Item Limit section.

  12. Click the OK button to publish the changes.

Figure 7.3. Figure 7-3

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.165.70