3

I am trying to get all the folder inside publication. Here is the snapshot of the code I am using

enter image description here

1 Answer 1

4

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.

enter image description here

2
  • Yeah Its working now. I've used RepositoryItemsFilterData fiter its working fine. Thanks
    – Sneh Gour
    Jun 9, 2022 at 11:56
  • 1
    Note 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

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.