2

For one of the requirements we need to extract the rendered HTML for each version of the Page. We want to understand if old versions of Pages renders the corresponding Component and Template version or if it renders the latest versions?

Problem statement :

  1. Product Page has overall 10 versions
  2. Object of 5th version is created using Core services
  3. In 5th version only one Component Presentation is there
  4. Component is having 3 version and Template is having 4 versions
  5. In 5th version of the Page, say 2nd version of Component is added and Template version is 3rd
  6. When we render 5th version of Page will it render correct Component version and Template version or it will render the latest version of Component and Template?

Note: As per our understanding version information is not added when we link Component and Template on Page

1 Answer 1

3

Your note indeed states it all, the Component Presentations on a Page are not versioned. When a Page is rendered for preview, the latest available version for that user is used. When a Page is rendered for publishing, the latest checked in version is used. So even if you are rendering an earlier version of a Page, you don't have a guarantee that the Content on that Page is equal to that earlier version.

From reading your question it sounds to me like you are trying to create a history of rendered Page versions. This is technically possible, but if you want to do that upon request you will have to rollforward (don't rollback as then you will loose the changes after that) both Page, Page Template, Component and Component Template versions before rendering the Page. Which versions to rollforward to is tricky, since you need to check for every item on the Page, which version it had at a certain pont of time. So while technically possible, it certainly isn't a trivial job. Add to that, that afterwards you need to rollback to the original (latest) version again, and you'll see its quite an operation.

A better solution (which will only work for the future and not for the past), is to separately store the (rendered) HTML of a Page every time it is published with its exact date/time (and optionally versions of what is on it).

3
  • To separately store the rendered versions of your pages as Bart suggests, the most obvious means of doing this is to run a web crawler over your site at regular intervals. Something like wget would do the trick. Commented Dec 1, 2017 at 17:05
  • I was more thinking about doing it as a storage extension and published with additional metadata like the versions of the content and page. Then you only store what is really updated/published. Crawling the site will give a snapshot of everything but can be a useful tool too. Commented Dec 1, 2017 at 21:25
  • Also possible, but rather more expensive. Without knowing the use-case it's hard to say whether the benefits would be worth it. Commented Dec 1, 2017 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.