Netcentric / vault-upgrade-hook

Jackrabbit FileVault Install Hook to perform additional actions during package installation
Eclipse Public License 1.0
19 stars 13 forks source link

Detect changes in SlingPipes and UserPreferencesUpgradeAction #24

Open nc-andreashaller opened 7 years ago

nc-andreashaller commented 7 years ago

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

nc-andreashaller commented 7 years ago

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