Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

In this article you’ll find:

Goal

The purpose of this article is to show you how to create your own Exporter and how to use it instead of the default one.

Overview

In order to define your custom Hawksearch Exporter which will be used instead of the default one, there are 2 approaches - create your own exporter class which implements the IHawksearchExporter interface or inherit from the existing Exporter class and override your desired functionality. You also need to register the new exporter class within Kentico’s CMS.Core.Service container.

Steps to creating your own exporter

  1. Either create your own class which implements Hawksearch.Kentico.Xperience.CMS.Services.Indexing.Contracts.IHawksearchExporter or inherit from Hawksearch.Kentico.Xperience.CMS.Services.Indexing.Exporter.

  2. Implement your custom logic.

  3. Create a new module to contain the initialization code: https://docs.xperience.io/custom-development/creating-custom-modules/initializing-modules-to-run-custom-code

  4. In the module’s OnPreInit method, register your new exporter class. Here CustomExporter is assumed to be your exporter class, so replace it with your own class name:

    protected override void OnPreInit()
    {
        base.OnPreInit();
    
        CMS.Core.Service.Use<IHawksearchExporter,CustomExporter>();
    }
  5. Now the system will use your custom exporter.

  • No labels