use of org.apache.sling.caconfig.resource.impl.def.DefaultContextPathStrategy in project sling by apache.
the class ContextPlugins method registerConfigurationResourceResolverDefaultImpl.
/**
* Register default implementations for for ConfigurationResourceResolver.
* @param context Sling context
*/
private static void registerConfigurationResourceResolverDefaultImpl(SlingContextImpl context) {
context.registerInjectActivateService(new DefaultContextPathStrategy());
context.registerInjectActivateService(new DefaultConfigurationResourceResolvingStrategy());
}
use of org.apache.sling.caconfig.resource.impl.def.DefaultContextPathStrategy in project sling by apache.
the class ContextPathStrategyMultiplexerImplTest method testWithDefaultStrategy.
@Test
public void testWithDefaultStrategy() {
context.registerInjectActivateService(new DefaultContextPathStrategy());
assertThat(toResourceIterator(underTest.findContextResources(site1Page1)), ResourceIteratorMatchers.paths("/content/tenant1/region1/site1", "/content/tenant1/region1", "/content/tenant1"));
assertThat(toResourceIterator(underTest.findContextResources(site2Page1)), ResourceIteratorMatchers.paths("/content/tenant1/region1/site2", "/content/tenant1/region1", "/content/tenant1"));
}
use of org.apache.sling.caconfig.resource.impl.def.DefaultContextPathStrategy in project sling by apache.
the class ConfigurationResourceResolvingStrategyMultiplexerImplTest method setUp.
@Before
public void setUp() {
context.registerInjectActivateService(new DefaultContextPathStrategy());
context.registerInjectActivateService(new ContextPathStrategyMultiplexerImpl());
underTest = context.registerInjectActivateService(new ConfigurationResourceResolvingStrategyMultiplexerImpl());
// content resources
context.build().resource("/content/site1", PROPERTY_CONFIG_REF, "/conf/site1").resource("/content/site2", PROPERTY_CONFIG_REF, "/conf/site2");
site1Page1 = context.create().resource("/content/site1/page1");
// configuration
context.build().resource("/conf/site1/sling:test/test").resource("/conf/site1/sling:test/feature", PROPERTY_CONFIG_COLLECTION_INHERIT, true).resource("c").resource("/conf/site2/sling:test/feature", PROPERTY_CONFIG_COLLECTION_INHERIT, true).siblingsMode().resource("c").resource("d").resource("/apps/conf/sling:test/feature", PROPERTY_CONFIG_COLLECTION_INHERIT, true).resource("a").resource("/libs/conf/sling:test/test").resource("/libs/conf/sling:test/feature").resource("b");
}
use of org.apache.sling.caconfig.resource.impl.def.DefaultContextPathStrategy in project sling by apache.
the class ConfigurationResourceTestUtils method registerConfigurationResourceResolver.
/**
* Register all services for {@link ConfigurationResourceResolver}.
* @param context Sling context
*/
public static ConfigurationResourceResolver registerConfigurationResourceResolver(SlingContext context) {
context.registerInjectActivateService(new DefaultContextPathStrategy());
context.registerInjectActivateService(new ContextPathStrategyMultiplexerImpl());
context.registerInjectActivateService(new DefaultConfigurationResourceResolvingStrategy());
context.registerInjectActivateService(new ConfigurationResourceResolvingStrategyMultiplexerImpl());
return context.registerInjectActivateService(new ConfigurationResourceResolverImpl());
}
Aggregations