In 5.5, you can contribute a VersionRemovalPolicy implementation that is in charge to know if versions should be removed when the associated live document is deleted.
This system works, but has some limitations :
- when 2 addons have to contribute changes in the policy we are stuck
(this is the case for Rendition and tree versioning that both need to change the removal policy)
- because the VersionRemovalPolicy is executed in a synchronous manner it must be quick
In order to improve that, the proposed evolution is :
- create a new extension point on CoreService that allow to contribute OrphanVersionRemovalFilters
- make default VersionRemovalPolicy fire a dedicated event containing live doc + associated versions
- have a Async Listener that call all the OrphanVersionRemovalFilters and do the delete operation on the remaining versions
This allows :
- to make the system more pluggable
- to do asyc cleanup of the versions
- to maintain compatibility