I am trying to get all the folder inside publication. Here is the snapshot of the code I am using
1 Answer
you should use it like this:
RepositoryItemsFilterData repositoryItemsFilterData = new RepositoryItemsFilterData()
{
BaseColumns = ListBaseColumns.Extended,
ItemTypes = new[] { ItemType.Folder },
Recursive = true,
ShowNewItems = true
};
XElement filterResults = client.GetListXml(publicationId, repositoryItemsFilterData);
i used getlistxml() method but you can use async one. The problem was the filter you used. It expects to work with OrganizationalItem, and publication is not an OrganizationalItem.
-
Yeah Its working now. I've used RepositoryItemsFilterData fiter its working fine. Thanks Jun 9, 2022 at 11:56
-
1Note that both filters share a common base class:
ItemsFilterData
. We wanted to make the distinction between Repository-level items filter and OrgItem-level items filter clear and thus we ended up with this yaw-breaking OrganizationalItemItemsFilter. :-) Jun 16, 2022 at 15:20