fix issue with upload field in xml export

saml2
Bernaldo Mihasi 2 years ago
parent 07f499707e
commit db8f10ac1e

@ -246,6 +246,19 @@ public class ExportXmlBuilderDatasetProfile {
}
}
break;
case UPLOAD:
UploadData uploadDataObject = (UploadData) field.getData();
dataOut.setAttribute("label", uploadDataObject.getLabel());
dataOut.setAttribute("maxFileSizeInMB", String.valueOf(uploadDataObject.getMaxFileSizeInMB()));
Element types = element.createElement("types");
uploadDataObject.getTypes().forEach(type -> {
Element optionChild = element.createElement("option");
optionChild.setAttribute("label", type.getLabel());
optionChild.setAttribute("value", type.getValue());
types.appendChild(optionChild);
});
dataOut.appendChild(types);
break;
case BOOLEAN_DECISION:
BooleanDecisionData booleanDecisionDataObject = (BooleanDecisionData) field.getData();
dataOut.setAttribute("label", booleanDecisionDataObject.getLabel());

@ -83,7 +83,13 @@ public class UploadData extends FieldData<UploadData> {
this.types.add(newOption);
}
this.setLabel(((Map<String, String>) data).get("label"));
this.setMaxFileSizeInMB(((Map<String, Integer>) data).get("maxFileSizeInMB"));
Object maxFileSizeInMB = ((Map<String, Object>) data).get("maxFileSizeInMB");
if(maxFileSizeInMB instanceof String){ // template export
this.setMaxFileSizeInMB(Integer.valueOf((String)maxFileSizeInMB));
}
else if(maxFileSizeInMB instanceof Integer){ // template preview
this.setMaxFileSizeInMB((Integer)maxFileSizeInMB);
}
}
return this;
}

Loading…
Cancel
Save