More in this section

Forums / General Discussions / Clean up obsolete functions

Clean up obsolete functions

2 posts, 0 answered
  1. Denis
    Denis avatar
    105 posts
    Registered:
    27 Feb 2009
    03 Oct 2011
    Link to this post
    Hello,

    please provide correct way to fix following obsolete functions:

    1.
    public override IEnumerable<PortfolioItemViewModel> GetViewModelList(IEnumerable<PortfolioItem> contentList, ContentDataProviderBase dataProvider)
    warning CS0672: Member 'PortfolioItemsModule.Web.Services.PortfolioItemsBackendService.GetViewModelList(System.Collections.Generic.IEnumerable<PortfolioItemsModule.Model.PortfolioItem>, Telerik.Sitefinity.Modules.GenericContent.ContentDataProviderBase)' overrides obsolete member 'Telerik.Sitefinity.Modules.ContentServiceBase<PortfolioItemsModule.Model.PortfolioItem,PortfolioItemsModule.Model.PortfolioItem,PortfolioItemsModule.Web.Services.Data.PortfolioItemViewModel,PortfolioItemsModule.Web.Services.Data.PortfolioItemViewModel,PortfolioItemsModule.Data.PortfolioItemsManager>.GetViewModelList(System.Collections.Generic.IEnumerable<PortfolioItemsModule.Model.PortfolioItem>, Telerik.Sitefinity.Modules.GenericContent.ContentDataProviderBase)'. Add the Obsolete attribute to 'PortfolioItemsModule.Web.Services.PortfolioItemsBackendService.GetViewModelList(System.Collections.Generic.IEnumerable<PortfolioItemsModule.Model.PortfolioItem>, Telerik.Sitefinity.Modules.GenericContent.ContentDataProviderBase)'
    2.
    public class PortfolioItemsManagerContentManagerBase<OpenAccessPortfolioItemsDataProvider>, IContentLifecycleManager<PortfolioItem>
    
    c:\Development\Projects\webbywell\website2\PortfolioItemsModule\Data\PortfolioItemsManager.cs(17,18): warning CS0618: 'Telerik.Sitefinity.IContentLifecycleManager<PortfolioItemsModule.Model.PortfolioItem>' is obsolete: 'Use Telerik.Sitefinity.Lifecycle.ILifecycleManager' Comment: my project doesn't implement Lifecycle so far. It just defines IContentLifecycleManager I found two new ILifecyclemanager interfaces.
    Telerik.Sitefinity.Lifecycle.ILifecycleManager
    and I Telerik.Sitefinity.Lifecycle.ILifecycleManager<TItem, TDraft> which should be implemented in my case?
    3.
    RegularExpression = DefinitionsHelper.UrlRegularExpressionFilterForValidator,
    
    c:\Development\Projects\webbywell\website2\PortfolioItemsModule\Web\UI\PortfolioItemsDefinitions.cs(586,41): warning CS0612: 'Telerik.Sitefinity.Modules.DefinitionsHelper.UrlRegularExpressionFilterForValidator' is obsolete
    4.
    // create control panel
    var backendView = new BackendContentView()
    c:\Development\Projects\webbywell\website2\PortfolioItemsModule\PortfolioItemsModule.cs(120,39): warning CS0618: 'Telerik.Sitefinity.Web.UI.ContentUI.BackendContentView' is obsolete: 'Remove this class once the ControlBuilders can correctly instantiate standard ContentView control.'
    5.
    initializer.CreatePageFromConfiguration(pageInfo, portfolioItemsModulePageGroupNode, backendView);
    
    c:\Development\Projects\webbywell\website2\PortfolioItemsModule\PortfolioItemsModule.cs(127,17): warning CS0618: 'Telerik.Sitefinity.Abstractions.SiteInitializer.CreatePageFromConfiguration(Telerik.Sitefinity.Modules.Pages.Configuration.PageElement, Telerik.Sitefinity.Pages.Model.PageNode, params System.Web.UI.Control[])' is obsolete: 'Use fluent API App.WorkWith().Module().Install() instead.'
    Some cases maybe obvious but that would be nice if someone confirm how people should handle obsolete cases like these.
    Thanks, Denis.
  2. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    11 Oct 2011
    Link to this post
    Hi Denis,

    1. There are two methods with name GetViewModelList in ContentServiceBase. One is obsolete (with 2 arguments) and one is OK (with 4 arguments). Use the one with 4 arguments instead. The full method signature is

    public virtual IEnumerable<TContentViewModel> GetViewModelList(IEnumerable<TContent> contentList, ContentDataProviderBase dataProvider, IDictionary<Guid, TContent> liveContentDictionary, IDictionary<Guid, TContent> tempContentDictionary)


    2. You should use the non-generic version of ILifecycleManager. The other one is used by pages and templates, not custom modules.

    3.  The particular obsolete property is a regular expression which is no longer used internally. It depends on the context in which you are using it. Here is the value it contains (without the quotes), you can decide whether you need to change it or not - "^[\p{L}\-\!\$\(\)\=\@\d_\'\.]+$"

    4. The BackendContentView class is no longer used. Use ContentView directly instead.

    5. Instead of directly creating pages from configuration, we now use a fluent API for module installation. It is basically self-documenting. In the Install() or InstallPages() method of your module, call App.WorkWith().Module().Install() and from there, you can use intellisense to see all available methods.

     All the best,
    Slavo
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered