Minor fixes on DMP json export
This commit is contained in:
parent
2dc5037afe
commit
efe75b4932
|
@ -1135,7 +1135,7 @@ public class DataManagementPlanManager {
|
||||||
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||||
String fileName = dmp.getLabel();
|
String fileName = dmp.getLabel();
|
||||||
fileName = fileName.replaceAll("[^a-zA-Z0-9+ ]", "");
|
fileName = fileName.replaceAll("[^a-zA-Z0-9+ ]", "");
|
||||||
File file = new File(fileName);
|
File file = new File(fileName + ".json");
|
||||||
try {
|
try {
|
||||||
mapper.writeValue(file, rdaExportModel);
|
mapper.writeValue(file, rdaExportModel);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
@ -315,7 +315,7 @@ public class DatasetRDAExportModel {
|
||||||
if (rdaField.getRdaProperty().equals("dataset.metadata.language")) {
|
if (rdaField.getRdaProperty().equals("dataset.metadata.language")) {
|
||||||
metadataRda.setLanguage(rdaField.getRdaValue());
|
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());
|
JSONArray jsonArray = new JSONArray(rdaField.getRdaValue());
|
||||||
for (int i = 0; i < jsonArray.length(); i++) {
|
for (int i = 0; i < jsonArray.length(); i++) {
|
||||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||||
|
|
Loading…
Reference in New Issue