[wip] dmp xml upload changes, including section and extra fields information
This commit is contained in:
parent
3f14528f16
commit
94c0f7ac9c
|
@ -1,5 +1,6 @@
|
||||||
package eu.eudat.logic.managers;
|
package eu.eudat.logic.managers;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import eu.eudat.configurations.dynamicgrant.DynamicGrantConfiguration;
|
import eu.eudat.configurations.dynamicgrant.DynamicGrantConfiguration;
|
||||||
import eu.eudat.configurations.dynamicgrant.entities.Property;
|
import eu.eudat.configurations.dynamicgrant.entities.Property;
|
||||||
|
@ -1708,9 +1709,9 @@ public class DataManagementPlanManager {
|
||||||
Element dmpProfileId = xmlDoc.createElement("dmpProfileId");
|
Element dmpProfileId = xmlDoc.createElement("dmpProfileId");
|
||||||
dmpProfileId.setTextContent(dmpProfile.getId().toString());
|
dmpProfileId.setTextContent(dmpProfile.getId().toString());
|
||||||
dmpProfileElement.appendChild(dmpProfileId);
|
dmpProfileElement.appendChild(dmpProfileId);
|
||||||
Element values = xmlDoc.createElement("values");
|
// Element values = xmlDoc.createElement("values");
|
||||||
values.setTextContent(dmpProfile.getDefinition());
|
// values.setTextContent(dmpProfile.getDefinition());
|
||||||
dmpProfileElement.appendChild(values);
|
// dmpProfileElement.appendChild(values);
|
||||||
}
|
}
|
||||||
dmpElement.appendChild(dmpProfileElement);
|
dmpElement.appendChild(dmpProfileElement);
|
||||||
|
|
||||||
|
@ -1830,8 +1831,33 @@ public class DataManagementPlanManager {
|
||||||
researchersElement.appendChild(researcherElement);
|
researchersElement.appendChild(researcherElement);
|
||||||
}
|
}
|
||||||
dmpElement.appendChild(researchersElement);
|
dmpElement.appendChild(researchersElement);
|
||||||
Element datasetsElement = xmlDoc.createElement("datasets");
|
|
||||||
|
|
||||||
|
Element extraFields = xmlDoc.createElement("extraFields");
|
||||||
|
Map<String, Object> dmpProperties = new ObjectMapper().readValue(dmp.getProperties(), new TypeReference<Map<String, Object>>() {});
|
||||||
|
DataManagementPlanBlueprint blueprint = this.dataManagementProfileManager.getSingleBlueprint(dmp.getProfile().getId().toString(), principal).getDefinition();
|
||||||
|
blueprint.getSections().forEach(section -> {
|
||||||
|
section.getFields().forEach(fieldModel -> {
|
||||||
|
if (fieldModel.getCategory() == FieldCategory.EXTRA) {
|
||||||
|
Element extraField = xmlDoc.createElement("extraField");
|
||||||
|
Element extraFieldId = xmlDoc.createElement("id");
|
||||||
|
extraFieldId.setTextContent(fieldModel.getId().toString());
|
||||||
|
Element extraFieldLabel = xmlDoc.createElement("label");
|
||||||
|
extraFieldLabel.setTextContent(fieldModel.getLabel());
|
||||||
|
Element extraFieldValue = xmlDoc.createElement("value");
|
||||||
|
Object value = dmpProperties.get(fieldModel.getId().toString());
|
||||||
|
if (value != null) {
|
||||||
|
extraFieldValue.setTextContent((String) value);
|
||||||
|
}
|
||||||
|
extraField.appendChild(extraFieldId);
|
||||||
|
extraField.appendChild(extraFieldLabel);
|
||||||
|
extraField.appendChild(extraFieldValue);
|
||||||
|
extraFields.appendChild(extraField);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
dmpElement.appendChild(extraFields);
|
||||||
|
|
||||||
|
Element datasetsElement = xmlDoc.createElement("datasets");
|
||||||
for (Dataset dataset : datasets) {
|
for (Dataset dataset : datasets) {
|
||||||
Element datasetElement = xmlDoc.createElement("dataset");
|
Element datasetElement = xmlDoc.createElement("dataset");
|
||||||
datasetElement.setAttribute("name", dataset.getLabel());
|
datasetElement.setAttribute("name", dataset.getLabel());
|
||||||
|
@ -1840,6 +1866,10 @@ public class DataManagementPlanManager {
|
||||||
datasetElement.appendChild(datasetDescriptionElement);
|
datasetElement.appendChild(datasetDescriptionElement);
|
||||||
datasetDescriptionElement.setTextContent(dataset.getDescription());
|
datasetDescriptionElement.setTextContent(dataset.getDescription());
|
||||||
|
|
||||||
|
Element datasetDmpSectionIndex = xmlDoc.createElement("dmpSectionIndex");
|
||||||
|
datasetElement.appendChild(datasetDmpSectionIndex);
|
||||||
|
datasetDmpSectionIndex.setTextContent(String.valueOf(dataset.getDmpSectionIndex()));
|
||||||
|
|
||||||
Element datsetProfileElement = xmlDoc.createElement("profile-id");
|
Element datsetProfileElement = xmlDoc.createElement("profile-id");
|
||||||
datasetElement.appendChild(datsetProfileElement);
|
datasetElement.appendChild(datsetProfileElement);
|
||||||
datsetProfileElement.setTextContent(dataset.getProfile().getId().toString());
|
datsetProfileElement.setTextContent(dataset.getProfile().getId().toString());
|
||||||
|
@ -1860,8 +1890,8 @@ public class DataManagementPlanManager {
|
||||||
datasetElement.appendChild(xmlBuilder.createPages(pagedDatasetProfile.getPages(), visibilityRuleService, xmlDoc));
|
datasetElement.appendChild(xmlBuilder.createPages(pagedDatasetProfile.getPages(), visibilityRuleService, xmlDoc));
|
||||||
datasetsElement.appendChild(datasetElement);
|
datasetsElement.appendChild(datasetElement);
|
||||||
}
|
}
|
||||||
Element profiles = xmlDoc.createElement("profiles");
|
|
||||||
|
|
||||||
|
Element profiles = xmlDoc.createElement("profiles");
|
||||||
// Get DatasetProfiles from DMP to add to XML.
|
// Get DatasetProfiles from DMP to add to XML.
|
||||||
for (DMPDatasetProfile dmpDescriptionProfile : dmp.getAssociatedDmps()) {
|
for (DMPDatasetProfile dmpDescriptionProfile : dmp.getAssociatedDmps()) {
|
||||||
DescriptionTemplate descriptionTemplate = dmpDescriptionProfile.getDatasetprofile();
|
DescriptionTemplate descriptionTemplate = dmpDescriptionProfile.getDatasetprofile();
|
||||||
|
@ -1878,6 +1908,15 @@ public class DataManagementPlanManager {
|
||||||
Element profileVersion = xmlDoc.createElement("profileVersion");
|
Element profileVersion = xmlDoc.createElement("profileVersion");
|
||||||
profileVersion.setTextContent(String.valueOf(descriptionTemplate.getVersion()));
|
profileVersion.setTextContent(String.valueOf(descriptionTemplate.getVersion()));
|
||||||
profile.appendChild(profileVersion);
|
profile.appendChild(profileVersion);
|
||||||
|
Element profileInSections = xmlDoc.createElement("profileInSections");
|
||||||
|
Map<String, Object> data = new ObjectMapper().readValue(dmpDescriptionProfile.getData(), new TypeReference<Map<String, Object>>() {});
|
||||||
|
List<Integer> sections = (List<Integer>) data.get("dmpSectionIndex");
|
||||||
|
for(int section: sections) {
|
||||||
|
Element profileInSection = xmlDoc.createElement("section");
|
||||||
|
profileInSection.setTextContent(String.valueOf(section));
|
||||||
|
profileInSections.appendChild(profileInSection);
|
||||||
|
}
|
||||||
|
profile.appendChild(profileInSections);
|
||||||
profiles.appendChild(profile);
|
profiles.appendChild(profile);
|
||||||
}
|
}
|
||||||
dmpElement.appendChild(profiles);
|
dmpElement.appendChild(profiles);
|
||||||
|
@ -1988,59 +2027,85 @@ public class DataManagementPlanManager {
|
||||||
// Creates new dataManagementPlan to fill it with the data model that was parsed from the xml.
|
// Creates new dataManagementPlan to fill it with the data model that was parsed from the xml.
|
||||||
// Creates properties.
|
// Creates properties.
|
||||||
DataManagementPlanEditorModel dm = new DataManagementPlanEditorModel();
|
DataManagementPlanEditorModel dm = new DataManagementPlanEditorModel();
|
||||||
// DataManagementPlanProfile dmpProfile = new DataManagementPlanProfile();
|
|
||||||
//
|
|
||||||
// List<Field> fieldList = new LinkedList<>();
|
|
||||||
// Field field = new Field();
|
|
||||||
// field.setLabel(dataManagementPlans.get(0).getDmpProfile().getDmpProfileName());
|
|
||||||
// field.setId(dataManagementPlans.get(0).getDmpProfile().getDmpProfileId());
|
|
||||||
//
|
|
||||||
// fieldList.add(field);
|
|
||||||
// dmpProfile.setFields(fieldList);
|
|
||||||
|
|
||||||
/*Tuple tuple = new Tuple();
|
DmpProfileImportModel dmpProfileImportModel = dataManagementPlans.get(0).getDmpProfile();
|
||||||
tuple.setId(dataManagementPlans.get(0).getDmpProfile().getDmpProfileId());
|
Tuple<UUID, String> tupleProfile = new Tuple<>();
|
||||||
tuple.setLabel(dataManagementPlans.get(0).getDmpProfile().getDmpProfileName());*/
|
if (dmpProfileImportModel != null) {
|
||||||
eu.eudat.models.data.funder.Funder funder = new eu.eudat.models.data.funder.Funder();
|
tupleProfile.setId(dmpProfileImportModel.getDmpProfileId());
|
||||||
FunderImportModels funderImport = dataManagementPlans.get(0).getFunderImportModels();
|
tupleProfile.setLabel(dmpProfileImportModel.getDmpProfileName());
|
||||||
funder.setId(funderImport.getId());
|
}
|
||||||
funder.setLabel(funderImport.getLabel());
|
else {
|
||||||
FunderDMPEditorModel funderEditor = new FunderDMPEditorModel();
|
tupleProfile.setId(UUID.fromString("86635178-36a6-484f-9057-a934e4eeecd5"));
|
||||||
funderEditor.setExistFunder(funder);
|
tupleProfile.setLabel("Dmp Default Blueprint");
|
||||||
|
}
|
||||||
|
dm.setProfile(tupleProfile);
|
||||||
|
|
||||||
eu.eudat.models.data.grant.Grant grant = new eu.eudat.models.data.grant.Grant();
|
|
||||||
GrantImportModels grantImport = dataManagementPlans.get(0).getGrantImport();
|
|
||||||
grant.setId(grantImport.getId());
|
|
||||||
grant.setLabel(grantImport.getLabel());
|
|
||||||
grant.setAbbreviation(grantImport.getAbbreviation());
|
|
||||||
grant.setDescription(grantImport.getDescription());
|
|
||||||
GrantDMPEditorModel grantEditor = new GrantDMPEditorModel();
|
|
||||||
grantEditor.setExistGrant(grant);
|
|
||||||
|
|
||||||
eu.eudat.models.data.project.Project project = new eu.eudat.models.data.project.Project();
|
Map<String, Object> dmpPropertiesMap = new HashMap<>();
|
||||||
ProjectImportModels projectImport = dataManagementPlans.get(0).getProjectImportModels();
|
if (dataManagementPlans.get(0).getExtraFieldsImportModels() != null) {
|
||||||
project.setId(projectImport.getId());
|
for (ExtraFieldsImportModels extraField: dataManagementPlans.get(0).getExtraFieldsImportModels()) {
|
||||||
project.setLabel(projectImport.getLabel());
|
dmpPropertiesMap.put(extraField.getId(), extraField.getValue());
|
||||||
ProjectDMPEditorModel projectEditor = new ProjectDMPEditorModel();
|
|
||||||
projectEditor.setExistProject(project);
|
|
||||||
|
|
||||||
List<eu.eudat.models.data.dmp.AssociatedProfile> associatedProfiles = new LinkedList<>();
|
|
||||||
if (profiles != null && profiles.length > 0) {
|
|
||||||
for (String profile : profiles) {
|
|
||||||
DescriptionTemplate exProfile = apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().find(UUID.fromString(profile));
|
|
||||||
AssociatedProfile associatedProfile = new AssociatedProfile().fromData(exProfile);
|
|
||||||
associatedProfiles.add(associatedProfile);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
dm.setProperties(dmpPropertiesMap);
|
||||||
|
|
||||||
|
if (this.dataManagementProfileManager.fieldInBlueprint(dmpProfileImportModel.getDmpProfileId().toString(), SystemFieldType.FUNDER, principal)) {
|
||||||
|
eu.eudat.models.data.funder.Funder funder = new eu.eudat.models.data.funder.Funder();
|
||||||
|
FunderImportModels funderImport = dataManagementPlans.get(0).getFunderImportModels();
|
||||||
|
funder.setId(funderImport.getId());
|
||||||
|
funder.setLabel(funderImport.getLabel());
|
||||||
|
FunderDMPEditorModel funderEditor = new FunderDMPEditorModel();
|
||||||
|
funderEditor.setExistFunder(funder);
|
||||||
|
|
||||||
|
dm.setFunder(funderEditor);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.dataManagementProfileManager.fieldInBlueprint(dmpProfileImportModel.getDmpProfileId().toString(), SystemFieldType.GRANT, principal)) {
|
||||||
|
eu.eudat.models.data.grant.Grant grant = new eu.eudat.models.data.grant.Grant();
|
||||||
|
GrantImportModels grantImport = dataManagementPlans.get(0).getGrantImport();
|
||||||
|
grant.setId(grantImport.getId());
|
||||||
|
grant.setLabel(grantImport.getLabel());
|
||||||
|
grant.setAbbreviation(grantImport.getAbbreviation());
|
||||||
|
grant.setDescription(grantImport.getDescription());
|
||||||
|
GrantDMPEditorModel grantEditor = new GrantDMPEditorModel();
|
||||||
|
grantEditor.setExistGrant(grant);
|
||||||
|
|
||||||
|
dm.setGrant(grantEditor);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.dataManagementProfileManager.fieldInBlueprint(dmpProfileImportModel.getDmpProfileId().toString(), SystemFieldType.PROJECT, principal)) {
|
||||||
|
eu.eudat.models.data.project.Project project = new eu.eudat.models.data.project.Project();
|
||||||
|
ProjectImportModels projectImport = dataManagementPlans.get(0).getProjectImportModels();
|
||||||
|
project.setId(projectImport.getId());
|
||||||
|
project.setLabel(projectImport.getLabel());
|
||||||
|
ProjectDMPEditorModel projectEditor = new ProjectDMPEditorModel();
|
||||||
|
projectEditor.setExistProject(project);
|
||||||
|
|
||||||
|
dm.setProject(projectEditor);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<eu.eudat.models.data.dmp.AssociatedProfile> associatedProfiles = new LinkedList<>();
|
||||||
|
// if (profiles != null && profiles.length > 0) {
|
||||||
|
// for (String profile : profiles) {
|
||||||
|
// DescriptionTemplate exProfile = apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().find(UUID.fromString(profile));
|
||||||
|
// AssociatedProfile associatedProfile = new AssociatedProfile().fromData(exProfile);
|
||||||
|
// associatedProfiles.add(associatedProfile);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
for (AssociatedProfileImportModels a : dataManagementPlans.get(0).getProfilesImportModels()) {
|
for (AssociatedProfileImportModels a : dataManagementPlans.get(0).getProfilesImportModels()) {
|
||||||
try {
|
try {
|
||||||
DescriptionTemplate exProfile = apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().find(a.getId());
|
DescriptionTemplate exProfile = apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().find(a.getId());
|
||||||
AssociatedProfile associatedProfile = new AssociatedProfile().fromData(exProfile);
|
AssociatedProfile associatedProfile = new AssociatedProfile().fromData(exProfile);
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
List<Integer> sections = new ArrayList<>(a.getSection());
|
||||||
|
data.put("dmpSectionIndex", sections);
|
||||||
|
associatedProfile.setData(data);
|
||||||
associatedProfiles.add(associatedProfile);
|
associatedProfiles.add(associatedProfile);
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<eu.eudat.models.data.dmp.Organisation> organisations = new ArrayList<>();
|
List<eu.eudat.models.data.dmp.Organisation> organisations = new ArrayList<>();
|
||||||
for (OrganisationImportModel org : dataManagementPlans.get(0).getOrganisationImportModels()) {
|
for (OrganisationImportModel org : dataManagementPlans.get(0).getOrganisationImportModels()) {
|
||||||
eu.eudat.models.data.dmp.Organisation organisation = new eu.eudat.models.data.dmp.Organisation();
|
eu.eudat.models.data.dmp.Organisation organisation = new eu.eudat.models.data.dmp.Organisation();
|
||||||
|
@ -2049,6 +2114,7 @@ public class DataManagementPlanManager {
|
||||||
organisation.setKey(organisation.getReference().split(":")[0]);
|
organisation.setKey(organisation.getReference().split(":")[0]);
|
||||||
organisations.add(organisation);
|
organisations.add(organisation);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<eu.eudat.models.data.dmp.Researcher> researchers = new LinkedList<>();
|
List<eu.eudat.models.data.dmp.Researcher> researchers = new LinkedList<>();
|
||||||
for (ResearcherImportModels res : dataManagementPlans.get(0).getResearchersImportModels()) {
|
for (ResearcherImportModels res : dataManagementPlans.get(0).getResearchersImportModels()) {
|
||||||
eu.eudat.models.data.dmp.Researcher researcher = new eu.eudat.models.data.dmp.Researcher();
|
eu.eudat.models.data.dmp.Researcher researcher = new eu.eudat.models.data.dmp.Researcher();
|
||||||
|
@ -2064,9 +2130,6 @@ public class DataManagementPlanManager {
|
||||||
|
|
||||||
// Sets properties.
|
// Sets properties.
|
||||||
dm.setLabel(files[0].getOriginalFilename()); // Sets label.
|
dm.setLabel(files[0].getOriginalFilename()); // Sets label.
|
||||||
dm.setGrant(grantEditor); //Sets grant property.
|
|
||||||
dm.setFunder(funderEditor);
|
|
||||||
dm.setProject(projectEditor);
|
|
||||||
dm.setDescription(dataManagementPlans.get(0).getDescriptionImport()); // Sets description property.
|
dm.setDescription(dataManagementPlans.get(0).getDescriptionImport()); // Sets description property.
|
||||||
dm.setProfiles(associatedProfiles);
|
dm.setProfiles(associatedProfiles);
|
||||||
dm.setOrganisations(organisations); // Sets organisations property.
|
dm.setOrganisations(organisations); // Sets organisations property.
|
||||||
|
@ -2112,6 +2175,7 @@ public class DataManagementPlanManager {
|
||||||
for (DatasetImportModels das: dataManagementPlans.get(0).getDatasetImportModels()) {
|
for (DatasetImportModels das: dataManagementPlans.get(0).getDatasetImportModels()) {
|
||||||
eu.eudat.data.entities.Dataset dataset = new eu.eudat.data.entities.Dataset();
|
eu.eudat.data.entities.Dataset dataset = new eu.eudat.data.entities.Dataset();
|
||||||
dataset.setLabel(das.getName());
|
dataset.setLabel(das.getName());
|
||||||
|
dataset.setDmpSectionIndex(das.getDmpSectionIndex());
|
||||||
try {
|
try {
|
||||||
dataset.setProfile(databaseRepository.getDatasetProfileDao().find(das.getProfile()));
|
dataset.setProfile(databaseRepository.getDatasetProfileDao().find(das.getProfile()));
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
|
|
|
@ -108,6 +108,11 @@ public class DataManagementProfileManager {
|
||||||
return dataManagementPlanBlueprintListingModel;
|
return dataManagementPlanBlueprintListingModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean fieldInBlueprint(String id, SystemFieldType type, Principal principal) {
|
||||||
|
DMPProfile dmpProfile = databaseRepository.getDmpProfileDao().find(UUID.fromString(id));
|
||||||
|
return this.fieldInBlueprint(dmpProfile, type, principal);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean fieldInBlueprint(DMPProfile dmpProfile, SystemFieldType type, Principal principal) {
|
public boolean fieldInBlueprint(DMPProfile dmpProfile, SystemFieldType type, Principal principal) {
|
||||||
DataManagementPlanBlueprintListingModel dmpBlueprint = new DataManagementPlanBlueprintListingModel();
|
DataManagementPlanBlueprintListingModel dmpBlueprint = new DataManagementPlanBlueprintListingModel();
|
||||||
dmpBlueprint.fromDataModel(dmpProfile);
|
dmpBlueprint.fromDataModel(dmpProfile);
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
package eu.eudat.models.data.dmp;
|
package eu.eudat.models.data.dmp;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import jakarta.xml.bind.annotation.XmlElement;
|
import jakarta.xml.bind.annotation.XmlElement;
|
||||||
|
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
||||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
@XmlRootElement(name = "profile")
|
@XmlRootElement(name = "profile")
|
||||||
public class AssociatedProfileImportModels {
|
public class AssociatedProfileImportModels {
|
||||||
private UUID id;
|
private UUID id;
|
||||||
private String label;
|
private String label;
|
||||||
|
private List<Integer> section;
|
||||||
|
|
||||||
@XmlElement(name = "profileId")
|
@XmlElement(name = "profileId")
|
||||||
public UUID getId() { return id; }
|
public UUID getId() { return id; }
|
||||||
|
@ -16,4 +19,13 @@ public class AssociatedProfileImportModels {
|
||||||
@XmlElement(name = "profilelabel")
|
@XmlElement(name = "profilelabel")
|
||||||
public String getLabel() { return label; }
|
public String getLabel() { return label; }
|
||||||
public void setLabel(String label) { this.label = label; }
|
public void setLabel(String label) { this.label = label; }
|
||||||
|
|
||||||
|
@XmlElementWrapper(name="profileInSections")
|
||||||
|
@XmlElement(name = "section")
|
||||||
|
public List<Integer> getSection() {
|
||||||
|
return section;
|
||||||
|
}
|
||||||
|
public void setSection(List<Integer> section) {
|
||||||
|
this.section = section;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ public class DatasetImportModels {
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private UUID profile;
|
private UUID profile;
|
||||||
|
private int dmpSectionIndex;
|
||||||
private HashMap<String, String> fieldImportModels;
|
private HashMap<String, String> fieldImportModels;
|
||||||
|
|
||||||
@XmlAttribute(name ="name")
|
@XmlAttribute(name ="name")
|
||||||
|
@ -27,6 +28,7 @@ public class DatasetImportModels {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlElement(name = "profile-id")
|
||||||
public UUID getProfile() {
|
public UUID getProfile() {
|
||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
|
@ -34,6 +36,14 @@ public class DatasetImportModels {
|
||||||
this.profile = profile;
|
this.profile = profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlElement(name = "dmpSectionIndex")
|
||||||
|
public int getDmpSectionIndex() {
|
||||||
|
return dmpSectionIndex;
|
||||||
|
}
|
||||||
|
public void setDmpSectionIndex(int dmpSectionIndex) {
|
||||||
|
this.dmpSectionIndex = dmpSectionIndex;
|
||||||
|
}
|
||||||
|
|
||||||
@XmlJavaTypeAdapter(PageAdapter.class)
|
@XmlJavaTypeAdapter(PageAdapter.class)
|
||||||
@XmlElement(name = "pages")
|
@XmlElement(name = "pages")
|
||||||
public HashMap<String, String> getFieldImportModels() {
|
public HashMap<String, String> getFieldImportModels() {
|
||||||
|
|
|
@ -17,6 +17,7 @@ public class DmpImportModel {
|
||||||
private List<OrganisationImportModel> organisationImportModels;
|
private List<OrganisationImportModel> organisationImportModels;
|
||||||
private List<ResearcherImportModels> researchersImportModels;
|
private List<ResearcherImportModels> researchersImportModels;
|
||||||
private List<UserInfoImportModels> associatedUsersImportModels;
|
private List<UserInfoImportModels> associatedUsersImportModels;
|
||||||
|
private List<ExtraFieldsImportModels> extraFieldsImportModels;
|
||||||
private List<DynamicFieldWithValueImportModels> dynamicFieldsImportModels;
|
private List<DynamicFieldWithValueImportModels> dynamicFieldsImportModels;
|
||||||
private List<DatasetImportModels> datasetImportModels;
|
private List<DatasetImportModels> datasetImportModels;
|
||||||
private String language;
|
private String language;
|
||||||
|
@ -104,6 +105,15 @@ public class DmpImportModel {
|
||||||
this.associatedUsersImportModels = associatedUsersImportModels;
|
this.associatedUsersImportModels = associatedUsersImportModels;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlElementWrapper(name="extraFields")
|
||||||
|
@XmlElement(name = "extraField")
|
||||||
|
public List<ExtraFieldsImportModels> getExtraFieldsImportModels() {
|
||||||
|
return extraFieldsImportModels;
|
||||||
|
}
|
||||||
|
public void setExtraFieldsImportModels(List<ExtraFieldsImportModels> extraFieldsImportModels) {
|
||||||
|
this.extraFieldsImportModels = extraFieldsImportModels;
|
||||||
|
}
|
||||||
|
|
||||||
@XmlElementWrapper(name="dynamicFieldWithValues")
|
@XmlElementWrapper(name="dynamicFieldWithValues")
|
||||||
@XmlElement(name = "dynamicFieldWithValue")
|
@XmlElement(name = "dynamicFieldWithValue")
|
||||||
public List<DynamicFieldWithValueImportModels> getDynamicFieldsImportModels() {
|
public List<DynamicFieldWithValueImportModels> getDynamicFieldsImportModels() {
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
package eu.eudat.models.data.dmp;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "extraField")
|
||||||
|
public class ExtraFieldsImportModels {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String label;
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
@XmlElement(name = "id")
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@XmlElement(name = "label")
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
@XmlElement(name = "value")
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue