Using Context Aware Configuration Collection
I created a CAC Configuration with the collection = true like this (redacting real values and field names)
package com.cws.aem.core.beans.caconfigs;
import org.apache.sling.caconfig.annotation.Configuration;
import org.apache.sling.caconfig.annotation.Property;
@Configuration(label = "Some Configuration", collection = true)
public @interface SomeConfiguration{
@Property(label = "Field A", order = 1)
String fieldA();
@Property(label = "Field B", order = 6)
String fieldB();
}
When I try to use the configuration above I used the following code
resource = getRequest().getRequestPathInfo().getSuffixResource();
resourceResolver = resource.getResourceResolver();
collection = resourceResolver.adaptTo(PageManager.class).getContainingPage(resource)
.getContentResource().adaptTo(ConfigurationBuilder.class).asCollection(SomeConfiguration.class);
I step through the logic with the JVM debugger, I can actually see the resource nodes for the configurations I stored. I don't know how to access that data though and render the values in the HTL template.
