use of org.activityinfo.legacy.shared.reports.content.TableContent in project activityinfo by bedatadriven.
the class TableGenerator method generate.
@Override
public void generate(User user, TableElement element, Filter inheritedFilter, DateRange dateRange) {
Filter filter = GeneratorUtils.resolveElementFilter(element, dateRange);
Filter effectiveFilter = inheritedFilter == null ? filter : new Filter(inheritedFilter, filter);
TableContent content = new TableContent();
content.setFilterDescriptions(generateFilterDescriptions(filter, Collections.<DimensionType>emptySet(), user));
TableData data = generateData(element, effectiveFilter);
content.setData(data);
if (element.getMap() != null) {
mapGenerator.generate(user, element.getMap(), effectiveFilter, dateRange);
Map<Integer, String> siteLabels = element.getMap().getContent().siteLabelMap();
for (SiteDTO row : data.getRows()) {
row.set("map", siteLabels.get(row.getId()));
}
}
element.setContent(content);
}
Aggregations