Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using SDL Tridion 2011 Core Service to create Components programatically

Tags:

tridion

I have seen some of the questions/answers related to this topic here, however still I am not getting the suggestion which I want. So I am posting my question again here, and I would be thankful for your valuable time and answers.

I would like to create “Component, Page, SG, Publication, Folders “ via programmatically in SDL Tridion Content Manager, and later on, I would like to add programmatically created components in Page and attach CT,PT for that page, and finally would like to publish the page programmatically.

I have done these all the activities in SDL Tridion 2009 using TOM API (Interop DLL's), and I tried these activities in SDL Tridion 2011 using TOM.Net API. It was not working and later on I came to know that, TOM.Net API will not support these kinds of works and it is specifically only for Templates and Event System. And finally I came to know I have to go for Core services to do these kinds of stuffs.

My Questions:

  1. When I create console application to create component programmatically using core service, what are the DLL’s I have to add as reference?
  2. Earlier, I have created the exe and ran in the TCM server, the exe created all the stuffs, can I used the same approach using core services too? Will it work?
  3. Is BC still available or Core Service replaced BC? (BC-Business Connector)
  4. Can anyone send some code snippet to create Component/Page (complete class file will be helpful to understand better)
like image 877
user1428019 Avatar asked May 31 '12 09:05

user1428019


2 Answers

  1. You will only need to reference Tridion.ContentManager.CoreService.Client.dll. You may want to reference Tridion.Common.dll to get access to some helpful classes such as TcmUri, but it is not needed.
  2. You client program will make an explicit connection with the core service on a machine that you specify. If done properly, you can run the client both on the same machine as the Tridion Content Manager or on a different machine.
  3. The Business Connector is still available, but has been superseded by the Core Service.
  4. Have a look at these links:

Updating Components using the Core Service in SDL Tridion 2011

In SDL Tridion 2011, how can I process metadata on an item using the Core Service?

And the standard documentation on the topic connecting to the Core Service from .NET.

If you need more help with the code, I suggest you show us the code you've already written and explain what isn't working.

like image 163
Frank van Puffelen Avatar answered Sep 23 '22 02:09

Frank van Puffelen


I will try to answer your questions:

  1. You have to reference Tridion.ContentManager.CoreService.Client and add some stuff to app.config. It's described here

  2. It will work from CM server, as well as from any other machine, provided it can access CoreService

  3. CoreService is replacement for BC. BC is deprecated and will be dropped soon
  4. You will get all the basic info from here.

This should be enough for you to start. If you will have specific problems - post them as a seperate questions.

like image 39
Andrey Marchuk Avatar answered Sep 27 '22 02:09

Andrey Marchuk