Expand my Community achievements bar.

SOLVED

AEM - vault -package filter.xml query

Avatar

Level 3

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(/.*)"/>
Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@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.

View solution in original post

11 Replies

Avatar

Community Advisor

@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?

Avatar

Level 3

@Shashi_Mulugu AEM versio is 6.4, Content maven version is 0.5.1, We are using include pattern so that we can inslude only the required folders other than including everthing in the package.

Avatar

Community Advisor

<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

Level 3
@Albin_Issac If we give <filter root="/apps/site"/> , the full nodes under site will be included right which I dont want. Hence given required paths only using include pattern. But my question is if i need to include all nodes and files under <include pattern="/apps/site/components"/>, how do i need to give the include pattern?

Avatar

Community Advisor

You can use either one of the below options

 

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

Exclude pattern - <exclude pattern="/apps/site/test(/.*)?" />

 

No need to add the include specific to parent node (<include pattern="/apps/site/components" />) if you have the regex rule 

Avatar

Correct answer by
Community Advisor

@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.

Avatar

Level 3
@BrianKasingli I have installed the package manually and saw the changes inside dialog.xml was not refflecting by just giving <include pattern="/apps/site/components"/>. I cannot give filter root alone as there are some folder which we don't need to be added as part of the package and hence giving the include patterns and including only those required

Avatar

Community Advisor

That's Great! My example was a default example to replace everything inside of the JCR. Manual installation works! thats great! it shows that your jackrabbit plugin works as expected! Next, What is your project version? is there a SNAPSHOT?

Avatar

Community Advisor

@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

Level 3
I tried <include pattern="/apps/site/components(/.*)?"/> and this did not work. Also, in my case exclude pattern will not work as we have a designs package which i would like to exclude inorder to remove the dependency between apps and design package. Since the clientlib folder resides in designs package, even though if we give the exlcude ath for designs in the apps filter, it will not work. So we have to go by include pattern only.