add xml attributes in dmp xml export

This commit is contained in:
Bernaldo Mihasi 2023-03-30 11:44:00 +03:00
parent 18a200f099
commit b6b7a2444c
1 changed files with 14 additions and 4 deletions

View File

@ -1573,10 +1573,14 @@ public class DataManagementPlanManager {
datasetElement.appendChild(datasetDescriptionElement);
datasetDescriptionElement.setTextContent(dataset.getDescription());
Element datsetProfileElement = xmlDoc.createElement("profile");
Element datsetProfileElement = xmlDoc.createElement("profile-id");
datasetElement.appendChild(datsetProfileElement);
datsetProfileElement.setTextContent(dataset.getProfile().getId().toString());
Element datsetProfileLabelElement = xmlDoc.createElement("profile-label");
datasetElement.appendChild(datsetProfileLabelElement);
datsetProfileLabelElement.setTextContent(dataset.getProfile().getLabel());
DatasetWizardModel datasetWizardModel = new DatasetWizardModel();
Map<String, Object> properties = new HashMap<>();
if (dataset.getProperties() != null) {
@ -1594,12 +1598,18 @@ public class DataManagementPlanManager {
// Get DatasetProfiles from DMP to add to XML.
for (DatasetProfile datasetProfile : dmp.getAssociatedDmps()) {
Element profile = xmlDoc.createElement("profile");
Element profileLabel = xmlDoc.createElement("profilelabel");
profileLabel.setTextContent(datasetProfile.getLabel());
profile.appendChild(profileLabel);
Element profileId = xmlDoc.createElement("profileId");
profileId.setTextContent(datasetProfile.getId().toString());
profile.appendChild(profileId);
Element profileGroupId = xmlDoc.createElement("profileGroupId");
profileGroupId.setTextContent(datasetProfile.getGroupId().toString());
profile.appendChild(profileGroupId);
Element profileLabel = xmlDoc.createElement("profileLabel");
profileLabel.setTextContent(datasetProfile.getLabel());
profile.appendChild(profileLabel);
Element profileVersion = xmlDoc.createElement("profileVersion");
profileVersion.setTextContent(String.valueOf(datasetProfile.getVersion()));
profile.appendChild(profileVersion);
profiles.appendChild(profile);
}
dmpElement.appendChild(profiles);