Skip to content

Commit

Permalink
Check Content Fragment Models for replication metadata by default
Browse files Browse the repository at this point in the history
This closes #17
  • Loading branch information
kwin committed Jun 27, 2024
1 parent c09d4e5 commit 4e2299b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class AemReplicationMetadataValidatorFactory implements ValidatorFactory
private static final @NotNull Set<@NotNull String> DEFAULT_AGENT_NAMES = Collections.singleton(ReplicationMetadata.DEFAULT_AGENT_NAME);
private static final @NotNull Map<Pattern, String> DEFAULT_INCLUDED_NODE_PATH_PATTERNS_AND_TYPES = createDefaultIncludeMap();
private static final String RESOURCE_TYPE_SEGMENT_PAGE = "cq/contexthub/components/segment-page";
private static final String RESOURCE_TYPE_CONTENT_FRAGMENT_MODEL_PAGE = "dam/cfm/models/console/components/data/entity/default";

private static Map<Pattern, String> createDefaultIncludeMap() {
Map<Pattern, String> map = new HashMap<>();
Expand All @@ -53,6 +54,8 @@ private static Map<Pattern, String> createDefaultIncludeMap() {
map.put(Pattern.compile(".*/settings/wcm/templates/[^/]*/policies"), NameConstants.NT_PAGE);
// mapped content policies (as found by com.day.cq.wcm.core.impl.reference.ContentPolicyReferenceProvider)
map.put(Pattern.compile(".*/settings/wcm/policies/.*"), RESOURCE_TYPE_CONTENT_POLICY);
// content fragment models (as found by com.adobe.cq.dam.cfm.impl.search.ContentFragmentReferencePublishProvider)
map.put(Pattern.compile(".*/settings/dam/cfm/models/.*"), RESOURCE_TYPE_CONTENT_FRAGMENT_MODEL_PAGE);
// regular context-aware configuration (as found by https://github.com/adobe/aem-core-wcm-components/blob/main/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/services/CaConfigReferenceProvider.java)
map.put(Pattern.compile("/(apps|conf)/.*/(sling:configs|settings/cloudconfigs)/.*"), NameConstants.NT_PAGE);
// segment pages (as found by com.day.cq.personalization.impl.TargetedComponentReferenceProvider)
Expand Down

0 comments on commit 4e2299b

Please sign in to comment.