Search code examples
packageaem

What is default mode for AEM filter.xml entry?


In AEM, there is well known filter.xml file used to filter target paths of a package. Here is an example :

<workspaceFilter version="1.0">
    <filter root="/etc/map" mode="merge" />
</workspaceFilter>

In my current project, the developpers asked multiple times what is the default mode. I think it's replace but it's not clear in Jackrabbit / AEM documentation.


Solution

  • Yes replace it a the default mode. The documentation says:

    "replace : This is the normal behavior. Existing content is replaced
     completely by the imported content, i.e. is overridden or deleted
     accordingly.The normal mode"
    

    https://jackrabbit.apache.org/filevault/filter.html

    The code is here (line 68): https://github.com/apache/jackrabbit-filevault/blob/e730ef9c999ac69b477675cd2671ff6ab5167d4d/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/api/FilterSet.java

    /**
     * import mode. defaults to {@link ImportMode#REPLACE}.
     */
    @NotNull
    private ImportMode mode = ImportMode.REPLACE;