Share this article on

The filter is used to define what parts of the JCR repository will be inport or export during package installation or un-installation.

The filter.xml file is present under META-INF/vault. filter.xml has below structure. It consist a set of filter elements which is having a mandatory root attribute and optional include and exclude child elements.

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
    <filter root="/apps/techiearchive">
        <exclude pattern="/apps/techiearchive/install" />
    </filter>
    <filter root="/etc/clientlibs/techiearchive"/>
    <filter root="/etc/notification/email/html/techiearchive"/>
</workspaceFilter>

Filter elements

The filter elements are independent of each other and define include and exclude patters for subtrees. The root of a subtree is defined by the root attribute, which must be an absolute path.

The filter element can have an optional mode attribute which specified the import mode used when importing content. the following values are possible:

replace

This is the normal behavior. Existing content is replaced completely by the imported content, i.e. is overridden or deleted accordingly.

merge

Existing content is not modified, i.e. only new content is added and none is deleted or modified.

update

Existing content is updated, new content is added and none is deleted.

Share this article on

10 Replies to “Workspace Filter in AEM”

  1. Good thoughts and great article. You are bang on point. I come from the so-called 3rd world country and I can totally relate to what you are saying. Jordan Max Udale

Comments are closed.