Export and Import Dataset Template description and language

This commit is contained in:
George Kalampokis 2021-04-05 11:40:25 +03:00
parent e88f88d97c
commit 5b930a6870
3 changed files with 45 additions and 1 deletions

View File

@ -32,6 +32,9 @@ public class ExportXmlBuilderDatasetProfile {
// root.appendChild(createPages(datasetProfile.getPages(), datasetProfile.getSections(), xmlDoc));
xmlDoc.appendChild(createPages(datasetProfile.getPages(), datasetProfile.getSections(), xmlDoc));
Element pages = (Element)xmlDoc.getFirstChild();
pages.setAttribute("description", datasetProfile.getDescription());
pages.setAttribute("language", datasetProfile.getLanguage());
String xml = XmlBuilder.generateXml(xmlDoc);
writer.write(xml);
writer.close();

View File

@ -1,6 +1,7 @@
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.LinkedList;
@ -9,6 +10,9 @@ import java.util.List;
@XmlRootElement(name = "pages")
public class DatasetProfile {
private String description;
private String language;
private List<Page> page;
@XmlElement(name = "page")
@ -20,11 +24,30 @@ public class DatasetProfile {
this.page = page;
}
@XmlAttribute(name = "description")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@XmlAttribute(name = "language")
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public eu.eudat.models.data.admin.composite.DatasetProfile toAdminCompositeModel(String label){
eu.eudat.models.data.admin.composite.DatasetProfile newDatasetEntityProfile = new eu.eudat.models.data.admin.composite.DatasetProfile();
newDatasetEntityProfile.setLabel(label);
newDatasetEntityProfile.setStatus(eu.eudat.data.entities.DatasetProfile.Status.SAVED.getValue());
newDatasetEntityProfile.setDescription(description);
newDatasetEntityProfile.setLanguage(language);
List<eu.eudat.models.data.admin.components.datasetprofile.Page> pagesDatasetEntity = new LinkedList<>();
List<eu.eudat.models.data.admin.components.datasetprofile.Section> sectionDatasetEntity = new LinkedList<>();
for (Page xmlPage: page) {

View File

@ -10,11 +10,29 @@ import java.util.List;
import java.util.Map;
public class DatasetProfile implements PropertiesModelBuilder {
private String description;
private String language;
private List<Section> sections;
private List<Rule> rules;
private List<Page> pages;
private int status;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public List<Section> getSections() {
return sections;
}