It seems like you are working with AEM (Adobe Experience Manager), and you are trying to deploy content fragments to a target environment without overriding a specific property (externalPreviewUrlPattern) within the content fragment model. Based on the filter approach you're using, you're on the right track, but there may be a slight misunderstanding about how the filter.xml is applied. Let’s go over the solution and ensure it works as expected.
Problem Breakdown:
You want to:
Suggested Solution:
In AEM, the filter.xml inside the content package defines what content will be included or excluded during deployment. Your current approach seems mostly correct, but there are a couple of things to check:
Ensure correct syntax in the filter.xml file.
Use the correct paths to reference the node/ property.
Verify the deployment mode to ensure it aligns with the correct behavior.
Corrected and Detailed Filter Example:
First, make sure that the path you're using to specify the property is correct and points to the exact property in the content fragment model.
<workspaceFilter version="1.0">
<filter root="/conf/myProject/settings/dam/cfm/mymodel" mode="replace">
<!-- Exclude the property externalPreviewUrlPattern from being replaced -->
<exclude pattern="/conf/myProject/settings/dam/cfm/mymodel/externalPreviewUrlPattern"/>
</filter>
</workspaceFilter>
Key Points:
mode="replace" – This means that all content under the specified path (/conf/myProject/settings/dam/cfm/mymodel) will be replaced. To avoid overriding specific properties, we are excluding them.
<exclude pattern="/conf/myProject/settings/dam/cfm/mymodel/externalPreviewUrlPattern"/> – This line tells the deployment process to exclude the externalPreviewUrlPattern from being replaced. You must ensure that the path is exactly correct. If it's a property inside the model (like externalPreviewUrlPattern), the path should point to the property, not just the model node.
Additional Considerations:
Property vs Node: Ensure that externalPreviewUrlPattern is indeed a property and not a child node. If it's a node, the pattern would need to specify that as well (e.g., /conf/myProject/settings/dam/cfm/mymodel/externalPreviewUrlPattern/*).
Deployment Mode: Check if the mode="replace" is causing unintended overwrites for other parts of your content. You can also try using mode="merge" if you don't want to completely replace the model but only update parts of it.
Testing the Solution:
Test on Staging: Test your filter.xml in a staging environment before applying it to production.
Verify Exclusions: After the deployment, verify that the externalPreviewUrlPattern property is not overwritten, while other model properties are updated as expected.
Summary:
The filter.xml syntax you are using is mostly correct.
Ensure the correct path to the property and confirm that it's a property (not a node).
If the problem persists, you may also want to experiment with changing the deployment mode to merge or double-check your model paths.
Let me know if this resolves the issue or if further adjustments are needed! Have a great night!
- Shaka