ASP.NET, CMS

Data Exchange Framework

              What is Data Exchange Framework (DEF)

The Data Exchange Framework (DEF) is a Sitecore module that provides a framework for transferring data between two systems. One of these systems will always be Sitecore and we can use it for pulling data from a third party system and vice versa.

Advantages

  1. Provide consistent model for reading, writing and mapping data(ETL)
  2. Maintain flexibility of current approach
  3. Minimal dependency on Sitecore at runtime
  4. Minimal Sitecore Expertise needed to develop provider

 

The Scenario

The Scenario I’m about to present is a very simple example of data exchange between text file and Sitecore where the source will be the text file and the target will be the Sitecore.

Basic Requirements:

  • Sitecore 8.2
  • Download DEF 1.1 package and Sitecore provider for data exchange framework from dev.sitecore.net and install.

 

Steps to Perform:

  • After installing the above packages we will be getting a Data Exchange node at Sitecore/System/
  • Then we have created a text file and saved it in our Sitecore website folder as shown below.
  • We created a template having three fields (FirstName, LastName, Identifier) all having Type as Single-Line Text
  • Created a folder under content where items will get created after the successful data transfer from our text file.
  • We have installed one more provider which we have downloaded from github.com/Sitecore/Sitecore.DataExchange.Examples (which a sample provider for data exchange framework which will let us read from text file.) 

Configuring End Points:

  • To start the configuration for DEF we created Empty Data Exchange Tenant under path Sitecore/System/Data Exchange
  • After adding tenant we will get the below structure.
  • Under Endpoints we added two folder to group similar end points providers i.e FileSystem and Sitecore.

->First we added FileSystem folder by using File system End Point    Root so as to organize the items that represent the                 files.

-> In that folder we added Endpoint using Text File Endpoint and provided the field values as shown below:

-> Now we have added the Folder Sitecore using Sitecore Endpoints Roots.

-> In that folder we have added Sitecore End Point Using Sitecore Item Model Repository Endpoint

 

Data Access Configuration:

  • Now to describe the different data, which we will be reading, from the text file we need to add two providers (i.e File System and Sitecore) under Sitecore/System/Data Exchange/OurTenantFolder/Data Access/Value Accessor sets/Providers.
  • Provide the value in position field of each childs of Value Accessor Set according to text file e.g. ID will have position 1 as mentioned in Text File.
  • In the same manner we added the Sitecore folder using Sitecore Value Accessor Sets Root and added its children using Sitecore Item Field Value Accessor Set.
  • Choose the value from dropdown for field of each childs of Sitecore Item Field Value Accessor Set according to the field we have defined in our template which we created above e.g. In case of FirstName choose data field FirstName from our Template as shown below:
  • Now we have to map the Source fields and the Destination Fields as shown below.

Configuring Flow using Pipelines:

We have created 2 pipeline steps: one to read the data from Text File and then another to iterate over the data.

Below is the set up of the target piplines that will Iterate Data step specified.

Resolve Sitecore Item:

Allows us to set what will be the new template for the Sitecore item. In our case it will be a Template which we created previously.

Apply Mapping:

It make use of the Value Mapping Set to map the fields from the source to the target in memory.

Update Sitecore Item:

It performs all the creation and updation options based on the 2 previous steps.

Pipeline Batches:

Pipeline batches are similar to “start” button for the whole process. We can select the pipelines which we want to run and in which order.

 

Click the Run Pipeline Batches command from the ribbon on the top.

About The Author

Leave a Reply

*