7

I am working on a project an need to find the complete history of who revised a series of items in Tridion 2011 sp1.

Currently I am using the following to get the last revisor.

versionInfo = (FullVersionInfo)OrigCompTemp.VersionInfo;
versionInfo = (FullVersionInfo)OrigCompTemp.VersionInfo;
myReport.WriteLine(versionInfo.Revisor.Title + ...

But what I really need is to get the complete history of revision revisors. I am thinking that I should use IdentifiableObjectData in some way but can seem to get that working, = does anyone have any pointers?

thanks

5

You are making the very reasonable, but wrong, assumption that an item should be able to serve you a list of its own versions. This is a common "culture shock" for people coming to the core service from more object-oriented approaches.

You need to call GetList on your core service client and pass in the id of the item you are interested in. The items in the list will have versioned TCM URIs, so it's quite straightforward to process each version.

This worked for me:

SessionAwareCoreServiceClient client = new SessionAwareCoreServiceClient("netTcp_2012");
var pageVersions = client.GetList(pageUri, new VersionsFilterData());
foreach (var version in pageVersions){
    var versionItem = client.Read(version.Id, null);
    // not really sure that this cast will always succeed - it's just a sketch!
    var versionInfo = (FullVersionInfo)versionItem.VersionInfo;
    Console.WriteLine(versionInfo.Revisor.Title);
}
| improve this answer | |
2

In Tridion versioned items like components have a version history, including the authors. Dominic's answer explains how to get the list of revisors.

But... In Tridion CM you cannot get the "complete history". You cannot get the complete list because users can delete old versions in the CME, by automation or the purge versions feature. Hence you will get the list of known revisors, but not the complete list.

Because versions are numberer incrementeal you can detect if versions of the item are deleted. If any gaps occur in the numbering you can assume a version is deleted.

| improve this answer | |
  • Indeed - my answer addresses getting the "complete" list as known to Tridion at the time. For a more robust audit trail, you'd need some events system code to log the required data to an external repository. – Dominic Cronin Nov 11 '13 at 12:36
  • I finally had to use OrganizationalItemItemsFilterData and fullversioninfo to get the info. Unfortunatly, the content had be content ported and lost all of the previous history. that i needed – james jumonville Jan 29 '14 at 18:12

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.