Newsagent/Multiple Feeds

From School of CS Wiki
Jump to: navigation, search
Newsagent
Newsagent Logo.png
Author Chris Page
Contact Support
Repository github
Issue tracker github
OS Neutral (web based)
Will not work with IE8 or older
URL Newsagent
Navigation
Multiple feeds

Newsagent version 0.3 introduced the ability for authors to publish individual articles in multiple Newsagent feeds simultaneously. During composition or editing, users are given the option to select multiple Newsagent feeds in the "Show in feed" dropdown: unlike a traditional single-option select dropdown, the "Show in feed" dropdown contains checkboxes for each option. Ticking a checkbox in the "Show in feed" dropdown indicates that the article will appear in that Newsagent feed. At a minimum, at least one option must be ticked for article creation or editing to work, but there is no restriction on the maximum number of Newsagent feeds any given article may appear in.

Multiple feeds and visibility levels

When creating or editing an article, the user must select one or more visibility levels for the article. When an article appears in more than one Newsagent feed, it does not have different visibility levels for each feed: the article will appear at the same visibility levels in all the Newsagent feeds it has been added to. So if an article is added to the Newsagent feeds "General", "Research", and "Industry", and is given the visibility levels "Medium" and "General", it will appear in all three feeds at the two chosen visibility levels. It is not possible to create an article in two or more Newsagent feeds and set different visibility levels for each feed.

A side effect of this is that the visibility levels a given article may be created at is determined by the user's permissions and the selected Newsagent feeds: for any given combination of feeds, the visibility levels available to the user are determined by the feed with the least posting permissions. For example, a given user has permission to publish at all three visibility levels in the "Research" feed, but only "Medium" and "General" in the "General" feed (ie: the user can not set the "Important" level when publishing to the "General" feed). If the user only selects the "Research" feed then they can publish the article in that feed at any or all of the three visibility levels, but if the user selects both "Research" and "General", only the ""Medium" and "General" visibility levels will be available; "Important" will be disabled.

In most cases, users will have the same permissions on all feeds they have access to, so the restriction discussed here will only apply to a few isolated cases.


Multiple feeds and syndication

The ability to publish articles in multiple Newsagent feeds, combined with the ability to request multiple Newsagent feeds when invoking the RSS and HTML feed generators, causes some problems when syndicating content. In particular, determining which URL to use for the "full article viewer" link in articles included in a generated feed is not entirely straightforward. When generating the contents of feeds, the following rules are used to determine which full article viewer URL should be used for each article in the feed:

  • If the feed generator has been invoked with the viewer argument set to "internal" then an internal Newsagent article viewer URL is used.
  • If the viewer argument has been specified, and the value corresponds to a valid Newsagent feed or defined viewer URL record, the URL associated with the feed or viewer record is used.
  • If no viewer argument has been specified - or it is not valid - the system will attempt to determine which viewer URL to use based on the selected Newsagent feeds, and the feeds the article has been published in:
    • If an article has been published in a single Newsagent feed, the viewer URL associated with that feed is used.
    • If an article has been published in multiple Newsagent feeds, but the feed generator has been invoked with only a single Newsagent feed name in the feed argument, the viewer URL associated with that feed is used.
    • If an article has been published in multiple Newsagent feeds, and the feed generator has been invoked with multiple feeds in the feed argument, the viewer URL associated with the first Newsagent feed the article has been published in is used.

Viewers

The viewer argument to the feed generators allows the caller to specify a URL to use for the full article viewer. As noted in the syndication documentation, direct specification of a URL is not supported, instead the value set for the viewer argument should either be "internal" (to use Newsagent's own viewer), a feed name, or the name of a defined article viewer URL record. The feed names that can be set are the same as those shown on the syndication page: each Newsagent feed has an associated default viewer URL, and if viewer is set to a feed name, then the viewer URL associated with that feed is used. The viewer URL records are a separate list of name-URL mappings that allows any number of full article viewers to be created, and the feed generator can be instructed to use one of those viewers by passing the corresponding name in the viewer argument.

Authors

  • gravatar Mbasscp2 [userbureaucrateditorhandbook-editstaff-editsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPmVkaXRvcjxiciAvPmhhbmRib29rLWVkaXQ8YnIgLz5zdGFmZi1lZGl0PGJyIC8+c3lzb3A8YnIgLz48L3RkPjwvdHI+PC90YWJsZT4=]