66 lines
1.8 KiB
Java
66 lines
1.8 KiB
Java
package eu.eudat.commons.types.descriptiontemplate.importmodel;
|
|
|
|
import eu.eudat.model.persist.descriptiontemplatedefinition.PagePersist;
|
|
import eu.eudat.model.persist.descriptiontemplatedefinition.SectionPersist;
|
|
import eu.eudat.service.fielddatahelper.FieldDataHelperServiceProvider;
|
|
import jakarta.xml.bind.annotation.XmlAttribute;
|
|
import jakarta.xml.bind.annotation.XmlElement;
|
|
import jakarta.xml.bind.annotation.XmlRootElement;
|
|
import java.util.List;
|
|
|
|
@XmlRootElement(name = "page")
|
|
public class PageImportXml {
|
|
private String id;
|
|
private int ordinal;
|
|
private String title;
|
|
private List<SectionsImportXml> sections;
|
|
|
|
@XmlAttribute(name = "id")
|
|
public String getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(String id) {
|
|
this.id = id;
|
|
}
|
|
|
|
@XmlAttribute(name = "ordinal")
|
|
public int getOrdinal() {
|
|
return ordinal;
|
|
}
|
|
|
|
public void setOrdinal(int ordinal) {
|
|
this.ordinal = ordinal;
|
|
}
|
|
|
|
@XmlAttribute(name = "title")
|
|
public String getTitle() {
|
|
return title;
|
|
}
|
|
|
|
public void setTitle(String title) {
|
|
this.title = title;
|
|
}
|
|
|
|
@XmlElement(name = "sections")
|
|
public List<SectionsImportXml> getSections() {
|
|
return sections;
|
|
}
|
|
|
|
public void setSections(List<SectionsImportXml> sections) {
|
|
this.sections = sections;
|
|
}
|
|
|
|
public PagePersist toPersistModel(){
|
|
PagePersist pageEntity = new PagePersist();
|
|
pageEntity.setId(this.id);
|
|
pageEntity.setOrdinal(this.ordinal);
|
|
pageEntity.setTitle(this.title);
|
|
return pageEntity;
|
|
}
|
|
|
|
public SectionPersist toPersistModel(int i, FieldDataHelperServiceProvider fieldDataHelperServiceProvider){
|
|
return sections.get(i).toPersistModel(fieldDataHelperServiceProvider);
|
|
}
|
|
}
|