* @throws org.xml.sax.SAXException if there is a parsing error.
*/
protected void startParsing(final PropertyAttributes attrs)
throws SAXException
{
RootXmlReadHandler rootHandler = getRootHandler();
final Object maybeReport = rootHandler.getHelperObject
(ReportParserUtil.HELPER_OBJ_REPORT_NAME);
final MasterReport report;
if (maybeReport instanceof MasterReport == false)
{
// replace it ..
report = new MasterReport();
report.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, rootHandler.getSource());
}
else
{
report = (MasterReport) maybeReport;
}
if (ReportParserUtil.isIncluded(rootHandler) == false)
{
final String query = attrs.getValue(getUri(), "query");
if (query != null)
{
report.setQuery(query);
}
final String value = attrs.getValue(getUri(), "name");
if (value != null)
{
report.setName(value);
}
}
final ElementFactoryCollector elementFactory = new ElementFactoryCollector();
final StyleKeyFactoryCollector styleKeyFactory = new StyleKeyFactoryCollector();
final ClassFactoryCollector classFactory = new ClassFactoryCollector();
final DataSourceCollector dataSourceFactory = new DataSourceCollector();
final TemplateCollector templateFactory = new TemplateCollector();
classFactory.configure(rootHandler.getParserConfiguration());
dataSourceFactory.configure(rootHandler.getParserConfiguration());
templateFactory.configure(rootHandler.getParserConfiguration());
if (rootHandler.getHelperObject(ReportParserUtil.HELPER_OBJ_LEGACY_STYLES) instanceof HashMap == false)
{
rootHandler.setHelperObject(ReportParserUtil.HELPER_OBJ_LEGACY_STYLES, new HashMap<String, ElementStyleSheet>());
}
rootHandler.setHelperObject(ReportParserUtil.HELPER_OBJ_REPORT_NAME, report);
rootHandler.setHelperObject(ReportDefinitionReadHandler.ELEMENT_FACTORY_KEY, elementFactory);
rootHandler.setHelperObject(ReportDefinitionReadHandler.STYLE_FACTORY_KEY, styleKeyFactory);
rootHandler.setHelperObject(ReportDefinitionReadHandler.CLASS_FACTORY_KEY, classFactory);
rootHandler.setHelperObject(ReportDefinitionReadHandler.DATASOURCE_FACTORY_KEY, dataSourceFactory);
rootHandler.setHelperObject(ReportDefinitionReadHandler.TEMPLATE_FACTORY_KEY, templateFactory);
report.setAttribute(AttributeNames.Internal.NAMESPACE, AttributeNames.Internal.FILEFORMAT, "extended-xml");
report.setCompatibilityLevel(ClassicEngineBoot.computeVersionId(3, 8, 0));
this.report = report;
}