Get Version History of a page via Java
Hi, would like to ask how can I get the all the versions of the page. I've tried the following code
ResourceResolver rr = currentResource.getResourceResolver();
PageManager pageManager = rr.adaptTo(PageManager.class);
Page page = pageManager.getPage(currentResource.getPath());
Session session = rr.adaptTo(Session.class);
VersionManager versionManager = session.getWorkspace().getVersionManager();
VersionHistory versionHistory = versionManager.getVersionHistory(page.getPath());
VersionIterator versionIterator = versionHistory.getAllVersions();
if (versionIterator.hasNext()) {
Version firstVersion = versionIterator.nextVersion();
////////////////Some codes here/////////////
}
and when it gets to
VersionHistory versionHistory = versionManager.getVersionHistory(page.getPath());
it would throw an exception
javax.jcr.UnsupportedRepositoryOperationException: Node at /content/acom/us-en/about/sample-page is not versionable.
Reason that I need to get the version history is that I need to get the value of the date for the Version 1.0 of the page. Or are there any other way to do that.

*Note: this line of code is added on the Replication/publish action.
Thanks!

