code for Version Purging | Community
Skip to main content
Sh1ju
Level 4
January 30, 2016
Solved

code for Version Purging

  • January 30, 2016
  • 14 replies
  • 4674 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kunal_Gaba_

Sh1ju wrote...

@ Jitendera ,Its already versionable.please check the screen shot

 

 

The versionable mixin is applied on jcr:content node whereas in your code you are trying to do the operation on mm1 node which may not have the mixin. 

14 replies

Jitendra_S_Toma
Level 10
February 5, 2016

Hi,

Have you tried purging versions using OOTB service?.

Day CQ WCM Version Purge Task

Jitendra

Jitendra_S_Toma
Level 10
February 5, 2016

Hi,

If you are using AEM 6.0/6.1, here is another tool which could help you purging versions.

http://localhost:4502/etc/versioning/purge.html

Sh1ju wrote...

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

 

Kunal_Gaba_
Kunal_Gaba_Accepted solution
February 5, 2016

Sh1ju wrote...

@ Jitendera ,Its already versionable.please check the screen shot

 

 

The versionable mixin is applied on jcr:content node whereas in your code you are trying to do the operation on mm1 node which may not have the mixin. 

OldOldOld
Level 2
February 26, 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