This was my second Sitecore Chicago Meetup I attended this year. You can find the June meetup here. I learned a lot of information on this meetup and it was always good to see fellow Sitecore developers and talk about the industry. This is my high-level overview in a few words and pictures. If you have not been to one I highly recommend it. Should be another one in about 2-3 months from now.
The presentation was put on by Verndale and the speakers were Javier Castillo and Kirsten Leshko. To sum what the presentation was about I copied this from the meetup:
“Sitecore’s customer intelligence and context marketing capabilities. Join us as we extend our presentation to focus on key considerations for marketers throughout the upgrade process to help set up your implementation for both short and long-term success.”
You can find the white paper of what they talked about here.
I always joke that I come to these for the Lou Malnati’s pizza and the drinks. That may be half true.
Javier Castillo and Kirsten Leshko putting on their presentation.
Time to head back to the train. Need to take a pic first.
I got the best seat on the train. Upstairs double seat.
In part 1 you saw what Sitecore items were created to for the data exchange process. In part 2 you saw how the backend was connected and the classes defined in the Converters section. In part 3 you saw how the item models are used. In part 4 you saw how the pipeline step processor is the method that brings everything together. In this part I want to talk about how the Pipeline Batch process is called that runs each step. This is the one of the coolest parts as you will be able to see the final result. You can find the source code here for reference. Still waiting for my module to get approved, but hopefully that will be soon.
Below you will find a Pipeline Batch that was created to run all the necessary steps to process and import the data into Sitecore.
When you first click on the Pipeline Batch you will notice a group of buttons on the ribbon. If something is not correctly setup these buttons will be disabled. To run the Pipeline Batch just click on the Run Pipeline Batch button.
While it is running the button will grey out and you will see the Stop Pipeline Batch button enabled. After it is finished running the Run Pipeline Batch will be enabled again.
Below are the steps that get run under Pipelines. You can also see above that the Reddit Pipeline is selected.
As you saw before the Reddit Pipeline Step hooks into the Converter and Processor. That will then call the next step below it (Iterate feed from Reddit Feeds and Run Pipeline).
The Iterate feed from Reddit Feeds and Run Pipeline as you see below will call a Pipeline (Reddit Feed to Sitecore Item Sync Pipeline) and store the data that the processor outputted into the Pipeline Context Source.
On the Resolve Sitecore Item Pipeline Step I defaulted all the fields except for the following. You will see the Template for New Item is the Reddit Feed Data item. The Item Name Value Accessor uses one of the fields from the Value Accessor Set to name the item. Endpoint From I just selected the Sitecore one. For the Identifier section you will see that the Identifier Value Accessor is a unique value that you can select from the Value Accessor Set. Then the Identifier Object Location is simply the Pipeline Context Source.
For the Apply Mapping from Reddit feed to Sitecore Item the fields are defaulted except for the Mapping Set. This is set to the Reddit Feed to Sitecore Item. You can see what it looks like below. This will map the data to the Sitecore fields.
For the Update Sitecore Item Pipeline Step I just chose the Sitecore Database Endpoint. This is the final step that updates the new item.
After everything runs you get the final result below:
So that is the Sitecore’s Data Exchange Framework in a nutshell. I have some more stuff I will be showing in different blogs, but this concludes the Reddit feed import example. I hope you have found this useful and I will be updating these blogs and cleaning them up as time permits. Please let me know if you have any questions.
In part 1 you saw what Sitecore items were created to for the data exchange process. In part 2 you saw how the backend was connected and the classes defined in the Converters section. In part 3 you saw how the item models are used. In this part I wanted to talk about the pipeline step processor. The method that brings it all together. You can find the source code here for reference.
This is a snapshot of each folder that was created and the corresponding class file. You can see there is a Processors\PipelineSteps folder that contains the process class.
In Sitecore under Pipelines\Reddit Pipeline\Reddit Pipeline Step you will see under Processor Type the RedditItemsProcessor defined.
Below is the code for the processor. You will see that the Required EndpointPlugin is defined for RedditSettings. Endpoint, PipelineStep and PipelineContext should all have values at this point. As you will notice the pipelineContext.PipelineBatchContext.Logger.Info is used to set up any custom logging. This will be outputted in the batch window when the processor runs. See example below.
If you look at the method RedditFeed. What that does is create a new Reddit class using RedditSharp. It then uses the blogpath setting from the endpoint to retrieve the blog feed. The redditfeedresults gets set to a collection of Reddit blogs. From there that collection is passed to the DEF which will use everything we setup to map and process each of the records. It will use fieldnames we defined earlier to match the Reddit feed fields to the fields defined for the new Reddit Sitecore item.
Outputted to the batch window:
Hopefully now you are getting the big picture on how all this stuff pieces together. In part 5 I will get into the part of running the DEF process and different options you can do. Let me know if you have any questions.
In part 1 you saw what Sitecore items were created to for the data exchange process. In part 2 you saw how the backend was connected and the classes defined in the Converters section. In this part I wanted to talk briefly about the item models that are defined for data exchange framework. You can find the source code here for reference.
This is a snapshot of each folder that was created and the corresponding class file. You can see there is a Models folder.
As mentioned in the previous blog a ItemModel is used to defined the field name for the Value Accessor fields. Using this method is a good practice if you need to rename the field and makes the accessor code cleaner.
The name corresponds to the filed name of the template used for Value Accessor fields.
As shown in the last blog in the RedditEndPointConverter class the RedditReadStepItemModel is used to correspond to the field name that holds the selection to the required EndPoint. As the previous item model mentioned this a good practice if you need to rename the field and makes the code cleaner.
Sitecore ItemModel class
The ItemModel Sitecore method that this item models inherit from is below.
So this blog was brief, but hopefully it gives a little glimpse of the value of having the item models defined. In part 4 I will get into the pipeline step processor. The most important piece that brings the functionality together. Let me know if you have any questions.