Export and Import Dataset Template description and language
This commit is contained in:
parent
e88f88d97c
commit
5b930a6870
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue