7

I'm trying to fetch the list of Protocol Schema's from the content manager, but no luck. I've tried both the GetSystemWideListXml method as the GetListXml, but I'm not sure which type of filter to use.

This will get me no schema's at all:

RepositoryItemsFilterData filter = new RepositoryItemsFilterData();
filter.ItemTypes = new ItemType[] { ItemType.Schema };
filter.SchemaPurposes = new SchemaPurpose[] { SchemaPurpose.Protocol };
XElement schemas = this.CoreService.GetListXml(this.txtPublication.Text, filter);

I was kinda expecting something like a 'ProtocolSchemasFilterData' to use together with GetSystemWideListXml, but I can't find anything like this.

How can this be achieved?

1 Answer 1

8

You need to search in system repository:

OrganizationalItemItemsFilterData filter = new OrganizationalItemItemsFilterData();
filter.ItemTypes = new[] { ItemType.Schema };
filter.SchemaPurposes = new[] { SchemaPurpose.Protocol };
IEnumerable<IdentifiableObjectData> list = client.GetList("tcm:0-0-7", filter);
4
  • 1
    In case it isn't clear to everyone: "tcm:0-0-7" is a special URI that corresponds to the aforementioned system repository. Commented Nov 21, 2014 at 11:59
  • Excellent, works like a charm! I would've never come up with this... Commented Nov 21, 2014 at 12:23
  • Noone would, that's why I pushed to put it into the API documentation a while ago Commented Nov 21, 2014 at 12:41
  • 1
    Note in 2013 release and onward, enabling the Core Service WCF trace (in TcmServiceHost.exe.config) is an effective way to find out which Core Service Requests the GUI uses to obtain its data. It will show you public secrets like this one. :-) Commented Nov 24, 2014 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.