// Loop over children, get resources, call some ..forMultiMetrics..
List<Integer> resourceIds = new ArrayList<Integer>();
for (AutoGroupComposite child : children) {
List resources = child.getResources();
ResourceWithAvailability rwa = (ResourceWithAvailability) resources.get(0);
resourceIds.add(rwa.getResource().getId());
}
// Map<ResourceId, List<Summaries for that resource>
Map<Integer, List<MetricDisplaySummary>> summaries = dataManager
.findNarrowedMetricDisplaySummariesForResourcesAndParent(subject, resourceTypeId, parentId,
resourceIds, begin, end);
for (AutoGroupComposite child : children) {
if (parentComposite != null)
child.increaseDepth(1);
List resources = child.getResources();
ResourceWithAvailability rwa = (ResourceWithAvailability) resources.get(0);
List<MetricDisplaySummary> sumList = summaries.get(rwa.getResource().getId());
displaySummary.add(new AutoGroupCompositeDisplaySummary(child, sumList));
}
} else {
RequestUtils.setError(request, MessageConstants.ERR_RESOURCE_NOT_FOUND);