public void startReport (ReportStructureRoot report)
throws DataSourceException, ReportProcessingException
{
try
{
final InputFeed feed = getInputFeed();
feed.startDocument();
feed.startMetaInfo();
feed.addDocumentAttribute(DocumentContext.BASE_RESOURCE_ATTR, report.getBaseResource());
feed.addDocumentAttribute(DocumentContext.RESOURCE_MANAGER_ATTR, report.getResourceManager());
String strictStyleMode = "false";
if ("true".equals(strictStyleMode))
{
feed.addDocumentAttribute(DocumentContext.STRICT_STYLE_MODE, Boolean.TRUE);
}
final NamespaceDefinition[] namespaces = createDefaultNameSpaces();
for (int i = 0; i < namespaces.length; i++)
{
final NamespaceDefinition definition = namespaces[i];
feed.startMetaNode();
feed.setMetaNodeAttribute("type", "namespace");
feed.setMetaNodeAttribute("definition", definition);
feed.endMetaNode();
}
if (report instanceof JFreeReport)
{
final JFreeReport realReport = (JFreeReport) report;
final int size = realReport.getStyleSheetCount();
for (int i = 0; i < size; i++)
{
final StyleSheet styleSheet = realReport.getStyleSheet(i);
feed.startMetaNode();
feed.setMetaNodeAttribute("type", "style");
feed.setMetaNodeAttribute("#content", styleSheet);
feed.endMetaNode();
}
}
feed.endMetaInfo();
this.namespaces = feed.getNamespaceCollection();
}
catch (InputFeedException dse)
{
dse.printStackTrace();
throw new ReportProcessingException("Failed to process inputfeed", dse);