User Tools

Site Tools


en:user:rss

This is an old revision of the document!


RSS

RSS technology allows you to syndicate your collection's content, so users who subscribe to your site will be informed of new content in their RSS/News Feeds.

If you will be frequently adding new content to a collection, consider enabling RSS. This will allow your users to 'subscribe' to the collection, and keep track of updates.

Turn on RSS

<TABAREA tabs="Greenstone3,Greenstone2"> <TAB> To turn on RSS for a collection, go to the Format Features section of GLI's Format Panel. Select which page(s) on which you want the RSS link to appear (choose 'global' to have it appear on all pages of the collection). Add the following as the child of the root node (This simply means, do not put it inside any of the gsf:template elements. If in doubt, put it below all other statements.):

<gsf:option name="RSS" value="true" />

In the default interface, the RSS icon will appear in the upper right-hand corner of the web page, as shown in the screenshot below. Clicking on the icon will present the list of updated content, and allow users to subscribe to the RSS feed for the collection.

NOTE: the RSS serviceRack must also be included in the collectionConfig.xml file (it should be there by default). If RSS is not working after setting the option to true, check that you have <serviceRack name="RSSRetrieve"/> inside the <serviceRackList> of the collection's etc/collectionConfig.xml file.

</TAB> <TAB> To turn on RSS for a collection, go to GLI's Format panel's Collection Specific Macros, and paste the following:

package Global
_optrsslink_ {
_rsslink_
}

Alternatively, you can just paste the above directly into your collect/<collection-name>/macros/extra.dm file

The RSS icon will appear in the upper right-hand corner of the web page, as shown in the screenshot below. Clicking on the icon will present the list of updated content, and allow users to subscribe to the RSS feed for the collection.

</TAB> </TABAREA>

Configuring RSS feed info

The data for the RSS feed is generated when the collection is (re)built. A file is created in the index folder of the collection: rss-items.rdf. The format is like:

<item>
   <title>Recipe of The Week-Pumpkin Gingerbread Muffins (Nut-Free)</title>
   <link>_httpdomain__httpcollection_/document/HASH01547a1ae03355d22142bf77</link>
</item>
<item>
   <title>Annabel Langbein's Walnut Salad</title>
   <link>_httpdomain__httpcollection_/document/HASH8b6e330cc072e5e713083e</link>
</item>

The _httpdomain_ and _httpcollection_ macros get replaced with the appropriate url components at runtime.

The title used is dc.Title by default. To change this, you can set the plugout's -rss_title option to something else, eg dc.Title,Title. It takes a comma separated list of metadata fields, in order of preference, from which the title for a document's RSS link is to be obtained.

Another plugout option for RSS is to disable outputting the rdf file: -no_rss.

Note, plugouts are the opposite to plugins. Plugins handle converting document formats to Greenstone's internal representation. Plugouts take the internal representation and write them out to file. By default, the import process uses the GreenstoneXMLPlugout, which writes out documents as GreenstoneXML archive files. If you export a collection to another format e.g. MARCXML, then a different plugout will be used.

These plugout options cannot currently be set using GLI. To change them, you will need to edit the collection's configuration file by hand. Make sure the collection is not open in GLI before you start editing the file. Once you have edited the file, save it, and rebuild the collection to regenerate the rss file.

<TABAREA tabs="Greenstone3,Greenstone2"> <TAB> Open up the file greenstone3/web/sites/localsite/collect/<collname>/etc/collectionConfig.xml. Inside the <import> node, add code like the following:

<plugout name="GreenstoneXMLPlugout">
   <option name="-rss_title" value="dc.Title, Title"/>
</plugout>

</TAB> <TAB> Open up the file greenstone2/collect/<collname>/etc/collect.cfg. Add the line

plugout GreenstoneXMLPlugout -rss_title "dc.Title,Title"

</TAB> </TABAREA>

en/user/rss.1503264813.txt.gz · Last modified: 2017/08/20 21:33 by kjdon