GetListItems() and GetItems() methods
To retrieve the contents of any type of container in the Content Manager you can use the GetListItems() method, which returns a DOM document, or the GetItems() method which returns a Collection of objects.
TOM.NET classes that use the GetListItems() and GetItems() methods
The following TOM.NET classes use the GetListItems() and GetItems() methods to filter lists of items contained in this type of container:
- Repository (
Tridion.ContentManager.ContentManagement.Repository) - Publication (
Tridion.ContentManager.CommunicationManagement.Publication) - Organizational Item (
Tridion.ContentManager.ContentManagement.OrganizationalItem), the parent class of the following four classes - Category (
Tridion.ContentManager.ContentManagement.Category) - Folder (
Tridion.ContentManager.ContentManagement.Folder) - Virtual Folder (
Tridion.ContentManager.ContentManagement.VirtualFolder) - Structure Group (
Tridion.ContentManager.CommunicationManagement.StructureGroup)
Parameters and return values
Depending on the item type, both the GetListItems() and GetItems() methods take a parameter of either class RepositoryItemsFilter or OrganizationalItemItemsFilter, that lets you specify how the results of the method call are to be filtered:
- In a
GetListItems()call, you can restrict the amount of information that is returned for each item (for example, only the ID and title of each item) - In both methods, you can restrict which items are returned from the total set of items contained in the container (for example, only items that are Components)
For more information on filtering results, see Filtering the result of GetListItems(). The return value of each method is different:
- A call to
GetListItems()returns an XML document that consists of onetcm:ListItemselement containing zero or moretcm:Itemselements. - A call to
GetItems()returns anIEnumerable<RepositoryLocalObject>of those objects in the container that match the filter criteria.