Creating the definitions class

You use the definitions class for building the UI for the backend and the frontend views of the module. To create the definitions class, you must perform the following:

  1. From the context menu of the folder Web » UI in the LocationsModule project, click Add » Class.
  2. Name the class file LocationsDefinitions.cs and click Add.
  3. Open the file LocationsDefinitions.cs.
  4. Add the following using statments:

    • using Telerik.Sitefinity.Services;
    • using Telerik.Sitefinity.Web.UI.ContentUI.Config;
    • using LocationsModule.Web.UI;
  5. Define the following static constructor:

    static LocationsDefinitions()
    {
        SystemManager.GetApplicationModule(LocationsModule.ModuleName);
    }

    You will create the ModuleName constant later in this tutorial. For more information, see Implementing the module class.

  6. Define the following constants:

    public const string BackendDefinitionName = "LocationsBackend";
    public const string BackendListViewName = "LocationsBackendListView";
    public const string BackendInsertViewName = "LocationsBackendInsertView";
    public const string BackendEditViewName = "LocationsBackendEditView";
    public const string BackendPreviewName = "LocationsBackendPreview";
     
    public const string FrontendDefinitionName = "LocationsFrontend";
    public const string FrontendListViewName = "LocationsFrontendListView";
    public const string FrontendDetailViewName = "LocationsDetailView";
  7. Define DefineLocationsBackendContentView and DefineLocationsFrontendContentView methods in the following way:

    public static ContentViewControlElement DefineLocationsBackendContentView(ConfigElement parent)
    {
        throw new NotImplementedException();
    }
     
    public static ContentViewControlElement DefineLocationsFrontendContentView(ConfigElement parent)
    {
        throw new NotImplementedException();
    }

    You will implement these methods later in this tutorial. In them you must return a ContentViewControlElement object that contains the UI for the respective view. For more information, see Creating the backend view and Creating the frontend view.

    You must call the DefineLocationsBackendContentView and the DefineLocationsFrontendContentView methods from the configuration class. For more information, see Implementing a configuration class.

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