AEM Filter.xml | Community
Skip to main content
Level 3
December 2, 2021
Solved

AEM Filter.xml

  • December 2, 2021
  • 2 replies
  • 8297 views

I made below changes in filter.xml file:
<filter root="/etc/msm/rolloutconfigs/" mode="update"/>

 

There are certain rollout-configs listed under path /etc/msm/rolloutconfigs

 

/etc/msm/rolloutconfigs/rollout-config-sample has some value for 'editMap' property at editProperties node ( /etc/msm/rolloutconfigs/rollout-config-dealer/jcr:content/editProperties).

rollout-config-sample is not part of the code base and I did some modification in editMap value for which I created a package and Installed on the server. After each deployment, my modified value gets overwritten even though I've set mode="update".
I was expecting it to add the new content while keeping the existing value in place.

Could anyone please help me understand why mode="update" didn't work as expected here or I understood it wrong?


This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by user1576

Just replace mode ="merge"

2 replies

lukasz-m
Community Advisor
Community Advisor
December 2, 2021

Hi @meenurajput, I think what you should try mode="merge". I think the update mode is working as expected.

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

Please find more information about each mode under https://jackrabbit.apache.org/filevault/filter.html#Filter_Elements

Level 3
December 2, 2021

Hi @lukasz-m Thanks for you response. With mode="update" We expect that Existing content is updated, new content is added and none is deleted.

My situation is that I’m installing a package which is adding some content at /etc/msm/rolloutconfigs/rollout-config-same path. Once i deploy code, it is overwriting the line of code I added with the old/previous value.
 

Before update, I also tried merge on a particular filter path like 

	<filter root="/etc/msm/rolloutconfigs/rollout-config-dealer" mode="merge"/> 

With this, once I deployed the code, it was completely deleting the "/etc/msm/rolloutconfigs/rollout-config-dealer" node from /etc/msm/rolloutconfigs/ path. 


lukasz-m
Community Advisor
Community Advisor
December 2, 2021

@meenurajputcould you please share list of all filters related to /etc that you are using in your package?

user1576Accepted solution
Level 3
December 6, 2021

Just replace mode ="merge"

July 12, 2024

My issue is somewhat similar. 

I want to preserve what is here: 

<filter root="/apps/cq/core/content/nav/tools" mode="merge"/>

Building the app, there is an error stating 

"Filter root's ancestor '/apps/cq/core' is not covered by any of the specified dependencies.".

When I add all of those to the filter, I still don't get the mode="merge" flag set in the UI.