use of org.openlca.ilcd.sources.DataSetInfo in project olca-modules by GreenDelta.
the class SourceExport method makeDateSetInfo.
private DataSetInfo makeDateSetInfo() {
log.trace("Create data set information.");
DataSetInfo info = new DataSetInfo();
info.uuid = source.refId;
LangString.set(info.name, source.name, config.lang);
if (source.description != null) {
LangString.set(info.description, source.description, config.lang);
}
addTextReference(info);
CategoryConverter converter = new CategoryConverter();
Classification c = converter.getClassification(source.category);
if (c != null)
info.classifications.add(c);
return info;
}
use of org.openlca.ilcd.sources.DataSetInfo in project olca-modules by GreenDelta.
the class SourceExport method run.
public Source run(org.openlca.core.model.Source source) {
if (config.store.contains(Source.class, source.refId))
return config.store.get(Source.class, source.refId);
this.source = source;
log.trace("Run source export with {}", source);
Source iSource = new Source();
iSource.version = "1.1";
iSource.adminInfo = makeAdminInfo();
SourceInfo info = new SourceInfo();
iSource.sourceInfo = info;
DataSetInfo dataSetInfo = makeDateSetInfo();
info.dataSetInfo = dataSetInfo;
File extFile = getExternalFile();
if (extFile == null)
config.store.put(iSource);
else {
addFileRef(dataSetInfo, extFile);
config.store.put(iSource, new File[] { extFile });
}
return iSource;
}
Aggregations