use of org.openlca.core.model.ProcessDocumentation in project olca-modules by GreenDelta.
the class ProcessConverter method mapDocumentation.
private void mapDocumentation(DataSet dataSet) {
ProcessDocumentation doc = process.documentation;
if (doc == null)
return;
mapDataSetInformation(doc, dataSet);
mapTime(doc, dataSet);
mapTechnology(doc, dataSet);
mapGeography(doc, dataSet);
mapModelingAndValidation(doc, dataSet);
mapAdminInfo(doc, dataSet);
}
use of org.openlca.core.model.ProcessDocumentation in project olca-modules by GreenDelta.
the class EcoSpold01Import method process.
private void process(DataSet ds) {
String id = ES1KeyGen.forProcess(ds);
Process p = db.get(Process.class, id);
if (p != null) {
log.skipped(p);
return;
}
p = new Process();
p.refId = id;
ProcessDocumentation doc = new ProcessDocumentation();
p.documentation = doc;
IReferenceFunction refFun = ds.getReferenceFunction();
if (refFun != null)
mapReferenceFunction(refFun, p);
p.processType = Mapper.getProcessType(ds);
mapTimeAndGeography(ds, p, doc);
if (ds.getTechnology() != null && ds.getTechnology().getText() != null) {
doc.technology = Strings.cut((ds.getTechnology().getText()), 65500);
}
mapExchanges(ds.getExchanges(), p);
if (p.quantitativeReference == null)
createProductFromRefFun(ds, p);
if (ds.getAllocations() != null && ds.getAllocations().size() > 0) {
mapAllocations(p, ds.getAllocations());
p.defaultAllocationMethod = AllocationMethod.CAUSAL;
}
Mapper.mapModellingAndValidation(ds, doc);
Mapper.mapAdminInfo(ds, p);
mapActors(doc, ds);
mapSources(doc, ds);
db.put(p, id);
localExchangeCache.clear();
log.imported(p);
}
use of org.openlca.core.model.ProcessDocumentation in project olca-modules by GreenDelta.
the class ProcessImport method switchDocRefs.
private void switchDocRefs(Process destProcess) {
if (destProcess.documentation == null)
return;
ProcessDocumentation doc = destProcess.documentation;
doc.reviewer = refs.switchRef(doc.reviewer);
doc.dataGenerator = refs.switchRef(doc.dataGenerator);
doc.dataDocumentor = refs.switchRef(doc.dataDocumentor);
doc.dataSetOwner = refs.switchRef(doc.dataSetOwner);
doc.publication = refs.switchRef(doc.publication);
List<Source> translatedSources = new ArrayList<>();
for (Source source : doc.sources) translatedSources.add(refs.switchRef(source));
doc.sources.clear();
doc.sources.addAll(translatedSources);
}
use of org.openlca.core.model.ProcessDocumentation in project olca-modules by GreenDelta.
the class ProcessReferenceSearchTest method createDocumentation.
private ProcessDocumentation createDocumentation() {
ProcessDocumentation doc = new ProcessDocumentation();
doc.dataDocumentor = db.insert(new Actor());
doc.dataGenerator = db.insert(new Actor());
doc.dataSetOwner = db.insert(new Actor());
doc.reviewer = db.insert(new Actor());
doc.publication = db.insert(new Source());
doc.sources.add(db.insert(new Source()));
doc.sources.add(db.insert(new Source()));
return doc;
}
use of org.openlca.core.model.ProcessDocumentation in project olca-modules by GreenDelta.
the class Update8Test method testProcessDoc.
@Test
public void testProcessDoc() {
Source source = new Source();
source.name = "source";
Daos.base(db, Source.class).insert(source);
ProcessDao dao = new ProcessDao(db);
Process proc = new Process();
proc.documentation = new ProcessDocumentation();
proc.documentation.sources.add(source);
proc.documentation.precedingDataSet = "ABC123";
dao.insert(proc);
proc = dao.getForId(proc.id);
assertEquals("source", proc.documentation.sources.get(0).name);
assertEquals("ABC123", proc.documentation.precedingDataSet);
dao.delete(proc);
Daos.base(db, Source.class).delete(source);
}
Aggregations