Search in sources :

Example 1 with InheritLevelsMergeStrategy

use of org.craftercms.core.xml.mergers.impl.strategies.InheritLevelsMergeStrategy 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;
}
Also used : DescriptorMergeStrategy(org.craftercms.core.xml.mergers.DescriptorMergeStrategy) UrlPatternMergeStrategyResolver(org.craftercms.core.xml.mergers.impl.resolvers.UrlPatternMergeStrategyResolver) InheritLevelsMergeStrategy(org.craftercms.core.xml.mergers.impl.strategies.InheritLevelsMergeStrategy) Mockito.anyString(org.mockito.Mockito.anyString) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

LinkedHashMap (java.util.LinkedHashMap)1 DescriptorMergeStrategy (org.craftercms.core.xml.mergers.DescriptorMergeStrategy)1 UrlPatternMergeStrategyResolver (org.craftercms.core.xml.mergers.impl.resolvers.UrlPatternMergeStrategyResolver)1 InheritLevelsMergeStrategy (org.craftercms.core.xml.mergers.impl.strategies.InheritLevelsMergeStrategy)1 Mockito.anyString (org.mockito.Mockito.anyString)1