fix export-import dataset missing rda mappings

This commit is contained in:
Bernaldo Mihasi 2022-02-08 14:04:26 +02:00
parent 815fc05af6
commit 80e5e12f29
2 changed files with 17 additions and 0 deletions

View File

@ -163,6 +163,11 @@ public class ExportXmlBuilderDatasetProfile {
numbering.setTextContent(field.getNumbering());
elementField.appendChild(numbering);
}
if (field.getRdaProperty() != null) {
Element rdaProperty = element.createElement("rdaProperty");
rdaProperty.setTextContent(field.getRdaProperty());
elementField.appendChild(rdaProperty);
}
if (field.getValidations() != null) {
Element validations = element.createElement("validations");
field.getValidations().forEach(validation -> {

View File

@ -29,6 +29,8 @@ public class Field {
private Object data;
private String rdaProperty;
@XmlAttribute(name = "id")
public String getId() {
return id;
@ -101,6 +103,15 @@ public class Field {
this.data = data;
}
@XmlElement(name = "rdaProperty")
public String getRdaProperty() {
return rdaProperty;
}
public void setRdaProperty(String rdaProperty) {
this.rdaProperty = rdaProperty;
}
public eu.eudat.models.data.admin.components.datasetprofile.Field toAdminCompositeModelSection() {
eu.eudat.models.data.admin.components.datasetprofile.Field fieldEntity =new eu.eudat.models.data.admin.components.datasetprofile.Field();
@ -120,6 +131,7 @@ public class Field {
if (data != null) {
fieldEntity.setData(data.toMap((Element) this.data));
}
fieldEntity.setRdaCommonStandard(this.rdaProperty);
return fieldEntity;
}
}