P.Muralikrishna
P.Muralikrishna

Reputation: 1289

How to list the existing Components of a Folder using WebDAV URL in Tridion?

Can you please explain how to get the list of Components in a Folder based on it's WebDAV URL in C# by using Tridion's TOM.NET API.

Upvotes: 4

Views: 1106

Answers (2)

Jaison Prabhu Doss
Jaison Prabhu Doss

Reputation: 123

List<RepositoryLocalObject> myLookComponentList = 
     (List<RepositoryLocalObject>)folder.GetItems(filter).ToList();

Upvotes: 0

Andrey Marchuk
Andrey Marchuk

Reputation: 13483

var folder = (Folder) session.GetObject("/webdav/Test/Building%20Blocks/Default%20Templates");
var filter = new OrganizationalItemItemsFilter(session);
var listXml = folder.GetListItems(filter);

The GetItems method will return you a list of objects while GetListItems returns an XML element. Depending on the version of Tridion you are using you might not have GetItems method implemented yet

You can set additional properties on filter variable.

Upvotes: 2

Related Questions