use of org.openlca.ilcd.util.SourceBag in project olca-modules by GreenDelta.
the class SourceImport method run.
public Source run(org.openlca.ilcd.sources.Source dataSet) {
this.ilcdSource = new SourceBag(dataSet, config.langOrder());
var source = config.db().get(Source.class, dataSet.getUUID());
return source != null ? source : createNew();
}
use of org.openlca.ilcd.util.SourceBag in project olca-modules by GreenDelta.
the class DataSets method putSource.
private static void putSource(SodaClient client) throws Exception {
Source source = load(Source.class, "source.xml");
SourceBag bag = new SourceBag(source, "en");
if (!client.contains(Source.class, bag.getId()))
client.put(source);
}
use of org.openlca.ilcd.util.SourceBag in project olca-modules by GreenDelta.
the class SourceBagTest method setUp.
@Before
public void setUp() throws Exception {
try (InputStream stream = this.getClass().getResourceAsStream("source.xml")) {
XmlBinder binder = new XmlBinder();
Source source = binder.fromStream(Source.class, stream);
bag = new SourceBag(source, "en");
}
}
Aggregations