Can I use a custom data provider for a built in module?

Posted by Community Admin on 04-Aug-2018 20:31

Can I use a custom data provider for a built in module?

All Replies

Posted by Community Admin on 14-Jan-2014 00:00

Is it possible to modify the built-in Events module so that it pulls events from my own custom data provider?

My goal is to have the existing functionality of the built-in Events module and Events widgets but I want to use my own data provider.

Could I accomplish my goal if I built a custom module and derived from the built-in Events module classes such as EventsModule, EventsManager, EventsDataProvider, and EventsConfig?

Here's what I've tried so far and it hasn't worked:

I created my class, MyInertiaDataProvider that derives from EventsDataProvider. I implemented #GetEvents and #GetEvent so that they use my ORM. I made the other methods return null. I overrode #InitializeDefaultData to return true (since the base implementation was problematic and it didn't seem like it was doing anything I needed).

I added MyInertiaDataProvider to the Events providers similar to how it is described in www.sitefinity.com/.../quick_and_easy_way_to_extend_the_news_module_by_making_use_of_the_sitefinity_provider_model and set MyInertiaDataProvider as the default provider.

I restarted the server, visited the backend, and clicked on Content > Events. The events displayed are not coming from my data provider. I checked the Sitefinity error log and there are no errors.

Posted by Community Admin on 14-Jan-2014 00:00

I found this, www.sitefinity.com/.../custom-event-news-data-providers, which I believe is asking for the same thing I am. The thread there suggests that I can create a custom data provider and it provides a few details on how to do that. However, it doesn't provide enough information for me to get it working.

Fyi, I'm on Sitefinity 6.2.4910.0

Posted by Community Admin on 16-Jan-2014 00:00

I'm working with support on this. I'll post here what I find out.

Posted by Community Admin on 17-Jan-2014 00:00

Support helped me figure one step I was missing. Here's what I had to do to get Events to use my custom data provider:

1. In the upper left corner you can find the manage site drop down. Choose the manage site option.

2. The page will list your sites managed by this Sitefinity instance.
From the action menu of the site you want to use the custom provider
choose Configure Modules option.

3. Find the Events module and click on the "Change" link at the "This site can use data from..." column.

4. If you can see your custom provider listed make sure its checkbox is
checked and you can also click on the "Make Default" link to set it as a
default provider. If the provider is not listed there then there is
probably a issue in the way your registering the provider.

Posted by Community Admin on 17-Jan-2014 00:00

I've run into several other problems now that Events is using my custom data provider.

I'm getting MissingDecoratorExceptions. I worked around them by overriding the following methods in my custom data provider: #GetSecurityRoot, #GetSecurityRoot(bool), SecurityRoot property, #GetComment, #GetComments, and #GetComments(Guid). I made them all return either null or an empty IQueryable.

If I try to set any LString properties on Event, I get the following error:

Unsupported language "". If you want to support this language, please configure your application accordingly.

If I don't try to set any LString properties, then visiting Content > Events will show the Event items that my custom data provider returns.

Posted by Community Admin on 20-Jan-2014 00:00

Hello,

We are looking into your problem. Lets continue the discussion in the ticket you have oppened, since the solution will be found faster this way. Please contact us here if you have any reason to keep this thread oppened.

Regards,
Bonny
Telerik

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 20-Jan-2014 00:00

Thanks Bonny. I'm only adding what I find out here so that others can make use of what I've learned and hopefully it will help them. Searching the forums has helped me figure out some of my problems and I think it's nice to have any useful information recorded somewhere that's searchable.

Posted by Community Admin on 21-Jan-2014 00:00

Hi,

I understand. You are right - feel free to share anything useful here.

Regards,
Bonny
Telerik

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

This thread is closed