use of org.mycore.common.config.MCRConfiguration in project mycore by MyCoRe-Org.
the class MCRDataSourceFactory method buildDataSource.
private MCRDataSource buildDataSource(String sourceID) {
MCRConfiguration config = MCRConfiguration.instance();
MCRDataSource dataSource = new MCRDataSource(sourceID);
String[] identifierTypes = config.getString("MCR.MODS.EnrichmentResolver.DataSource." + sourceID + ".IdentifierTypes").split("\\s");
for (String typeID : identifierTypes) {
String prefix = "MCR.MODS.EnrichmentResolver.DataSource." + sourceID + "." + typeID + ".";
String uri = config.getString(prefix + "URI");
MCRIdentifierType idType = MCRIdentifierTypeFactory.instance().getType(typeID);
MCRIdentifierResolver resolver = new MCRIdentifierResolver(idType, uri);
dataSource.addResolver(resolver);
}
return dataSource;
}
Aggregations