../Client/scripts/revisionDialog.html
The file contains an xpath query that defines what should be shown in the revision history. I plan to use a custom xpath string based on the ItemType.
// default xpath
var xpath = "Relationships/Item[@type=\"Property\" and (not(is_hidden) or is_hidden=0 or name=\"generation\" or name=\"major_rev\" or name=\"comments\")]|Relationships/Item[@type=\"xItemTypeAllowedProperty\"]/related_id/Item";
// custom code - overwrite xpath for specific ItemTypes
if (itemTypeName == "Part"){
xpath = "Relationships/Item[@type=\"Property\" and (name=\"generation\" or name=\"major_rev\" or name=\"comments\" or name=\"item_number\" or name=\"name\" or name=\"id\" or name=\"version_comment\")]|Relationships/Item[@type=\"xItemTypeAllowedProperty\"]/related_id/Item";
}
The basic idea works fine! My custom xpath is successfully used when open a Part revision history. Also adding the additional version_comment property works. But I cannot get rid of the non-hidden properties. Deleting the code used for the hidden properties crashes the revision history and I will not get no results any more (=empty table without columns).
Any idea what could be missing in my xpath? Are there some required properties that I have to add?
Using a TGV view for a custom revision history would work but is not an option right now. In SP11 the TGV view is slower than the standard revision history. The current TGV version also cannot use a custom orderBy property and will only sort accross the sort_order property (if there is one). But a revision history shall use the generation property for sorting.
Thanks for any input!
Angela