-3

使用 Tridion Core Service,如何获取文件夹中的所有项目?

4

2 回答 2

14

您需要一个过滤器(OrganizationalItemItemsFilterData)。

然后您需要调用 client.GetList(folderId, filter) 来获取该文件夹中的项目列表。

OrganizationalItemItemsFilterData filter = new OrganizationalItemItemsFilterData();
foreach (XElement element in client.GetListXml("tcm:3-640-2", filter).Nodes())
{
    Console.WriteLine(element.Attribute("ID").Value);
}
于 2012-07-13T20:05:40.910 回答
3

A good example on how to use the Core Service which contains all sorts of read operations (like reading a single item and getting a list of items) is shown in the following eXtension on SDL Tridion World: Item Selector Custom URL

The download on SDL Tridion World comes with complete source but this can also be found directly on Google Code where it is hosted as an open source solution. The actual Core Service code can be found in the UserControls/TridionTreeView.ascx.cs Class.

于 2012-07-16T08:38:05.767 回答