Sitefinity CMS

Implementing IRssProviderModule Send comments on this topic.
See Also
Developing with Sitefinity > Services > RSS Service > Implementing IRssProviderModule

Glossary Item Box

IRssProviderModule declares that the module implements the Rss provider functionality. It informs the RSS Service which providers exist. It checks all modules and finds the modules which implement the RSS Provider.

 

In order to implement that functionality, we will create a new public class - JobModule - and place it in the Samples.Jobs.Pluggable module. It will implement the interface, and also inherit the WebModule class (the base class for implementation of a Sitefinity module). 

  

We will create an IRssProviderModule Members region which will contain the following public function:

  • RssProviderInfo[] GetRssProviders() - gets several Rss providers and creates new objects of type RssProviderInfo. Returns an array of the same type with information about the provider. In order to save the information about each provider, a new object of type RssProviderInfo is created for each provider, and is then populated. Out of four possible constructors, the following parameters should be set:
  1. string Name - channel provider name
  2. type Type -  type of channel provider
  3. string settingsControl - type name of the settings control and its assembly      
  4. IDictionary<string,string> settings - dictionary of settings, could leave a default one - will be defined later in the process, in RssSettingsControl.cs
  5. string description - short description of the Rss provider

 

 

Here is an example of the parameter settings in GetRssProviders() of our JobModule class:

 

GetRssProviders() Copy Code
new RssProviderInfo("JobsRssChannelProvider", typeof(JobsChannelProvider), "Telerik.Samples.Jobs.Pluggable.RssSettingsControl, Telerik.Samples.Jobs.Pluggable", new Dictionary<string, string>())

 

In the above code example:

- "JobsRssChannelProvider" is the Name of our provider

-  typeof(JobsRssChannelProvider) specifies the Type of channel provider

-  the settingsControl combines its type name and its assembly: "Telerik.Samples.Jobs.Pluggable.RssSettingsControl, Telerik.Samples.Jobs.Pluggable"

-  the settings parameter is set to be a new (empty) object of type Dictionary<string,string>.

 

 

If there is more than one provider, which implements the IRssProvider interface, a new object of type RssProviderInfo() should be created and the settings for the provider would be specified in that object. For example, if we assume there are two providers, the following structure should be followed:

 

Settings for Two Providers Copy Code
return new RssProviderInfo[] { new RssProviderInfo( <settings for Provider#1> ) , new RssProviderInfo( <settings for Provider#2>) };

 

 See Next:

 

See Also