use of mondrian.xmla.DataSourcesConfig.DataSources in project pentaho-platform by pentaho.
the class MondrianCatalogHelper method parseDataSources.
protected DataSourcesConfig.DataSources parseDataSources(final String dataSourcesConfigString) {
try {
if (dataSourcesConfigString == null) {
MondrianCatalogHelper.logger.warn(Messages.getInstance().getString(// $NON-NLS-1$
"MondrianCatalogHelper.WARN_PARSE_NULL_INPUT"));
return null;
}
String replacedConfigString = Util.replaceProperties(dataSourcesConfigString, Util.toMap(System.getProperties()));
if (MondrianCatalogHelper.logger.isDebugEnabled()) {
// $NON-NLS-1$
String msg = "parseDataSources: dataSources=" + replacedConfigString;
MondrianCatalogHelper.logger.debug(msg);
}
final Parser parser = XOMUtil.createDefaultParser();
final DOMWrapper doc = parser.parse(replacedConfigString);
catalogComplementInfoMap = makeCatalogComplementInfoMap(doc);
return new DataSourcesConfig.DataSources(doc);
} catch (XOMException e) {
throw Util.newError(e, Messages.getInstance().getErrorString("MondrianCatalogHelper.ERROR_0002_FAILED_TO_PARSE_DATASOURCE_CONFIG", dataSourcesConfigString));
}
}
Aggregations