title: Display an older version of a CQ page
body: <p>For audit purposes I got the requirment to create a tool where the authors can look at older versions of a CQ page. I managed to get the available versions with the JCR VersionManager using the following code (used in a SlingServlet with cq:Page as the resourceType):</p>
  
  <pre><code>Session session = request.getResourceResolver().adaptTo(Session.class);
  VersionManager vm = session.getWorkspace().getVersionManager();
  VersionHistory versionHistory = vm.getVersionHistory(request.getResource().getPath());
  VersionIterator vIt = versionHistory.getAllVersions();
  while (vIt.hasNext()) {
      Version version = vIt.nextVersion();
      String no = version.getName();
      Calendar createdDate = version.getCreated();
      // do something with it
  }
  </code></pre>
  
  <p>The path of the version points to e.g. <code>/jcr:system/jcr:versionStorage/d6/23/4f/d6234f36-3360-4024-bee2-411020ac63ae/1.0</code> where I can see a child node called <code>jcr:frozenNode</code> which seems to represent the jcr:content node of this specific version. </p>
  
  <p>How can I tell CQ to render the page in this version? I would expect an url with some parameter or selector, but I didn't find any documentation. I tried to reverse engineer it with the Timewarp, but there the URL seems to be still the original and the magic is hidden somewhere.</p>