Filtering properties before replication
If you have properties that contain sensitive information you don't want to risk exposing in your target environment, then you may need to implement the PropertyFilter interface to filter out or modify such properties. Most of the use cases however, can be handled by the already configured generic property filter.
Use the generic property filter
If you want to simply exclude properties by name then you can use the pre-configured generic property filter. Add the name of the property you want to exclude to /hippo:configuration/hippo:modules/replication/hippo:moduleconfig/metadata/filter/excludedProperties
You can use the add operation in a YAML source definition for this:
You can also use this filter when you want to change the value of some specific property to a constant value. Specify the multi-valued configuration properties /hippo:configuration/hippo:modules/replication/hippo:moduleconfig/metadata/filter/modifiedProperties and /hippo:configuration/hippo:modules/replication/hippo:moduleconfig/metadata/filter/modifiedValues for this purpose. Properties named in the former property get the value specified at the corresponding position in the latter property. Only properties of type string can be modified in this way.
Implement your own PropertyFilter
If the logic to determine which properties to filter out, or the way to modify those properties, is more complicated than what can be accomplished with the generic property filter, then you must implement your own. Create a class that implements the interface com.onehippo.cms7.replication.PropertyFilter:
If you want to be passed the moduleConfig node that registers your filter with the replication engine, then also implement the interface com.onehippo.cms7.replication.Configurable.
To register the filter with the replication engine add a node of type hipposys:moduleconfig below /hippo:configuration/hippo:modules/replication/hippo:moduleconfig/metadata/ using the following YAML source definition:
Note that the same class may implement both the PropertyFilter interface and the ReplicationScopeProvider interface.