MultipleVersionDocumentInfo

Database

Cms Kit

This module is developed based on Abp Cms Kit and adds the following features:

  • Provides Favorite functionality, allowing users to add favorites/collections for any resource.
  • Provides Visit functionality, recording visits to any resource.

Installation

  • Install the Dignite.CmsKit.Domain.Shared NuGet package in the Domain.Shared project.

    Add DigniteCmsKitDomainSharedModule to the [DependsOn(...)] property list in the module class.

  • Install the Dignite.CmsKit.Domain NuGet package in the Domain project.

    Add DigniteCmsKitDomainModule to the [DependsOn(...)] property list in the module class.

  • Install the Dignite.CmsKit.EntityFrameworkCore NuGet package in the EntityFrameworkCore project.

    Add DigniteCmsKitEntityFrameworkCoreModule to the [DependsOn(...)] property list in the module class.

    Add builder.ConfigureCmsKit() to the OnModelCreating() method:

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);
    
        modelBuilder.ConfigurePermissionManagement();
        modelBuilder.ConfigureSettingManagement();
        modelBuilder.ConfigureAuditLogging();
        modelBuilder.ConfigureIdentity();
        modelBuilder.ConfigureFeatureManagement();
        modelBuilder.ConfigureTenantManagement();
        modelBuilder.ConfigureDigniteCmsKit(); //Add this line to configure the CmsKit Module
    }
    

    Open the Package Manager Console in Visual Studio, select DbMigrations as the default project, and then write the following command to add migrations for the document module.

    add-migration Added_DigniteCmsKit_Module
    

    Now update the database.

    update-database
    
  • Install the Dignite.CmsKit.Application.Contracts NuGet package in the Application.Contracts project.

    Add DigniteCmsKitApplicationContractsModule to the [DependsOn(...)] property list in the module class.

  • Install the Dignite.CmsKit.Application NuGet package in the Application project.

    Add DigniteCmsKitApplicationModule to the [DependsOn(...)] property list in the module class.

  • Install the Dignite.CmsKit.HttpApi NuGet package in the HttpApi project.

    Add DigniteCmsKitHttpApiModule to the [DependsOn(...)] property list in the module class.

How to Use

By default, the Dignite Cms-Kit GlobalFeature is disabled. Therefore, the initial migration will be empty. So, when installing with EF Core, you can add the --skip-db-migrations command to skip migrations. After enabling Dignite Cms-Kit global features, please add a new migration.

Once the installation process is complete, open the GlobalFeatureConfigurator class in your solution's Domain.Shared project and write the following code in the Configure method to enable all features of the CMS Kit module.

GlobalFeatureManager.Instance.Modules.DigniteCmsKit(cmsKit =>
{
    cmsKit.EnableAll();
});

You may prefer to enable these features one by one rather than enabling all at once. The following example only enables the Favorite and Visit features:

GlobalFeatureManager.Instance.Modules.DigniteCmsKit(cmsKit =>
{
    cmsKit.Favourites.Enable();
    cmsKit.Visits.Enable();
});

If you are using EF Core, don't forget to add a new migration and update your database.

Internal Structure

Table/Collection Prefix & Schema

Similar to Abp Cms Kit, all tables/collections in this module use Cms as the default prefix.

Connection String

Similar to Abp Cms Kit, this module uses CmsKit as the name of the connection string. If you haven't defined a connection string with this name, it will fall back to the Default connection string.

For more details, refer to the Connection Strings documentation.

InThisDocument