use of org.craftercms.core.xml.mergers.impl.resolvers.UrlPatternMergeStrategyResolver in project engine by craftercms.
the class TargetedContentDescriptorMergeStrategyTest method createStrategyResolver.
private DescriptorMergeStrategyResolver createStrategyResolver(DescriptorMergeStrategy defaultMergeStrategy) {
InheritLevelsMergeStrategy inheritLevelsMergeStrategy = new InheritLevelsMergeStrategy();
inheritLevelsMergeStrategy.setLevelDescriptorFileName(LEVEL_DESCRIPTOR_FILENAME);
Map<String, DescriptorMergeStrategy> mappings = new LinkedHashMap<>(2);
mappings.put("/site/website/products/index.xml", inheritLevelsMergeStrategy);
mappings.put(".*", defaultMergeStrategy);
UrlPatternMergeStrategyResolver strategyResolver = new UrlPatternMergeStrategyResolver();
strategyResolver.setUrlPatternToStrategyMappings(mappings);
return strategyResolver;
}
Aggregations