Kentico Xperience 13 documentation and ASP.NET Core

Most documentation about running Xperience applications under ASP.NET Core can be found in a dedicated section: Developing Xperience applications using ASP.NET Core. The rest of the documentation still applies, but some code samples and scenarios might need slight modifications for Core projects.

Certain pages allow you to switch between Core and MVC 5 content using a selector located under the page heading.

All major differences between the MVC 5 and Core platforms are summarized in Migrating to ASP.NET Core.

×

Customizing providers

Providers in the Xperience API are classes that allow the system to manipulate objects and perform various actions. The following list presents the providers that the system uses and their purpose:

  • Info providers contain methods for working with specific types of objects stored in the database, such as users, contacts, custom table records, etc.
  • Data provider handles low-level database operations. The Info providers are built on top of the Data provider and use it to store and fetch data.
  • Email provider manages the email queue and sends emails.
  • File system providers allow you to access various file systems. They extend the CMS.IO namespace. See Working with physical files using the API to learn how to write a custom file system provider.

By developing custom providers and using them instead of the standard ones, you can modify the behavior of the application (or a specific feature) according to your exact requirements.

Provider interfaces

Customizations of provider classes automatically apply to the corresponding provider interfaces (services).

For example, if you develop and register a custom OrderInfoProvider, and override its Set method, your customization applies when the Set method of the IOrderInfoProvider service is called.

Adding your custom code files

When developing custom functionality, we recommend that you place your code files into a separate Class Library project (assembly), which you can then reference from your live site or administration web projects.

On this page

In this section

Deploying customizations to the live site

Consider whether you need to deploy the assembly containing custom provider classes to your live site (MVC) application, in addition to the Xperience administration project. This is required if you are customizing any provider that affects functionality on the live site (registration of users, e-commerce activity, automatic sending of emails based on the actions of visitors, etc.).

For additional information, see Applying customizations in the Xperience environment.

Writing the custom code

Custom provide classes must inherit from the original class. This allows you to implement your modifications or additions by overriding the members of the given class. When creating overrides for existing methods, it is recommended to call the original base method within your custom code.

Registering custom providers

After you write the code, you must register your custom classes to ensure that the system uses them instead of the default providers. You can choose between two options of registering custom provider classes:

Other customization options

In addition to providers, you can also customize the following helper and manager classes:

Helper class nameNamespaceDescription
AutomationHelper

CMS.SalesForce.Automation

Provides marketing automation support for common actions related to Salesforce integration.
CacheHelperCMS.HelpersHandles operations with cache items.
ClassHelperCMS.BaseTakes care of dynamically loaded classes and assemblies.
CookieHelperCMS.HelpersContains methods for managing cookies.
DirectoryHelperCMS.IOManages directories in the file system.
LeadReplicationHelperCMS.SalesForceReplicates contacts into SalesForce leads.
LocalizationHelperCMS.LocalizationRetrieves localized text from resource strings.
MFAuthenticationHelperCMS.MembershipContains methods and properties that implement and configure multi-factor authentication.
TriggerHelperCMS.AutomationManages marketing automation triggers.
Manager class nameNamespaceDescription
AutomationManagerCMS.AutomationHandles the marketing automation process.
SyncManagerCMS.SynchronizationSynchronizes page and object data to other instances of the application when using Content staging.
VersionManagerCMS.DocumentEngineProvides page versioning functionality.
WorkflowManager

CMS.DocumentEngine

Handles the workflow process.

You can also use global event handlers to customize the behavior of the system. Handlers allow you to execute custom code whenever a specific event occurs in the system, such as page or object changes, various parts of the user authentication process, etc.

Examples


Was this page helpful?