+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / custom rss content

custom rss content

12 posts, 0 answered
  1. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    15 Sep 2008
    Link to this post
    I've searched the forum for more information about rss feeds... what I'm wondering is if additional content can be added to the "What to syndicate" section from the Rss Fees page. If the RSS service has some kind of API against which we can program it would be great to be able to select modules or generic content for this section.

    For example, we have a module for Bid notices (RFPs) and I think it would be great to publish new entries as rss. While I could make a handler or external page to handle this, I would much rather fit within the sitefinity model, especially using the .rss extesion for consitency accross the different feeds...

    so if there was a way to "feed" the content from bids into a format that can be read by the rss service, we could theoretically rss feed anything on the sitefinity site.

    can this be done? if not I think it would make a great feature
  2. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
  3. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    16 Sep 2008
    Link to this post
    Hi SelArom,

    We are glad that you were able to find the solution in the Developer's Manual. Let us know if there is anything else we can do for you.

    All the best,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  4. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    16 Sep 2008
    Link to this post
    thanks well actually looking at the manual it looks like these instructions are for a pluggable module.. is rss possible for intrasite modules? my bids module is intrasite and i'm trying to follow the guide but i'm getting thrown off on where stuff goes since I only have the one definition for the class in the App_code folder for the bids module...

    a quick overview on how to proceed for intra site would be great!
  5. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    16 Sep 2008
    Link to this post
    lol okay never mind again. it's pretty straight forward, I just created the classes inside the bids folder under App_code and implemented the interfaces. I was a little lost under the IRssSettings as laid out here http://www.sitefinity.com/help/developer-manual/services-rss-implementing-irsssettingscontrol.html because it references properties from the pluggable module. I just replaced all that code with

    _settings = new Dictionary<string, string>();
    return _settings;


    and it works. I don't know why but it does??? also this manual seems out of date because the method in IRssSettings is SaveSettings() not GetSettings. there's some other inconsistencies in there too...
  6. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    16 Sep 2008
    Link to this post
    Hi SelArom,

    glad that you get it working and thanks for bringing the issue with dev manual RSS topic to us. We'll take a look at it and make necessary adjustments. Your Telerik points have been updated.

    Greetings,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    16 Sep 2008
    Link to this post

    Hi SelArom,

    You're very easy to support:

    Step 1: Read SelArom's post.
    Step 2: Wait for SelArom's to solve his own problem.

    :)  I'm glad you got this working. 

    This is new to me and I haven't yet created a custom RSS provider for Sitefinity.  You mention the documentation was written for pluggable modules.  Aside from making your changes in "App_Code", were there other differences?

    Thanks for reporting back to the forums.  If you can think of any other tips for Sitefinity users following in your footsteps, please share!

    Thanks,

    Gabe Sumner

  8. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    16 Sep 2008
    Link to this post
    lol yeah that happens a lot. I guess asking my question 'out loud' (so to speak) goes a long way to put things into perspective...

    as for the feeds, lets see if I can outline the steps here:

    1) modify the module class in App_Code so that in addition to inheriting from the module class (secured module in my case) it also implements the Telerik.Rss.IRssProviderModule, and implement the interface method, which needs an array of RssProviderInfo

    public class MyModule : Telerik.Security.Permissions.SecuredModule, Telerik.Rss.IRssProviderModule  
    {
        #region IRssProviderModule Members  
        public Telerik.Rss.RssProviderInfo[] GetRssProviders()  
        {  
        Telerik.Rss.RssProviderInfo[] providers = new Telerik.Rss.RssProviderInfo[1];  
        providers[0] = new Telerik.Rss.RssProviderInfo("MyModuleRssChannelProvider"typeof(MyModuleRssChannelProvider), "MyModuleRssSettings""MyModuleRssViewControl"new Dictionary<stringstring>());  
        return providers;  
        }
        #endregion  

    This is one area where the documentation is different. The overload used to initialize the RssProviderInfo shown here http://www.sitefinity.com/help/developer-manual/services-rss-implementing-irssprovidermodule.html differs from the actual available overload choices. the one documented asks for

    (string Name, Type ChannelProvider, string SettingsControl, IDictionanry<string, string> Settings, string Description)

    but this overload is not available, at least I couldn't find it. I ended up using the one like this:

    (string Name, Type ChannelProvider, string SettingsControl, string ViewControl, IDictionanry<string, string> Settings)

    where SettingsControl and ViewControl are the NAMES of the additional classes that implement the remaining intefaces below.

    2) create the RssChannelProvider class, implementing the Telerik.Rss.IRssProvider interface.

    public class MyModuleRssChannelProvider : Telerik.Rss.IRssProvider  
    {  
        public MyModuleRssChannelProvider()  
        { }
        #region IRssProvider Members  
     
        public string Description  
        {  
            get { return "RSS Feed for My Module"; }  
        }  
     
        public IList<RssItem> GetRssItems(System.Collections.Specialized.NameValueCollection query)  
        {  
            List<RssItem> feed = new List<RssItem>();  
                      
            RssItem item = new RssItem();  
     
            // set item properties and add more items  
                    ...  
     
            feed.Add(item);  
     
            return feed;  
        }  
     
        public void Initialize(IDictionary<stringstring> settings)  
        {  
            throw new NotImplementedException();  
        }  
     
        public string Name  
        {  
            get { return "My Module Rss Feed"; }  
        }
        #endregion  
    }  
     

    I wasn't sure what to do for initialize...

    3) Make another class for RssSettings, imlementing that interface. Also this one is different from documentation (i think). The IRssSettings interface is in Telerik.Framework.Rss, NOT in Telerik.Rss:

    public class MyModuleRssSettings : System.Web.UI.WebControls.CompositeControl, Telerik.Framework.Rss.IRssSettingsControl  
    {  
        public MyModuleRssSettings()  
        {  
            //  
            // TODO: Add constructor logic here  
            //  
        }
        #region IRssSettingsControl Members  
     
        private IDictionary<stringstring> _settings;  
        public void InitSettings(IDictionary<stringstring> settings)  
        {  
            _settings = settings;  
        }  
     
        public IDictionary<stringstring> SaveSettings()  
        {  
     
            _settings = new Dictionary<stringstring>();  
            return _settings;  
        }
        #endregion  

    I wasn't really sure what to do with the _settings, because it wasn't defined in the documentation, so I made a private member just so the interface wouldn't break. Strangely enough, this information IS persisted, but I don't know how!

    4) Implment the RssViewControl, once again in the Telerik.Framework.Rss namespace

    public class MyModuleRssViewControl : System.Web.UI.WebControls.CompositeControl, Telerik.Framework.Rss.IRssViewControl  
    {  
        public MyModuleRssViewControl()  
        {  
            //  
            // TODO: Add constructor logic here  
            //  
        }
        #region IRssViewControl Members  
        IDictionary<stringstring> _settings;  
        public void InitializeSettings(IDictionary<stringstring> settings)  
        {  
            _settings = settings;  
        }
        #endregion  
    }  
     

    once again I did the same thing with the private _settings property.

    After completing those steps, I went to administration->Rss feeds and there it was! I set all the properties and started the feed, sure enough it works, take a look: http://www.mcallen.net/bids.rss. Using the RssItem class I was even able to post the bid notice as an enclosure!

    // create enclosure  
    item.Enclosure = new RssEnclosure();  
    item.Enclosure.Url = new Uri(string.Format("http://www.mcallen.net{0}/{1}", path, files[0].Name));  
    item.Enclosure.Length = (int)files[0].Length;  
     
    switch (files[0].Extension.ToLower())  
    {  
        case ".doc":  
            item.Enclosure.Type = "application/msword";  
            break;  
     
        case ".pdf":  
            item.Enclosure.Type = "application/pdf";  
            break;  

    Now that I know how to do this, I'm gonna RSS feed EVERYTHING!!

    hope this was helpful... damn I love sitefinity :)
  9. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    16 Sep 2008
    Link to this post
    Incredible!!  I'm going to take a crack at this myself using your example!

    This will be very helpful to our developers as well as the Sitefinity community!  Thank you so much for posting this information!

    Gabe Sumner - Telerik

  10. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    10 Oct 2008
    Link to this post
    well, I took everything I learned and applied it to something new, and have created a new series of blog posts for adding an Rss Feed to the Generic Content Control, with support for PODCASTS! In fact I used it to make bring my Dark Synthesis Podcast back online!

    As before I outlined it in three parts.

    Rss Feeds for Generic Content Part 1: Setting Up
    Part 2
    Part 3 - Podcasts!

    I hope that someone finds this useful!
  11. Amier
    Amier avatar
    8 posts
    Registered:
    14 Sep 2010
    29 Oct 2010
    Link to this post
    Is it necessary to follow SelArom's approach to create an rss feed for a module that inherits from Telerik.News.NewsModule or should the default rss functionality work?
  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    31 Oct 2010
    Link to this post
    Hello Amier,

    You could check Implementing RSS: a Simple RSS Bare-Bones RSS Module

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
12 posts, 0 answered