use of com.day.cq.wcm.api.reference.Reference in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class CaConfigReferenceProvider method findReferences.
@Override
public List<Reference> findReferences(Resource resource) {
if (!enabled) {
return Collections.emptyList();
}
List<Reference> references = new ArrayList<>();
// If the resource is not part of a page: stop the processing
PageManager pageManager = resource.getResourceResolver().adaptTo(PageManager.class);
if (pageManager == null) {
return references;
}
Page page = pageManager.getContainingPage(resource);
if (page == null) {
return references;
}
for (String config : configurationManager.getConfigurationNames()) {
addCaConfigReference(config, resource, references);
}
return references;
}
Aggregations