Commit efe75b49 authored by George Kalampokis's avatar George Kalampokis

Minor fixes on DMP json export

parent 2dc5037a
......@@ -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) {
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment