DescriptionTemplate refactor
This commit is contained in:
parent
e02237e599
commit
d38f22ccbf
|
@ -6,38 +6,71 @@ import eu.eudat.data.converters.enums.DatabaseEnum;
|
|||
import java.util.Map;
|
||||
|
||||
public enum FieldType implements DatabaseEnum<String> {
|
||||
COMBO_BOX("combobox"), //TODO remove from xml an keep subtypes only AUTO_COMPLETE, WORD_LIST
|
||||
AUTO_COMPLETE("autocomplete"),
|
||||
WORD_LIST("wordlist"),
|
||||
BOOLEAN_DECISION("booleanDecision"),
|
||||
RADIO_BOX("radiobox"),
|
||||
INTERNAL_DMP_ENTRIES("internalDmpEntities"), //TODO remove from xml an keep subtypes only INTERNAL_DMP_ENTRIES_RESEARCHERS. INTERNAL_DMP_ENTRIES_DMPS, INTERNAL_DMP_ENTRIES_DATASETS
|
||||
INTERNAL_DMP_ENTRIES_RESEARCHERS("internalDmpResearchers"),
|
||||
INTERNAL_DMP_ENTRIES_DMPS("internalDmpDmps"),
|
||||
INTERNAL_DMP_ENTRIES_DATASETS("internalDmpDatasets"),
|
||||
CHECK_BOX("checkBox"),
|
||||
FREE_TEXT("freetext"),
|
||||
TEXT_AREA("textarea"),
|
||||
RICH_TEXT_AREA("richTextarea"),
|
||||
UPLOAD("upload"),
|
||||
DATE_PICKER("datePicker"),
|
||||
EXTERNAL_DATASETS("externalDatasets"),
|
||||
DATA_REPOSITORIES("dataRepositories"),
|
||||
JOURNAL_REPOSITORIES("journalRepositories"),
|
||||
PUB_REPOSITORIES("pubRepositories"),
|
||||
LICENSES("licenses"),
|
||||
TAXONOMIES("taxonomies"),
|
||||
PUBLICATIONS("publications"),
|
||||
REGISTRIES("registries"),
|
||||
SERVICES("services"),
|
||||
TAGS("tags"),
|
||||
RESEARCHERS("researchers"),
|
||||
ORGANIZATIONS("organizations"),
|
||||
DATASET_IDENTIFIER("datasetIdentifier"),
|
||||
CURRENCY("currency"),
|
||||
VALIDATION("validation");
|
||||
COMBO_BOX(Names.ComboBox), //TODO remove from xml an keep subtypes only AUTO_COMPLETE, WORD_LIST
|
||||
AUTO_COMPLETE(Names.Autocomplete),
|
||||
WORD_LIST(Names.Wordlist),
|
||||
BOOLEAN_DECISION(Names.BooleanDecision),
|
||||
RADIO_BOX(Names.RadioBox),
|
||||
INTERNAL_DMP_ENTRIES(Names.InternalDmpEntities), //TODO remove from xml an keep subtypes only INTERNAL_DMP_ENTRIES_RESEARCHERS. INTERNAL_DMP_ENTRIES_DMPS, INTERNAL_DMP_ENTRIES_DATASETS
|
||||
INTERNAL_DMP_ENTRIES_RESEARCHERS(Names.InternalDmpResearchers),
|
||||
INTERNAL_DMP_ENTRIES_DMPS(Names.InternalDmpDmps),
|
||||
INTERNAL_DMP_ENTRIES_DATASETS(Names.InternalDmpDatasets),
|
||||
CHECK_BOX(Names.CheckBox),
|
||||
FREE_TEXT(Names.FreeText),
|
||||
TEXT_AREA(Names.TextArea),
|
||||
RICH_TEXT_AREA(Names.RichTextarea),
|
||||
UPLOAD(Names.Upload),
|
||||
DATE_PICKER(Names.DatePicker),
|
||||
EXTERNAL_DATASETS(Names.ExternalDatasets),
|
||||
DATA_REPOSITORIES(Names.DataRepositories),
|
||||
JOURNAL_REPOSITORIES(Names.JournalRepositories),
|
||||
PUB_REPOSITORIES(Names.PubRepositories),
|
||||
LICENSES(Names.Licenses),
|
||||
TAXONOMIES(Names.Taxonomies),
|
||||
PUBLICATIONS(Names.Publications),
|
||||
REGISTRIES(Names.Registries),
|
||||
SERVICES(Names.Services),
|
||||
TAGS(Names.Tags),
|
||||
RESEARCHERS(Names.Researchers),
|
||||
ORGANIZATIONS(Names.Organizations),
|
||||
DATASET_IDENTIFIER(Names.DatasetIdentifier),
|
||||
CURRENCY(Names.Currency),
|
||||
VALIDATION(Names.Validation);
|
||||
private final String value;
|
||||
|
||||
public static class Names {
|
||||
public static final String ComboBox = "combobox";
|
||||
public static final String Autocomplete = "autocomplete";
|
||||
public static final String Wordlist = "wordlist";
|
||||
public static final String BooleanDecision = "booleanDecision";
|
||||
public static final String RadioBox = "radiobox";
|
||||
public static final String InternalDmpEntities = "internalDmpEntities";
|
||||
public static final String InternalDmpResearchers = "internalDmpResearchers";
|
||||
public static final String InternalDmpDmps = "internalDmpDmps";
|
||||
public static final String InternalDmpDatasets = "internalDmpDatasets";
|
||||
public static final String CheckBox = "checkBox";
|
||||
public static final String FreeText = "freetext";
|
||||
public static final String TextArea = "textarea";
|
||||
public static final String RichTextarea = "richTextarea";
|
||||
public static final String Upload = "upload";
|
||||
public static final String DatePicker = "datePicker";
|
||||
public static final String ExternalDatasets = "externalDatasets";
|
||||
public static final String DataRepositories = "dataRepositories";
|
||||
public static final String JournalRepositories = "journalRepositories";
|
||||
public static final String PubRepositories = "pubRepositories";
|
||||
public static final String Licenses = "licenses";
|
||||
public static final String Taxonomies = "taxonomies";
|
||||
public static final String Publications = "publications";
|
||||
public static final String Registries = "registries";
|
||||
public static final String Services = "services";
|
||||
public static final String Tags = "tags";
|
||||
public static final String Researchers = "researchers";
|
||||
public static final String Organizations = "organizations";
|
||||
public static final String DatasetIdentifier = "datasetIdentifier";
|
||||
public static final String Currency = "currency";
|
||||
public static final String Validation = "validation";
|
||||
}
|
||||
|
||||
FieldType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel;
|
||||
package eu.eudat.commons.types.descriptiontemplate.importexport;
|
||||
|
||||
|
||||
import eu.eudat.commons.enums.DescriptionTemplateStatus;
|
||||
|
@ -9,32 +9,35 @@ import eu.eudat.model.persist.descriptiontemplatedefinition.DefinitionPersist;
|
|||
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 jakarta.xml.bind.annotation.*;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@XmlRootElement(name = "pages")
|
||||
public class DescriptionTemplateImportXml {
|
||||
|
||||
@XmlRootElement(name = "root")
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class DescriptionTemplateImportExport {
|
||||
@XmlAttribute(name = "description")
|
||||
private String description;
|
||||
@XmlAttribute(name = "language")
|
||||
private String language;
|
||||
@XmlAttribute(name = "type")
|
||||
private String type;
|
||||
|
||||
private List<PageImportXml> page;
|
||||
|
||||
@XmlElementWrapper(name = "pages")
|
||||
@XmlElement(name = "page")
|
||||
public List<PageImportXml> getPage() {
|
||||
private List<PageImportExport> page;
|
||||
|
||||
|
||||
public List<PageImportExport> getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(List<PageImportXml> page) {
|
||||
public void setPage(List<PageImportExport> page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "description")
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
@ -43,7 +46,7 @@ public class DescriptionTemplateImportXml {
|
|||
this.description = description;
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "language")
|
||||
|
||||
public String getLanguage() {
|
||||
return language;
|
||||
}
|
||||
|
@ -52,7 +55,7 @@ public class DescriptionTemplateImportXml {
|
|||
this.language = language;
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "type")
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
@ -72,7 +75,7 @@ public class DescriptionTemplateImportXml {
|
|||
|
||||
List<PagePersist> pagesDatasetEntity = new LinkedList<>();
|
||||
List<SectionPersist> sectionDatasetEntity = new LinkedList<>();
|
||||
for (PageImportXml xmlPage: page) {
|
||||
for (PageImportExport xmlPage: page) {
|
||||
pagesDatasetEntity.add(xmlPage.toPersistModel());
|
||||
for (int i = 0; i < xmlPage.getSections().size(); i++) {
|
||||
sectionDatasetEntity.add(xmlPage.toPersistModel(i, fieldDataHelperServiceProvider));
|
||||
|
@ -97,7 +100,7 @@ public class DescriptionTemplateImportXml {
|
|||
|
||||
List<PagePersist> pagesDatasetEntity = new LinkedList<>();
|
||||
List<SectionPersist> sectionDatasetEntity = new LinkedList<>();
|
||||
for (PageImportXml xmlPage: page) {
|
||||
for (PageImportExport xmlPage: page) {
|
||||
pagesDatasetEntity.add(xmlPage.toPersistModel());
|
||||
for (int i = 0; i < xmlPage.getSections().size(); i++) {
|
||||
sectionDatasetEntity.add(xmlPage.toPersistModel(i, fieldDataHelperServiceProvider));
|
|
@ -0,0 +1,174 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport;
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import eu.eudat.commons.enums.FieldValidationType;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.FieldDataHelper;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.*;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.FieldPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.RulePersist;
|
||||
import eu.eudat.service.fielddatahelper.FieldDataHelperService;
|
||||
import eu.eudat.service.fielddatahelper.FieldDataHelperServiceProvider;
|
||||
import jakarta.xml.bind.annotation.*;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class FieldImportExport {
|
||||
|
||||
@XmlAttribute(name = "id")
|
||||
private String id;
|
||||
|
||||
@XmlAttribute(name = "ordinal")
|
||||
private int ordinal;
|
||||
|
||||
@XmlElement(name = "numbering")
|
||||
private String numbering;
|
||||
|
||||
@XmlElementWrapper(name = "validations")
|
||||
@XmlElement(name = "validation")
|
||||
private List<FieldValidationType> validations;
|
||||
|
||||
@XmlElement(name = "defaultValue")
|
||||
private String defaultValue;
|
||||
|
||||
@XmlElementWrapper(name = "visibilityRules")
|
||||
@XmlElement(name = "visibilityRule")
|
||||
private List<RuleImportExport> visibilityRules;
|
||||
|
||||
@XmlElement(name = "fieldType")
|
||||
private FieldType fieldType;
|
||||
|
||||
@XmlElements({
|
||||
@XmlElement(name = FieldType.Names.CheckBox, type = CheckBoxDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.Validation, type = ValidationDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.TextArea, type = TextAreaDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.Taxonomies, type = TaxonomyDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.Tags, type = TagDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.Services, type = ServiceDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.RichTextarea, type = RichTextAreaDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.Researchers, type = ResearcherDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.Registries, type = RegistryDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.PubRepositories, type = PublicationRepositoryDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.Publications, type = PublicationDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.Organizations, type = OrganizationDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.Licenses, type = LicenseDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.JournalRepositories, type = JournalRepositoryDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.FreeText, type = FreeTextDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.ExternalDatasets, type = ExternalDatasetDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.DatePicker, type = DatePickerDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.DatasetIdentifier, type = DatasetIdentifierDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.DataRepositories, type = DataRepositoryDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.Currency, type = CurrencyDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.BooleanDecision, type = BooleanDecisionDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.Upload, type = UploadDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.RadioBox, type = RadioBoxDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.Wordlist, type = WordListDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.Autocomplete, type = AutoCompleteDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.InternalDmpDatasets, type = DatasetAutoCompleteDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.InternalDmpDmps, type = DmpAutoCompleteDataImportExport.class),
|
||||
@XmlElement(name = FieldType.Names.InternalDmpResearchers, type = ResearcherAutoCompleteDataImportExport.class),
|
||||
})
|
||||
private BaseFieldDataImportExport data;
|
||||
|
||||
@XmlElementWrapper(name = "schematics")
|
||||
@XmlElement(name = "schematic")
|
||||
private List<String> schematics;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getOrdinal() {
|
||||
return ordinal;
|
||||
}
|
||||
|
||||
public void setOrdinal(int ordinal) {
|
||||
this.ordinal = ordinal;
|
||||
}
|
||||
|
||||
public String getNumbering() {
|
||||
return numbering;
|
||||
}
|
||||
|
||||
public void setNumbering(String numbering) {
|
||||
this.numbering = numbering;
|
||||
}
|
||||
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public void setDefaultValue(String defaultValue) {
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public FieldType getFieldType() {
|
||||
return fieldType;
|
||||
}
|
||||
|
||||
public void setFieldType(FieldType fieldType) {
|
||||
this.fieldType = fieldType;
|
||||
}
|
||||
|
||||
public BaseFieldDataImportExport getData() {
|
||||
return this.data;
|
||||
}
|
||||
|
||||
public void setData(BaseFieldDataImportExport data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public List<FieldValidationType> getValidations() {
|
||||
return validations;
|
||||
}
|
||||
|
||||
public void setValidations(List<FieldValidationType> validations) {
|
||||
this.validations = validations;
|
||||
}
|
||||
|
||||
public List<String> getSchematics() {
|
||||
return schematics;
|
||||
}
|
||||
|
||||
public void setSchematics(List<String> schematics) {
|
||||
this.schematics = schematics;
|
||||
}
|
||||
|
||||
public List<RuleImportExport> getVisibilityRules() {
|
||||
return visibilityRules;
|
||||
}
|
||||
|
||||
public void setVisibilityRules(List<RuleImportExport> visibilityRules) {
|
||||
this.visibilityRules = visibilityRules;
|
||||
}
|
||||
|
||||
public FieldPersist toPersistModel(FieldDataHelperServiceProvider fieldDataHelperServiceProvider) {
|
||||
FieldPersist fieldEntity =new FieldPersist();
|
||||
fieldEntity.setId(this.id);
|
||||
fieldEntity.setOrdinal(this.ordinal);
|
||||
fieldEntity.setValidations(this.validations);
|
||||
fieldEntity.setDefaultValue(this.defaultValue);
|
||||
List<RulePersist> rulePersists = new ArrayList<>();
|
||||
if(this.visibilityRules!=null) {
|
||||
for (RuleImportExport xmlRule : this.visibilityRules) {
|
||||
rulePersists.add(xmlRule.toPersistModel());
|
||||
}
|
||||
}
|
||||
fieldEntity.setVisibilityRules(rulePersists);
|
||||
FieldType fieldType = this.fieldType;
|
||||
|
||||
BaseFieldDataEntity<?> data = new FieldDataHelper().toFieldData(null, fieldType, (Element) this.data);
|
||||
if (data != null) {
|
||||
FieldDataHelperService fieldDataHelperService = fieldDataHelperServiceProvider.get(fieldType);
|
||||
fieldEntity.setData(fieldDataHelperService.importExportMapDataToPersist(this.data));
|
||||
}
|
||||
fieldEntity.setSchematics(this.schematics);
|
||||
return fieldEntity;
|
||||
}
|
||||
}
|
|
@ -1,28 +1,38 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel;
|
||||
|
||||
import eu.eudat.commons.types.descriptiontemplate.importmodel.fields.FieldsImportXml;
|
||||
package eu.eudat.commons.types.descriptiontemplate.importexport;
|
||||
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.FieldPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.FieldSetPersist;
|
||||
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 jakarta.xml.bind.annotation.*;
|
||||
|
||||
@XmlRootElement(name = "field-Set")
|
||||
public class FieldSetImportXml {
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
private String id;
|
||||
private int ordinal;
|
||||
private FieldsImportXml fields;
|
||||
private String numbering;
|
||||
private Boolean commentField;
|
||||
private MultiplicityImportXml multiplicity;
|
||||
private String description;
|
||||
private String extendedDescription;
|
||||
private String additionalInformation;
|
||||
private String title;
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class FieldSetImportExport {
|
||||
|
||||
@XmlAttribute(name = "id")
|
||||
private String id;
|
||||
@XmlAttribute(name = "ordinal")
|
||||
private int ordinal;
|
||||
@XmlElementWrapper(name = "fields")
|
||||
@XmlElement(name = "field")
|
||||
private List<FieldImportExport> fields;
|
||||
@XmlElement(name = "numbering")
|
||||
private String numbering;
|
||||
@XmlElement(name = "commentField")
|
||||
private Boolean commentField;
|
||||
@XmlElement(name = "multiplicity")
|
||||
private MultiplicityImportXml multiplicity;
|
||||
@XmlElement(name = "description")
|
||||
private String description;
|
||||
@XmlElement(name = "extendedDescription")
|
||||
private String extendedDescription;
|
||||
@XmlElement(name = "additionalInformation")
|
||||
private String additionalInformation;
|
||||
@XmlElement(name = "title")
|
||||
private String title;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -31,7 +41,6 @@ public class FieldSetImportXml {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "ordinal")
|
||||
public int getOrdinal() {
|
||||
return ordinal;
|
||||
}
|
||||
|
@ -40,16 +49,14 @@ public class FieldSetImportXml {
|
|||
this.ordinal = ordinal;
|
||||
}
|
||||
|
||||
@XmlElement(name = "fields")
|
||||
public FieldsImportXml getFields() {
|
||||
public List<FieldImportExport> getFields() {
|
||||
return fields;
|
||||
}
|
||||
|
||||
public void setFields(FieldsImportXml fields) {
|
||||
public void setFields(List<FieldImportExport> fields) {
|
||||
this.fields = fields;
|
||||
}
|
||||
|
||||
@XmlElement(name = "numbering")
|
||||
public String getNumbering() {
|
||||
return numbering;
|
||||
}
|
||||
|
@ -58,7 +65,6 @@ public class FieldSetImportXml {
|
|||
this.numbering = numbering;
|
||||
}
|
||||
|
||||
@XmlElement(name = "CommentField")
|
||||
public Boolean getCommentField() {
|
||||
return commentField;
|
||||
}
|
||||
|
@ -67,7 +73,6 @@ public class FieldSetImportXml {
|
|||
this.commentField = commentField;
|
||||
}
|
||||
|
||||
@XmlElement(name = "multiplicity")
|
||||
public MultiplicityImportXml getMultiplicity() {
|
||||
return multiplicity;
|
||||
}
|
||||
|
@ -76,12 +81,10 @@ public class FieldSetImportXml {
|
|||
this.multiplicity = multiplicity;
|
||||
}
|
||||
|
||||
@XmlElement(name = "title")
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@XmlElement(name = "description")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
@ -90,7 +93,6 @@ public class FieldSetImportXml {
|
|||
this.description = description;
|
||||
}
|
||||
|
||||
@XmlElement(name = "extendedDescription")
|
||||
public String getExtendedDescription() {
|
||||
return extendedDescription;
|
||||
}
|
||||
|
@ -99,7 +101,6 @@ public class FieldSetImportXml {
|
|||
this.extendedDescription = extendedDescription;
|
||||
}
|
||||
|
||||
@XmlElement(name = "additionalInformation")
|
||||
public String getAdditionalInformation() {
|
||||
return additionalInformation;
|
||||
}
|
||||
|
@ -123,7 +124,13 @@ public class FieldSetImportXml {
|
|||
fieldSet1Entity.setExtendedDescription(this.extendedDescription);
|
||||
fieldSet1Entity.setAdditionalInformation(this.additionalInformation);
|
||||
|
||||
fieldSet1Entity.setFields(this.fields.toPersistModel(fieldDataHelperServiceProvider));
|
||||
List<FieldPersist> fieldsEntity = new LinkedList<>();
|
||||
if (this.fields != null){
|
||||
for (FieldImportExport xmlField : this.fields) {
|
||||
fieldsEntity.add(xmlField.toPersistModel(fieldDataHelperServiceProvider));
|
||||
}
|
||||
}
|
||||
fieldSet1Entity.setFields(fieldsEntity);
|
||||
return fieldSet1Entity;
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel;
|
||||
package eu.eudat.commons.types.descriptiontemplate.importexport;
|
||||
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.MultiplicityPersist;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
|
@ -1,21 +1,26 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel;
|
||||
package eu.eudat.commons.types.descriptiontemplate.importexport;
|
||||
|
||||
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 jakarta.xml.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@XmlRootElement(name = "page")
|
||||
public class PageImportXml {
|
||||
private String id;
|
||||
private int ordinal;
|
||||
private String title;
|
||||
private List<SectionsImportXml> sections;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class PageImportExport {
|
||||
@XmlAttribute(name = "id")
|
||||
private String id;
|
||||
@XmlAttribute(name = "ordinal")
|
||||
private int ordinal;
|
||||
|
||||
@XmlAttribute(name = "title")
|
||||
private String title;
|
||||
@XmlElementWrapper(name = "sections")
|
||||
@XmlElement(name = "section")
|
||||
private List<SectionImportExport> sections;
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -24,7 +29,6 @@ public class PageImportXml {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "ordinal")
|
||||
public int getOrdinal() {
|
||||
return ordinal;
|
||||
}
|
||||
|
@ -32,8 +36,6 @@ public class PageImportXml {
|
|||
public void setOrdinal(int ordinal) {
|
||||
this.ordinal = ordinal;
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "title")
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
@ -42,12 +44,11 @@ public class PageImportXml {
|
|||
this.title = title;
|
||||
}
|
||||
|
||||
@XmlElement(name = "sections")
|
||||
public List<SectionsImportXml> getSections() {
|
||||
public List<SectionImportExport> getSections() {
|
||||
return sections;
|
||||
}
|
||||
|
||||
public void setSections(List<SectionsImportXml> sections) {
|
||||
public void setSections(List<SectionImportExport> sections) {
|
||||
this.sections = sections;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport;
|
||||
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.RulePersist;
|
||||
import jakarta.xml.bind.annotation.*;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class RuleImportExport {
|
||||
|
||||
@XmlAttribute(name = "target")
|
||||
private String target;
|
||||
@XmlAttribute(name = "value")
|
||||
private String value;
|
||||
|
||||
@XmlAttribute(name = "target")
|
||||
public String getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public void setTarget(String target) {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public RulePersist toPersistModel(){
|
||||
RulePersist ruleEntity = new RulePersist();
|
||||
ruleEntity.setTarget(target);
|
||||
ruleEntity.setValue(value);
|
||||
return ruleEntity;
|
||||
}
|
||||
}
|
|
@ -1,28 +1,38 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel;
|
||||
package eu.eudat.commons.types.descriptiontemplate.importexport;
|
||||
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.FieldSetPersist;
|
||||
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 jakarta.xml.bind.annotation.*;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@XmlRootElement(name = "section")
|
||||
public class SectionImportXml {
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class SectionImportExport {
|
||||
@XmlAttribute(name = "id")
|
||||
private String id;
|
||||
@XmlAttribute(name = "ordinal")
|
||||
private int ordinal;
|
||||
@XmlAttribute(name = "page")
|
||||
private String page;
|
||||
@XmlAttribute(name = "defaultVisibility")
|
||||
private Boolean defaultVisibility;
|
||||
private FieldSetsImportXml fieldSets;
|
||||
@XmlElementWrapper(name = "fieldSets")
|
||||
@XmlElement(name = "fieldSet")
|
||||
private List<FieldSetImportExport> fieldSets;
|
||||
@XmlElement(name = "numbering")
|
||||
private String numbering;
|
||||
@XmlElement(name = "description")
|
||||
private String description;
|
||||
private String extendedDescription;
|
||||
@XmlElement(name = "title")
|
||||
private String title;
|
||||
private List<SectionImportXml> section;
|
||||
@XmlElementWrapper(name = "sections")
|
||||
@XmlElement(name = "section")
|
||||
private List<SectionImportExport> section;
|
||||
@XmlAttribute(name = "multiplicity")
|
||||
private Boolean multiplicity;
|
||||
|
||||
@XmlAttribute(name = "id")
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -31,7 +41,6 @@ public class SectionImportXml {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "ordinal")
|
||||
public int getOrdinal() {
|
||||
return ordinal;
|
||||
}
|
||||
|
@ -40,7 +49,6 @@ public class SectionImportXml {
|
|||
this.ordinal = ordinal;
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "page")
|
||||
public String getPage() {
|
||||
return page;
|
||||
}
|
||||
|
@ -49,7 +57,6 @@ public class SectionImportXml {
|
|||
this.page = page;
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "defaultVisibility")
|
||||
public Boolean getDefaultVisibility() {
|
||||
return defaultVisibility;
|
||||
}
|
||||
|
@ -58,16 +65,14 @@ public class SectionImportXml {
|
|||
this.defaultVisibility = defaultVisibility;
|
||||
}
|
||||
|
||||
@XmlElement(name = "field-Sets")
|
||||
public FieldSetsImportXml getFieldSets() {
|
||||
public List<FieldSetImportExport> getFieldSets() {
|
||||
return fieldSets;
|
||||
}
|
||||
|
||||
public void setFieldSets(FieldSetsImportXml fieldSets) {
|
||||
public void setFieldSets(List<FieldSetImportExport> fieldSets) {
|
||||
this.fieldSets = fieldSets;
|
||||
}
|
||||
|
||||
@XmlElement(name = "numbering")
|
||||
public String getNumbering() {
|
||||
return numbering;
|
||||
}
|
||||
|
@ -76,8 +81,7 @@ public class SectionImportXml {
|
|||
this.numbering = numbering;
|
||||
}
|
||||
|
||||
@XmlElement(name = "description")
|
||||
public String getDescription() {
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
|
@ -85,16 +89,6 @@ public class SectionImportXml {
|
|||
this.description = description;
|
||||
}
|
||||
|
||||
@XmlElement(name = "extendedDescription")
|
||||
public String getExtendedDescription() {
|
||||
return extendedDescription;
|
||||
}
|
||||
|
||||
public void setExtendedDescription(String extendedDescription) {
|
||||
this.extendedDescription = extendedDescription;
|
||||
}
|
||||
|
||||
@XmlElement(name = "title")
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
@ -103,16 +97,14 @@ public class SectionImportXml {
|
|||
this.title = title;
|
||||
}
|
||||
|
||||
@XmlElement(name = "section")
|
||||
public List<SectionImportXml> getSection() {
|
||||
public List<SectionImportExport> getSection() {
|
||||
return section;
|
||||
}
|
||||
|
||||
public void setSection(List<SectionImportXml> section) {
|
||||
public void setSection(List<SectionImportExport> section) {
|
||||
this.section = section;
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "multiplicity")
|
||||
public Boolean getMultiplicity() {
|
||||
return multiplicity;
|
||||
}
|
||||
|
@ -126,7 +118,7 @@ public class SectionImportXml {
|
|||
List<SectionPersist> sectionsListEntity = new LinkedList<>();
|
||||
|
||||
if (this.section != null) {
|
||||
for (SectionImportXml xmlsection : this.section) {
|
||||
for (SectionImportExport xmlsection : this.section) {
|
||||
sectionsListEntity.add(xmlsection.toPersistModel(fieldDataHelperServiceProvider));
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +132,13 @@ public class SectionImportXml {
|
|||
// for (FieldSets xmpFieldSets: this.fieldSets) {
|
||||
// fieldSetsEntity.add(xmpFieldSets.toAdminCompositeModelSection());
|
||||
// }
|
||||
sectionEntity.setFieldSets(this.fieldSets.toPersistModel(fieldDataHelperServiceProvider));
|
||||
List<FieldSetPersist> fieldSetEntity = new LinkedList<>();
|
||||
if(this.fieldSets!=null) {
|
||||
for (FieldSetImportExport xmlFieldSet : this.fieldSets) {
|
||||
fieldSetEntity.add(xmlFieldSet.toPersistModel(fieldDataHelperServiceProvider));
|
||||
}
|
||||
}
|
||||
sectionEntity.setFieldSets(fieldSetEntity);
|
||||
|
||||
sectionEntity.setSections(sectionsListEntity);
|
||||
sectionEntity.setDefaultVisibility(this.defaultVisibility);
|
|
@ -0,0 +1,59 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class AuthAutoCompleteData {
|
||||
@XmlAttribute(name = "url")
|
||||
private String url;
|
||||
@XmlAttribute(name = "method")
|
||||
private String method;
|
||||
@XmlAttribute(name = "body")
|
||||
private String body;
|
||||
@XmlAttribute(name = "path")
|
||||
private String path;
|
||||
@XmlAttribute(name = "type")
|
||||
private String type;
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
public void setMethod(String method) {
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(String body) {
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class AutoCompleteDataImportExport extends BaseFieldDataImportExport {
|
||||
|
||||
@XmlAttribute(name = "multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
@XmlElementWrapper(name = "autoCompleteSingleDataList")
|
||||
@XmlElement(name = "autoCompleteSingleData")
|
||||
private List<AutoCompleteSingleData> autoCompleteSingleDataList;
|
||||
|
||||
public Boolean getMultiAutoComplete() { return multiAutoComplete; }
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) { this.multiAutoComplete = multiAutoComplete; }
|
||||
|
||||
public List<AutoCompleteSingleData> getAutoCompleteSingleDataList() {
|
||||
return autoCompleteSingleDataList;
|
||||
}
|
||||
|
||||
public void setAutoCompleteSingleDataList(List<AutoCompleteSingleData> autoCompleteSingleDataList) {
|
||||
this.autoCompleteSingleDataList = autoCompleteSingleDataList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class AutoCompleteSingleData {
|
||||
@XmlAttribute(name = "autocompleteType")
|
||||
private eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity.AutocompleteType autocompleteType;
|
||||
@XmlAttribute(name = "url")
|
||||
private String url;
|
||||
@XmlElement(name = "autoCompleteOptions")
|
||||
private ComboBoxDataOptionEntity autoCompleteOptions;
|
||||
@XmlAttribute(name = "optionsRoot")
|
||||
private String optionsRoot;
|
||||
@XmlAttribute(name = "hasAuth")
|
||||
private Boolean hasAuth;
|
||||
@XmlElement(name = "auth")
|
||||
private AuthAutoCompleteData auth;
|
||||
@XmlAttribute(name = "method")
|
||||
private String method;
|
||||
|
||||
public eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity.AutocompleteType getAutocompleteType() {
|
||||
return autocompleteType;
|
||||
}
|
||||
|
||||
public void setAutocompleteType(eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity.AutocompleteType autocompleteType) {
|
||||
this.autocompleteType = autocompleteType;
|
||||
}
|
||||
|
||||
public String getOptionsRoot() {
|
||||
return optionsRoot;
|
||||
}
|
||||
|
||||
public void setOptionsRoot(String optionsRoot) {
|
||||
this.optionsRoot = optionsRoot;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public Boolean getHasAuth() {
|
||||
return hasAuth;
|
||||
}
|
||||
|
||||
public void setHasAuth(Boolean hasAuth) {
|
||||
this.hasAuth = hasAuth;
|
||||
}
|
||||
|
||||
public AuthAutoCompleteData getAuth() {
|
||||
return auth;
|
||||
}
|
||||
|
||||
public void setAuth(AuthAutoCompleteData auth) {
|
||||
this.auth = auth;
|
||||
}
|
||||
|
||||
public ComboBoxDataOptionEntity getAutoCompleteOptions() {
|
||||
return autoCompleteOptions;
|
||||
}
|
||||
|
||||
public void setAutoCompleteOptions(ComboBoxDataOptionEntity autoCompleteOptions) {
|
||||
this.autoCompleteOptions = autoCompleteOptions;
|
||||
}
|
||||
|
||||
public String getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
public void setMethod(String method) {
|
||||
this.method = method;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import eu.eudat.commons.types.xml.XmlSerializable;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class BaseFieldDataImportExport {
|
||||
private String label;
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class BooleanDecisionDataImportExport extends BaseFieldDataImportExport {
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class CheckBoxDataImportExport extends BaseFieldDataImportExport {
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldDataComboBoxType;
|
||||
import eu.eudat.commons.types.xml.XmlSerializable;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class ComboBoxDataOptionEntity {
|
||||
@XmlAttribute(name = "label")
|
||||
private String label;
|
||||
@XmlAttribute(name = "value")
|
||||
private String value;
|
||||
@XmlAttribute(name = "source")
|
||||
private String source;
|
||||
@XmlAttribute(name = "uri")
|
||||
private String uri;
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getUri() {
|
||||
return uri;
|
||||
}
|
||||
|
||||
public void setUri(String uri) {
|
||||
this.uri = uri;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class CurrencyDataImportExport extends BaseFieldDataImportExport {
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class DataRepositoryDataImportExport extends BaseFieldDataImportExport {
|
||||
|
||||
@XmlAttribute(name = "multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class DatasetAutoCompleteDataImportExport extends BaseFieldDataImportExport {
|
||||
@XmlAttribute(name = "multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class DatasetIdentifierDataImportExport extends BaseFieldDataImportExport {
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class DatePickerDataImportExport extends BaseFieldDataImportExport {
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class DmpAutoCompleteDataImportExport extends BaseFieldDataImportExport {
|
||||
@XmlAttribute(name = "multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldDataExternalDatasetType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class ExternalDatasetDataImportExport extends BaseFieldDataImportExport {
|
||||
@XmlAttribute(name = "multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
@XmlAttribute(name = "type")
|
||||
private FieldDataExternalDatasetType type;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
public FieldDataExternalDatasetType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(FieldDataExternalDatasetType type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class FreeTextDataImportExport extends BaseFieldDataImportExport {
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class JournalRepositoryDataImportExport extends BaseFieldDataImportExport {
|
||||
@XmlAttribute(name = "multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class LicenseDataImportExport extends BaseFieldDataImportExport {
|
||||
@XmlAttribute(name = "multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class OrganizationDataImportExport extends BaseFieldDataImportExport {
|
||||
@XmlAttribute(name = "multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class PublicationDataImportExport extends BaseFieldDataImportExport {
|
||||
@XmlAttribute(name = "multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class PublicationRepositoryDataImportExport extends BaseFieldDataImportExport {
|
||||
|
||||
@XmlAttribute(name = "multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class RadioBoxDataImportExport extends BaseFieldDataImportExport {
|
||||
|
||||
@XmlElementWrapper(name = "options")
|
||||
@XmlElement(name = "option")
|
||||
private List<RadioBoxOption> options;
|
||||
|
||||
public List<RadioBoxOption> getOptions() {
|
||||
return options;
|
||||
}
|
||||
|
||||
public void setOptions(List<RadioBoxOption> options) {
|
||||
this.options = options;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class RadioBoxOption {
|
||||
@XmlAttribute(name = "label")
|
||||
private String label;
|
||||
@XmlAttribute(name = "value")
|
||||
private String value;
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class RegistryDataImportExport extends BaseFieldDataImportExport {
|
||||
@XmlAttribute(name = "multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class ResearcherAutoCompleteDataImportExport extends BaseFieldDataImportExport {
|
||||
@XmlAttribute(name = "multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class ResearcherDataImportExport extends BaseFieldDataImportExport {
|
||||
@XmlAttribute(name = "multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class RichTextAreaDataImportExport extends BaseFieldDataImportExport {
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class ServiceDataImportExport extends BaseFieldDataImportExport {
|
||||
@XmlAttribute(name = "multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class TagDataImportExport extends BaseFieldDataImportExport {
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class TaxonomyDataImportExport extends BaseFieldDataImportExport {
|
||||
@XmlAttribute(name = "multiAutoComplete")
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class TextAreaDataImportExport extends BaseFieldDataImportExport {
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class UploadDataImportExport extends BaseFieldDataImportExport {
|
||||
@XmlElementWrapper(name = "types")
|
||||
@XmlElement(name = "type")
|
||||
private List<UploadDataOption> types;
|
||||
|
||||
@XmlAttribute(name = "maxFileSizeInMB")
|
||||
private Integer maxFileSizeInMB;
|
||||
|
||||
public List<UploadDataOption> getTypes() {
|
||||
return types;
|
||||
}
|
||||
|
||||
public void setTypes(List<UploadDataOption> types) {
|
||||
this.types = types;
|
||||
}
|
||||
|
||||
public Integer getMaxFileSizeInMB() {
|
||||
return maxFileSizeInMB;
|
||||
}
|
||||
|
||||
public void setMaxFileSizeInMB(Integer maxFileSizeInMB) {
|
||||
this.maxFileSizeInMB = maxFileSizeInMB;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class UploadDataOption {
|
||||
@XmlAttribute(name = "label")
|
||||
private String label;
|
||||
@XmlAttribute(name = "value")
|
||||
private String value;
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class ValidationDataImportExport extends BaseFieldDataImportExport {
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importexport.fielddata;
|
||||
|
||||
import jakarta.xml.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class WordListDataImportExport extends BaseFieldDataImportExport {
|
||||
@XmlElementWrapper(name = "options")
|
||||
@XmlElement(name = "options")
|
||||
private List<ComboBoxDataOptionEntity> options;
|
||||
|
||||
@XmlAttribute(name = "multiList")
|
||||
private Boolean multiList;
|
||||
|
||||
public List<ComboBoxDataOptionEntity> getOptions() {
|
||||
return options;
|
||||
}
|
||||
|
||||
public void setOptions(List<ComboBoxDataOptionEntity> options) {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
public Boolean getMultiList() {
|
||||
return multiList;
|
||||
}
|
||||
|
||||
public void setMultiList(Boolean multiList) {
|
||||
this.multiList = multiList;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel;
|
||||
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.FieldSetPersist;
|
||||
import eu.eudat.service.fielddatahelper.FieldDataHelperServiceProvider;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@XmlRootElement(name = "field-Sets")
|
||||
public class FieldSetsImportXml {
|
||||
|
||||
List<FieldSetImportXml> fieldSet;
|
||||
|
||||
@XmlElement(name = "field-Set")
|
||||
public List<FieldSetImportXml> getFieldSet() {
|
||||
return fieldSet;
|
||||
}
|
||||
|
||||
public void setFieldSet(List<FieldSetImportXml> fieldSet) {
|
||||
this.fieldSet = fieldSet;
|
||||
}
|
||||
|
||||
public List<FieldSetPersist> toPersistModel(FieldDataHelperServiceProvider fieldDataHelperServiceProvider){
|
||||
List<FieldSetPersist> fieldSetEntity = new LinkedList<>();
|
||||
if(this.fieldSet!=null) {
|
||||
for (FieldSetImportXml xmlFieldSet : this.fieldSet) {
|
||||
fieldSetEntity.add(xmlFieldSet.toPersistModel(fieldDataHelperServiceProvider));
|
||||
}
|
||||
}
|
||||
return fieldSetEntity;
|
||||
}
|
||||
}
|
|
@ -1,143 +0,0 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel;
|
||||
|
||||
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.FieldSetPersist;
|
||||
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.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@XmlRootElement(name = "sections")
|
||||
public class SectionsImportXml {
|
||||
private String id;
|
||||
private int ordinal;
|
||||
private String page;
|
||||
private Boolean defaultVisibility;
|
||||
private String numbering;
|
||||
private String description;
|
||||
private String title;
|
||||
private List<SectionImportXml> section;
|
||||
private FieldSetsImportXml fieldSets;
|
||||
private Boolean multiplicity;
|
||||
|
||||
@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 = "page")
|
||||
public String getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(String page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "defaultVisibility")
|
||||
public Boolean getDefaultVisibility() {
|
||||
return defaultVisibility;
|
||||
}
|
||||
|
||||
public void setDefaultVisibility(Boolean defaultVisibility) {
|
||||
this.defaultVisibility = defaultVisibility;
|
||||
}
|
||||
|
||||
@XmlElement(name = "numbering")
|
||||
public String getNumbering() {
|
||||
return numbering;
|
||||
}
|
||||
|
||||
public void setNumbering(String numbering) {
|
||||
this.numbering = numbering;
|
||||
}
|
||||
|
||||
@XmlElement(name = "description")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@XmlElement(name = "title")
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@XmlElement(name = "section")
|
||||
public List<SectionImportXml> getSection() {
|
||||
return section;
|
||||
}
|
||||
|
||||
public void setSection(List<SectionImportXml> section) {
|
||||
this.section = section;
|
||||
}
|
||||
|
||||
@XmlElement(name = "field-Sets")
|
||||
public FieldSetsImportXml getFieldSets() {
|
||||
return fieldSets;
|
||||
}
|
||||
|
||||
public void setFieldSets(FieldSetsImportXml fieldSets) {
|
||||
this.fieldSets = fieldSets;
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "multiplicity")
|
||||
public Boolean getMultiplicity() {
|
||||
return multiplicity;
|
||||
}
|
||||
|
||||
public void setMultiplicity(Boolean multiplicity) {
|
||||
this.multiplicity = multiplicity;
|
||||
}
|
||||
|
||||
public SectionPersist toPersistModel(FieldDataHelperServiceProvider fieldDataHelperServiceProvider) {
|
||||
SectionPersist sectionEntity = new SectionPersist();
|
||||
List<SectionPersist> sectionsListEntity = new LinkedList<>();
|
||||
|
||||
if (this.section != null) {
|
||||
for (SectionImportXml xmlsection : this.section) {
|
||||
sectionsListEntity.add(xmlsection.toPersistModel(fieldDataHelperServiceProvider));
|
||||
}
|
||||
}
|
||||
sectionEntity.setId(this.id);
|
||||
sectionEntity.setOrdinal(this.ordinal);
|
||||
sectionEntity.setTitle(this.title);
|
||||
sectionEntity.setDefaultVisibility(this.defaultVisibility);
|
||||
sectionEntity.setDescription(description);
|
||||
sectionEntity.setPage(this.page);
|
||||
sectionEntity.setFieldSets(toFieldSetPersistModel(fieldDataHelperServiceProvider));
|
||||
sectionEntity.setMultiplicity(this.multiplicity);
|
||||
|
||||
|
||||
sectionEntity.setSections(sectionsListEntity);
|
||||
return sectionEntity;
|
||||
}
|
||||
|
||||
public List<FieldSetPersist> toFieldSetPersistModel(FieldDataHelperServiceProvider fieldDataHelperServiceProvider) {
|
||||
return fieldSets.toPersistModel(fieldDataHelperServiceProvider);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel.fields;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@XmlRootElement(name = "defaultValue")
|
||||
public class DefaultValueImportXml {
|
||||
|
||||
private String type;
|
||||
private String value;
|
||||
|
||||
@XmlAttribute(name = "type")
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "value")
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String toPersistModel(){
|
||||
return value;
|
||||
}
|
||||
}
|
|
@ -1,149 +0,0 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel.fields;
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import eu.eudat.commons.enums.FieldValidationType;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.FieldDataHelper;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.FieldPersist;
|
||||
import eu.eudat.service.fielddatahelper.FieldDataHelperService;
|
||||
import eu.eudat.service.fielddatahelper.FieldDataHelperServiceProvider;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@XmlRootElement(name = "field")
|
||||
public class FieldImportXml {
|
||||
|
||||
private String id;
|
||||
|
||||
private int ordinal;
|
||||
|
||||
private String numbering;
|
||||
|
||||
private List<ValidationsImportXml> validations;
|
||||
|
||||
private DefaultValueImportXml defaultValue;
|
||||
|
||||
private VisibleImportXml visible;
|
||||
|
||||
private ViewStyleImportXml viewStyle;
|
||||
|
||||
private Element data;
|
||||
|
||||
private SchematicsImportXml schematics;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@XmlElement(name = "numbering")
|
||||
public String getNumbering() {
|
||||
return numbering;
|
||||
}
|
||||
|
||||
public void setNumbering(String numbering) {
|
||||
this.numbering = numbering;
|
||||
}
|
||||
|
||||
@XmlElement(name = "validations")
|
||||
public List<ValidationsImportXml> getValidations() {
|
||||
return validations;
|
||||
}
|
||||
|
||||
public void setValidations(List<ValidationsImportXml> validations) {
|
||||
this.validations = validations;
|
||||
}
|
||||
|
||||
@XmlElement(name = "defaultValue")
|
||||
public DefaultValueImportXml getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public void setDefaultValue(DefaultValueImportXml defaultValue) {
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
@XmlElement(name = "visible")
|
||||
public VisibleImportXml getVisible() {
|
||||
return visible;
|
||||
}
|
||||
|
||||
public void setVisible(VisibleImportXml visible) {
|
||||
this.visible = visible;
|
||||
}
|
||||
|
||||
@XmlElement(name = "viewStyle")
|
||||
public ViewStyleImportXml getViewStyle() {
|
||||
return viewStyle;
|
||||
}
|
||||
|
||||
public void setViewStyle(ViewStyleImportXml viewStyle) {
|
||||
this.viewStyle = viewStyle;
|
||||
}
|
||||
|
||||
@XmlElement(name = "data")
|
||||
public Element getData() {
|
||||
return this.data;
|
||||
}
|
||||
|
||||
public void setData(Element data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@XmlElement(name = "schematics")
|
||||
public SchematicsImportXml getSchematics() {
|
||||
return schematics;
|
||||
}
|
||||
|
||||
public void setSchematics(SchematicsImportXml schematics) {
|
||||
this.schematics = schematics;
|
||||
}
|
||||
|
||||
public FieldPersist toPersistModel(FieldDataHelperServiceProvider fieldDataHelperServiceProvider) {
|
||||
FieldPersist fieldEntity =new FieldPersist();
|
||||
fieldEntity.setId(this.id);
|
||||
fieldEntity.setOrdinal(this.ordinal);
|
||||
List<FieldValidationType> validationList = new LinkedList<>();
|
||||
for(ValidationsImportXml validation:this.validations){
|
||||
if(validation.getValidation()!=null) {
|
||||
validationList.add(validation.toPersistModel());
|
||||
}
|
||||
}
|
||||
fieldEntity.setValidations(validationList);
|
||||
fieldEntity.setDefaultValue(this.defaultValue.toPersistModel());
|
||||
fieldEntity.setVisibilityRules(this.visible.toPersistModel());
|
||||
FieldType fieldType = this.viewStyle.toPersistModel();
|
||||
|
||||
BaseFieldDataEntity<?> data = new FieldDataHelper().toFieldData(null, fieldType, (Element) this.data);
|
||||
if (data != null) {
|
||||
FieldDataHelperService fieldDataHelperService = fieldDataHelperServiceProvider.get(fieldType);
|
||||
fieldEntity.setData(fieldDataHelperService.mapDataToPersist((BaseFieldDataEntity<?>)fieldDataHelperService.newDataInstance().fromXml(this.data)));
|
||||
}
|
||||
List<String> schematicsList = new LinkedList<>();
|
||||
if (this.schematics != null && this.schematics.getSchematics() != null) {
|
||||
for (SchematicImportXml schematic : this.schematics.getSchematics()) {
|
||||
if (schematic != null && schematic.getSchematic() != null && !schematic.getSchematic().isEmpty())
|
||||
schematicsList.add(schematic.getSchematic());
|
||||
}
|
||||
}
|
||||
fieldEntity.setSchematics(schematicsList);
|
||||
return fieldEntity;
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel.fields;
|
||||
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.FieldPersist;
|
||||
import eu.eudat.service.fielddatahelper.FieldDataHelperServiceProvider;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@XmlRootElement(name = "fields")
|
||||
public class FieldsImportXml {
|
||||
|
||||
private List<FieldImportXml> field;
|
||||
|
||||
@XmlElement(name = "field")
|
||||
public List<FieldImportXml> getField() {
|
||||
return field;
|
||||
}
|
||||
|
||||
public void setField(List<FieldImportXml> field) {
|
||||
this.field = field;
|
||||
}
|
||||
|
||||
public List<FieldPersist> toPersistModel(FieldDataHelperServiceProvider fieldDataHelperServiceProvider) {
|
||||
List<FieldPersist> fieldsEntity = new LinkedList<>();
|
||||
if (this.field != null)
|
||||
for (FieldImportXml xmlField : this.field) {
|
||||
fieldsEntity.add(xmlField.toPersistModel(fieldDataHelperServiceProvider));
|
||||
}
|
||||
return fieldsEntity;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel.fields;
|
||||
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.RulePersist;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@XmlRootElement(name = "rule")
|
||||
public class RuleImportXml {
|
||||
|
||||
private String ruleStyle;
|
||||
private String target;
|
||||
private String type;
|
||||
private ValueImportXml value;
|
||||
|
||||
@XmlAttribute(name = "ruleStyle")
|
||||
public String getRuleStyle() {
|
||||
return ruleStyle;
|
||||
}
|
||||
|
||||
public void setRuleStyle(String ruleStyle) {
|
||||
this.ruleStyle = ruleStyle;
|
||||
}
|
||||
@XmlAttribute(name = "target")
|
||||
public String getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public void setTarget(String target) {
|
||||
this.target = target;
|
||||
}
|
||||
@XmlAttribute(name = "type")
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
@XmlElement(name = "value")
|
||||
public ValueImportXml getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(ValueImportXml value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public RulePersist toPersistModel(){
|
||||
RulePersist ruleEntity = new RulePersist();
|
||||
ruleEntity.setTarget(target);
|
||||
ruleEntity.setValue(value.getValue());
|
||||
return ruleEntity;
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel.fields;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
import jakarta.xml.bind.annotation.XmlValue;
|
||||
|
||||
@XmlRootElement(name = "schematic")
|
||||
public class SchematicImportXml {
|
||||
|
||||
private String schematic;
|
||||
|
||||
@XmlValue
|
||||
public String getSchematic() {
|
||||
return schematic;
|
||||
}
|
||||
public void setSchematic(String schematic) {
|
||||
this.schematic = schematic;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel.fields;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
import java.util.List;
|
||||
|
||||
@XmlRootElement(name = "schematics")
|
||||
public class SchematicsImportXml {
|
||||
|
||||
private List<SchematicImportXml> schematics;
|
||||
|
||||
@XmlElement(name = "schematic")
|
||||
public List<SchematicImportXml> getSchematics() {
|
||||
return schematics;
|
||||
}
|
||||
|
||||
public void setSchematics(List<SchematicImportXml> schematics) {
|
||||
this.schematics = schematics;
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel.fields;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@XmlRootElement(name = "validation")
|
||||
public class ValidationImportXml {
|
||||
|
||||
private int type;
|
||||
|
||||
@XmlAttribute(name = "type")
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel.fields;
|
||||
|
||||
import eu.eudat.commons.enums.FieldValidationType;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@XmlRootElement(name = "validations")
|
||||
public class ValidationsImportXml {
|
||||
|
||||
ValidationImportXml validation;
|
||||
|
||||
@XmlElement(name = "validation")
|
||||
public ValidationImportXml getValidation() {
|
||||
return validation;
|
||||
}
|
||||
|
||||
public void setValidation(ValidationImportXml validation) {
|
||||
this.validation = validation;
|
||||
}
|
||||
|
||||
public FieldValidationType toPersistModel() {
|
||||
return FieldValidationType.of((short)validation.getType());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel.fields;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
import jakarta.xml.bind.annotation.XmlValue;
|
||||
|
||||
@XmlRootElement(name = "value")
|
||||
public class ValueImportXml {
|
||||
|
||||
private String type;
|
||||
private String value;
|
||||
|
||||
@XmlAttribute(name = "type")
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@XmlValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel.fields;
|
||||
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@XmlRootElement(name = "viewStyle")
|
||||
public class ViewStyleImportXml {
|
||||
|
||||
private String cssClass;
|
||||
private String renderStyle;
|
||||
|
||||
@XmlAttribute(name = "cssClass")
|
||||
public String getCssClass() {
|
||||
return cssClass;
|
||||
}
|
||||
|
||||
public void setCssClass(String cssClass) {
|
||||
this.cssClass = cssClass;
|
||||
}
|
||||
@XmlAttribute(name = "renderStyle")
|
||||
public String getRenderStyle() {
|
||||
return renderStyle;
|
||||
}
|
||||
|
||||
public void setRenderStyle(String renderStyle) {
|
||||
this.renderStyle = renderStyle;
|
||||
}
|
||||
|
||||
public FieldType toPersistModel(){
|
||||
return FieldType.of(this.renderStyle);
|
||||
}
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.importmodel.fields;
|
||||
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.RulePersist;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@XmlRootElement(name = "visible")
|
||||
public class VisibleImportXml {
|
||||
|
||||
private String style;
|
||||
private List<RuleImportXml> rule;
|
||||
|
||||
@XmlAttribute(name = "style")
|
||||
public String getStyle() {
|
||||
return style;
|
||||
}
|
||||
|
||||
public void setStyle(String style) {
|
||||
this.style = style;
|
||||
}
|
||||
@XmlElement(name = "rule")
|
||||
public List<RuleImportXml> getRule() {
|
||||
return rule;
|
||||
}
|
||||
|
||||
public void setRule(List<RuleImportXml> rule) {
|
||||
this.rule = rule;
|
||||
}
|
||||
|
||||
public List<RulePersist> toPersistModel(){
|
||||
List<RulePersist> rulePersists = new ArrayList<>();
|
||||
if(this.rule!=null) {
|
||||
for (RuleImportXml xmlRule : this.rule) {
|
||||
rulePersists.add(xmlRule.toPersistModel());
|
||||
}
|
||||
}
|
||||
return rulePersists;
|
||||
}
|
||||
}
|
|
@ -4,13 +4,15 @@ import jakarta.xml.bind.annotation.XmlAccessType;
|
|||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class DescriptionTemplateImportExport {
|
||||
|
||||
@XmlAttribute(name = "id")
|
||||
private String id;
|
||||
private UUID id;
|
||||
@XmlAttribute(name = "descriptionTemplateId")
|
||||
private String descriptionTemplateId;
|
||||
private UUID descriptionTemplateId;
|
||||
@XmlAttribute(name = "label")
|
||||
private String label;
|
||||
@XmlAttribute(name = "minMultiplicity")
|
||||
|
@ -18,19 +20,19 @@ public class DescriptionTemplateImportExport {
|
|||
@XmlAttribute(name = "maxMultiplicity")
|
||||
private int maxMultiplicity;
|
||||
|
||||
public String getId() {
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDescriptionTemplateId() {
|
||||
public UUID getDescriptionTemplateId() {
|
||||
return descriptionTemplateId;
|
||||
}
|
||||
|
||||
public void setDescriptionTemplateId(String descriptionTemplateId) {
|
||||
public void setDescriptionTemplateId(UUID descriptionTemplateId) {
|
||||
this.descriptionTemplateId = descriptionTemplateId;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,20 @@
|
|||
package eu.eudat.commons.types.dmpblueprint.importexport;
|
||||
|
||||
import eu.eudat.commons.enums.DmpBlueprintExtraFieldDataType;
|
||||
import eu.eudat.commons.enums.DmpBlueprintSystemFieldType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class ExtraFieldImportExport {
|
||||
|
||||
@XmlAttribute(name = "id")
|
||||
private String id;
|
||||
private UUID id;
|
||||
@XmlAttribute(name = "type")
|
||||
private short type;
|
||||
private DmpBlueprintExtraFieldDataType type;
|
||||
@XmlAttribute(name = "label")
|
||||
private String label;
|
||||
@XmlAttribute(name = "placeholder")
|
||||
|
@ -22,19 +26,19 @@ public class ExtraFieldImportExport {
|
|||
@XmlAttribute(name = "required")
|
||||
private boolean required;
|
||||
|
||||
public String getId() {
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public short getType() {
|
||||
public DmpBlueprintExtraFieldDataType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(short type) {
|
||||
public void setType(DmpBlueprintExtraFieldDataType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,12 +3,13 @@ package eu.eudat.commons.types.dmpblueprint.importexport;
|
|||
import jakarta.xml.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class SectionImportExport {
|
||||
|
||||
@XmlAttribute(name = "id")
|
||||
private String id;
|
||||
private UUID id;
|
||||
@XmlAttribute(name = "label")
|
||||
private String label;
|
||||
@XmlAttribute(name = "description")
|
||||
|
@ -27,11 +28,11 @@ public class SectionImportExport {
|
|||
@XmlElement(name = "descriptionTemplate")
|
||||
private List<DescriptionTemplateImportExport> descriptionTemplates;
|
||||
|
||||
public String getId() {
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
package eu.eudat.commons.types.dmpblueprint.importexport;
|
||||
|
||||
import eu.eudat.commons.enums.DmpBlueprintSystemFieldType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class SystemFieldImportExport {
|
||||
|
||||
@XmlAttribute(name = "id")
|
||||
private String id;
|
||||
private UUID id;
|
||||
@XmlAttribute(name = "type")
|
||||
private short type;
|
||||
private DmpBlueprintSystemFieldType type;
|
||||
@XmlAttribute(name = "label")
|
||||
private String label;
|
||||
@XmlAttribute(name = "placeholder")
|
||||
|
@ -22,19 +25,19 @@ public class SystemFieldImportExport {
|
|||
@XmlAttribute(name = "required")
|
||||
private boolean required;
|
||||
|
||||
public String getId() {
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public short getType() {
|
||||
public DmpBlueprintSystemFieldType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(short type) {
|
||||
public void setType(DmpBlueprintSystemFieldType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes;
|
|||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import eu.eudat.commons.validation.ValidEnum;
|
||||
import eu.eudat.model.persist.dmpblueprintdefinition.ExtraFieldPersist;
|
||||
import eu.eudat.model.persist.dmpblueprintdefinition.SystemFieldPersist;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
|
@ -15,34 +13,34 @@ import jakarta.validation.constraints.NotNull;
|
|||
property = "fieldType",
|
||||
visible = true)
|
||||
@JsonSubTypes({
|
||||
@JsonSubTypes.Type(value = AutoCompleteDataPersist.class, name = "autocomplete"),
|
||||
@JsonSubTypes.Type(value = BooleanDecisionDataPersist.class, name = "booleanDecision"),
|
||||
@JsonSubTypes.Type(value = DatasetAutoCompleteDataPersist.class, name = "internalDmpDatasets"),
|
||||
@JsonSubTypes.Type(value = DmpAutoCompleteDataPersist.class, name = "internalDmpDmps"),
|
||||
@JsonSubTypes.Type(value = CheckBoxDataPersist.class, name = "checkBox"),
|
||||
@JsonSubTypes.Type(value = DatePickerDataPersist.class, name = "datePicker"),
|
||||
@JsonSubTypes.Type(value = ExternalDatasetDataPersist.class, name = "externalDatasets"),
|
||||
@JsonSubTypes.Type(value = FreeTextDataPersist.class, name = "freetext"),
|
||||
@JsonSubTypes.Type(value = LicenseDataPersist.class, name = "licenses"),
|
||||
@JsonSubTypes.Type(value = OrganizationDataPersist.class, name = "organizations"),
|
||||
@JsonSubTypes.Type(value = PublicationDataPersist.class, name = "publications"),
|
||||
@JsonSubTypes.Type(value = RadioBoxDataPersist.class, name = "radiobox"),
|
||||
@JsonSubTypes.Type(value = RegistryDataPersist.class, name = "registries"),
|
||||
@JsonSubTypes.Type(value = ResearcherAutoCompleteDataPersist.class, name = "internalDmpResearchers"),
|
||||
@JsonSubTypes.Type(value = ResearcherDataPersist.class, name = "researchers"),
|
||||
@JsonSubTypes.Type(value = RichTextAreaDataPersist.class, name = "richTextarea"),
|
||||
@JsonSubTypes.Type(value = ServiceDataPersist.class, name = "services"),
|
||||
@JsonSubTypes.Type(value = TagDataPersist.class, name = "tags"),
|
||||
@JsonSubTypes.Type(value = TaxonomyDataPersist.class, name = "taxonomies"),
|
||||
@JsonSubTypes.Type(value = TextAreaDataPersist.class, name = "textarea"),
|
||||
@JsonSubTypes.Type(value = UploadDataPersist.class, name = "upload"),
|
||||
@JsonSubTypes.Type(value = ValidationDataPersist.class, name = "validation"),
|
||||
@JsonSubTypes.Type(value = DatasetIdentifierDataPersist.class, name = "datasetIdentifier"),
|
||||
@JsonSubTypes.Type(value = CurrencyDataPersist.class, name = "currency"),
|
||||
@JsonSubTypes.Type(value = WordListDataPersist.class, name = "wordlist"),
|
||||
@JsonSubTypes.Type(value = DataRepositoryDataPersist.class, name = "dataRepositories"),
|
||||
@JsonSubTypes.Type(value = JournalRepositoryDataPersist.class, name = "journalRepositories"),
|
||||
@JsonSubTypes.Type(value = PublicationRepositoryDataPersist.class, name = "pubRepositories"),
|
||||
@JsonSubTypes.Type(value = AutoCompleteDataPersist.class, name = FieldType.Names.Autocomplete),
|
||||
@JsonSubTypes.Type(value = BooleanDecisionDataPersist.class, name = FieldType.Names.BooleanDecision),
|
||||
@JsonSubTypes.Type(value = DatasetAutoCompleteDataPersist.class, name = FieldType.Names.InternalDmpDatasets),
|
||||
@JsonSubTypes.Type(value = DmpAutoCompleteDataPersist.class, name = FieldType.Names.InternalDmpDmps),
|
||||
@JsonSubTypes.Type(value = CheckBoxDataPersist.class, name = FieldType.Names.CheckBox),
|
||||
@JsonSubTypes.Type(value = DatePickerDataPersist.class, name = FieldType.Names.DatePicker),
|
||||
@JsonSubTypes.Type(value = ExternalDatasetDataPersist.class, name = FieldType.Names.ExternalDatasets),
|
||||
@JsonSubTypes.Type(value = FreeTextDataPersist.class, name = FieldType.Names.FreeText),
|
||||
@JsonSubTypes.Type(value = LicenseDataPersist.class, name = FieldType.Names.Licenses),
|
||||
@JsonSubTypes.Type(value = OrganizationDataPersist.class, name = FieldType.Names.Organizations),
|
||||
@JsonSubTypes.Type(value = PublicationDataPersist.class, name = FieldType.Names.Publications),
|
||||
@JsonSubTypes.Type(value = RadioBoxDataPersist.class, name = FieldType.Names.RadioBox),
|
||||
@JsonSubTypes.Type(value = RegistryDataPersist.class, name = FieldType.Names.Registries),
|
||||
@JsonSubTypes.Type(value = ResearcherAutoCompleteDataPersist.class, name = FieldType.Names.InternalDmpResearchers),
|
||||
@JsonSubTypes.Type(value = ResearcherDataPersist.class, name = FieldType.Names.Researchers),
|
||||
@JsonSubTypes.Type(value = RichTextAreaDataPersist.class, name = FieldType.Names.RichTextarea),
|
||||
@JsonSubTypes.Type(value = ServiceDataPersist.class, name = FieldType.Names.Services),
|
||||
@JsonSubTypes.Type(value = TagDataPersist.class, name = FieldType.Names.Tags),
|
||||
@JsonSubTypes.Type(value = TaxonomyDataPersist.class, name = FieldType.Names.Taxonomies),
|
||||
@JsonSubTypes.Type(value = TextAreaDataPersist.class, name = FieldType.Names.TextArea),
|
||||
@JsonSubTypes.Type(value = UploadDataPersist.class, name = FieldType.Names.Upload),
|
||||
@JsonSubTypes.Type(value = ValidationDataPersist.class, name = FieldType.Names.Validation),
|
||||
@JsonSubTypes.Type(value = DatasetIdentifierDataPersist.class, name = FieldType.Names.DatasetIdentifier),
|
||||
@JsonSubTypes.Type(value = CurrencyDataPersist.class, name = FieldType.Names.Currency),
|
||||
@JsonSubTypes.Type(value = WordListDataPersist.class, name = FieldType.Names.Wordlist),
|
||||
@JsonSubTypes.Type(value = DataRepositoryDataPersist.class, name = FieldType.Names.DataRepositories),
|
||||
@JsonSubTypes.Type(value = JournalRepositoryDataPersist.class, name = FieldType.Names.JournalRepositories),
|
||||
@JsonSubTypes.Type(value = PublicationRepositoryDataPersist.class, name = FieldType.Names.Publications),
|
||||
})
|
||||
public abstract class BaseFieldDataPersist {
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import eu.eudat.commons.enums.UserDescriptionTemplateRole;
|
|||
import eu.eudat.commons.scope.user.UserScope;
|
||||
import eu.eudat.commons.types.descriptiontemplate.*;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importmodel.DescriptionTemplateImportXml;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.DescriptionTemplateImportExport;
|
||||
import eu.eudat.convention.ConventionService;
|
||||
import eu.eudat.data.DescriptionTemplateEntity;
|
||||
import eu.eudat.data.UserDescriptionTemplateEntity;
|
||||
|
@ -56,8 +56,6 @@ import org.springframework.context.MessageSource;
|
|||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import javax.management.InvalidApplicationException;
|
||||
|
@ -120,6 +118,8 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
|
|||
this.environment = environment;
|
||||
}
|
||||
|
||||
//region Persist
|
||||
|
||||
public DescriptionTemplate persist(DescriptionTemplatePersist model, FieldSet fields) throws MyForbiddenException, MyValidationException, MyApplicationException, MyNotFoundException, InvalidApplicationException, JAXBException, ParserConfigurationException, JsonProcessingException, TransformerException {
|
||||
logger.debug(new MapLogEntry("persisting data descriptionTemplate").And("model", model).And("fields", fields));
|
||||
|
||||
|
@ -344,6 +344,10 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
|
|||
return data;
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
//region Delete
|
||||
|
||||
public void deleteAndSave(UUID id) throws MyForbiddenException, InvalidApplicationException {
|
||||
logger.debug("deleting dataset: {}", id);
|
||||
|
||||
|
@ -352,6 +356,10 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
|
|||
this.deleterFactory.deleter(DescriptionTemplateDeleter.class).deleteAndSaveByIds(List.of(id));
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
//region Clone
|
||||
|
||||
public DescriptionTemplate buildClone(UUID id, FieldSet fields) throws MyForbiddenException, MyValidationException, MyApplicationException, MyNotFoundException {
|
||||
logger.debug(new MapLogEntry("persisting data").And("id", id).And("fields", fields));
|
||||
|
||||
|
@ -423,6 +431,10 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
|
|||
model.setId(UUID.randomUUID().toString());
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
//region NewVersion
|
||||
|
||||
public DescriptionTemplate createNewVersion(NewVersionDescriptionTemplatePersist model, FieldSet fields) throws MyForbiddenException, MyValidationException, MyApplicationException, MyNotFoundException, InvalidApplicationException, JAXBException, ParserConfigurationException, JsonProcessingException, TransformerException {
|
||||
logger.debug(new MapLogEntry("persisting data descriptionTemplateType").And("model", model).And("fields", fields));
|
||||
|
||||
|
@ -463,18 +475,21 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
|
|||
return this.builderFactory.builder(DescriptionTemplateBuilder.class).authorize(AuthorizationFlags.OwnerOrPermission).build(BaseFieldSet.build(fields, DescriptionTemplate._id), data);
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
//region Import
|
||||
|
||||
public DescriptionTemplate importXml(byte[] bytes, UUID id, String label, FieldSet fields) throws MyForbiddenException, MyNotFoundException, JAXBException, ParserConfigurationException, TransformerException, InvalidApplicationException, IOException, InstantiationException, IllegalAccessException, SAXException {
|
||||
logger.debug(new MapLogEntry("import data").And("bytes", bytes).And("fields", fields));
|
||||
|
||||
this.authorizationService.authorizeForce(Permission.ImportDescriptionTemplate);
|
||||
|
||||
DescriptionTemplateImportExport importXml = this.xmlHandlingService.fromXml(DescriptionTemplateImportExport.class, new String(bytes, StandardCharsets.UTF_8));
|
||||
if (id != null) {
|
||||
DescriptionTemplateImportXml importXml = this.xmlHandlingService.fromXml(DescriptionTemplateImportXml.class, new String(bytes, StandardCharsets.UTF_8));
|
||||
DescriptionTemplatePersist persist = importXml.toPersistModel(label, this.fieldDataHelperServiceProvider);
|
||||
this.validationService.validateForce(persist);
|
||||
return this.persist(persist, fields);
|
||||
} else {
|
||||
DescriptionTemplateImportXml importXml = this.xmlHandlingService.fromXml(DescriptionTemplateImportXml.class, new String(bytes, StandardCharsets.UTF_8));
|
||||
NewVersionDescriptionTemplatePersist persist = importXml.toNewVersionPersistModel(id, label, this.fieldDataHelperServiceProvider);
|
||||
DescriptionTemplateEntity oldDescriptionTemplateEntity = this.entityManager.find(DescriptionTemplateEntity.class, id);
|
||||
if (oldDescriptionTemplateEntity == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{id, DescriptionTemplate.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
||||
|
@ -483,5 +498,7 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
|
|||
return this.createNewVersion(persist, fields);
|
||||
}
|
||||
}
|
||||
|
||||
//endregion
|
||||
}
|
||||
|
||||
|
|
|
@ -340,7 +340,7 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
|
|||
|
||||
private SectionImportExport sectionXmlToExport(SectionEntity entity) {
|
||||
SectionImportExport xml = new SectionImportExport();
|
||||
xml.setId(entity.getId().toString());
|
||||
xml.setId(entity.getId());
|
||||
xml.setLabel(entity.getLabel());
|
||||
xml.setDescription(entity.getDescription());
|
||||
xml.setOrdinal(entity.getOrdinal());
|
||||
|
@ -372,8 +372,8 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
|
|||
|
||||
private DescriptionTemplateImportExport descriptionTemplateXmlToExport(DescriptionTemplateEntity entity) {
|
||||
DescriptionTemplateImportExport xml = new DescriptionTemplateImportExport();
|
||||
xml.setId(entity.getId().toString());
|
||||
xml.setDescriptionTemplateId(entity.getDescriptionTemplateId().toString());
|
||||
xml.setId(entity.getId());
|
||||
xml.setDescriptionTemplateId(entity.getDescriptionTemplateId());
|
||||
xml.setLabel(entity.getLabel());
|
||||
xml.setMinMultiplicity(entity.getMinMultiplicity());
|
||||
xml.setMaxMultiplicity(entity.getMaxMultiplicity());
|
||||
|
@ -382,8 +382,8 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
|
|||
|
||||
private ExtraFieldImportExport extraFieldXmlToExport(ExtraFieldEntity entity) {
|
||||
ExtraFieldImportExport xml = new ExtraFieldImportExport();
|
||||
xml.setId(entity.getId().toString());
|
||||
xml.setType(entity.getType().getValue());
|
||||
xml.setId(entity.getId());
|
||||
xml.setType(entity.getType());
|
||||
xml.setLabel(entity.getLabel());
|
||||
xml.setPlaceholder(entity.getPlaceholder());
|
||||
xml.setDescription(entity.getDescription());
|
||||
|
@ -394,8 +394,8 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
|
|||
|
||||
private SystemFieldImportExport systemFieldXmlToExport(SystemFieldEntity entity) {
|
||||
SystemFieldImportExport xml = new SystemFieldImportExport();
|
||||
xml.setId(entity.getId().toString());
|
||||
xml.setType(entity.getType().getValue());
|
||||
xml.setId(entity.getId());
|
||||
xml.setType(entity.getType());
|
||||
xml.setLabel(entity.getLabel());
|
||||
xml.setPlaceholder(entity.getPlaceholder());
|
||||
xml.setDescription(entity.getDescription());
|
||||
|
@ -441,7 +441,7 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
|
|||
|
||||
private SectionPersist xmlSectionToPersist(SectionImportExport importXml) {
|
||||
SectionPersist persist = new SectionPersist();
|
||||
persist.setId(UUID.fromString(importXml.getId()));
|
||||
persist.setId(importXml.getId());
|
||||
persist.setLabel(importXml.getLabel());
|
||||
persist.setDescription(importXml.getDescription());
|
||||
persist.setOrdinal(importXml.getOrdinal());
|
||||
|
@ -470,8 +470,8 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
|
|||
|
||||
private DescriptionTemplatePersist xmlDescriptionTemplateToPersist(DescriptionTemplateImportExport importXml) {
|
||||
DescriptionTemplatePersist persist = new DescriptionTemplatePersist();
|
||||
persist.setId(UUID.fromString(importXml.getId()));
|
||||
persist.setDescriptionTemplateId(UUID.fromString(importXml.getDescriptionTemplateId()));
|
||||
persist.setId(importXml.getId());
|
||||
persist.setDescriptionTemplateId(importXml.getDescriptionTemplateId());
|
||||
persist.setLabel(importXml.getLabel());
|
||||
persist.setMinMultiplicity(importXml.getMinMultiplicity());
|
||||
persist.setMaxMultiplicity(importXml.getMaxMultiplicity());
|
||||
|
@ -480,9 +480,9 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
|
|||
|
||||
private FieldPersist xmlExtraFieldToPersist(ExtraFieldImportExport importXml) {
|
||||
ExtraFieldPersist persist = new ExtraFieldPersist();
|
||||
persist.setId(UUID.fromString(importXml.getId()));
|
||||
persist.setId(importXml.getId());
|
||||
persist.setCategory(DmpBlueprintFieldCategory.Extra);
|
||||
persist.setDataType(DmpBlueprintExtraFieldDataType.of(importXml.getType()));
|
||||
persist.setDataType(importXml.getType());
|
||||
persist.setLabel(importXml.getLabel());
|
||||
persist.setPlaceholder(importXml.getPlaceholder());
|
||||
persist.setDescription(importXml.getDescription());
|
||||
|
@ -493,9 +493,9 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
|
|||
|
||||
private FieldPersist xmlSystemFieldToPersist(SystemFieldImportExport importXml) {
|
||||
SystemFieldPersist persist = new SystemFieldPersist();
|
||||
persist.setId(UUID.fromString(importXml.getId()));
|
||||
persist.setId(importXml.getId());
|
||||
persist.setCategory(DmpBlueprintFieldCategory.System);
|
||||
persist.setSystemFieldType(DmpBlueprintSystemFieldType.of(importXml.getType()));
|
||||
persist.setSystemFieldType(importXml.getType());
|
||||
persist.setLabel(importXml.getLabel());
|
||||
persist.setPlaceholder(importXml.getPlaceholder());
|
||||
persist.setDescription(importXml.getDescription());
|
||||
|
|
|
@ -6,6 +6,7 @@ import eu.eudat.commons.types.descriptiontemplate.SectionEntity;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ComboBoxDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.*;
|
||||
import eu.eudat.convention.ConventionService;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.AutoCompleteDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
|
@ -27,7 +28,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperService<AutoCompleteData, AutoCompleteDataPersist, AutoCompleteDataEntity> {
|
||||
public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperService<AutoCompleteData, AutoCompleteDataPersist, AutoCompleteDataEntity, AutoCompleteDataImportExport> {
|
||||
private final ConventionService conventionService;
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -57,6 +58,11 @@ public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperServi
|
|||
return new AutoCompleteDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AutoCompleteDataImportExport newImportExportInstanceInternal() {
|
||||
return new AutoCompleteDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return AutoCompleteDataEntity.class;
|
||||
|
@ -65,12 +71,16 @@ public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperServi
|
|||
public Class<?> getModelClass() {
|
||||
return AutoCompleteData.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getPersistModelClass() {
|
||||
return AutoCompleteDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return AutoCompleteDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AutoCompleteData> buildInternal(FieldSet fieldSet, List<AutoCompleteDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(AutoCompleteDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -129,18 +139,18 @@ public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperServi
|
|||
}
|
||||
|
||||
@Override
|
||||
protected AutoCompleteDataPersist mapDataToPersist(AutoCompleteDataEntity data, AutoCompleteDataPersist persist) {
|
||||
protected AutoCompleteDataPersist importExportMapDataToPersistInternal(AutoCompleteDataImportExport data, AutoCompleteDataPersist persist) {
|
||||
persist.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
if (!this.conventionService.isListNullOrEmpty(data.getAutoCompleteSingleDataList())){
|
||||
persist.setAutoCompleteSingleDataList(new ArrayList<>());
|
||||
for (AutoCompleteDataEntity.AutoCompleteSingleData autoCompleteSingleData: data.getAutoCompleteSingleDataList()) {
|
||||
for (AutoCompleteSingleData autoCompleteSingleData: data.getAutoCompleteSingleDataList()) {
|
||||
persist.getAutoCompleteSingleDataList().add(this.buildAutoCompleteSingleData(autoCompleteSingleData));
|
||||
}
|
||||
}
|
||||
return persist;
|
||||
}
|
||||
|
||||
private @NotNull AutoCompleteSingleDataPersist buildAutoCompleteSingleData(AutoCompleteDataEntity.AutoCompleteSingleData data){
|
||||
private @NotNull AutoCompleteSingleDataPersist buildAutoCompleteSingleData(AutoCompleteSingleData data){
|
||||
AutoCompleteSingleDataPersist persist = new AutoCompleteSingleDataPersist();
|
||||
if (data == null) return persist;
|
||||
|
||||
|
@ -155,7 +165,7 @@ public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperServi
|
|||
return persist;
|
||||
}
|
||||
|
||||
private @NotNull ComboBoxOptionPersist buildOption(ComboBoxDataEntity.Option data){
|
||||
private @NotNull ComboBoxOptionPersist buildOption(ComboBoxDataOptionEntity data){
|
||||
ComboBoxOptionPersist persist = new ComboBoxOptionPersist();
|
||||
if (data == null) return persist;
|
||||
|
||||
|
@ -167,7 +177,7 @@ public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperServi
|
|||
return persist;
|
||||
}
|
||||
|
||||
private @NotNull AuthAutoCompleteDataPersist buildAuthAutoCompleteData(AutoCompleteDataEntity.AuthAutoCompleteData data){
|
||||
private @NotNull AuthAutoCompleteDataPersist buildAuthAutoCompleteData(AuthAutoCompleteData data){
|
||||
AuthAutoCompleteDataPersist persist = new AuthAutoCompleteDataPersist();
|
||||
if (data == null) return persist;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package eu.eudat.service.fielddatahelper;
|
|||
import eu.eudat.authorization.AuthorizationFlags;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BooleanDecisionDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.BaseFieldDataImportExport;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BooleanDecisionData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
|
@ -14,14 +15,15 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public abstract class BaseFieldDataHelperService<M extends BaseFieldData, PM extends BaseFieldDataPersist, D extends BaseFieldDataEntity<?>> implements FieldDataHelperService {
|
||||
public abstract class BaseFieldDataHelperService<M extends BaseFieldData, PM extends BaseFieldDataPersist, D extends BaseFieldDataEntity<?>, IE extends BaseFieldDataImportExport> implements FieldDataHelperService {
|
||||
protected abstract D newDataInstanceInternal();
|
||||
protected abstract M newModelInstanceInternal();
|
||||
protected abstract PM newPersistModelInstanceInternal();
|
||||
protected abstract IE newImportExportInstanceInternal();
|
||||
|
||||
protected abstract List<M> buildInternal(FieldSet fieldSet, List<D> datas, EnumSet<AuthorizationFlags> authorizationFlags);
|
||||
protected abstract D applyPersistInternal(PM persist, D data);
|
||||
protected abstract PM mapDataToPersist(D data, PM persist);
|
||||
protected abstract PM importExportMapDataToPersistInternal(IE data, PM persist);
|
||||
@Override
|
||||
public BaseFieldDataEntity<?> newDataInstance() {
|
||||
return this.newDataInstanceInternal();
|
||||
|
@ -38,11 +40,16 @@ public abstract class BaseFieldDataHelperService<M extends BaseFieldData, PM ext
|
|||
}
|
||||
|
||||
@Override
|
||||
public BaseFieldDataPersist mapDataToPersist(BaseFieldDataEntity<?> data) {
|
||||
public BaseFieldDataImportExport newImportExportInstance() {
|
||||
return this.newImportExportInstanceInternal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseFieldDataPersist importExportMapDataToPersist(BaseFieldDataImportExport data) {
|
||||
PM model = this.newPersistModelInstanceInternal();
|
||||
model.setFieldType(this.getFormType());
|
||||
model.setLabel(data.getLabel());
|
||||
return this.mapDataToPersist((D)data, model);
|
||||
return this.importExportMapDataToPersistInternal((IE)data, model);
|
||||
}
|
||||
@Override
|
||||
public BaseFieldDataEntity<?> applyPersist(BaseFieldDataPersist persist){
|
||||
|
|
|
@ -5,13 +5,12 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BooleanDecisionDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.BooleanDecisionDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.BooleanDecisionDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BooleanDecisionData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.AutoCompleteDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.AutoCompleteSingleDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BooleanDecisionDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.*;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -24,7 +23,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class BooleanDecisionFieldDataHelperService extends BaseFieldDataHelperService<BooleanDecisionData, BooleanDecisionDataPersist, BooleanDecisionDataEntity> {
|
||||
public class BooleanDecisionFieldDataHelperService extends BaseFieldDataHelperService<BooleanDecisionData, BooleanDecisionDataPersist, BooleanDecisionDataEntity, BooleanDecisionDataImportExport> {
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
public BooleanDecisionFieldDataHelperService(BuilderFactory builderFactory) {
|
||||
|
@ -51,6 +50,11 @@ public class BooleanDecisionFieldDataHelperService extends BaseFieldDataHelperSe
|
|||
return new BooleanDecisionDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BooleanDecisionDataImportExport newImportExportInstanceInternal() {
|
||||
return new BooleanDecisionDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return BooleanDecisionDataEntity.class;
|
||||
|
@ -64,6 +68,11 @@ public class BooleanDecisionFieldDataHelperService extends BaseFieldDataHelperSe
|
|||
return BooleanDecisionDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return BooleanDecisionDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BooleanDecisionData> buildInternal(FieldSet fieldSet, List<BooleanDecisionDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(BooleanDecisionDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -75,7 +84,7 @@ public class BooleanDecisionFieldDataHelperService extends BaseFieldDataHelperSe
|
|||
}
|
||||
|
||||
@Override
|
||||
protected BooleanDecisionDataPersist mapDataToPersist(BooleanDecisionDataEntity data, BooleanDecisionDataPersist persist) {
|
||||
protected BooleanDecisionDataPersist importExportMapDataToPersistInternal(BooleanDecisionDataImportExport data, BooleanDecisionDataPersist persist) {
|
||||
return persist;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BooleanDecisionDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.CheckBoxDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.CheckBoxDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.CheckBoxDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.CheckBoxData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BooleanDecisionDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.CheckBoxDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class CheckBoxFieldDataHelperService extends BaseFieldDataHelperService<CheckBoxData, CheckBoxDataPersist, CheckBoxDataEntity> {
|
||||
public class CheckBoxFieldDataHelperService extends BaseFieldDataHelperService<CheckBoxData, CheckBoxDataPersist, CheckBoxDataEntity, CheckBoxDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -50,6 +53,11 @@ public class CheckBoxFieldDataHelperService extends BaseFieldDataHelperService<C
|
|||
return new CheckBoxDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CheckBoxDataImportExport newImportExportInstanceInternal() {
|
||||
return new CheckBoxDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return CheckBoxDataEntity.class;
|
||||
|
@ -64,6 +72,11 @@ public class CheckBoxFieldDataHelperService extends BaseFieldDataHelperService<C
|
|||
return CheckBoxDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return CheckBoxDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CheckBoxData> buildInternal(FieldSet fieldSet, List<CheckBoxDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(CheckBoxDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -75,7 +88,7 @@ public class CheckBoxFieldDataHelperService extends BaseFieldDataHelperService<C
|
|||
}
|
||||
|
||||
@Override
|
||||
protected CheckBoxDataPersist mapDataToPersist(CheckBoxDataEntity data, CheckBoxDataPersist persist) {
|
||||
protected CheckBoxDataPersist importExportMapDataToPersistInternal(CheckBoxDataImportExport data, CheckBoxDataPersist persist) {
|
||||
return persist;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,14 @@ import eu.eudat.authorization.AuthorizationFlags;
|
|||
import eu.eudat.commons.enums.FieldType;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.CurrencyDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.CurrencyDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.CurrencyDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.CurrencyData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.CurrencyDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -19,7 +22,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class CurrencyFieldDataHelperService extends BaseFieldDataHelperService<CurrencyData, CurrencyDataPersist, CurrencyDataEntity> {
|
||||
public class CurrencyFieldDataHelperService extends BaseFieldDataHelperService<CurrencyData, CurrencyDataPersist, CurrencyDataEntity, CurrencyDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -48,6 +51,11 @@ public class CurrencyFieldDataHelperService extends BaseFieldDataHelperService<C
|
|||
return new CurrencyDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CurrencyDataImportExport newImportExportInstanceInternal() {
|
||||
return new CurrencyDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return CurrencyDataEntity.class;
|
||||
|
@ -62,6 +70,11 @@ public class CurrencyFieldDataHelperService extends BaseFieldDataHelperService<C
|
|||
return CurrencyDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return CurrencyDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CurrencyData> buildInternal(FieldSet fieldSet, List<CurrencyDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(CurrencyDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -72,7 +85,7 @@ public class CurrencyFieldDataHelperService extends BaseFieldDataHelperService<C
|
|||
}
|
||||
|
||||
@Override
|
||||
protected CurrencyDataPersist mapDataToPersist(CurrencyDataEntity data, CurrencyDataPersist persist) {
|
||||
protected CurrencyDataPersist importExportMapDataToPersistInternal(CurrencyDataImportExport data, CurrencyDataPersist persist) {
|
||||
return persist;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,13 +5,12 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DataRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.DataRepositoryDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.DataRepositoryDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.DataRepositoryData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.AutoCompleteDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.AutoCompleteSingleDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DataRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.*;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -23,7 +22,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class DataRepositoryFieldDataHelperService extends BaseFieldDataHelperService<DataRepositoryData, DataRepositoryDataPersist, DataRepositoryDataEntity> {
|
||||
public class DataRepositoryFieldDataHelperService extends BaseFieldDataHelperService<DataRepositoryData, DataRepositoryDataPersist, DataRepositoryDataEntity, DataRepositoryDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -52,6 +51,11 @@ public class DataRepositoryFieldDataHelperService extends BaseFieldDataHelperSer
|
|||
return new DataRepositoryDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DataRepositoryDataImportExport newImportExportInstanceInternal() {
|
||||
return new DataRepositoryDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return DataRepositoryDataEntity.class;
|
||||
|
@ -65,6 +69,11 @@ public class DataRepositoryFieldDataHelperService extends BaseFieldDataHelperSer
|
|||
return DataRepositoryDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return DataRepositoryDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataRepositoryData> buildInternal(FieldSet fieldSet, List<DataRepositoryDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(DataRepositoryDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -77,7 +86,7 @@ public class DataRepositoryFieldDataHelperService extends BaseFieldDataHelperSer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected DataRepositoryDataPersist mapDataToPersist(DataRepositoryDataEntity data, DataRepositoryDataPersist persist) {
|
||||
protected DataRepositoryDataPersist importExportMapDataToPersistInternal(DataRepositoryDataImportExport data, DataRepositoryDataPersist persist) {
|
||||
persist.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
return persist;
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DataRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DatasetAutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.DatasetAutoCompleteDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.DatasetAutoCompleteDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.DatasetAutoCompleteData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DataRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DatasetAutoCompleteDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class DatasetAutoCompleteFieldDataHelperService extends BaseFieldDataHelperService<DatasetAutoCompleteData, DatasetAutoCompleteDataPersist, DatasetAutoCompleteDataEntity> {
|
||||
public class DatasetAutoCompleteFieldDataHelperService extends BaseFieldDataHelperService<DatasetAutoCompleteData, DatasetAutoCompleteDataPersist, DatasetAutoCompleteDataEntity, DatasetAutoCompleteDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -50,6 +53,11 @@ public class DatasetAutoCompleteFieldDataHelperService extends BaseFieldDataHelp
|
|||
return new DatasetAutoCompleteDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DatasetAutoCompleteDataImportExport newImportExportInstanceInternal() {
|
||||
return new DatasetAutoCompleteDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return DatasetAutoCompleteDataEntity.class;
|
||||
|
@ -64,6 +72,11 @@ public class DatasetAutoCompleteFieldDataHelperService extends BaseFieldDataHelp
|
|||
return DatasetAutoCompleteDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return DatasetAutoCompleteDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DatasetAutoCompleteData> buildInternal(FieldSet fieldSet, List<DatasetAutoCompleteDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(DatasetAutoCompleteDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -76,7 +89,7 @@ public class DatasetAutoCompleteFieldDataHelperService extends BaseFieldDataHelp
|
|||
}
|
||||
|
||||
@Override
|
||||
protected DatasetAutoCompleteDataPersist mapDataToPersist(DatasetAutoCompleteDataEntity data, DatasetAutoCompleteDataPersist persist) {
|
||||
protected DatasetAutoCompleteDataPersist importExportMapDataToPersistInternal(DatasetAutoCompleteDataImportExport data, DatasetAutoCompleteDataPersist persist) {
|
||||
persist.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
return persist;
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BooleanDecisionDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DatasetIdentifierDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.DatasetIdentifierDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.DatasetIdentifierDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.DatasetIdentifierData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BooleanDecisionDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DatasetIdentifierDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class DatasetIdentifierFieldDataHelperService extends BaseFieldDataHelperService<DatasetIdentifierData, DatasetIdentifierDataPersist, DatasetIdentifierDataEntity> {
|
||||
public class DatasetIdentifierFieldDataHelperService extends BaseFieldDataHelperService<DatasetIdentifierData, DatasetIdentifierDataPersist, DatasetIdentifierDataEntity, DatasetIdentifierDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -49,6 +52,11 @@ public class DatasetIdentifierFieldDataHelperService extends BaseFieldDataHelper
|
|||
return new DatasetIdentifierDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DatasetIdentifierDataImportExport newImportExportInstanceInternal() {
|
||||
return new DatasetIdentifierDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return DatasetIdentifierDataEntity.class;
|
||||
|
@ -62,6 +70,11 @@ public class DatasetIdentifierFieldDataHelperService extends BaseFieldDataHelper
|
|||
return DatasetIdentifierDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return DatasetIdentifierDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DatasetIdentifierData> buildInternal(FieldSet fieldSet, List<DatasetIdentifierDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(DatasetIdentifierDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -73,7 +86,7 @@ public class DatasetIdentifierFieldDataHelperService extends BaseFieldDataHelper
|
|||
}
|
||||
|
||||
@Override
|
||||
protected DatasetIdentifierDataPersist mapDataToPersist(DatasetIdentifierDataEntity data, DatasetIdentifierDataPersist persist) {
|
||||
protected DatasetIdentifierDataPersist importExportMapDataToPersistInternal(DatasetIdentifierDataImportExport data, DatasetIdentifierDataPersist persist) {
|
||||
return persist;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BooleanDecisionDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DatePickerDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.DatePickerDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.DatePickerDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.DatePickerData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BooleanDecisionDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DatePickerDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class DatePickerFieldDataHelperService extends BaseFieldDataHelperService<DatePickerData, DatePickerDataPersist, DatePickerDataEntity> {
|
||||
public class DatePickerFieldDataHelperService extends BaseFieldDataHelperService<DatePickerData, DatePickerDataPersist, DatePickerDataEntity, DatePickerDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -49,6 +52,11 @@ public class DatePickerFieldDataHelperService extends BaseFieldDataHelperService
|
|||
return new DatePickerDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DatePickerDataImportExport newImportExportInstanceInternal() {
|
||||
return new DatePickerDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return DatePickerDataEntity.class;
|
||||
|
@ -62,6 +70,11 @@ public class DatePickerFieldDataHelperService extends BaseFieldDataHelperService
|
|||
return DatePickerDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return DatePickerDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DatePickerData> buildInternal(FieldSet fieldSet, List<DatePickerDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(DatePickerDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -73,7 +86,7 @@ public class DatePickerFieldDataHelperService extends BaseFieldDataHelperService
|
|||
}
|
||||
|
||||
@Override
|
||||
protected DatePickerDataPersist mapDataToPersist(DatePickerDataEntity data, DatePickerDataPersist persist) {
|
||||
protected DatePickerDataPersist importExportMapDataToPersistInternal(DatePickerDataImportExport data, DatePickerDataPersist persist) {
|
||||
return persist;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DataRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DmpAutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.DmpAutoCompleteDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.DmpAutoCompleteDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.DmpAutoCompleteData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DataRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DmpAutoCompleteDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class DmpAutoCompleteFieldDataHelperService extends BaseFieldDataHelperService<DmpAutoCompleteData, DmpAutoCompleteDataPersist, DmpAutoCompleteDataEntity> {
|
||||
public class DmpAutoCompleteFieldDataHelperService extends BaseFieldDataHelperService<DmpAutoCompleteData, DmpAutoCompleteDataPersist, DmpAutoCompleteDataEntity, DmpAutoCompleteDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -50,6 +53,11 @@ public class DmpAutoCompleteFieldDataHelperService extends BaseFieldDataHelperSe
|
|||
return new DmpAutoCompleteDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DmpAutoCompleteDataImportExport newImportExportInstanceInternal() {
|
||||
return new DmpAutoCompleteDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return DmpAutoCompleteDataEntity.class;
|
||||
|
@ -64,6 +72,11 @@ public class DmpAutoCompleteFieldDataHelperService extends BaseFieldDataHelperSe
|
|||
return DmpAutoCompleteDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return DmpAutoCompleteDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DmpAutoCompleteData> buildInternal(FieldSet fieldSet, List<DmpAutoCompleteDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(DmpAutoCompleteDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -76,7 +89,7 @@ public class DmpAutoCompleteFieldDataHelperService extends BaseFieldDataHelperSe
|
|||
}
|
||||
|
||||
@Override
|
||||
protected DmpAutoCompleteDataPersist mapDataToPersist(DmpAutoCompleteDataEntity data, DmpAutoCompleteDataPersist persist) {
|
||||
protected DmpAutoCompleteDataPersist importExportMapDataToPersistInternal(DmpAutoCompleteDataImportExport data, DmpAutoCompleteDataPersist persist) {
|
||||
persist.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
return persist;
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DataRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ExternalDatasetDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.ExternalDatasetDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.ExternalDatasetDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.ExternalDatasetData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DataRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.ExternalDatasetDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class ExternalDatasetFieldDataHelperService extends BaseFieldDataHelperService<ExternalDatasetData, ExternalDatasetDataPersist, ExternalDatasetDataEntity> {
|
||||
public class ExternalDatasetFieldDataHelperService extends BaseFieldDataHelperService<ExternalDatasetData, ExternalDatasetDataPersist, ExternalDatasetDataEntity, ExternalDatasetDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -50,6 +53,11 @@ public class ExternalDatasetFieldDataHelperService extends BaseFieldDataHelperSe
|
|||
return new ExternalDatasetDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ExternalDatasetDataImportExport newImportExportInstanceInternal() {
|
||||
return new ExternalDatasetDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return ExternalDatasetDataEntity.class;
|
||||
|
@ -63,6 +71,11 @@ public class ExternalDatasetFieldDataHelperService extends BaseFieldDataHelperSe
|
|||
return ExternalDatasetDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return ExternalDatasetDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExternalDatasetData> buildInternal(FieldSet fieldSet, List<ExternalDatasetDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(ExternalDatasetDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -76,7 +89,7 @@ public class ExternalDatasetFieldDataHelperService extends BaseFieldDataHelperSe
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ExternalDatasetDataPersist mapDataToPersist(ExternalDatasetDataEntity data, ExternalDatasetDataPersist persist) {
|
||||
protected ExternalDatasetDataPersist importExportMapDataToPersistInternal(ExternalDatasetDataImportExport data, ExternalDatasetDataPersist persist) {
|
||||
persist.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
persist.setType(data.getType());
|
||||
return persist;
|
||||
|
|
|
@ -3,6 +3,7 @@ package eu.eudat.service.fielddatahelper;
|
|||
import eu.eudat.authorization.AuthorizationFlags;
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.BaseFieldDataImportExport;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
|
@ -16,12 +17,14 @@ public interface FieldDataHelperService {
|
|||
BaseFieldDataEntity<?> newDataInstance();
|
||||
BaseFieldData newModelInstance();
|
||||
BaseFieldDataPersist newPersistModelInstance();
|
||||
BaseFieldDataImportExport newImportExportInstance();
|
||||
Class<?> getDataClass();
|
||||
Class<?> getModelClass();
|
||||
Class<?> getPersistModelClass();
|
||||
Class<?> getImportExportClass();
|
||||
List<BaseFieldData> build(gr.cite.tools.fieldset.FieldSet fieldSet, List<BaseFieldDataEntity<?>> datas, EnumSet<AuthorizationFlags> authorizationFlags);
|
||||
BaseFieldData buildOne(FieldSet fieldSet, BaseFieldDataEntity<?> data, EnumSet<AuthorizationFlags> authorizationFlags);
|
||||
BaseFieldDataEntity<?> applyPersist(BaseFieldDataPersist persist);
|
||||
BaseFieldDataEntity<?> applyPersist(BaseFieldDataPersist persist, BaseFieldDataEntity<?> data);
|
||||
BaseFieldDataPersist mapDataToPersist(BaseFieldDataEntity<?> data);
|
||||
BaseFieldDataPersist importExportMapDataToPersist(BaseFieldDataImportExport data);
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BooleanDecisionDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.FreeTextDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.FreeTextDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.FreeTextDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.FreeTextData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BooleanDecisionDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.FreeTextDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class FreeTextFieldDataHelperService extends BaseFieldDataHelperService<FreeTextData, FreeTextDataPersist, FreeTextDataEntity> {
|
||||
public class FreeTextFieldDataHelperService extends BaseFieldDataHelperService<FreeTextData, FreeTextDataPersist, FreeTextDataEntity, FreeTextDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -50,6 +53,11 @@ public class FreeTextFieldDataHelperService extends BaseFieldDataHelperService<F
|
|||
return new FreeTextDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected FreeTextDataImportExport newImportExportInstanceInternal() {
|
||||
return new FreeTextDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return FreeTextDataEntity.class;
|
||||
|
@ -64,6 +72,11 @@ public class FreeTextFieldDataHelperService extends BaseFieldDataHelperService<F
|
|||
return FreeTextDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return FreeTextDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FreeTextData> buildInternal(FieldSet fieldSet, List<FreeTextDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(FreeTextDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -75,7 +88,7 @@ public class FreeTextFieldDataHelperService extends BaseFieldDataHelperService<F
|
|||
}
|
||||
|
||||
@Override
|
||||
protected FreeTextDataPersist mapDataToPersist(FreeTextDataEntity data, FreeTextDataPersist persist) {
|
||||
protected FreeTextDataPersist importExportMapDataToPersistInternal(FreeTextDataImportExport data, FreeTextDataPersist persist) {
|
||||
return persist;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DataRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.JournalRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.JournalRepositoryDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.DataRepositoryDataBuilder;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.JournalRepositoryDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
|
@ -13,6 +15,7 @@ import eu.eudat.model.descriptiontemplatedefinition.fielddata.JournalRepositoryD
|
|||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DataRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.JournalRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -23,7 +26,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class JournalRepositoryFieldDataHelperService extends BaseFieldDataHelperService<JournalRepositoryData, JournalRepositoryDataPersist, JournalRepositoryDataEntity> {
|
||||
public class JournalRepositoryFieldDataHelperService extends BaseFieldDataHelperService<JournalRepositoryData, JournalRepositoryDataPersist, JournalRepositoryDataEntity, JournalRepositoryDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -52,6 +55,11 @@ public class JournalRepositoryFieldDataHelperService extends BaseFieldDataHelper
|
|||
return new JournalRepositoryDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JournalRepositoryDataImportExport newImportExportInstanceInternal() {
|
||||
return new JournalRepositoryDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return JournalRepositoryDataEntity.class;
|
||||
|
@ -65,6 +73,11 @@ public class JournalRepositoryFieldDataHelperService extends BaseFieldDataHelper
|
|||
return JournalRepositoryDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return JournalRepositoryDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JournalRepositoryData> buildInternal(FieldSet fieldSet, List<JournalRepositoryDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(JournalRepositoryDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -77,7 +90,7 @@ public class JournalRepositoryFieldDataHelperService extends BaseFieldDataHelper
|
|||
}
|
||||
|
||||
@Override
|
||||
protected JournalRepositoryDataPersist mapDataToPersist(JournalRepositoryDataEntity data, JournalRepositoryDataPersist persist) {
|
||||
protected JournalRepositoryDataPersist importExportMapDataToPersistInternal(JournalRepositoryDataImportExport data, JournalRepositoryDataPersist persist){
|
||||
persist.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
return persist;
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DataRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.LicenseDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.LicenseDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.LicenseDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.LicenseData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DataRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.LicenseDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class LicenseFieldDataHelperService extends BaseFieldDataHelperService<LicenseData, LicenseDataPersist, LicenseDataEntity> {
|
||||
public class LicenseFieldDataHelperService extends BaseFieldDataHelperService<LicenseData, LicenseDataPersist, LicenseDataEntity, LicenseDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -50,6 +53,11 @@ public class LicenseFieldDataHelperService extends BaseFieldDataHelperService<Li
|
|||
return new LicenseDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected LicenseDataImportExport newImportExportInstanceInternal() {
|
||||
return new LicenseDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return LicenseDataEntity.class;
|
||||
|
@ -63,6 +71,11 @@ public class LicenseFieldDataHelperService extends BaseFieldDataHelperService<Li
|
|||
return LicenseDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return LicenseDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LicenseData> buildInternal(FieldSet fieldSet, List<LicenseDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(LicenseDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -75,7 +88,7 @@ public class LicenseFieldDataHelperService extends BaseFieldDataHelperService<Li
|
|||
}
|
||||
|
||||
@Override
|
||||
protected LicenseDataPersist mapDataToPersist(LicenseDataEntity data, LicenseDataPersist persist) {
|
||||
protected LicenseDataPersist importExportMapDataToPersistInternal(LicenseDataImportExport data, LicenseDataPersist persist) {
|
||||
persist.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
return persist;
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DataRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.OrganizationDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.OrganizationDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.OrganizationDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.OrganizationData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DataRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.OrganizationDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class OrganizationFieldDataHelperService extends BaseFieldDataHelperService<OrganizationData, OrganizationDataPersist, OrganizationDataEntity> {
|
||||
public class OrganizationFieldDataHelperService extends BaseFieldDataHelperService<OrganizationData, OrganizationDataPersist, OrganizationDataEntity, OrganizationDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -50,6 +53,11 @@ public class OrganizationFieldDataHelperService extends BaseFieldDataHelperServi
|
|||
return new OrganizationDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected OrganizationDataImportExport newImportExportInstanceInternal() {
|
||||
return new OrganizationDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return OrganizationDataEntity.class;
|
||||
|
@ -63,6 +71,11 @@ public class OrganizationFieldDataHelperService extends BaseFieldDataHelperServi
|
|||
return OrganizationDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return OrganizationDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrganizationData> buildInternal(FieldSet fieldSet, List<OrganizationDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(OrganizationDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -75,7 +88,7 @@ public class OrganizationFieldDataHelperService extends BaseFieldDataHelperServi
|
|||
}
|
||||
|
||||
@Override
|
||||
protected OrganizationDataPersist mapDataToPersist(OrganizationDataEntity data, OrganizationDataPersist persist) {
|
||||
protected OrganizationDataPersist importExportMapDataToPersistInternal(OrganizationDataImportExport data, OrganizationDataPersist persist) {
|
||||
persist.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
return persist;
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DataRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.PublicationDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.PublicationDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.PublicationDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.PublicationData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DataRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.PublicationDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class PublicationFieldDataHelperService extends BaseFieldDataHelperService<PublicationData, PublicationDataPersist, PublicationDataEntity> {
|
||||
public class PublicationFieldDataHelperService extends BaseFieldDataHelperService<PublicationData, PublicationDataPersist, PublicationDataEntity, PublicationDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -50,6 +53,11 @@ public class PublicationFieldDataHelperService extends BaseFieldDataHelperServic
|
|||
return new PublicationDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PublicationDataImportExport newImportExportInstanceInternal() {
|
||||
return new PublicationDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return PublicationDataEntity.class;
|
||||
|
@ -63,6 +71,11 @@ public class PublicationFieldDataHelperService extends BaseFieldDataHelperServic
|
|||
return PublicationDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return PublicationDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PublicationData> buildInternal(FieldSet fieldSet, List<PublicationDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(PublicationDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -75,7 +88,7 @@ public class PublicationFieldDataHelperService extends BaseFieldDataHelperServic
|
|||
}
|
||||
|
||||
@Override
|
||||
protected PublicationDataPersist mapDataToPersist(PublicationDataEntity data, PublicationDataPersist persist) {
|
||||
protected PublicationDataPersist importExportMapDataToPersistInternal(PublicationDataImportExport data, PublicationDataPersist persist){
|
||||
persist.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
return persist;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DataRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.PublicationRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.PublicationRepositoryDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.DataRepositoryDataBuilder;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.PublicationRepositoryDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
|
@ -13,6 +15,7 @@ import eu.eudat.model.descriptiontemplatedefinition.fielddata.PublicationReposit
|
|||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DataRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.PublicationRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -23,7 +26,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class PublicationRepositoryFieldDataHelperService extends BaseFieldDataHelperService<PublicationRepositoryData, PublicationRepositoryDataPersist, PublicationRepositoryDataEntity> {
|
||||
public class PublicationRepositoryFieldDataHelperService extends BaseFieldDataHelperService<PublicationRepositoryData, PublicationRepositoryDataPersist, PublicationRepositoryDataEntity, PublicationRepositoryDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -52,6 +55,11 @@ public class PublicationRepositoryFieldDataHelperService extends BaseFieldDataHe
|
|||
return new PublicationRepositoryDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PublicationRepositoryDataImportExport newImportExportInstanceInternal() {
|
||||
return new PublicationRepositoryDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return PublicationRepositoryDataEntity.class;
|
||||
|
@ -65,6 +73,11 @@ public class PublicationRepositoryFieldDataHelperService extends BaseFieldDataHe
|
|||
return PublicationRepositoryDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return PublicationRepositoryDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PublicationRepositoryData> buildInternal(FieldSet fieldSet, List<PublicationRepositoryDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(PublicationRepositoryDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -77,7 +90,7 @@ public class PublicationRepositoryFieldDataHelperService extends BaseFieldDataHe
|
|||
}
|
||||
|
||||
@Override
|
||||
protected PublicationRepositoryDataPersist mapDataToPersist(PublicationRepositoryDataEntity data, PublicationRepositoryDataPersist persist) {
|
||||
protected PublicationRepositoryDataPersist importExportMapDataToPersistInternal(PublicationRepositoryDataImportExport data, PublicationRepositoryDataPersist persist){
|
||||
persist.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
return persist;
|
||||
}
|
||||
|
|
|
@ -5,14 +5,14 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.RadioBoxDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.RadioBoxDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.RadioBoxOption;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.convention.ConventionService;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.RadioBoxDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.RadioBoxData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.AutoCompleteSingleDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.RadioBoxDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.RadioBoxOptionPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.*;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
@ -25,7 +25,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class RadioBoxFieldDataHelperService extends BaseFieldDataHelperService<RadioBoxData, RadioBoxDataPersist, RadioBoxDataEntity> {
|
||||
public class RadioBoxFieldDataHelperService extends BaseFieldDataHelperService<RadioBoxData, RadioBoxDataPersist, RadioBoxDataEntity, RadioBoxDataImportExport> {
|
||||
|
||||
private final ConventionService conventionService;
|
||||
private final BuilderFactory builderFactory;
|
||||
|
@ -56,6 +56,11 @@ public class RadioBoxFieldDataHelperService extends BaseFieldDataHelperService<R
|
|||
return new RadioBoxDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RadioBoxDataImportExport newImportExportInstanceInternal() {
|
||||
return new RadioBoxDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return RadioBoxDataEntity.class;
|
||||
|
@ -69,6 +74,11 @@ public class RadioBoxFieldDataHelperService extends BaseFieldDataHelperService<R
|
|||
return RadioBoxDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return RadioBoxDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RadioBoxData> buildInternal(FieldSet fieldSet, List<RadioBoxDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(RadioBoxDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -84,6 +94,7 @@ public class RadioBoxFieldDataHelperService extends BaseFieldDataHelperService<R
|
|||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
private @NotNull RadioBoxDataEntity.Option buildOption(RadioBoxOptionPersist persist){
|
||||
RadioBoxDataEntity.Option data = new RadioBoxDataEntity.Option();
|
||||
if (persist == null) return data;
|
||||
|
@ -95,17 +106,17 @@ public class RadioBoxFieldDataHelperService extends BaseFieldDataHelperService<R
|
|||
}
|
||||
|
||||
@Override
|
||||
protected RadioBoxDataPersist mapDataToPersist(RadioBoxDataEntity data, RadioBoxDataPersist persist) {
|
||||
protected RadioBoxDataPersist importExportMapDataToPersistInternal(RadioBoxDataImportExport data, RadioBoxDataPersist persist){
|
||||
if (!this.conventionService.isListNullOrEmpty(data.getOptions())){
|
||||
persist.setOptions(new ArrayList<>());
|
||||
for (RadioBoxDataEntity.Option radioBoxOption: data.getOptions()) {
|
||||
for (RadioBoxOption radioBoxOption: data.getOptions()) {
|
||||
persist.getOptions().add(this.buildOption(radioBoxOption));
|
||||
}
|
||||
}
|
||||
return persist;
|
||||
}
|
||||
|
||||
private @NotNull RadioBoxOptionPersist buildOption(RadioBoxDataEntity.Option data){
|
||||
private @NotNull RadioBoxOptionPersist buildOption(RadioBoxOption data){
|
||||
RadioBoxOptionPersist persist = new RadioBoxOptionPersist();
|
||||
if (data == null) return persist;
|
||||
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DataRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.RegistryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.RegistryDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.RegistryDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.RegistryData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DataRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.RegistryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class RegistryFieldDataHelperService extends BaseFieldDataHelperService<RegistryData, RegistryDataPersist, RegistryDataEntity> {
|
||||
public class RegistryFieldDataHelperService extends BaseFieldDataHelperService<RegistryData, RegistryDataPersist, RegistryDataEntity, RegistryDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -50,6 +53,11 @@ public class RegistryFieldDataHelperService extends BaseFieldDataHelperService<R
|
|||
return new RegistryDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RegistryDataImportExport newImportExportInstanceInternal() {
|
||||
return new RegistryDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return RegistryDataEntity.class;
|
||||
|
@ -63,6 +71,11 @@ public class RegistryFieldDataHelperService extends BaseFieldDataHelperService<R
|
|||
return RegistryDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return RegistryDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RegistryData> buildInternal(FieldSet fieldSet, List<RegistryDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(RegistryDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -75,7 +88,7 @@ public class RegistryFieldDataHelperService extends BaseFieldDataHelperService<R
|
|||
}
|
||||
|
||||
@Override
|
||||
protected RegistryDataPersist mapDataToPersist(RegistryDataEntity data, RegistryDataPersist persist) {
|
||||
protected RegistryDataPersist importExportMapDataToPersistInternal(RegistryDataImportExport data, RegistryDataPersist persist) {
|
||||
persist.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
return persist;
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DataRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ResearcherAutoCompleteDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.ResearcherAutoCompleteDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.ResearcherAutoCompleteDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.ResearcherAutoCompleteData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DataRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.ResearcherAutoCompleteDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class ResearcherAutoCompleteFieldDataHelperService extends BaseFieldDataHelperService<ResearcherAutoCompleteData, ResearcherAutoCompleteDataPersist, ResearcherAutoCompleteDataEntity> {
|
||||
public class ResearcherAutoCompleteFieldDataHelperService extends BaseFieldDataHelperService<ResearcherAutoCompleteData, ResearcherAutoCompleteDataPersist, ResearcherAutoCompleteDataEntity, ResearcherAutoCompleteDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -50,6 +53,11 @@ public class ResearcherAutoCompleteFieldDataHelperService extends BaseFieldDataH
|
|||
return new ResearcherAutoCompleteDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResearcherAutoCompleteDataImportExport newImportExportInstanceInternal() {
|
||||
return new ResearcherAutoCompleteDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return ResearcherAutoCompleteDataEntity.class;
|
||||
|
@ -63,6 +71,11 @@ public class ResearcherAutoCompleteFieldDataHelperService extends BaseFieldDataH
|
|||
return ResearcherAutoCompleteDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return ResearcherAutoCompleteDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResearcherAutoCompleteData> buildInternal(FieldSet fieldSet, List<ResearcherAutoCompleteDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(ResearcherAutoCompleteDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -75,7 +88,7 @@ public class ResearcherAutoCompleteFieldDataHelperService extends BaseFieldDataH
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ResearcherAutoCompleteDataPersist mapDataToPersist(ResearcherAutoCompleteDataEntity data, ResearcherAutoCompleteDataPersist persist) {
|
||||
protected ResearcherAutoCompleteDataPersist importExportMapDataToPersistInternal(ResearcherAutoCompleteDataImportExport data, ResearcherAutoCompleteDataPersist persist){
|
||||
persist.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
return persist;
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DataRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ResearcherDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.ResearcherDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.ResearcherDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.ResearcherData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DataRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.ResearcherDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class ResearcherFieldDataHelperService extends BaseFieldDataHelperService<ResearcherData, ResearcherDataPersist, ResearcherDataEntity> {
|
||||
public class ResearcherFieldDataHelperService extends BaseFieldDataHelperService<ResearcherData, ResearcherDataPersist, ResearcherDataEntity, ResearcherDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -50,6 +53,11 @@ public class ResearcherFieldDataHelperService extends BaseFieldDataHelperService
|
|||
return new ResearcherDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResearcherDataImportExport newImportExportInstanceInternal() {
|
||||
return new ResearcherDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return ResearcherDataEntity.class;
|
||||
|
@ -63,6 +71,11 @@ public class ResearcherFieldDataHelperService extends BaseFieldDataHelperService
|
|||
return ResearcherDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return ResearcherDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResearcherData> buildInternal(FieldSet fieldSet, List<ResearcherDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(ResearcherDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -75,7 +88,7 @@ public class ResearcherFieldDataHelperService extends BaseFieldDataHelperService
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ResearcherDataPersist mapDataToPersist(ResearcherDataEntity data, ResearcherDataPersist persist) {
|
||||
protected ResearcherDataPersist importExportMapDataToPersistInternal(ResearcherDataImportExport data, ResearcherDataPersist persist){
|
||||
persist.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
return persist;
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BooleanDecisionDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.RichTextAreaDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.RichTextAreaDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.RichTextAreaDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.RichTextAreaData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BooleanDecisionDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.RichTextAreaDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class RichTextAreaDataFieldDataHelperService extends BaseFieldDataHelperService<RichTextAreaData, RichTextAreaDataPersist, RichTextAreaDataEntity> {
|
||||
public class RichTextAreaDataFieldDataHelperService extends BaseFieldDataHelperService<RichTextAreaData, RichTextAreaDataPersist, RichTextAreaDataEntity, RichTextAreaDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -50,6 +53,11 @@ public class RichTextAreaDataFieldDataHelperService extends BaseFieldDataHelperS
|
|||
return new RichTextAreaDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RichTextAreaDataImportExport newImportExportInstanceInternal() {
|
||||
return new RichTextAreaDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return RichTextAreaDataEntity.class;
|
||||
|
@ -64,6 +72,11 @@ public class RichTextAreaDataFieldDataHelperService extends BaseFieldDataHelperS
|
|||
return RichTextAreaDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return RichTextAreaDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RichTextAreaData> buildInternal(FieldSet fieldSet, List<RichTextAreaDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(RichTextAreaDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -75,7 +88,7 @@ public class RichTextAreaDataFieldDataHelperService extends BaseFieldDataHelperS
|
|||
}
|
||||
|
||||
@Override
|
||||
protected RichTextAreaDataPersist mapDataToPersist(RichTextAreaDataEntity data, RichTextAreaDataPersist persist) {
|
||||
protected RichTextAreaDataPersist importExportMapDataToPersistInternal(RichTextAreaDataImportExport data, RichTextAreaDataPersist persist) {
|
||||
return persist;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DataRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ServiceDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.ServiceDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.ServiceDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.ServiceData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DataRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.ServiceDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class ServiceFieldDataHelperService extends BaseFieldDataHelperService<ServiceData, ServiceDataPersist, ServiceDataEntity> {
|
||||
public class ServiceFieldDataHelperService extends BaseFieldDataHelperService<ServiceData, ServiceDataPersist, ServiceDataEntity, ServiceDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -50,6 +53,11 @@ public class ServiceFieldDataHelperService extends BaseFieldDataHelperService<Se
|
|||
return new ServiceDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ServiceDataImportExport newImportExportInstanceInternal() {
|
||||
return new ServiceDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return ServiceDataEntity.class;
|
||||
|
@ -63,6 +71,11 @@ public class ServiceFieldDataHelperService extends BaseFieldDataHelperService<Se
|
|||
return ServiceDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return ServiceDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ServiceData> buildInternal(FieldSet fieldSet, List<ServiceDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(ServiceDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -75,7 +88,7 @@ public class ServiceFieldDataHelperService extends BaseFieldDataHelperService<Se
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ServiceDataPersist mapDataToPersist(ServiceDataEntity data, ServiceDataPersist persist) {
|
||||
protected ServiceDataPersist importExportMapDataToPersistInternal(ServiceDataImportExport data, ServiceDataPersist persist) {
|
||||
persist.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
return persist;
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BooleanDecisionDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.TagDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.TagDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.TagDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.TagData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BooleanDecisionDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.TagDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class TagFieldDataHelperService extends BaseFieldDataHelperService<TagData, TagDataPersist, TagDataEntity> {
|
||||
public class TagFieldDataHelperService extends BaseFieldDataHelperService<TagData, TagDataPersist, TagDataEntity, TagDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -45,6 +48,11 @@ public class TagFieldDataHelperService extends BaseFieldDataHelperService<TagDat
|
|||
return new TagDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TagDataImportExport newImportExportInstanceInternal() {
|
||||
return new TagDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TagData newModelInstanceInternal() {
|
||||
return new TagData();
|
||||
|
@ -64,6 +72,11 @@ public class TagFieldDataHelperService extends BaseFieldDataHelperService<TagDat
|
|||
return TagDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return TagDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TagData> buildInternal(FieldSet fieldSet, List<TagDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(TagDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -75,7 +88,7 @@ public class TagFieldDataHelperService extends BaseFieldDataHelperService<TagDat
|
|||
}
|
||||
|
||||
@Override
|
||||
protected TagDataPersist mapDataToPersist(TagDataEntity data, TagDataPersist persist) {
|
||||
protected TagDataPersist importExportMapDataToPersistInternal(TagDataImportExport data, TagDataPersist persist) {
|
||||
return persist;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DataRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.TaxonomyDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.TaxonomyDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.TaxonomyDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.TaxonomyData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DataRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.TaxonomyDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class TaxonomyFieldDataHelperService extends BaseFieldDataHelperService<TaxonomyData, TaxonomyDataPersist, TaxonomyDataEntity> {
|
||||
public class TaxonomyFieldDataHelperService extends BaseFieldDataHelperService<TaxonomyData, TaxonomyDataPersist, TaxonomyDataEntity, TaxonomyDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -50,6 +53,11 @@ public class TaxonomyFieldDataHelperService extends BaseFieldDataHelperService<T
|
|||
return new TaxonomyDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TaxonomyDataImportExport newImportExportInstanceInternal() {
|
||||
return new TaxonomyDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return TaxonomyDataEntity.class;
|
||||
|
@ -63,6 +71,11 @@ public class TaxonomyFieldDataHelperService extends BaseFieldDataHelperService<T
|
|||
return TaxonomyDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return TaxonomyDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaxonomyData> buildInternal(FieldSet fieldSet, List<TaxonomyDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(TaxonomyDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -75,7 +88,7 @@ public class TaxonomyFieldDataHelperService extends BaseFieldDataHelperService<T
|
|||
}
|
||||
|
||||
@Override
|
||||
protected TaxonomyDataPersist mapDataToPersist(TaxonomyDataEntity data, TaxonomyDataPersist persist) {
|
||||
protected TaxonomyDataPersist importExportMapDataToPersistInternal(TaxonomyDataImportExport data, TaxonomyDataPersist persist) {
|
||||
persist.setMultiAutoComplete(data.getMultiAutoComplete());
|
||||
return persist;
|
||||
}
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DataRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.TextAreaDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.TextAreaDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.TextAreaDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.TextAreaData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DataRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.TextAreaDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class TextAreaFieldDataHelperService extends BaseFieldDataHelperService<TextAreaData, TextAreaDataPersist, TextAreaDataEntity> {
|
||||
public class TextAreaFieldDataHelperService extends BaseFieldDataHelperService<TextAreaData, TextAreaDataPersist, TextAreaDataEntity, TextAreaDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -50,6 +53,11 @@ public class TextAreaFieldDataHelperService extends BaseFieldDataHelperService<T
|
|||
return new TextAreaDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TextAreaDataImportExport newImportExportInstanceInternal() {
|
||||
return new TextAreaDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return TextAreaDataEntity.class;
|
||||
|
@ -63,6 +71,11 @@ public class TextAreaFieldDataHelperService extends BaseFieldDataHelperService<T
|
|||
return TextAreaDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return TextAreaDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TextAreaData> buildInternal(FieldSet fieldSet, List<TextAreaDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(TextAreaDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -74,7 +87,7 @@ public class TextAreaFieldDataHelperService extends BaseFieldDataHelperService<T
|
|||
}
|
||||
|
||||
@Override
|
||||
protected TextAreaDataPersist mapDataToPersist(TextAreaDataEntity data, TextAreaDataPersist persist) {
|
||||
protected TextAreaDataPersist importExportMapDataToPersistInternal(TextAreaDataImportExport data, TextAreaDataPersist persist) {
|
||||
return persist;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,9 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.RadioBoxDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.UploadDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.UploadDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.UploadDataOption;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.convention.ConventionService;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.UploadDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
|
@ -22,7 +25,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class UploadFieldDataHelperService extends BaseFieldDataHelperService<UploadData, UploadDataPersist, UploadDataEntity> {
|
||||
public class UploadFieldDataHelperService extends BaseFieldDataHelperService<UploadData, UploadDataPersist, UploadDataEntity, UploadDataImportExport> {
|
||||
|
||||
private final ConventionService conventionService;
|
||||
private final BuilderFactory builderFactory;
|
||||
|
@ -53,6 +56,11 @@ public class UploadFieldDataHelperService extends BaseFieldDataHelperService<Upl
|
|||
return new UploadDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected UploadDataImportExport newImportExportInstanceInternal() {
|
||||
return new UploadDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return UploadDataEntity.class;
|
||||
|
@ -66,6 +74,11 @@ public class UploadFieldDataHelperService extends BaseFieldDataHelperService<Upl
|
|||
return UploadDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return UploadDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UploadData> buildInternal(FieldSet fieldSet, List<UploadDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(UploadDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -93,17 +106,17 @@ public class UploadFieldDataHelperService extends BaseFieldDataHelperService<Upl
|
|||
}
|
||||
|
||||
@Override
|
||||
protected UploadDataPersist mapDataToPersist(UploadDataEntity data, UploadDataPersist persist) {
|
||||
protected UploadDataPersist importExportMapDataToPersistInternal(UploadDataImportExport data, UploadDataPersist persist) {
|
||||
if (!this.conventionService.isListNullOrEmpty(data.getTypes())){
|
||||
persist.setTypes(new ArrayList<>());
|
||||
for (UploadDataEntity.Option option: data.getTypes()) {
|
||||
for (UploadDataOption option: data.getTypes()) {
|
||||
persist.getTypes().add(this.buildOption(option));
|
||||
}
|
||||
}
|
||||
return persist;
|
||||
}
|
||||
|
||||
private @NotNull UploadOptionPersist buildOption(UploadDataEntity.Option data){
|
||||
private @NotNull UploadOptionPersist buildOption(UploadDataOption data){
|
||||
UploadOptionPersist persist = new UploadOptionPersist();
|
||||
if (data == null) return persist;
|
||||
|
||||
|
|
|
@ -5,12 +5,15 @@ import eu.eudat.commons.enums.FieldType;
|
|||
import eu.eudat.commons.types.descriptiontemplate.fielddata.BaseFieldDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.DataRepositoryDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.ValidationDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.ValidationDataImportExport;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.ValidationDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.ValidationData;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.BaseFieldDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.DataRepositoryDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.ValidationDataPersist;
|
||||
import eu.eudat.model.persist.descriptiontemplatedefinition.fielddata.WordListDataPersist;
|
||||
import gr.cite.tools.data.builder.BuilderFactory;
|
||||
import gr.cite.tools.fieldset.FieldSet;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
@ -21,7 +24,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class ValidationFieldDataHelperService extends BaseFieldDataHelperService<ValidationData, ValidationDataPersist, ValidationDataEntity> {
|
||||
public class ValidationFieldDataHelperService extends BaseFieldDataHelperService<ValidationData, ValidationDataPersist, ValidationDataEntity, ValidationDataImportExport> {
|
||||
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
|
@ -50,6 +53,11 @@ public class ValidationFieldDataHelperService extends BaseFieldDataHelperService
|
|||
return new ValidationDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ValidationDataImportExport newImportExportInstanceInternal() {
|
||||
return new ValidationDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return ValidationDataEntity.class;
|
||||
|
@ -63,6 +71,11 @@ public class ValidationFieldDataHelperService extends BaseFieldDataHelperService
|
|||
return ValidationDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return ValidationDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ValidationData> buildInternal(FieldSet fieldSet, List<ValidationDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(ValidationDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -74,7 +87,7 @@ public class ValidationFieldDataHelperService extends BaseFieldDataHelperService
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ValidationDataPersist mapDataToPersist(ValidationDataEntity data, ValidationDataPersist persist) {
|
||||
protected ValidationDataPersist importExportMapDataToPersistInternal(ValidationDataImportExport data, ValidationDataPersist persist) {
|
||||
return persist;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@ import eu.eudat.authorization.AuthorizationFlags;
|
|||
import eu.eudat.commons.enums.FieldType;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.*;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.WordListDataEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.ComboBoxDataOptionEntity;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.WordListDataImportExport;
|
||||
import eu.eudat.convention.ConventionService;
|
||||
import eu.eudat.model.builder.descriptiontemplatedefinition.fielddata.WordListDataBuilder;
|
||||
import eu.eudat.model.descriptiontemplatedefinition.fielddata.BaseFieldData;
|
||||
|
@ -21,7 +23,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class WordListFieldDataHelperService extends BaseFieldDataHelperService<WordListData, WordListDataPersist, WordListDataEntity> {
|
||||
public class WordListFieldDataHelperService extends BaseFieldDataHelperService<WordListData, WordListDataPersist, WordListDataEntity, WordListDataImportExport> {
|
||||
|
||||
private final ConventionService conventionService;
|
||||
private final BuilderFactory builderFactory;
|
||||
|
@ -52,6 +54,11 @@ public class WordListFieldDataHelperService extends BaseFieldDataHelperService<W
|
|||
return new WordListDataPersist();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected WordListDataImportExport newImportExportInstanceInternal() {
|
||||
return new WordListDataImportExport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getDataClass() {
|
||||
return WordListDataEntity.class;
|
||||
|
@ -65,6 +72,11 @@ public class WordListFieldDataHelperService extends BaseFieldDataHelperService<W
|
|||
return WordListDataPersist.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getImportExportClass() {
|
||||
return WordListDataImportExport.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WordListData> buildInternal(FieldSet fieldSet, List<WordListDataEntity> datas, EnumSet<AuthorizationFlags> authorizationFlags){
|
||||
return this.builderFactory.builder(WordListDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas);
|
||||
|
@ -82,6 +94,7 @@ public class WordListFieldDataHelperService extends BaseFieldDataHelperService<W
|
|||
return data;
|
||||
}
|
||||
|
||||
|
||||
private @NotNull ComboBoxDataEntity.Option buildOption(ComboBoxOptionPersist persist){
|
||||
ComboBoxDataEntity.Option data = new ComboBoxDataEntity.Option();
|
||||
if (persist == null) return data;
|
||||
|
@ -95,18 +108,18 @@ public class WordListFieldDataHelperService extends BaseFieldDataHelperService<W
|
|||
}
|
||||
|
||||
@Override
|
||||
protected WordListDataPersist mapDataToPersist(WordListDataEntity data, WordListDataPersist persist) {
|
||||
protected WordListDataPersist importExportMapDataToPersistInternal(WordListDataImportExport data, WordListDataPersist persist) {
|
||||
persist.setMultiList(data.getMultiList());
|
||||
if (!this.conventionService.isListNullOrEmpty(data.getOptions())){
|
||||
persist.setOptions(new ArrayList<>());
|
||||
for (ComboBoxDataEntity.Option option: data.getOptions()) {
|
||||
for (ComboBoxDataOptionEntity option: data.getOptions()) {
|
||||
persist.getOptions().add(this.buildOption(option));
|
||||
}
|
||||
}
|
||||
return persist;
|
||||
}
|
||||
|
||||
private @NotNull ComboBoxOptionPersist buildOption(ComboBoxDataEntity.Option data){
|
||||
private @NotNull ComboBoxOptionPersist buildOption(ComboBoxDataOptionEntity data){
|
||||
ComboBoxOptionPersist persist = new ComboBoxOptionPersist();
|
||||
if (data == null) return persist;
|
||||
|
||||
|
|
|
@ -1,19 +1,13 @@
|
|||
package eu.eudat.controllers;
|
||||
|
||||
import eu.eudat.authorization.Permission;
|
||||
import eu.eudat.commons.enums.UserDescriptionTemplateRole;
|
||||
import eu.eudat.commons.scope.user.UserScope;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importmodel.DescriptionTemplateImportXml;
|
||||
import eu.eudat.data.DescriptionTemplateEntity;
|
||||
import eu.eudat.data.UserDescriptionTemplateEntity;
|
||||
import eu.eudat.data.old.UserInfo;
|
||||
import eu.eudat.logic.managers.AdminManager;
|
||||
import eu.eudat.logic.managers.DatasetProfileManager;
|
||||
import eu.eudat.logic.managers.MetricsManager;
|
||||
import eu.eudat.logic.managers.UserManager;
|
||||
import eu.eudat.logic.proxy.config.configloaders.ConfigLoader;
|
||||
import eu.eudat.logic.services.ApiContext;
|
||||
import eu.eudat.models.data.admin.composite.DatasetProfile;
|
||||
import eu.eudat.models.data.helpers.responses.ResponseItem;
|
||||
import eu.eudat.query.DescriptionTemplateTypeQuery;
|
||||
import eu.eudat.service.descriptiontemplatetype.DescriptionTemplateTypeService;
|
||||
|
@ -25,7 +19,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import jakarta.transaction.Transactional;
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ import eu.eudat.logic.utilities.helpers.StreamDistinctBy;
|
|||
import eu.eudat.logic.utilities.json.JsonSearcher;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.AutoCompleteDataEntity;
|
||||
import eu.eudat.models.data.datasetprofile.DatasetProfileOverviewModel;
|
||||
import eu.eudat.models.data.datasetprofile.RenderStyle;
|
||||
import eu.eudat.models.data.datasetwizard.DatasetWizardModel;
|
||||
import eu.eudat.models.data.externaldataset.ExternalAutocompleteFieldModel;
|
||||
import eu.eudat.models.data.license.LicenseModel;
|
||||
|
@ -36,6 +35,7 @@ import java.time.LocalDate;
|
|||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
|
||||
@Component
|
||||
public class PrefillingMapper {
|
||||
|
@ -169,7 +169,7 @@ public class PrefillingMapper {
|
|||
String id = node.isArray() ? node.get(0).get("id").asText() : node.get("id").asText();
|
||||
String renderStyle = node.isArray() ? node.get(0).get("viewStyle").get("renderStyle").asText() : node.get("viewStyle").get("renderStyle").asText();
|
||||
|
||||
switch (RenderStyle.fromValue(renderStyle)) {
|
||||
switch (FieldType.of(renderStyle)) {
|
||||
case COMBO_BOX:
|
||||
if (parsedValues.isEmpty())
|
||||
parsedValues.add(parsedValue);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package eu.eudat.logic.utilities.documents.xml.datasetProfileXml;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importmodel.DescriptionTemplateImportXml;
|
||||
import eu.eudat.commons.types.descriptiontemplate.importexport.DescriptionTemplateImportExport;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -11,13 +11,13 @@ import java.io.*;
|
|||
public class ImportXmlBuilderDatasetProfile {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ImportXmlBuilderDatasetProfile.class);
|
||||
|
||||
public DescriptionTemplateImportXml build(File xmlFile) throws IOException {
|
||||
DescriptionTemplateImportXml descriptionTemplateImportXml = new DescriptionTemplateImportXml();
|
||||
public DescriptionTemplateImportExport build(File xmlFile) throws IOException {
|
||||
DescriptionTemplateImportExport descriptionTemplateImportXml = new DescriptionTemplateImportExport();
|
||||
JAXBContext jaxbContext = null;
|
||||
try {
|
||||
jaxbContext = JAXBContext.newInstance(DescriptionTemplateImportXml.class);
|
||||
jaxbContext = JAXBContext.newInstance(DescriptionTemplateImportExport.class);
|
||||
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
|
||||
descriptionTemplateImportXml = (DescriptionTemplateImportXml) unmarshaller.unmarshal(xmlFile);
|
||||
descriptionTemplateImportXml = (DescriptionTemplateImportExport) unmarshaller.unmarshal(xmlFile);
|
||||
} catch (JAXBException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
package eu.eudat.models.data.datasetprofile;
|
||||
|
||||
public enum RenderStyle {
|
||||
COMBO_BOX("combobox"),
|
||||
INTERNAL_DMP_ENTITIES("internalDmpEntities"),
|
||||
BOOLEAN_DECISION("booleanDecision"),
|
||||
RADIO_BOX("radiobox"),
|
||||
CHECKBOX("checkBox"),
|
||||
FREETEXT("freetext"),
|
||||
TEXTAREA("textarea"),
|
||||
RICH_TEXTAREA("richTextarea"),
|
||||
DATE_PICKER("datePicker"),
|
||||
EXTERNAL_DATASETS("externalDatasets"),
|
||||
DATASET_REPOSITORIES("dataRepositories"),
|
||||
REGISTRIES("registries"),
|
||||
SERVICES("services"),
|
||||
TAGS("tags"),
|
||||
RESEARCHERS("researchers"),
|
||||
ORGANIZATIONS("organizations"),
|
||||
DATASET_IDENTIFIER("datasetIdentifier"),
|
||||
CURRENCY("currency"),
|
||||
UPLOAD("upload"),
|
||||
LICENSES("licenses"),
|
||||
VALIDATION("validation");
|
||||
|
||||
private final String name;
|
||||
|
||||
RenderStyle(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static RenderStyle fromValue(String value) {
|
||||
for(RenderStyle renderStyle: RenderStyle.values()) {
|
||||
if (renderStyle.getName().equals(value)) {
|
||||
return renderStyle;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("RenderStyle [" + value + "] is not available");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue