Implement a converter for a custom value mapping set
In Data Exchange Framework, Sitecore items are only used for configuration. When a data synchronization process runs, the configuration is read from the Sitecore items and then converted into framework components.
Get template item ID
To link the converter to the custom value mapping set template, you must locate and copy the template item ID.
To do this:
-
In the Content Editor, navigate to /sitecore/templates/Data Exchange/Framework/Data Access/Mapping/Custom Value Mapping Set.
-
Click the Content tab.
-
In the Quick Info section, copy the Item ID value.
Implement custom converter class
You need a custom converter to transform the Sitecore item representing the custom value mapping set into an instance of your custom value mapping set type.
To implement the class:
-
In Visual Studio, add the following class:
RequestResponsec#using Sitecore.DataExchange; using Sitecore.DataExchange.Attributes; using Sitecore.DataExchange.Converters; using Sitecore.DataExchange.Repositories; using Sitecore.Services.Core.Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Examples.DataExchange { [SupportedIds("{00000000-0000-0000-0000-000000000000}")] public class CustomMappingSetConverter : BaseItemModelConverter<CustomMappingSet> { public CustomMappingSetConverter(IItemModelRepository repository) : base(repository) { } private static CustomMappingSet _instance = new CustomMappingSet(); protected override ConvertResult<CustomMappingSet> ConvertSupportedItem(ItemModel source) { return ConvertResult<CustomMappingSet>.PositiveResult(_instance); } } }
In the attribute SupportedIds, use the template item ID you copied in the previous step.
Deploy custom components
To deploy the code to your Sitecore server:
-
Build the Visual Studio project.
-
Copy the
Examples.DataExchange.dll
file to your Sitecore server.