8

I'm looking for information on how to create and publish dynamically components in Tridion 2009.

What kind of API do I need and are there any tutorials around to get started with it?

  • In case it doesn't come up, "dynamic" retrieval and display would be the Content Delivery API, which has .NET and Java versions. – Alvin Reyes Feb 2 '15 at 16:14
9

The TOM.NET API in 2009 was read-only, so your only option is the TOM API, and for .NET code, you can use the TOM Interop DLLs.

You will need to reference Tridion.ContentManager.Interop.cm_tom.dll and Tridion.ContentManager.Interop.cm_defines.dll (found in the [Tridion]\bin\client\PIA folder on your CMS)

Then you can use the TOM API in your .NET code (check out the TOM API guide for details on creating new items):

using Tridion.ContentManager.Interop.TDS;
using Tridion.ContentManager.Interop.TDSDefines;

TDSE tdse = new TDSE();
tdse.Impersonate(@"domain\user");
tdse.Initialize();

Page page = (Page)tdse.GetObject("tcm:1-2-64", EnumOpenMode.OpenModeEdit, Constants.URINULL, XMLReadFilter.XMLReadData);
page.Title = "new title";
page.Save(true);

ReleaseCom(page);
ReleaseCom(tdse);

private static void ReleaseCom(object instance)
{
  if (instance != null)
  {
    try
    {
      Marshal.ReleaseComObject(instance);
    }
    catch
    {
      // log potential memory leak
    }
  }
}

Please note the usage of Marshal.ReleaseComObject on every object you use, since this is Com Interop code, and you need to properly release your objects. There is more written about that in other questions, just search for Marshal.ReleaseComObject

2

In addition to what Bart said, below is the Link (Login Required) to get the Detailed Documentation for the TOM API:

https://www.sdltridionworld.com/Login.aspx?ReturnUrl=/downloads/documentation/SDLTridion2009/index.aspx

You need to login with valid SDL account and need to download the Full Documentation ZIP file.

  • Thanks for this link. I think there is an account i can use. Have to talk about this with my manager – Arn a Feb 2 '15 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.