use of org.openforis.collect.datacleansing.DataCleansingMetadataView in project collect by openforis.
the class JsonDataCleansingExportTask method execute.
@Override
protected void execute() throws Throwable {
DataCleansingMetadata metadata = dataCleansingManager.loadMetadata(survey);
if (!metadata.isEmpty()) {
DataCleansingMetadataView metadataView = DataCleansingMetadataView.fromMetadata(metadata);
ObjectMapper mapper = new ObjectMapper();
mapper.writeValue(resultFile, metadataView);
}
}
use of org.openforis.collect.datacleansing.DataCleansingMetadataView in project collect by openforis.
the class JsonDataCleansingImportTask method execute.
@Override
protected void execute() throws Throwable {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
DataCleansingMetadataView metadataView = objectMapper.readValue(inputFile, DataCleansingMetadataView.class);
DataCleansingMetadata metadata = metadataView.toMetadata(survey);
// TODO handle exceptions
dataCleansingManager.saveMetadata(survey, metadata, true, activeUser);
}
Aggregations