Netcentric/vault-upgrade-hook

Detect changes in SlingPipes and UserPreferencesUpgradeAction

nc-andreashaller opened this issue · 1 comments

For groovy scripts we implemented a MD5 hash mechanism to detect changes in a file and decide when to re-run it. This functionality has yet to be implemented for Sling Pipes. The empty String parameter of the constructor call has to be replaced by an proper hash of the configuration:

public SlingPipe(Resource resource, Phase defaultPhase) {
    super(resource.getName(), UpgradeAction.getPhaseFromPrefix(defaultPhase, resource.getName()), "");
...

The same is relevant for UserPreferencesUpgradeAction

org.apache.sling.commons.json.jcr.JsonItemWriter could be a possibility to serialise and hash the configurations.