Monday 16 May 2016

Creating Components in SDL Tridion using MongoDB Data Feed

In one of my previuos post we've discussed how to create components in SDL Tridion using MSSQLServer as a DataSoucre but today we are going to create components in SDL Tridion using MongoDB as a DataSource


We are going to use SDL Tridion CoreService,MonoDB 3.2.6 ssl-signed and C# as a language

You can download MongoDB from here and to know more about MongoDB here

Create an empty solution

  1. MongoDb.Client
    • C# Console Based Application Running on .NET 4.5
    • which will get the data from mongoDB
  2. MongoDBToTridion.BAL
    • In this Class Liabrary  i have written all the logic in order to create component.
  3. Install MongoDB Drivers
    • Install-Package MongoDB.Driver
  4. Create SDL Tridion CoreService Client
    • ISessionAwareCoreService
  5. Create a model name Article as Serializable
  6. I have also create a Database called customerDatabase in MongoDB
  7. In my customerDatabase i have create document name article which we will use to create component
  8. Main Method which is starting point of this application 

     
      9.Update appsettings key in app.config file 


     10. Process List<Article>


   11.Serialize article model


  12.Create or update Component in Tridion 


 Compare your Data in MongoDB with components created in Tridion


All the data which are available in Article Document in MongoDB has been successfully  created as Components in Tridion .



Open Component and check 



You can download the code from here


Happy Coding and keep Sharing !!!!

No comments:

Post a Comment