Telerik CMS and Events namespace missing

Posted by Community Admin on 04-Aug-2018 15:35

Telerik CMS and Events namespace missing

All Replies

Posted by Community Admin on 28-Sep-2011 00:00

I'm in the process of creating a custom class for exporting and importing from the Eventsmodule.  Here's the code for it...

using System;
using System.Collections;
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Channels;
 
using Telerik.Cms.Engine;
using Telerik.Events;
 
namespace Telerik.Sitefinity.Services.Migration
    public partial class MigrationExportService : IMigrationExportService
    
        public Message GetEventsList()
        
            List<MigrationItemContentDefinition> output = new List<MigrationItemContentDefinition>();
 
            foreach (KeyValuePair<string, ContentProviderBase> provider in m_AllProviders)
            
                // Check if the provider is DefaultEventsProvider
                if (provider.Value is Telerik.Events.Data.DefaultEventsProvider)
                
                    string providerName = provider.Key;
                    EventsManager eventsManager = new EventsManager(providerName);
 
                    if (provider.Value.AllowLocalization)
                    
                        foreach (var culture in m_Cultures)
                        
                            if (culture != m_DefaultCulture)
                                System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo(culture);
 
                            IList eventsList = eventsManager.GetEvents();
                            AddGenericContentGuidToList(eventsList, output, providerName, culture);
                        
                    
                    else
                    
                        IList eventsList = eventsManager.GetEvents();
                        AddGenericContentGuidToList(eventsList, output, providerName, String.Empty);
                    
                
            
 
            MessageVersion ver = OperationContext.Current.IncomingMessageVersion;
            return Message.CreateMessage(ver, "GetEventsListResponse", output);
        
 
        public Message GetSingleEvent(Message eventDefinitionParam)
        
            MigrationItemContentDefinition param = eventDefinitionParam.GetBody<MigrationItemContentDefinition>();
 
            EventsManager eventsManager = new EventsManager(param.ProviderName);
            if (!String.IsNullOrEmpty(param.Language))
                System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo(param.Language);
            IEvent eventItem = eventsManager.GetEvent(param.Id);
 
            MigrationEvent result = new MigrationEvent();
            result.RecurringRule = eventItem.RecurringRule;
 
            GetSingleGenericContentItem(result, eventItem.ContentItem, param.ProviderName, param.Language);
 
            MessageVersion ver = OperationContext.Current.IncomingMessageVersion;
            return Message.CreateMessage(ver, "GetSingleEventResponse", result);
        
    

On the "using Telerik.Cms.Engine;" and "using Telerik.Events;" I am getting a "type or namespace" "does not exist" error.  I checked the bin folder, and that doesn't contain the Telerik.CMS.dll either. 

How do I correct this problem?

Posted by Community Admin on 29-Sep-2011 00:00

Hi Kevin,

Telerk.Cms.* and Telerik.Events are namespaces from Sitefinity 3.x. Sitefinity 4.x has completely revamped API with completely different namespaces. Thus unless you have both sets of the assemblies in your /bin folder you can't create code that uses both APIs. But this is highly unrecommended.

Kind regards,
Lubomir Velkov
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

Posted by Community Admin on 29-Sep-2011 00:00

Ok... I actually discovered this yesterday.  My apologies for not updating this thread accordingly.  

Now since this code is for Sitefinity 3.x, can you point me in the right direction for Sitefinity 4.x?

Posted by Community Admin on 29-Sep-2011 00:00

the content managers are still available in 4.x, they are just in a different namespace:

Telerik.Sitefinity.Modules.Events;
Telerik.Sitefinity.Modules.News;
etc

you might also need to reference the models:
Telerik.Sitefinity.Events.Model;

however using the Fluent API is a nice way to quickly and intuitively get events out without having to instantiate content managers.

An example of both methods for querying event items is here: http://www.sitefinity.com/40/help/developers-guide/sitefinity-essentials-modules-events-querying-events.html

and here is an example of creating events: http://www.sitefinity.com/40/help/developers-guide/sitefinity-essentials-modules-events-creating-events.html

hopefully these two examples will help you accomplish your task...

hope this is helpful!

This thread is closed