Iterates trough child resources looking for the all resources from two specific resourceType
Hi,
I need to find two different resource types in the content and then render these in the correct order as they are stored in the content.
private List<???how to define it???> getRelevantResources(Resource r) {
return ResourceModelUtil.getAllResourcesFromResourceType(r, ???here I would have two resource types???)
.stream()
.map(resource-> event.adaptTo(??? not sure how to adapt here to two resource types???))
.filter(Objects::nonNull)
.collect(Collectors.toList());
I wrote a conceptual code but I am missing some building blocks that I marked with questionmarks. The idea is that I get a list that I can then render in a template.
Thanks in advance.