2019-02-25 17:46:16 +01:00
|
|
|
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel;
|
|
|
|
|
|
|
|
|
2023-07-25 14:04:39 +02:00
|
|
|
import eu.eudat.data.entities.DescriptionTemplate;
|
|
|
|
|
2021-04-05 10:40:25 +02:00
|
|
|
import javax.xml.bind.annotation.XmlAttribute;
|
2019-02-25 17:46:16 +01:00
|
|
|
import javax.xml.bind.annotation.XmlElement;
|
|
|
|
import javax.xml.bind.annotation.XmlRootElement;
|
|
|
|
import java.util.LinkedList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
@XmlRootElement(name = "pages")
|
|
|
|
public class DatasetProfile {
|
|
|
|
|
2021-04-05 10:40:25 +02:00
|
|
|
private String description;
|
|
|
|
private String language;
|
2023-10-02 09:14:14 +02:00
|
|
|
private String type;
|
2021-04-05 10:40:25 +02:00
|
|
|
|
2019-02-25 17:46:16 +01:00
|
|
|
private List<Page> page;
|
|
|
|
|
|
|
|
@XmlElement(name = "page")
|
|
|
|
public List<Page> getPage() {
|
|
|
|
return page;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setPage(List<Page> page) {
|
|
|
|
this.page = page;
|
|
|
|
}
|
|
|
|
|
2021-04-05 10:40:25 +02:00
|
|
|
@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;
|
|
|
|
}
|
|
|
|
|
2023-10-02 09:14:14 +02:00
|
|
|
@XmlAttribute(name = "type")
|
|
|
|
public String getType() {
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setType(String type) {
|
|
|
|
this.type = type;
|
|
|
|
}
|
|
|
|
|
2019-02-25 17:46:16 +01:00
|
|
|
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);
|
2023-07-25 14:04:39 +02:00
|
|
|
newDatasetEntityProfile.setStatus(DescriptionTemplate.Status.SAVED.getValue());
|
2021-04-05 10:40:25 +02:00
|
|
|
newDatasetEntityProfile.setDescription(description);
|
|
|
|
newDatasetEntityProfile.setLanguage(language);
|
2023-10-02 09:14:14 +02:00
|
|
|
newDatasetEntityProfile.setType(type);
|
2019-02-25 17:46:16 +01:00
|
|
|
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) {
|
|
|
|
pagesDatasetEntity.add(xmlPage.toAdminCompositeModelPage());
|
2021-10-06 14:02:21 +02:00
|
|
|
for (int i = 0; i < xmlPage.getSections().size(); i++) {
|
|
|
|
sectionDatasetEntity.add(xmlPage.toAdminCompositeModelSection(i));
|
|
|
|
}
|
2019-02-25 17:46:16 +01:00
|
|
|
}
|
|
|
|
newDatasetEntityProfile.setPages(pagesDatasetEntity);
|
|
|
|
newDatasetEntityProfile.setSections(sectionDatasetEntity);
|
|
|
|
|
|
|
|
return newDatasetEntityProfile;
|
|
|
|
}
|
|
|
|
}
|