![]() |
|||||||||||
|
|||||||||||
RSS ConfigurationOverviewRBT provides basic support for RSS. With the proper configuration, RBT document result sets can provide the content for RSS feeds. It is expected that the user configuring RBT RSS is familiar with RSS file setup, XML and URL encoding. The following should be considered when designing documents for RSS feeds:
Administrative SetupThe preliminary RBT RSS setup is as follows:
RBT RSS ChannelsRBT RSS channel files reside in the [rbt-web-root]/rsschannel directory. The default RSS file is rbt.rss which is a standard rss version 2.0 file. RBT documents are configured as URL entries in the <item> elements of the channel files. A URL similar to the one shown below will access the default (rbt.rss) file: http://[my-server-name]/rbt/rss You can specify custom channel files by adding a channel parameter as follows: http://[my-server-name]/rbt/rss?channel=some-other-file.rss RBT Document Feed ConfigurationRSS feeds are mapped to RBT documents via the <item> element in the channel file similar to the example below: <item> <title>RSS Test</title> <link>http://localhost:8088/rbt/rss?documentName=rsstest</link> <description>RSS Test Document</description> </item> the parameter "documentName=rsstest" specifies the RBT document name. The document must be owned by the rss user. When run, the output will display document results in tabular form similar to what is shown below:
Passing Additional Parameters to RSS DocumentIn addition to the documentName parameter, the RSS framework accepts other parameter types as described in the table below. The parameter format is of the form [parameter-type]-[position], for example - param-1, style-3 format-2. In each case the position number is significant.
Passing parameters in the RSS <item> element can be a bit tricky. Because we are in an XML document, special XML characters such as the & must be properly escaped. In addition, the URL must be encoded properly - a space will become %20, pound sign (#) becomes %23 etc. Lets look at an example. Suppose we wanted a better format for the example RSS feed shown above. Lets set the headers to more user-friendly names, format the average salary more appropriately and change the font color. We would want a URL in the <link> element something like (lines are broken to fit page): <link>http://localhost:8088/rbt/rss?documentName=rsstest&header-1=Name&header-2=Avg Salary &header-3=ID&format-2=$###,###.00&style-2=font-color:blue;</link>Unfortunately there are a lot of characters we need to escape and encode. First we need to escape the embedded ampersands (&) for the XML, so we end up with: <link>http://localhost:8088/rbt/rss?documentName=rsstest&header-1=Name&header-2=Avg Salary &header-3=ID&format-2=$###,###.00&style-2=font-color:blue;</link>Now we need to encode the special URL characters properly so the final - and correct - <link> element looks like: <link>http://localhost:8088/rbt/rss?documentName=rsstest&header-1=Name&header-2=Avg%20Salary&header-3=ID &format-2=%24%23%23%23%2C%23%23%23.00&style-2=color%3Ablue%3B</link>When we run the RSS document with the URL parameters above the output looks like this:
|
|||||||||||
|