As a EPiServer developer I want to customize content type property interception

Vote:
 

The reason is having code like the following (see https://github.com/VladimirLevchuk/EPiProperties for details) :

 

        public class PageBase : PageData
        {
            [CmsChildren]
            public virtual IEnumerable<PageBase> Children { get; internal set; }
        }
        ...
        [Test]
        public void GetPageModel_ReturnsContentPagesAvailableForCurrentUser()
        {
            var list = new ListPage
            {
                ContentPages = new[]
                        {
                            new ArticlePage { IsAvailableForCurrentUser = true },
                            new ArticlePage { IsAvailableForCurrentUser = false }
                        }
            };

            var result = Orchestrator.GetContentModel(list);

            result.ArticlesList.Items.Count.Should().Be(1);
        }
    

    In order to utilize full power of Castle interceptors I'd like several things to be configurable over IoC (see example code below): 

                // ContentDataInterceptorHandler to be overriden to allow customize interception logic and configure windsor container
                x.For<ContentDataInterceptorHandler>().Use<EPiPropertiesContentDataInterceptorHandler>().Ctor<Action<IWindsorContainer>>().Is(ConfigureWindsor);

                // Hook is called once when gen­er­at­ing proxy type, to filter out properties we can intercept 
                x.For<ContentDataInterceptorHook>().Singleton().Use<EPiPropertiesContentDataInterceptorHook>();
                // and selector works for each generated proxy instance
                x.For<ContentProxyInterceptorSelector>().Singleton().Use<EPiPropertiesInterceptorSelector>();

    

    

in terms of features I'd like to be able to configure:

  • IWindsorContainer you use in ContentDataInterceptorHandler
  • Interceptor hook
  • Interceptor selector


 

 

 

#79411
Dec 16, 2013 18:24
* 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.