This lesson gives insights into the Variation specific View Changes ribbon action and how it determines the versions to compare.

It is important to understand that this button is always disabled if you see the button in context of a page which does not reside in a target variation label. You cannot use it (e.g.) in the source label. It is also disabled if the current page in the target label is a major version or if only one version has been propagated from source to target.

What the button allows you to do is to compare the most recently propagated source page version with the version of the source page which was last used to create an approved version in the target.

To give you an example:

The Diagram above shows the following actions:

  1. A user created a page in the source label (version 1.0)
  2. The page was approved (version 1.0) which caused automatic propagation to the target where the page arrives as version 0.1
  3. A translator worked on the page in the target label and approved it (Version 1.0)
  4. In the source label someone changed something in the page (Version 1.1)
  5. Later the page is approved again (version 2.0) which causes automatic replication to the target label (version 1.1)
  6. Before a translator was able to work on the updated propagated page in the target another change is done in the source and approved (version 3.0) which causes another automatic propagation to the target (Version 1.2)
  7. Another change is done on source but is not yet approved (version 3.1)
  8. Now a translator starts to work on the page (version 1.2 and 1.3).
  9. The translator would like to know what has changed in the source page since he last translated the content. He uses the View Changes button which shows him the difference between version 1.0 and version 3.0 in the source page.

The question is now: how does SharePoint know which versions to compare?

 

Propagation Version Tracking

The variation system keeps track about the last propagated page version in two different places:

In a column of the Relationships List Entry

When a new version is variated to the target label the variation system adds/updates the relationships list entry of the created/updated target page.

The LastPropagateSourcePageVersion column of the relationships list entry will receive the version of the source page of the variation

In a property of the target peer page

When a new version is variated to the target label the variation system preserves the previous value of the PreviousSpawnSourcePageVersion property of the list item in the target page.

This property is changed by the ItemUpdated event receiver when the page is either approved or scheduled to go live in the future. The event receiver will then copy the value of the LastPropagateSourcePageVersion from the relationships list entry into this property.

That means the LastPropagateSourcePageVersion column in the relationships list always contains the version of the source page which was last variated to the target while the PreviousSpawnSourcePageVersion property of the target page always contains the version of the source page which was last propagated for the currently approved version in the target.

If both versions are the same, then the published version of the page in the target label is based on the last propagated source version.

If both versions are different, then at least one update has been propagated from source to target since the last version was published in target.

 

The View Changes ribbon action

The View Changes ribbon action evaluates the version information stored in the LastPropagateSourcePageVersion column of the relationships list entry and in the PreviousSpawnSourcePageVersion property of the page.

If both are different it generates an url to the _layouts/VersionDiff.aspx page passing in information about the source page (list id and item id) and the information about the two different versions stored as listed above to create a comparison.

The VersionDiff.aspx page comes with SharePoint Foundation and allows to compare the content in the different columns of a list item using the VersionDiffIterator control.