Minor fixes on DMP json export

This commit is contained in:
George Kalampokis 2020-03-19 18:22:47 +02:00
parent 2dc5037afe
commit efe75b4932
2 changed files with 2 additions and 2 deletions

View File

@ -1135,7 +1135,7 @@ public class DataManagementPlanManager {
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
String fileName = dmp.getLabel();
fileName = fileName.replaceAll("[^a-zA-Z0-9+ ]", "");
File file = new File(fileName);
File file = new File(fileName + ".json");
try {
mapper.writeValue(file, rdaExportModel);
} catch (IOException e) {

View File

@ -315,7 +315,7 @@ public class DatasetRDAExportModel {
if (rdaField.getRdaProperty().equals("dataset.metadata.language")) {
metadataRda.setLanguage(rdaField.getRdaValue());
}
if (rdaField.getRdaProperty().equals("dataset.metadata.metadata_standard_id")) {
if (rdaField.getRdaProperty().equals("dataset.metadata.metadata_standard_id") && !rdaField.getRdaValue().isEmpty()) {
JSONArray jsonArray = new JSONArray(rdaField.getRdaValue());
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);