November Happy Hour will be moved to Thursday December 5th.

Implementing dynamic content plugin - RSS feed

Vote:
 

Hi,

I'm currently trying to implement the RSS feed plugin provided by Christoffer von Sabsay
(http://world.episerver.com/Articles/Items/How-dynamic-content-can-be-used-to-create-a-more-flexible-web-site/).

When trying to test this feature I get the error shown below. I've tried to change the control added in web.config
serveral times without any luck.
I have tried to follow the solution in:
http://world.episerver.com/Templates/Forum/Pages/Thread.aspx?id=31173&epslanguage=en
as far as possible but with no luck.

My current registration is :

<

 

add description="Displays a list of items from an external RSS source" name="RSS Feed" type="DynamicContentExample.RSSFeed, EPi247.Publisering.Templates"/>

where "DynamicContentExample.RssFeed" is the path for the Guiplugin and "EPi247.Publisering.Templates is the name of the dll where the code is implemented.

 

ERROR DESCRIPTION:

The Dynamic Content control type RSS Feed must implement the IDynamicContent interface. Check the  section in web.config. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Configuration.ConfigurationErrorsException: The Dynamic Content control type RSS Feed must implement the IDynamicContent interface. Check the  section in web.config.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[ConfigurationErrorsException: The Dynamic Content control type RSS Feed must implement the IDynamicContent interface. Check the  section in web.config.]
   EPiServer.Web.InitializationModule.InitializeDynamicContent(DynamicContentElement dynamicContentElement) +341
   EPiServer.Web.<>c__DisplayClass32.b__1a() +22
   EPiServer.Web.InitializeEngine.Initialize() +228
   EPiServer.Web.InitializationModule.Initialize(EPiServerSection config, Settings settings, ConnectionStringSettingsCollection connectionStringSettings) +1267
   EPiServer.Web.InitializationModule.b__2() +34
   EPiServer.Web.InitializeEngine.Initialize() +228
   EPiServer.Web.InitializationModule.StaticInitialization() +737
   EPiServer.Web.InitializationModule.Application_BeginRequest(Object sender, EventArgs e) +484
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

 

The Dynamic Content control type RSS Feed must implement the IDynamicContent interface. Check the <dynamicContent> section in web.config.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Configuration.ConfigurationErrorsException: The Dynamic Content control type RSS Feed must implement the IDynamicContent interface. Check the <dynamicContent> section in web.config.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ConfigurationErrorsException: The Dynamic Content control type RSS Feed must implement the IDynamicContent interface. Check the <dynamicContent> section in web.config.]
   EPiServer.Web.InitializationModule.InitializeDynamicContent(DynamicContentElement dynamicContentElement) +341
   EPiServer.Web.<>c__DisplayClass32.<Initialize>b__1a() +22
   EPiServer.Web.InitializeEngine.Initialize() +228
   EPiServer.Web.InitializationModule.Initialize(EPiServerSection config, Settings settings, ConnectionStringSettingsCollection connectionStringSettings) +1267
   EPiServer.Web.InitializationModule.<StaticInitialization>b__2() +34
   EPiServer.Web.InitializeEngine.Initialize() +228
   EPiServer.Web.InitializationModule.StaticInitialization() +737
   EPiServer.Web.InitializationModule.Application_BeginRequest(Object sender, EventArgs e) +484
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
#39698
May 28, 2010 11:16
Vote:
 

Could you post the code you're using (everything inside RSSFeed.cs).

Frederik

#39711
May 28, 2010 22:55
Vote:
 
The code is the orginale code provided in the example.
Since last time I've managed to make it work in on solution based on a orginale Episerver CMS 5.2 installation
on IIS7, but my customer installation is configured for IIS 6 and I use a customer modified web.config.
The solution might be here.
I have to figure out how to make dynimic content run on IIS 6.
My aim is to merge the old customer solution with a brand new Episerver CMS 5.2 installation because the old site have been upgraded 
from previous versions in the past.
Here is the code:
using System;
using System.Web.UI;
using EPiServer;
using EPiServer.Core;
using EPiServer.DynamicContent;
using EPiServer.PlugIn;

namespace DynamicContentExample
{
    [GuiPlugIn(UrlFromUi = "/RSSFeedSettings.ascx", Area = PlugInArea.DynamicContent)]
    public class RSSFeed : IDynamicContent
    {
        public string RssUrl { get; set; }
        public int MaxCount { get; set; }
        public int CacheDuration { get; set; }

        public string Render(PageBase hostPage)
        {
            throw new NotImplementedException();
        }

        public Control GetControl(PageBase hostPage)
        {
            var rssControl = (RSSFeedControl)hostPage.LoadControl("~/RSSFeedControl.ascx");
            rssControl.RssUrl = RssUrl;
            rssControl.MaxCount = MaxCount;
            rssControl.CacheDuration = CacheDuration;
            return rssControl;
        }

        public string State
        {
            get { return RssUrl+"|"+MaxCount+"|"+CacheDuration; }
            set { 
                  string[] values = value.Split('|');
                    if (values.Length==3)
                    {
                        RssUrl = values[0];
                        MaxCount = Int32.Parse(values[1]);
                        CacheDuration = Int32.Parse(values[2]);
                    }
            }
        }

        public bool RendersWithControl
        {
            get { return true; }
        }

        public PropertyDataCollection Properties
        {
            get { throw new NotImplementedException(); }
        }
    }
}
#39729
May 31, 2010 0:37
Vote:
 

Any ideas anyone??

#39850
Jun 03, 2010 12:50
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.