AEM - vault -package filter.xml query

Avatar

Avatar
Validate 1
Level 2
pn_2007
Level 2

Likes

4 likes

Total Posts

42 posts

Correct reply

1 solution
Top badges earned
Validate 1
Ignite 1
Give Back
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
pn_2007
Level 2

Likes

4 likes

Total Posts

42 posts

Correct reply

1 solution
Top badges earned
Validate 1
Ignite 1
Give Back
Boost 3
Boost 1
View profile
pn_2007
Level 2

28-07-2020

In my apps package filter.xml i have give as below:

<filter root="/apps/site">
    <include pattern="/apps/site/components"/>
    <include pattern="/apps/site/config"/>
    <include pattern="/apps/site/config(.*)?"/>
    <include pattern="/apps/site/install"/>
    <include pattern="/apps/site/pages"/>
    <include pattern="/apps/site/templates"/>    
</filter>

With the above code, when I am deploying my package, any new folders/files created are getting updated in crxde any existing html file changes are getting updated in crxde but changes to component dialog.xml are not getting updated in crxde (to explain, I make changes directly in one of the component dialog in crxde and then i deploy my package. The changes I did are not getting udpated from my codebase is the problem)

So then I add the below pattern as well to the filter.xml and it works.

<include pattern="/apps/site/components(/.*)"/>

Can someone help me if we need to include both the below patterns in filter if this need to work or do we have an alternative approach?

<include pattern="/apps/site/components"/>
<include pattern="/apps/site/components(/.*)"/>

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

645 likes

Total Posts

607 posts

Correct reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

645 likes

Total Posts

607 posts

Correct reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
BrianKasingli
MVP

28-07-2020

@pn_2007 

Your filtering.xml file looks correct. What is your project's version? If there is no SNAPSHOT, then you need to manually click on install from the package manager, every time the package is uploaded into AEM. During development, we are expected to work against a SNAPSHOT version.

Secondly, if the SNAPSHOT version is not the problem, can you manually install the package in the package manager? I have a strong feeling that it might be the SNAPSHOT version not exist, as you may need to install the package manually, by clicking on the install button from the package manager. 

filter.xml below will replace all crx/de nodes with the folder structure provided below, recursively. You're on the right track.

 

 

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
    <filter root="/apps/my-site"/> // if empty, the mode is "replace"
</workspaceFilter>

 

 

Also, a reminder of the filter modes:

  1. replace : This is the normal behavior. Existing content is replaced completely 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 updated, new content is added and none is deleted.

Answers (3)

Answers (3)

Avatar

Avatar
Establish
Level 2
fanindras
Level 2

Likes

15 likes

Total Posts

19 posts

Correct reply

1 solution
Top badges earned
Establish
Give Back
Boost 5
Boost 3
Boost 10
View profile

Avatar
Establish
Level 2
fanindras
Level 2

Likes

15 likes

Total Posts

19 posts

Correct reply

1 solution
Top badges earned
Establish
Give Back
Boost 5
Boost 3
Boost 10
View profile
fanindras
Level 2

28-07-2020

@pn_2007 ,

 

As per my understanding, you have a solution to get the component dialog content updated but the actual problem is the necessity to always add multiple <include> entry for components like below:

 

<include pattern="/apps/site/components"/>
<include pattern="/apps/site/components(/.*)"/>

To avoid this, you can use a more generic regex like <include pattern="/apps/site/components(/.*)?"/> . I couldn't test this in my local though, Please verify and confirm, if this helps.

 

Alternatively, you can explore using <exclude> patterns for excluding specific folders that you don't want to deploy, rather than having <include> patterns for each sub folder of /apps/site, something like below:

<filter root="/apps/site">
    <exclude pattern="/apps/site/dont-include(/.*)"/> 
</filter>

 

Avatar

Avatar
Validate 1
MVP
Albin_Issac
MVP

Likes

106 likes

Total Posts

119 posts

Correct reply

33 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Validate 1
MVP
Albin_Issac
MVP

Likes

106 likes

Total Posts

119 posts

Correct reply

33 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
Albin_Issac
MVP

28-07-2020

<include pattern="/apps/site/components"/> - the pattern which has the format of a regexp. The regexp is matched against the full path of the respective or potential JCR node, so it either must start with / (absolute regex) or a wildcard (relative regex). If the pattern is absolute path only the specific domain is matched.

Refer http://jackrabbit.apache.org/filevault/filter.html for more details.

My recommendation is to use <filter root="/apps/site"/> without any includes so that all child nodes will be included if require define excludes based on the regex pattern.

Regards

Albin I

www.albinsblog.com

Avatar

Avatar
Springboard
MVP
Shashi_Mulugu
MVP

Likes

232 likes

Total Posts

294 posts

Correct reply

67 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Applaud 100
Establish
View profile

Avatar
Springboard
MVP
Shashi_Mulugu
MVP

Likes

232 likes

Total Posts

294 posts

Correct reply

67 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Applaud 100
Establish
View profile
Shashi_Mulugu
MVP

28-07-2020

@pn_2007 what version of aem you are using and what is the content maven plugin version also, why are using include pattern? Instead of just root? Any specific reason?