1

Using core service want to get only ther latest version of all the items in tridion.

I have tried in this way:-

 if (itemType.Equals("Folder"))
                    {
                        type = ItemType.Folder;
                    }
                    if (itemType.Equals("StructureGroup"))
                    {
                        type = ItemType.StructureGroup;
                    }

    VersionedItemData verinfo=csClient.Read(tcmuri, new ReadOptions()) as VersionedItemdata

But here i'm unalbe to filter on the ItemTypes.

If any other approaches to get the latest version info please let me know.

2

Im not sure about your requirements, but if you need to filter by itemType the correct aproach could be to use a filter like this:

var filter = new Tridion2011CoreService.OrganizationalItemItemsFilterData();
var filterItemTypes = new List<Tridion2011CoreService.ItemType>();
if (itemType.Equals("Folder"))
                    {
                        filterItemTypes.Add(Tridion2011CoreService.ItemType.Folder);
                    }
                    if (itemType.Equals("StructureGroup"))
                    {
                        filterItemTypes.Add(Tridion2011CoreService.ItemType.StructureGroup);
                    }

filter.ItemTypes = filterItemTypes.ToArray();
var result = csClient.GetListXml(tcmuri, filter);

foreach (System.Xml.Linq.XElement node in result.Nodes())
    {
        ...your logic
    }
| improve this answer | |
  • here i need to use the versionfilter data or version item data both these are not having flter property. so need help i want to filter using these methods for the itme type – k951 May 7 '15 at 10:17
  • Yo can try first the ItemType filter like I told, then parse the result items as a VersionedItem and try to use: VersionedItem.GetListVersions(VersionsFilter), I m still not sure if you mean that... – Julián Hernández May 7 '15 at 11:37
  • Want to use the versionsfilter on the itmetypes but it is not having any property called versionsfilter.filter ="ItemType" this is my concern want to get the versions of the items . how to go ahead – k951 May 7 '15 at 12:24
  • You can also use a SearchQueryData, but I think you need to use first a searchquery, and then use a versionsFilter apliend on the result. Something like this thread: tridion.stackexchange.com/questions/11535/… – Julián Hernández May 7 '15 at 13:32
  • Please let me know apart from the serach api which api will give the version info beacuse in my case there is an issue with the search engine and need to run the re-index tool that is at the support end. So i want to go use some other api which give me the version info of all the itmes in tridion. – k951 May 8 '15 at 6:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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