code for Version Purging

Avatar

Avatar

Sh1ju

Avatar

Sh1ju

Sh1ju

30-01-2016

Can you please share the code for Version Purging  using  VersionManager (com.day.cq.wcm.api)

View Entire Topic

Avatar

Avatar

MeasurableBusin

Avatar

MeasurableBusin

MeasurableBusin

26-02-2016

The wemblog code removes all newer versions except the base version, which is probably not what you want (keep the latest version only).

To get the code:

  • search for VersionManagerImpl in CRXDE, this will give you a path like /libs/wcm/core/install/cq-wcm-core-5.6.24.jar
  • create a package in package manager with that path, build it, download it, unzip it and extract the jar with "jar xf cq-wcm-core-5.6.24.jar"
  • download a Java "disassembler" like http://jd.benow.ca/
  • open the VersionManagerImpl.class file
  • look at the "purgeVersions" method to see how its done