use of org.apache.camel.component.salesforce.api.dto.analytics.reports.SummaryValue in project camel by apache.
the class SalesforceReportResultsToListConverter method addSummaryGroupValues.
private static void addSummaryGroupValues(ArrayList<List<String>> result, AbstractReportResultsBase reportResults, String[] columnNames, GroupingValue groupingValue, List<String> rowPrefix, boolean includeDetails, boolean includeSummary) {
// get fact map at this level
final ReportFactWithDetails factWithDetails = reportResults.getFactMap().get(groupingValue.getKey() + "!T");
final List<String> newPrefix = new ArrayList<String>(rowPrefix);
newPrefix.add(groupingValue.getLabel());
// more groups?
final GroupingValue[] groupings = groupingValue.getGroupings();
if (groupings.length > 0) {
for (GroupingValue subGroup : groupings) {
addSummaryGroupValues(result, reportResults, columnNames, subGroup, newPrefix, includeDetails, includeSummary);
}
// add lowest level group detail rows?
} else if (includeDetails) {
addDetailRows(result, newPrefix, factWithDetails);
// add group columns only at lowest level?
} else if (!includeSummary) {
result.add(newPrefix);
}
if (includeSummary) {
final SummaryValue[] summaryValues = factWithDetails.getAggregates();
final String[] aggregates = reportResults.getReportMetadata().getAggregates();
addSummaryValues(result, includeDetails, columnNames, newPrefix, aggregates, summaryValues);
}
}
Aggregations