final URL metaDataSource = ObjectUtilities.getResource
("org/pentaho/reporting/engine/classic/core/metadata/meta-elements.xml", ElementMetaDataParser.class);
if (metaDataSource == null)
{
throw new ModuleInitializeException("Error: Could not find the core element meta-data description file");
}
try
{
ElementTypeRegistry.getInstance().registerFromXml(metaDataSource);
}
catch (Exception e)
{
logger.debug("Failed:", e);
throw new ModuleInitializeException("Error: Could not parse the element meta-data description file", e);
}
final URL expressionMetaSource = ObjectUtilities.getResource
("org/pentaho/reporting/engine/classic/core/function/meta-expressions.xml", ElementMetaDataParser.class);
if (expressionMetaSource == null)
{
throw new ModuleInitializeException("Error: Could not find the core expression meta-data description file");
}
try
{
ExpressionRegistry.getInstance().registerFromXml(expressionMetaSource);
}
catch (Exception e)
{
logger.debug("Failed:", e);
throw new ModuleInitializeException("Error: Could not parse the expression meta-data description file", e);
}
final URL dataFactoryMetaSource = ObjectUtilities.getResource
("org/pentaho/reporting/engine/classic/core/metadata/meta-datafactory.xml", ElementMetaDataParser.class);
if (dataFactoryMetaSource == null)
{
throw new ModuleInitializeException("Error: Could not find the core dataFactory meta-data description file");
}
try
{
DataFactoryRegistry.getInstance().registerFromXml(dataFactoryMetaSource);
}
catch (Exception e)
{
logger.debug("Failed:", e);
throw new ModuleInitializeException("Error: Could not parse the datafactory meta-data description file", e);
}
final URL reportPreProcessorMetaSource = ObjectUtilities.getResource
("org/pentaho/reporting/engine/classic/core/metadata/meta-report-preprocessors.xml", ElementMetaDataParser.class);
if (reportPreProcessorMetaSource == null)
{
throw new ModuleInitializeException("Error: Could not find the core report-preprocessor meta-data description file");
}
try
{
ReportPreProcessorRegistry.getInstance().registerFromXml(reportPreProcessorMetaSource);
}
catch (Exception e)
{
logger.debug("Failed:", e);
throw new ModuleInitializeException("Error: Could not parse the report-preprocessor meta-data description file", e);
}
}