How to fetch the list of all the localized and locally created componentsComponents in a folderFolder for a particular publicationPublication using core service ? Currently
Currently I am first fetching all the componentsComponents using the following code.
public static IEnumerable<XNode> GetFolderItems(string folderUri, ItemType itemType)
{
OrganizationalItemItemsFilterData filter = new OrganizationalItemItemsFilterData();
IEnumerable<XNode> folderItems = null;
XElement folderData = null;
filter.ItemTypes = new[] { ItemType.Component };
filter.Recursive = true;
folderData = Client.GetListXml(folderUri, filter);
folderItems = folderData != null ? folderData.Nodes() : null;
return folderItems;
}
public static IEnumerable<XNode> GetFolderItems(string folderUri, ItemType itemType)
{
OrganizationalItemItemsFilterData filter = new OrganizationalItemItemsFilterData();
IEnumerable<XNode> folderItems = null;
XElement folderData = null;
filter.ItemTypes = new[] { ItemType.Component };
filter.Recursive = true;
folderData = Client.GetListXml(folderUri, filter);
folderItems = folderData != null ? folderData.Nodes() : null;
return folderItems;
}
After fetching the folder components thanFolder Components, then for each folderFolder item I call the following method to fetch the localized/locally created status.
public static bool GetComponentLocalizedStatus(string componentUri)
{
ComponentData componentdata;
bool status = false;
componentdata = Client.Read(componentUri, new ReadOptions()) as ComponentData;
if (componentdata.BluePrintInfo.IsShared == false)
{
status = true;
}
else
status = false;
return status;
}
public static bool GetComponentLocalizedStatus(string componentUri)
{
ComponentData componentdata;
bool status = false;
componentdata = Client.Read(componentUri, new ReadOptions()) as ComponentData;
if (componentdata.BluePrintInfo.IsShared == false)
{
status = true;
}
else
status = false;
return status;
}
This approach is not efficient. Is there a way to fetch the locally created/ localized componentsComponents present in a folderFolder in single go ? .