I am trying to find a list of bundles that contain a spcific component/page, I could not find a sample code, I searched the core services API doc, I found ContainingBundlesListInfo
but I don't know how to use it.
any help is appreciated
please stop using WhereUsed for everything, it's quite heavy list and it affects performance a lot. There's a special filter to show bundles that contain the current item: ContainingBundlesFilterData
.
string componentId = "tcm:5-4081";
CoreServiceClient channel = new CoreServiceClient();
ContainingBundlesFilterData filter = new ContainingBundlesFilterData();
var bundles = channel.GetList(componentId, filter);
There are also many nice properties on that filter.
This source code, will give you the list of bundles
string componentId = "tcm:5-4081";
CoreServiceClient channel = new CoreServiceClient();
UsingItemsFilterData filter = new UsingItemsFilterData();
filter.ItemTypes = new ItemType[] { ItemType.VirtualFolder };
XElement xBundles = channel.GetListXml(componentId, filter);