3

I need to access the 'Content' and 'Metadata' of a component and all of it's localized children. I need to do this using only one call if possible. I have the following code:

BluePrintChainFilterData bluePrintChainFilterData = new BluePrintChainFilterData() { Direction = BluePrintChainDirection.Down };
IdentifiableObjectData[] result = client.GetList(primaryBluePrintParentId, bluePrintChainFilterData);
foreach (ComponentData componentData in result)
{
    componentData.Content //not loaded and is null
    componentData.Metadata //not loaded and is null
}

Is there a way to fully/bulk load the data? Setting the filter's BaseColumns to ListBaseColumns.Extended gives additional data but excluding the 'Content' and 'Metadata'.

There is a similar question here: How can I read the full Component data? ,but I'm not sure if i understand Nuno Linhares' answer. It's possible I misinterpreted it, and in that case, sorry Nuno. Isn't .GetItems available in TOM.Net only?

SDL Tridion doesn't provide a method to bulk-load components. When loading items from an OrganizationalItem (like a folder) you can use .GetItems which will load all the objects, but under the hood it's still hitting the database for each individual items anyway.

1 Answer 1

8

The CM Kernel (Core Service and TOM.NET) currently don't have a facility to bulk load items in a list.

As Nuno mentioned, TOM.NET has list methods that return (partially loaded) TOM.NET objects and TOM.NET objects have lazy loading behavior: as soon as you access a property which is not loaded yet, it will implicitly cause a full load on the item.

So, even on the TOM.NET, you may implicitly cause separate loads for each item, it's just not noticeable in your client code. For a Core Service client, it will be painfully visible in your code. :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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