Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Getting the older version of page or all older version of page path Through Java

Avatar

Level 7

Hi Folk,

 

I need to get all versions of pages full path in java in aem .How we can do that .

 

I have done for asset through using versionHistory node where jcr:data will be saved for every versions for example : 1.1 1.2 1.3 1.4 ..for all version there is one node in crx and corresponding jcr:data is saving in crx node property that can be easily extracted .

 

Similary I want for pages . But for pages there is no binary data ,here my need is to get suppose any version 1.5 full path of page like localhsot:4502/temp/versionhistory/23gjsgsdjd6yfydd shdvy7/sbdshdvhd9bb/content/we-retail/en/is.html like that for .5 version now i can convert this page into pdf or something . But I am not sure this temp versionhostory is good idea to read or how it works it wll get node of all version which has been created as of now ?

 

How in java we can achive this for page? Asset jcr:versionhistory node will have rendition of 1.5(say any version) versiona and tehir corresponding JCR:DATA to retrvive the actual content. But how we ll get page (.html ) of  1.5(say any  version)'

 

please suggest 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @AdobeID24,

Can you try to use VersionManager API - https://docs.adobe.com/content/docs/en/spec/jsr170/javadocs/jcr-2.0/javax/jcr/version/VersionManager...

From VersionHistory, you can gain access to Version and its related methods.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @AdobeID24,

Can you try to use VersionManager API - https://docs.adobe.com/content/docs/en/spec/jsr170/javadocs/jcr-2.0/javax/jcr/version/VersionManager...

From VersionHistory, you can gain access to Version and its related methods.