Wednesday, 5 February 2014

Adobe CQ/AEM package install behaviour - filter.xml

Encountered a problem that whenever a package is deploy / installed, it will overwrite existing content and folder structure that was setup.

Using the filter.xml under META-INF/vault, we can configure it in a way that it keep existing content intact.

http://www.wemblog.com/2012/04/how-to-change-package-install-behavior.html

There are three Modes available:

  1. replace: Normal behavior. Existing content is replaced completly by the imported content, i.e. is overridden or deleted accordingly.
  2. merge: Existing content is not modified, i.e. only new content is added and none is deleted or modified
  3. update: Existing content is only updated but never deleted



Add it under META-INF/vault/filter.xml
<?xml version="1.0" encoding="UTF-8"?>

<workspaceFilter version="1.0">
    <filter root="/content" mode="update"/>
</workspaceFilter>


Advance package filtering include / exclude regular expression

http://aemfaq.blogspot.com.au/2013/04/cq5-package-filter-includeexclude.html

Example META-INF/vault/filter.xml
<?xml version="1.0" encoding="UTF-8"?>

<workspaceFilter version="1.0">
    <filter root="/content" mode="update">
        <include pattern="/content/foo/bar/*"/>
        </filter>
</workspaceFilter>



No comments:

Post a Comment