Creating the configuration class

The configuration class is a simple class which provides module configuration capabilities. The configuration class described in this section sets OpenAccessJobsDataProvider as the default provider and the default backend view.

To implement the configuration class, perform the following:

  1. From the context menu of folder Configuration, click Add » New Item...

  2. In the left pane, select Visual C# » Code.

  3. Click Class and in the Name input field, enter JobsConfig.

  4. Open the file JobsConfig.cs and add the following namespaces:

    using Jobs.Data;
    using Jobs.Resources;
    using Telerik.Sitefinity.Configuration;
    using Telerik.Sitefinity.Modules.GenericContent.Configuration;
    using Telerik.Sitefinity.Web.UI.ContentUI.Config;

  5. Change the class definition to:

    public class JobsConfig : ContentModuleConfigBase
    {
     
    }

  6. Implement ContentModuleConfigBase by pasting the following code:

    protected override void InitializeDefaultProviders(ConfigElementDictionary<string, DataProviderSettings> providers)
    {
        providers.Add(new DataProviderSettings(this.Providers)
        {
            Name = "OpenAccessDataProvider",
            Description = "A provider that stores jobs data in a database using OpenAccess ORM.",
            ProviderType = typeof(OpenAccessJobsDataProvider)
        });
    }
     
    protected override void InitializeDefaultViews(ConfigElementDictionary<string, ContentViewControlElement> contentViewControls)
    {
        contentViewControls.Add(JobsDefinitions.DefineJobsBackendContentView(contentViewControls));
    }

You inherit from ContentModuleConfigBase. Inside the InitializeDefaultProviders method, the JobsConfig class setsOpenAccessJobsDataProvider as the default provider. In InitializeDefaultViews you set the default backend view.

Next steps

+1-888-365-2779
sales@sitefinity.com

Related topics:

Feedback

How useful is this article?

Tell us more

Submit
Your message was successfully sent.

We appreciate your feedback.

Your message could not be sent.

OK