Search in sources :

Example 1 with SourceBag

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();
}
Also used : SourceBag(org.openlca.ilcd.util.SourceBag)

Example 2 with SourceBag

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);
}
Also used : SourceBag(org.openlca.ilcd.util.SourceBag) Source(org.openlca.ilcd.sources.Source)

Example 3 with SourceBag

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");
    }
}
Also used : InputStream(java.io.InputStream) SourceBag(org.openlca.ilcd.util.SourceBag) Source(org.openlca.ilcd.sources.Source) Before(org.junit.Before)

Aggregations

SourceBag (org.openlca.ilcd.util.SourceBag)3 Source (org.openlca.ilcd.sources.Source)2 InputStream (java.io.InputStream)1 Before (org.junit.Before)1