final AbstractReportDefinition reportDefinition) throws ReportProcessingException
{
final int count = section.getElementCount();
for (int i = 0; i < count; i++)
{
final ReportElement element = section.getElement(i);
if (element instanceof SubReport)
{
continue;
}
if (element instanceof Section)
{
processSection((Section) element, dataSchema, reportDefinition);
continue;
}
final Object attribute =
element.getAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.ELEMENT_TYPE);
if (attribute instanceof LegacyChartType == false)
{
continue;
}
final Object maybeChartExpression =
element.getAttributeExpression(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE);
if (maybeChartExpression instanceof ChartExpression == false)
{
continue;
}
final ChartExpression chartExpression = (ChartExpression) maybeChartExpression;
final Object primaryChartExpression = element.getAttribute
(LegacyChartElementModule.NAMESPACE, LegacyChartElementModule.PRIMARY_DATA_COLLECTOR_FUNCTION_ATTRIBUTE);
if (primaryChartExpression instanceof Expression)
{
final Expression datasetExpression = (Expression) primaryChartExpression;
final Expression datasetExpressionInstance = datasetExpression.getInstance();
final String name = AutoGeneratorUtility.generateUniqueExpressionName
(dataSchema, "::legacy-charts::primary-dataset::{0}", reportDefinition);
datasetExpressionInstance.setName(name);
chartExpression.setDataSource(name);
reportDefinition.addExpression(datasetExpressionInstance);
}
if (chartExpression instanceof MultiPlotChartExpression == false)
{
continue;
}
final MultiPlotChartExpression multiPlotChartExpression = (MultiPlotChartExpression) chartExpression;
final Object secondaryDataSourceExpression = element.getAttribute
(LegacyChartElementModule.NAMESPACE, LegacyChartElementModule.SECONDARY_DATA_COLLECTOR_FUNCTION_ATTRIBUTE);
if (secondaryDataSourceExpression instanceof Expression)
{
final Expression datasetExpression = (Expression) secondaryDataSourceExpression;
final Expression datasetExpressionInstance = datasetExpression.getInstance();