Is there a way to query old versions of a document?


#1

Authors are claiming that the value of a field in a document has changed over time. I can’t find evidence of it. I am using the GUI to look a revision history, but that is slow (and error prone) when the authors have created 10 or more revisions in the last hour or 2.

Ideally, I would like to look at a specific property of all the revisions of a document - either in the query manager or in the console.

How can I do that?


#2

itGumby
February 1

Authors are claiming that the value of a field in a document has changed over time. I can’t find evidence of it. I am using the GUI to look a revision history, but that is slow (and error prone) when the authors have created 10 or more revisions in the last hour or 2.

Ideally, I would like to look at a specific property of all the revisions of a document - either in the query manager or in the console.

You’d only be able to do this programmatically…otherwise you have to
go through the revision history in the cms or in the console. You
could write a groovy script for it if you want to do it
programmatically without redeploy

Regards Ard


#3

Suppose you have a “sample document”. Locate its “preview” document variant node (@hippostd:state=“unpublished”) because only the “preview” document variant node keeps JCR version history internally in our repository:


You will see @jcr:versionHistory reference, which points to the version history folder node for that specific “preview” document preview variant node. Also, @jcr:baseVersion tells you that the current preview variant node is based on that specific revision node.

Click on the link of the @jcr:versionHistory, and you will see all the revisions underneath:


Now, it’s intuitive enough. You see v1.3, v1.2, v1.1 and v1.0 there.

If you select the latest revision (v1.3) and its child node called jcr:frozenNode, you will see the real content of the document at the specific revision, which was frozen safely:


You will see the frozen node containing the current title property: “Lorem123”.

Now, if you investigate the revision v1.2, you will see the old title property: “Lorem12”:

That’s how revisions are maintained for a document in brXM JCR repository.
If you need to do it programmatically, you might want to either use or refer to HST Content Version Utils forge library [1].

Regards,

Woonsan

[1] https://bloomreach-forge.github.io/hst-content-version-utils/