Integrate a custom value mapping set
The final step is to integrate your custom value mapping set into Data Exchange Framework.
When configuring your data synchronization process, use your custom value mapping set when you create new tenants. For already existing tenants, replace the value mapping set currently used with your custom value mapping set.
Configure the custom template
To configure the template to use the custom converter and the custom value mapping set:
-
In the Content Editor, navigate to /sitecore/templates/Data Exchange/Framework/Data Access/Mapping/Custom Value Mapping Set/__Standard Values.
-
On the Configure tab, in the Data Exchange Framework section, set the following field values:
Field
Value
Converter Type
Examples.DataExchange.CustomMappingSetConverter,Examples.DataExchange
-
On the menu ribbon, click the CONFIGURE tab.
-
In the menu, click Assign.
-
In the Insert Options dialog, in the tree on the left, navigate to Templates/Data Exchange/Framework/Data Access/Mapping/Custom Value Mapping Set. Click the right arrow (
) to add the set to the Selected list.
-
Click OK.
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:
RequestResponseusing 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.