Search in sources :

Example 1 with ContextPathStrategyMultiplexerImpl

use of org.apache.sling.caconfig.management.impl.ContextPathStrategyMultiplexerImpl in project sling by apache.

the class DefaultConfigurationResourceResolvingStrategyHierarchyTest method setUp.

@Before
public void setUp() {
    context.registerInjectActivateService(new DefaultContextPathStrategy());
    context.registerInjectActivateService(new ContextPathStrategyMultiplexerImpl());
    underTest = context.registerInjectActivateService(new DefaultConfigurationResourceResolvingStrategy(), "configCollectionInheritancePropertyNames", PROPERTY_CONFIG_COLLECTION_INHERIT_CUSTOM);
    // content resources that form a deeper hierarchy
    context.build().resource("/content/tenant1", PROPERTY_CONFIG_REF, "/conf/brand1/tenant1").resource("/content/tenant1/region1", PROPERTY_CONFIG_REF, "/conf/brand1/tenant1/region1").resource("/content/tenant1/region1/site1", PROPERTY_CONFIG_REF, "/conf/brand1/tenant1/region1/site1").resource("/content/tenant1/region1/site2", PROPERTY_CONFIG_REF, "/conf/brand1/tenant1/region1/site2");
    site1Page1 = context.create().resource("/content/tenant1/region1/site1/page1");
    site2Page1 = context.create().resource("/content/tenant1/region1/site2/page1");
}
Also used : ContextPathStrategyMultiplexerImpl(org.apache.sling.caconfig.management.impl.ContextPathStrategyMultiplexerImpl) Before(org.junit.Before)

Example 2 with ContextPathStrategyMultiplexerImpl

use of org.apache.sling.caconfig.management.impl.ContextPathStrategyMultiplexerImpl 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");
}
Also used : ContextPathStrategyMultiplexerImpl(org.apache.sling.caconfig.management.impl.ContextPathStrategyMultiplexerImpl) DefaultContextPathStrategy(org.apache.sling.caconfig.resource.impl.def.DefaultContextPathStrategy) Before(org.junit.Before)

Example 3 with ContextPathStrategyMultiplexerImpl

use of org.apache.sling.caconfig.management.impl.ContextPathStrategyMultiplexerImpl 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());
}
Also used : ContextPathStrategyMultiplexerImpl(org.apache.sling.caconfig.management.impl.ContextPathStrategyMultiplexerImpl) DefaultConfigurationResourceResolvingStrategy(org.apache.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingStrategy) DefaultContextPathStrategy(org.apache.sling.caconfig.resource.impl.def.DefaultContextPathStrategy)

Example 4 with ContextPathStrategyMultiplexerImpl

use of org.apache.sling.caconfig.management.impl.ContextPathStrategyMultiplexerImpl in project sling by apache.

the class ConfigurationResourceTestUtils method registerConfigurationResourceResolverWithoutDefaultImpl.

/**
     * Register all services for {@link ConfigurationResourceResolver}
     * without the default implementations of the multiplexed services.
     * @param context Sling context
     */
public static ConfigurationResourceResolver registerConfigurationResourceResolverWithoutDefaultImpl(SlingContext context) {
    context.registerInjectActivateService(new ContextPathStrategyMultiplexerImpl());
    context.registerInjectActivateService(new ConfigurationResourceResolvingStrategyMultiplexerImpl());
    return context.registerInjectActivateService(new ConfigurationResourceResolverImpl());
}
Also used : ContextPathStrategyMultiplexerImpl(org.apache.sling.caconfig.management.impl.ContextPathStrategyMultiplexerImpl)

Example 5 with ContextPathStrategyMultiplexerImpl

use of org.apache.sling.caconfig.management.impl.ContextPathStrategyMultiplexerImpl in project sling by apache.

the class DefaultConfigurationResourceResolvingStrategyTest method setUp.

@Before
public void setUp() {
    context.registerInjectActivateService(new DefaultContextPathStrategy());
    context.registerInjectActivateService(new ContextPathStrategyMultiplexerImpl());
    // content resources
    context.build().resource("/content/site1", PROPERTY_CONFIG_REF, "/conf/site1").resource("/content/site2", PROPERTY_CONFIG_REF, "/conf/site2").resource("/content/mainsite", PROPERTY_CONFIG_REF, "/conf/main").resource("/content/mainsite/sub", PROPERTY_CONFIG_REF, "sub").resource("/content/mainsite/sub/some/where/deep", PROPERTY_CONFIG_REF, "sub/deep");
    site1Page1 = context.create().resource("/content/site1/page1");
    site2Page1 = context.create().resource("/content/site2/page1");
    subPage = context.create().resource("/content/mainsite/sub/page1");
    deepPage = context.create().resource("/content/mainsite/sub/some/where/deep/page1");
}
Also used : ContextPathStrategyMultiplexerImpl(org.apache.sling.caconfig.management.impl.ContextPathStrategyMultiplexerImpl) Before(org.junit.Before)

Aggregations

ContextPathStrategyMultiplexerImpl (org.apache.sling.caconfig.management.impl.ContextPathStrategyMultiplexerImpl)6 Before (org.junit.Before)3 DefaultContextPathStrategy (org.apache.sling.caconfig.resource.impl.def.DefaultContextPathStrategy)2 ConfigurationResourceResolverImpl (org.apache.sling.caconfig.resource.impl.ConfigurationResourceResolverImpl)1 DefaultConfigurationResourceResolvingStrategy (org.apache.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingStrategy)1