Table of Contents
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
Greenstone3
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.
Greenstone2
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.
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.
Plugout options can be set by specifying a plugout in the collection's configuration file, along with its options. Unfortunately, there was a bug in Greenstone 3.12 which means that this element is removed from the config file when you open the collection in GLI.
Alternatively you can use the import options -saveas and -saveas_options.
- -saveas specifies what type of output format to use (default: GreenstoneXML) and therefore which plugout (default GerenstoneXMLPlugout)
- -saveas_options specifies any options to pass to the plugout.
You can set these in the import options pane of the Create Pane in GLI - if you do that here, they will only be applied when building the collection through GLI.
You can also set import options directly into the config file using GLI's Edit→Edit collectionConfig.xml. If you use this method, the options will be available for use in GLI and for command line building.
Greenstone3
The three ways to specify plugout option, for example, setting the -rss_title option:
- 1. Create Pane, import option -saveas_options.
-saveas_options -rss_title dc.Title,Title
- 2. Add importOptions directly into the collectionConfig.xml file.
In GLI, Edit→Edit collectionConfig.xml. Or open up the file greenstone3/web/sites/localsite/collect/<collname>/etc/collectionConfig.xml in an editor. Add the following as a child node of the top level CollectionConfig element:
<importOption name="saveas_options" value="-rss_title dc.Title,Title"/>
- 3. Add a plugout element directly into the collectionConfig.xml file.
In GLI, Edit→Edit collectionConfig.xml. Or open up the file greenstone3/web/sites/localsite/collect/<collname>/etc/collectionConfig.xml in an editor. Inside the <import> node, add code like the following:
<plugout name="GreenstoneXMLPlugout"> <option name="-rss_title" value="dc.Title,Title"/> </plugout>
Greenstone2
Open up the file greenstone2/collect/<collname>/etc/collect.cfg. Add the line
plugout GreenstoneXMLPlugout -rss_title "dc.Title,Title"