prefilling source defintion classes
This commit is contained in:
parent
fdf8e13af9
commit
3f8716ab0a
|
@ -1,4 +1,4 @@
|
||||||
package eu.eudat.commons.types.referencetype;
|
package eu.eudat.commons.types.externalfetcher;
|
||||||
|
|
||||||
import eu.eudat.commons.enums.ReferenceTypeExternalApiHTTPMethodType;
|
import eu.eudat.commons.enums.ReferenceTypeExternalApiHTTPMethodType;
|
||||||
import eu.eudat.service.remotefetcher.config.entities.AuthenticationConfiguration;
|
import eu.eudat.service.remotefetcher.config.entities.AuthenticationConfiguration;
|
|
@ -1,4 +1,4 @@
|
||||||
package eu.eudat.commons.types.referencetype;
|
package eu.eudat.commons.types.externalfetcher;
|
||||||
|
|
||||||
|
|
||||||
import eu.eudat.commons.enums.ReferenceTypeExternalApiHTTPMethodType;
|
import eu.eudat.commons.enums.ReferenceTypeExternalApiHTTPMethodType;
|
||||||
|
@ -7,7 +7,7 @@ import jakarta.xml.bind.annotation.XmlElement;
|
||||||
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
public class ReferenceTypeSourceExternalApiConfigurationEntity extends ReferenceTypeSourceBaseConfigurationEntity implements SourceExternalApiConfiguration<ResultsConfigurationEntity, AuthenticationConfigurationEntity, QueryConfigEntity> {
|
public class ExternalFetcherApiSourceConfigurationEntity extends ExternalFetcherBaseSourceConfigurationEntity implements SourceExternalApiConfiguration<ResultsConfigurationEntity, AuthenticationConfigurationEntity, QueryConfigEntity> {
|
||||||
|
|
||||||
private String url;
|
private String url;
|
||||||
private ResultsConfigurationEntity results;
|
private ResultsConfigurationEntity results;
|
|
@ -1,4 +1,4 @@
|
||||||
package eu.eudat.commons.types.referencetype;
|
package eu.eudat.commons.types.externalfetcher;
|
||||||
|
|
||||||
import eu.eudat.commons.enums.ReferenceTypeSourceType;
|
import eu.eudat.commons.enums.ReferenceTypeSourceType;
|
||||||
import eu.eudat.service.remotefetcher.config.entities.SourceBaseConfiguration;
|
import eu.eudat.service.remotefetcher.config.entities.SourceBaseConfiguration;
|
||||||
|
@ -8,7 +8,7 @@ import jakarta.xml.bind.annotation.XmlElementWrapper;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public abstract class ReferenceTypeSourceBaseConfigurationEntity implements SourceBaseConfiguration {
|
public abstract class ExternalFetcherBaseSourceConfigurationEntity implements SourceBaseConfiguration {
|
||||||
|
|
||||||
private String key;
|
private String key;
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package eu.eudat.commons.types.externalfetcher;
|
||||||
|
|
||||||
|
import eu.eudat.service.remotefetcher.config.entities.SourceStaticOptionConfiguration;
|
||||||
|
import jakarta.xml.bind.annotation.XmlElement;
|
||||||
|
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ExternalFetcherStaticOptionSourceConfigurationEntity extends ExternalFetcherBaseSourceConfigurationEntity implements SourceStaticOptionConfiguration<StaticOptionEntity> {
|
||||||
|
|
||||||
|
List<StaticOptionEntity> options;
|
||||||
|
|
||||||
|
public List<StaticOptionEntity> getOptions() {
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
@XmlElementWrapper
|
||||||
|
@XmlElement(name = "option")
|
||||||
|
public void setOptions(List<StaticOptionEntity> options) {
|
||||||
|
this.options = options;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package eu.eudat.commons.types.referencetype;
|
package eu.eudat.commons.types.externalfetcher;
|
||||||
|
|
||||||
import eu.eudat.service.remotefetcher.config.entities.QueryCaseConfig;
|
import eu.eudat.service.remotefetcher.config.entities.QueryCaseConfig;
|
||||||
import jakarta.xml.bind.annotation.XmlElement;
|
import jakarta.xml.bind.annotation.XmlElement;
|
|
@ -1,12 +1,10 @@
|
||||||
package eu.eudat.commons.types.referencetype;
|
package eu.eudat.commons.types.externalfetcher;
|
||||||
|
|
||||||
import eu.eudat.service.remotefetcher.config.entities.QueryCaseConfig;
|
|
||||||
import eu.eudat.service.remotefetcher.config.entities.QueryConfig;
|
import eu.eudat.service.remotefetcher.config.entities.QueryConfig;
|
||||||
import jakarta.xml.bind.annotation.XmlElement;
|
import jakarta.xml.bind.annotation.XmlElement;
|
||||||
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public class QueryConfigEntity implements QueryConfig<QueryCaseConfigEntity> {
|
public class QueryConfigEntity implements QueryConfig<QueryCaseConfigEntity> {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package eu.eudat.commons.types.referencetype;
|
package eu.eudat.commons.types.externalfetcher;
|
||||||
|
|
||||||
import eu.eudat.service.remotefetcher.config.entities.ResultFieldsMappingConfiguration;
|
import eu.eudat.service.remotefetcher.config.entities.ResultFieldsMappingConfiguration;
|
||||||
import jakarta.xml.bind.annotation.XmlElement;
|
import jakarta.xml.bind.annotation.XmlElement;
|
|
@ -1,5 +1,6 @@
|
||||||
package eu.eudat.commons.types.referencetype;
|
package eu.eudat.commons.types.externalfetcher;
|
||||||
|
|
||||||
|
import eu.eudat.commons.types.externalfetcher.ResultFieldsMappingConfigurationEntity;
|
||||||
import eu.eudat.service.remotefetcher.config.entities.ResultsConfiguration;
|
import eu.eudat.service.remotefetcher.config.entities.ResultsConfiguration;
|
||||||
import jakarta.xml.bind.annotation.XmlElement;
|
import jakarta.xml.bind.annotation.XmlElement;
|
||||||
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
|
@ -1,9 +1,9 @@
|
||||||
package eu.eudat.commons.types.referencetype;
|
package eu.eudat.commons.types.externalfetcher;
|
||||||
|
|
||||||
import eu.eudat.service.remotefetcher.config.entities.StaticOption;
|
import eu.eudat.service.remotefetcher.config.entities.StaticOption;
|
||||||
import jakarta.xml.bind.annotation.XmlElement;
|
import jakarta.xml.bind.annotation.XmlElement;
|
||||||
|
|
||||||
public class ReferenceTypeStaticOptionEntity implements StaticOption {
|
public class StaticOptionEntity implements StaticOption {
|
||||||
|
|
||||||
private String code;
|
private String code;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package eu.eudat.commons.types.prefilling;
|
package eu.eudat.commons.types.prefillingsource;
|
||||||
|
|
||||||
import eu.eudat.commons.JsonHandlingService;
|
import eu.eudat.commons.JsonHandlingService;
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package eu.eudat.commons.types.prefillingsource;
|
||||||
|
|
||||||
|
import eu.eudat.model.referencetypedefinition.ReferenceTypeSourceExternalApiConfiguration;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class PrefillingSourceDefinition {
|
||||||
|
private ReferenceTypeSourceExternalApiConfiguration searchConfiguration;
|
||||||
|
private ReferenceTypeSourceExternalApiConfiguration getConfiguration;
|
||||||
|
private List<PrefillingSourceDefinitionField> fields;
|
||||||
|
|
||||||
|
public ReferenceTypeSourceExternalApiConfiguration getSearchConfiguration() {
|
||||||
|
return searchConfiguration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearchConfiguration(ReferenceTypeSourceExternalApiConfiguration searchConfiguration) {
|
||||||
|
this.searchConfiguration = searchConfiguration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReferenceTypeSourceExternalApiConfiguration getGetConfiguration() {
|
||||||
|
return getConfiguration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGetConfiguration(ReferenceTypeSourceExternalApiConfiguration getConfiguration) {
|
||||||
|
this.getConfiguration = getConfiguration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PrefillingSourceDefinitionField> getFields() {
|
||||||
|
return fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFields(List<PrefillingSourceDefinitionField> fields) {
|
||||||
|
this.fields = fields;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package eu.eudat.commons.types.prefillingsource;
|
||||||
|
|
||||||
|
public class PrefillingSourceDefinitionField {
|
||||||
|
private String code;
|
||||||
|
private String systemFieldTarget;
|
||||||
|
private String semanticTarget;
|
||||||
|
private String trimRegex;
|
||||||
|
private String fixedValue;
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSystemFieldTarget() {
|
||||||
|
return systemFieldTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSystemFieldTarget(String systemFieldTarget) {
|
||||||
|
this.systemFieldTarget = systemFieldTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSemanticTarget() {
|
||||||
|
return semanticTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSemanticTarget(String semanticTarget) {
|
||||||
|
this.semanticTarget = semanticTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTrimRegex() {
|
||||||
|
return trimRegex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrimRegex(String trimRegex) {
|
||||||
|
this.trimRegex = trimRegex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFixedValue() {
|
||||||
|
return fixedValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFixedValue(String fixedValue) {
|
||||||
|
this.fixedValue = fixedValue;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,8 +1,9 @@
|
||||||
package eu.eudat.commons.types.referencetype;
|
package eu.eudat.commons.types.referencetype;
|
||||||
|
|
||||||
import eu.eudat.commons.enums.FieldType;
|
|
||||||
import eu.eudat.commons.enums.ReferenceTypeSourceType;
|
import eu.eudat.commons.enums.ReferenceTypeSourceType;
|
||||||
import eu.eudat.commons.types.descriptiontemplate.importexport.fielddata.*;
|
import eu.eudat.commons.types.externalfetcher.ExternalFetcherBaseSourceConfigurationEntity;
|
||||||
|
import eu.eudat.commons.types.externalfetcher.ExternalFetcherApiSourceConfigurationEntity;
|
||||||
|
import eu.eudat.commons.types.externalfetcher.ExternalFetcherStaticOptionSourceConfigurationEntity;
|
||||||
import jakarta.xml.bind.annotation.*;
|
import jakarta.xml.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -16,10 +17,10 @@ public class ReferenceTypeDefinitionEntity {
|
||||||
|
|
||||||
@XmlElementWrapper(name = "sources")
|
@XmlElementWrapper(name = "sources")
|
||||||
@XmlElements({
|
@XmlElements({
|
||||||
@XmlElement(name = ReferenceTypeSourceType.Names.API, type = ReferenceTypeSourceExternalApiConfigurationEntity.class),
|
@XmlElement(name = ReferenceTypeSourceType.Names.API, type = ExternalFetcherApiSourceConfigurationEntity.class),
|
||||||
@XmlElement(name = ReferenceTypeSourceType.Names.STATIC, type = ReferenceTypeSourceStaticOptionConfigurationEntity.class),
|
@XmlElement(name = ReferenceTypeSourceType.Names.STATIC, type = ExternalFetcherStaticOptionSourceConfigurationEntity.class),
|
||||||
})
|
})
|
||||||
private List<ReferenceTypeSourceBaseConfigurationEntity> sources;
|
private List<ExternalFetcherBaseSourceConfigurationEntity> sources;
|
||||||
|
|
||||||
public List<ReferenceTypeFieldEntity> getFields() {
|
public List<ReferenceTypeFieldEntity> getFields() {
|
||||||
return fields;
|
return fields;
|
||||||
|
@ -29,11 +30,11 @@ public class ReferenceTypeDefinitionEntity {
|
||||||
this.fields = fields;
|
this.fields = fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ReferenceTypeSourceBaseConfigurationEntity> getSources() {
|
public List<ExternalFetcherBaseSourceConfigurationEntity> getSources() {
|
||||||
return sources;
|
return sources;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSources(List<ReferenceTypeSourceBaseConfigurationEntity> sources) {
|
public void setSources(List<ExternalFetcherBaseSourceConfigurationEntity> sources) {
|
||||||
this.sources = sources;
|
this.sources = sources;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
package eu.eudat.commons.types.referencetype;
|
|
||||||
|
|
||||||
import eu.eudat.service.remotefetcher.config.entities.SourceStaticOptionConfiguration;
|
|
||||||
import jakarta.xml.bind.annotation.XmlElement;
|
|
||||||
import jakarta.xml.bind.annotation.XmlElementWrapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ReferenceTypeSourceStaticOptionConfigurationEntity extends ReferenceTypeSourceBaseConfigurationEntity implements SourceStaticOptionConfiguration<ReferenceTypeStaticOptionEntity> {
|
|
||||||
|
|
||||||
List<ReferenceTypeStaticOptionEntity> options;
|
|
||||||
|
|
||||||
public List<ReferenceTypeStaticOptionEntity> getOptions() {
|
|
||||||
return options;
|
|
||||||
}
|
|
||||||
|
|
||||||
@XmlElementWrapper
|
|
||||||
@XmlElement(name = "option")
|
|
||||||
public void setOptions(List<ReferenceTypeStaticOptionEntity> options) {
|
|
||||||
this.options = options;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +1,9 @@
|
||||||
package eu.eudat.model.builder;
|
package eu.eudat.model.builder;
|
||||||
|
|
||||||
import eu.eudat.authorization.AuthorizationFlags;
|
import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.commons.enums.ContactInfoType;
|
import eu.eudat.commons.types.prefillingsource.PrefillingEntity;
|
||||||
import eu.eudat.commons.types.prefilling.PrefillingEntity;
|
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
import eu.eudat.data.UserEntity;
|
import eu.eudat.data.UserEntity;
|
||||||
import eu.eudat.model.DmpAssociatedUser;
|
|
||||||
import eu.eudat.model.Prefilling;
|
import eu.eudat.model.Prefilling;
|
||||||
import eu.eudat.model.User;
|
import eu.eudat.model.User;
|
||||||
import eu.eudat.model.UserContactInfo;
|
import eu.eudat.model.UserContactInfo;
|
||||||
|
|
|
@ -1,15 +1,10 @@
|
||||||
package eu.eudat.model.builder.referencetypedefinition;
|
package eu.eudat.model.builder.referencetypedefinition;
|
||||||
|
|
||||||
import eu.eudat.authorization.AuthorizationFlags;
|
import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.authorization.Permission;
|
import eu.eudat.commons.types.externalfetcher.AuthenticationConfigurationEntity;
|
||||||
import eu.eudat.commons.types.referencetype.AuthenticationConfigurationEntity;
|
|
||||||
import eu.eudat.commons.types.referencetype.QueryConfigEntity;
|
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
import eu.eudat.model.builder.BaseBuilder;
|
import eu.eudat.model.builder.BaseBuilder;
|
||||||
import eu.eudat.model.referencetypedefinition.AuthenticationConfiguration;
|
import eu.eudat.model.referencetypedefinition.AuthenticationConfiguration;
|
||||||
import eu.eudat.model.referencetypedefinition.QueryConfig;
|
|
||||||
import gr.cite.commons.web.authz.service.AuthorizationService;
|
|
||||||
import gr.cite.tools.data.builder.BuilderFactory;
|
|
||||||
import gr.cite.tools.exception.MyApplicationException;
|
import gr.cite.tools.exception.MyApplicationException;
|
||||||
import gr.cite.tools.fieldset.FieldSet;
|
import gr.cite.tools.fieldset.FieldSet;
|
||||||
import gr.cite.tools.logging.DataLogEntry;
|
import gr.cite.tools.logging.DataLogEntry;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package eu.eudat.model.builder.referencetypedefinition;
|
package eu.eudat.model.builder.referencetypedefinition;
|
||||||
|
|
||||||
import eu.eudat.authorization.AuthorizationFlags;
|
import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.commons.types.referencetype.QueryCaseConfigEntity;
|
import eu.eudat.commons.types.externalfetcher.QueryCaseConfigEntity;
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
import eu.eudat.model.ReferenceType;
|
import eu.eudat.model.ReferenceType;
|
||||||
import eu.eudat.model.builder.BaseBuilder;
|
import eu.eudat.model.builder.BaseBuilder;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package eu.eudat.model.builder.referencetypedefinition;
|
package eu.eudat.model.builder.referencetypedefinition;
|
||||||
|
|
||||||
import eu.eudat.authorization.AuthorizationFlags;
|
import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.commons.types.referencetype.QueryConfigEntity;
|
import eu.eudat.commons.types.externalfetcher.QueryConfigEntity;
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
import eu.eudat.model.builder.BaseBuilder;
|
import eu.eudat.model.builder.BaseBuilder;
|
||||||
import eu.eudat.model.referencetypedefinition.QueryConfig;
|
import eu.eudat.model.referencetypedefinition.QueryConfig;
|
||||||
|
|
|
@ -3,8 +3,8 @@ package eu.eudat.model.builder.referencetypedefinition;
|
||||||
import eu.eudat.authorization.AuthorizationFlags;
|
import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.commons.enums.ReferenceTypeSourceType;
|
import eu.eudat.commons.enums.ReferenceTypeSourceType;
|
||||||
import eu.eudat.commons.types.referencetype.ReferenceTypeDefinitionEntity;
|
import eu.eudat.commons.types.referencetype.ReferenceTypeDefinitionEntity;
|
||||||
import eu.eudat.commons.types.referencetype.ReferenceTypeSourceExternalApiConfigurationEntity;
|
import eu.eudat.commons.types.externalfetcher.ExternalFetcherApiSourceConfigurationEntity;
|
||||||
import eu.eudat.commons.types.referencetype.ReferenceTypeSourceStaticOptionConfigurationEntity;
|
import eu.eudat.commons.types.externalfetcher.ExternalFetcherStaticOptionSourceConfigurationEntity;
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
import eu.eudat.model.builder.BaseBuilder;
|
import eu.eudat.model.builder.BaseBuilder;
|
||||||
import eu.eudat.model.referencetypedefinition.ReferenceTypeDefinition;
|
import eu.eudat.model.referencetypedefinition.ReferenceTypeDefinition;
|
||||||
|
@ -56,8 +56,8 @@ public class ReferenceTypeDefinitionBuilder extends BaseBuilder<ReferenceTypeDef
|
||||||
ReferenceTypeDefinition m = new ReferenceTypeDefinition();
|
ReferenceTypeDefinition m = new ReferenceTypeDefinition();
|
||||||
if (!fieldsFields.isEmpty() && d.getFields() != null) m.setFields(this.builderFactory.builder(ReferenceTypeFieldBuilder.class).authorize(this.authorize).build(fieldsFields, d.getFields()));
|
if (!fieldsFields.isEmpty() && d.getFields() != null) m.setFields(this.builderFactory.builder(ReferenceTypeFieldBuilder.class).authorize(this.authorize).build(fieldsFields, d.getFields()));
|
||||||
if (!sourcesFields.isEmpty() && d.getSources() != null) {
|
if (!sourcesFields.isEmpty() && d.getSources() != null) {
|
||||||
List<ReferenceTypeSourceExternalApiConfigurationEntity> externalApiConfigEntities = d.getSources().stream().filter(x-> ReferenceTypeSourceType.API.equals(x.getType())).map(x-> (ReferenceTypeSourceExternalApiConfigurationEntity)x).toList();
|
List<ExternalFetcherApiSourceConfigurationEntity> externalApiConfigEntities = d.getSources().stream().filter(x-> ReferenceTypeSourceType.API.equals(x.getType())).map(x-> (ExternalFetcherApiSourceConfigurationEntity)x).toList();
|
||||||
List<ReferenceTypeSourceStaticOptionConfigurationEntity> staticOptionConfigEntities = d.getSources().stream().filter(x-> ReferenceTypeSourceType.STATIC.equals(x.getType())).map(x-> (ReferenceTypeSourceStaticOptionConfigurationEntity)x).toList();
|
List<ExternalFetcherStaticOptionSourceConfigurationEntity> staticOptionConfigEntities = d.getSources().stream().filter(x-> ReferenceTypeSourceType.STATIC.equals(x.getType())).map(x-> (ExternalFetcherStaticOptionSourceConfigurationEntity)x).toList();
|
||||||
m.setSources(new ArrayList<>());
|
m.setSources(new ArrayList<>());
|
||||||
m.getSources().addAll(this.builderFactory.builder(ReferenceTypeSourceExternalApiConfigurationBuilder.class).authorize(this.authorize).build(sourcesFields, externalApiConfigEntities));
|
m.getSources().addAll(this.builderFactory.builder(ReferenceTypeSourceExternalApiConfigurationBuilder.class).authorize(this.authorize).build(sourcesFields, externalApiConfigEntities));
|
||||||
m.getSources().addAll(this.builderFactory.builder(ReferenceTypeSourceStaticOptionConfigurationBuilder.class).authorize(this.authorize).build(sourcesFields, staticOptionConfigEntities));
|
m.getSources().addAll(this.builderFactory.builder(ReferenceTypeSourceStaticOptionConfigurationBuilder.class).authorize(this.authorize).build(sourcesFields, staticOptionConfigEntities));
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
package eu.eudat.model.builder.referencetypedefinition;
|
package eu.eudat.model.builder.referencetypedefinition;
|
||||||
|
|
||||||
import eu.eudat.authorization.AuthorizationFlags;
|
import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.commons.types.referencetype.ReferenceTypeSourceBaseConfigurationEntity;
|
import eu.eudat.commons.types.externalfetcher.ExternalFetcherBaseSourceConfigurationEntity;
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
import eu.eudat.data.ReferenceEntity;
|
|
||||||
import eu.eudat.model.Reference;
|
|
||||||
import eu.eudat.model.ReferenceType;
|
import eu.eudat.model.ReferenceType;
|
||||||
import eu.eudat.model.builder.BaseBuilder;
|
import eu.eudat.model.builder.BaseBuilder;
|
||||||
import eu.eudat.model.builder.ReferenceTypeBuilder;
|
import eu.eudat.model.builder.ReferenceTypeBuilder;
|
||||||
|
@ -27,7 +25,7 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||||
public abstract class ReferenceTypeSourceBaseConfigurationBuilder<Model extends ReferenceTypeSourceBaseConfiguration, Entity extends ReferenceTypeSourceBaseConfigurationEntity> extends BaseBuilder<Model, Entity> {
|
public abstract class ReferenceTypeSourceBaseConfigurationBuilder<Model extends ReferenceTypeSourceBaseConfiguration, Entity extends ExternalFetcherBaseSourceConfigurationEntity> extends BaseBuilder<Model, Entity> {
|
||||||
|
|
||||||
protected EnumSet<AuthorizationFlags> authorize = EnumSet.of(AuthorizationFlags.None);
|
protected EnumSet<AuthorizationFlags> authorize = EnumSet.of(AuthorizationFlags.None);
|
||||||
protected final BuilderFactory builderFactory;
|
protected final BuilderFactory builderFactory;
|
||||||
|
@ -90,7 +88,7 @@ public abstract class ReferenceTypeSourceBaseConfigurationBuilder<Model extends
|
||||||
Map<UUID, ReferenceType> itemMap;
|
Map<UUID, ReferenceType> itemMap;
|
||||||
if (!fields.hasOtherField(this.asIndexer(ReferenceType._id))) {
|
if (!fields.hasOtherField(this.asIndexer(ReferenceType._id))) {
|
||||||
itemMap = this.asEmpty(
|
itemMap = this.asEmpty(
|
||||||
data.stream().filter(x-> x.getReferenceTypeDependencyIds() != null).map(ReferenceTypeSourceBaseConfigurationEntity::getReferenceTypeDependencyIds).flatMap(List::stream).distinct().collect(Collectors.toList()),
|
data.stream().filter(x-> x.getReferenceTypeDependencyIds() != null).map(ExternalFetcherBaseSourceConfigurationEntity::getReferenceTypeDependencyIds).flatMap(List::stream).distinct().collect(Collectors.toList()),
|
||||||
x -> {
|
x -> {
|
||||||
ReferenceType item = new ReferenceType();
|
ReferenceType item = new ReferenceType();
|
||||||
item.setId(x);
|
item.setId(x);
|
||||||
|
@ -99,7 +97,7 @@ public abstract class ReferenceTypeSourceBaseConfigurationBuilder<Model extends
|
||||||
ReferenceType::getId);
|
ReferenceType::getId);
|
||||||
} else {
|
} else {
|
||||||
FieldSet clone = new BaseFieldSet(fields.getFields()).ensure(ReferenceType._id);
|
FieldSet clone = new BaseFieldSet(fields.getFields()).ensure(ReferenceType._id);
|
||||||
ReferenceTypeQuery q = this.queryFactory.query(ReferenceTypeQuery.class).authorize(this.authorize).ids(data.stream().filter(x-> x.getReferenceTypeDependencyIds() != null).map(ReferenceTypeSourceBaseConfigurationEntity::getReferenceTypeDependencyIds).flatMap(List::stream).distinct().collect(Collectors.toList()));
|
ReferenceTypeQuery q = this.queryFactory.query(ReferenceTypeQuery.class).authorize(this.authorize).ids(data.stream().filter(x-> x.getReferenceTypeDependencyIds() != null).map(ExternalFetcherBaseSourceConfigurationEntity::getReferenceTypeDependencyIds).flatMap(List::stream).distinct().collect(Collectors.toList()));
|
||||||
itemMap = this.builderFactory.builder(ReferenceTypeBuilder.class).authorize(this.authorize).asForeignKey(q, clone, ReferenceType::getId);
|
itemMap = this.builderFactory.builder(ReferenceTypeBuilder.class).authorize(this.authorize).asForeignKey(q, clone, ReferenceType::getId);
|
||||||
}
|
}
|
||||||
if (!fields.hasField(ReferenceType._id)) {
|
if (!fields.hasField(ReferenceType._id)) {
|
||||||
|
|
|
@ -2,7 +2,7 @@ package eu.eudat.model.builder.referencetypedefinition;
|
||||||
|
|
||||||
import eu.eudat.authorization.AuthorizationFlags;
|
import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.authorization.Permission;
|
import eu.eudat.authorization.Permission;
|
||||||
import eu.eudat.commons.types.referencetype.ReferenceTypeSourceExternalApiConfigurationEntity;
|
import eu.eudat.commons.types.externalfetcher.ExternalFetcherApiSourceConfigurationEntity;
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
import eu.eudat.model.referencetypedefinition.ReferenceTypeSourceExternalApiConfiguration;
|
import eu.eudat.model.referencetypedefinition.ReferenceTypeSourceExternalApiConfiguration;
|
||||||
import gr.cite.commons.web.authz.service.AuthorizationService;
|
import gr.cite.commons.web.authz.service.AuthorizationService;
|
||||||
|
@ -20,7 +20,7 @@ import java.util.*;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||||
public class ReferenceTypeSourceExternalApiConfigurationBuilder extends ReferenceTypeSourceBaseConfigurationBuilder<ReferenceTypeSourceExternalApiConfiguration, ReferenceTypeSourceExternalApiConfigurationEntity> {
|
public class ReferenceTypeSourceExternalApiConfigurationBuilder extends ReferenceTypeSourceBaseConfigurationBuilder<ReferenceTypeSourceExternalApiConfiguration, ExternalFetcherApiSourceConfigurationEntity> {
|
||||||
|
|
||||||
private final BuilderFactory builderFactory;
|
private final BuilderFactory builderFactory;
|
||||||
private EnumSet<AuthorizationFlags> authorize = EnumSet.of(AuthorizationFlags.None);
|
private EnumSet<AuthorizationFlags> authorize = EnumSet.of(AuthorizationFlags.None);
|
||||||
|
@ -41,7 +41,7 @@ public class ReferenceTypeSourceExternalApiConfigurationBuilder extends Referenc
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ReferenceTypeSourceExternalApiConfiguration buildChild(FieldSet fields, ReferenceTypeSourceExternalApiConfigurationEntity d, ReferenceTypeSourceExternalApiConfiguration m) {
|
protected ReferenceTypeSourceExternalApiConfiguration buildChild(FieldSet fields, ExternalFetcherApiSourceConfigurationEntity d, ReferenceTypeSourceExternalApiConfiguration m) {
|
||||||
FieldSet resultsFields = fields.extractPrefixed(this.asPrefix(ReferenceTypeSourceExternalApiConfiguration._results));
|
FieldSet resultsFields = fields.extractPrefixed(this.asPrefix(ReferenceTypeSourceExternalApiConfiguration._results));
|
||||||
FieldSet authFields = fields.extractPrefixed(this.asPrefix(ReferenceTypeSourceExternalApiConfiguration._auth));
|
FieldSet authFields = fields.extractPrefixed(this.asPrefix(ReferenceTypeSourceExternalApiConfiguration._auth));
|
||||||
FieldSet queriesFields = fields.extractPrefixed(this.asPrefix(ReferenceTypeSourceExternalApiConfiguration._queries));
|
FieldSet queriesFields = fields.extractPrefixed(this.asPrefix(ReferenceTypeSourceExternalApiConfiguration._queries));
|
||||||
|
|
|
@ -2,7 +2,7 @@ package eu.eudat.model.builder.referencetypedefinition;
|
||||||
|
|
||||||
import eu.eudat.authorization.AuthorizationFlags;
|
import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.authorization.Permission;
|
import eu.eudat.authorization.Permission;
|
||||||
import eu.eudat.commons.types.referencetype.ReferenceTypeSourceStaticOptionConfigurationEntity;
|
import eu.eudat.commons.types.externalfetcher.ExternalFetcherStaticOptionSourceConfigurationEntity;
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
import eu.eudat.model.referencetypedefinition.ReferenceTypeSourceStaticOptionConfiguration;
|
import eu.eudat.model.referencetypedefinition.ReferenceTypeSourceStaticOptionConfiguration;
|
||||||
import gr.cite.commons.web.authz.service.AuthorizationService;
|
import gr.cite.commons.web.authz.service.AuthorizationService;
|
||||||
|
@ -20,7 +20,7 @@ import java.util.EnumSet;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||||
public class ReferenceTypeSourceStaticOptionConfigurationBuilder extends ReferenceTypeSourceBaseConfigurationBuilder<ReferenceTypeSourceStaticOptionConfiguration, ReferenceTypeSourceStaticOptionConfigurationEntity> {
|
public class ReferenceTypeSourceStaticOptionConfigurationBuilder extends ReferenceTypeSourceBaseConfigurationBuilder<ReferenceTypeSourceStaticOptionConfiguration, ExternalFetcherStaticOptionSourceConfigurationEntity> {
|
||||||
|
|
||||||
private final BuilderFactory builderFactory;
|
private final BuilderFactory builderFactory;
|
||||||
private EnumSet<AuthorizationFlags> authorize = EnumSet.of(AuthorizationFlags.None);
|
private EnumSet<AuthorizationFlags> authorize = EnumSet.of(AuthorizationFlags.None);
|
||||||
|
@ -41,7 +41,7 @@ public class ReferenceTypeSourceStaticOptionConfigurationBuilder extends Referen
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ReferenceTypeSourceStaticOptionConfiguration buildChild(FieldSet fields, ReferenceTypeSourceStaticOptionConfigurationEntity d, ReferenceTypeSourceStaticOptionConfiguration m) {
|
protected ReferenceTypeSourceStaticOptionConfiguration buildChild(FieldSet fields, ExternalFetcherStaticOptionSourceConfigurationEntity d, ReferenceTypeSourceStaticOptionConfiguration m) {
|
||||||
FieldSet optionsFields = fields.extractPrefixed(this.asPrefix(ReferenceTypeSourceStaticOptionConfiguration._options));
|
FieldSet optionsFields = fields.extractPrefixed(this.asPrefix(ReferenceTypeSourceStaticOptionConfiguration._options));
|
||||||
|
|
||||||
if(!authorizationService.authorize(Permission.EditReferenceType)) return m;
|
if(!authorizationService.authorize(Permission.EditReferenceType)) return m;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package eu.eudat.model.builder.referencetypedefinition;
|
package eu.eudat.model.builder.referencetypedefinition;
|
||||||
|
|
||||||
import eu.eudat.authorization.AuthorizationFlags;
|
import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.commons.types.referencetype.ReferenceTypeStaticOptionEntity;
|
import eu.eudat.commons.types.externalfetcher.StaticOptionEntity;
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
import eu.eudat.model.builder.BaseBuilder;
|
import eu.eudat.model.builder.BaseBuilder;
|
||||||
import eu.eudat.model.referencetypedefinition.ReferenceTypeStaticOption;
|
import eu.eudat.model.referencetypedefinition.ReferenceTypeStaticOption;
|
||||||
|
@ -19,7 +19,7 @@ import java.util.*;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||||
public class ReferenceTypeStaticOptionBuilder extends BaseBuilder<ReferenceTypeStaticOption, ReferenceTypeStaticOptionEntity> {
|
public class ReferenceTypeStaticOptionBuilder extends BaseBuilder<ReferenceTypeStaticOption, StaticOptionEntity> {
|
||||||
|
|
||||||
private EnumSet<AuthorizationFlags> authorize = EnumSet.of(AuthorizationFlags.None);
|
private EnumSet<AuthorizationFlags> authorize = EnumSet.of(AuthorizationFlags.None);
|
||||||
|
|
||||||
|
@ -34,14 +34,14 @@ public class ReferenceTypeStaticOptionBuilder extends BaseBuilder<ReferenceTypeS
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ReferenceTypeStaticOption> build(FieldSet fields, List<ReferenceTypeStaticOptionEntity> data) throws MyApplicationException {
|
public List<ReferenceTypeStaticOption> build(FieldSet fields, List<StaticOptionEntity> data) throws MyApplicationException {
|
||||||
this.logger.debug("building for {} items requesting {} fields", Optional.ofNullable(data).map(List::size).orElse(0), Optional.ofNullable(fields).map(FieldSet::getFields).map(Set::size).orElse(0));
|
this.logger.debug("building for {} items requesting {} fields", Optional.ofNullable(data).map(List::size).orElse(0), Optional.ofNullable(fields).map(FieldSet::getFields).map(Set::size).orElse(0));
|
||||||
this.logger.trace(new DataLogEntry("requested fields", fields));
|
this.logger.trace(new DataLogEntry("requested fields", fields));
|
||||||
if (fields == null || data == null || fields.isEmpty())
|
if (fields == null || data == null || fields.isEmpty())
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
|
|
||||||
List<ReferenceTypeStaticOption> models = new ArrayList<>();
|
List<ReferenceTypeStaticOption> models = new ArrayList<>();
|
||||||
for (ReferenceTypeStaticOptionEntity d : data) {
|
for (StaticOptionEntity d : data) {
|
||||||
ReferenceTypeStaticOption m = new ReferenceTypeStaticOption();
|
ReferenceTypeStaticOption m = new ReferenceTypeStaticOption();
|
||||||
if (fields.hasField(this.asIndexer(ReferenceTypeStaticOption._code))) m.setCode(d.getCode());
|
if (fields.hasField(this.asIndexer(ReferenceTypeStaticOption._code))) m.setCode(d.getCode());
|
||||||
if (fields.hasField(this.asIndexer(ReferenceTypeStaticOption._value))) m.setValue(d.getValue());
|
if (fields.hasField(this.asIndexer(ReferenceTypeStaticOption._value))) m.setValue(d.getValue());
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package eu.eudat.model.builder.referencetypedefinition;
|
package eu.eudat.model.builder.referencetypedefinition;
|
||||||
|
|
||||||
import eu.eudat.authorization.AuthorizationFlags;
|
import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.commons.types.referencetype.ResultFieldsMappingConfigurationEntity;
|
import eu.eudat.commons.types.externalfetcher.ResultFieldsMappingConfigurationEntity;
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
import eu.eudat.model.builder.BaseBuilder;
|
import eu.eudat.model.builder.BaseBuilder;
|
||||||
import eu.eudat.model.referencetypedefinition.ResultFieldsMappingConfiguration;
|
import eu.eudat.model.referencetypedefinition.ResultFieldsMappingConfiguration;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package eu.eudat.model.builder.referencetypedefinition;
|
package eu.eudat.model.builder.referencetypedefinition;
|
||||||
|
|
||||||
import eu.eudat.authorization.AuthorizationFlags;
|
import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.commons.types.referencetype.ResultsConfigurationEntity;
|
import eu.eudat.commons.types.externalfetcher.ResultsConfigurationEntity;
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
import eu.eudat.model.builder.BaseBuilder;
|
import eu.eudat.model.builder.BaseBuilder;
|
||||||
import eu.eudat.model.referencetypedefinition.ResultsConfiguration;
|
import eu.eudat.model.referencetypedefinition.ResultsConfiguration;
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
package eu.eudat.model.persist.referencetypedefinition;
|
package eu.eudat.model.persist.referencetypedefinition;
|
||||||
|
|
||||||
import eu.eudat.commons.enums.FieldType;
|
|
||||||
import eu.eudat.commons.types.referencetype.QueryCaseConfigEntity;
|
|
||||||
import eu.eudat.commons.validation.BaseValidator;
|
import eu.eudat.commons.validation.BaseValidator;
|
||||||
import eu.eudat.model.persist.ReferencePersist;
|
|
||||||
import eu.eudat.model.persist.descriptionproperties.FieldPersist;
|
|
||||||
import gr.cite.tools.validation.ValidatorFactory;
|
|
||||||
import gr.cite.tools.validation.specification.Specification;
|
import gr.cite.tools.validation.specification.Specification;
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
import eu.eudat.errorcode.ErrorThesaurusProperties;
|
import eu.eudat.errorcode.ErrorThesaurusProperties;
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
package eu.eudat.model.referencetypedefinition;
|
package eu.eudat.model.referencetypedefinition;
|
||||||
|
|
||||||
|
|
||||||
import eu.eudat.commons.types.referencetype.QueryCaseConfigEntity;
|
|
||||||
import eu.eudat.model.ReferenceType;
|
import eu.eudat.model.ReferenceType;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class QueryCaseConfig {
|
public class QueryCaseConfig {
|
||||||
|
|
||||||
public final static String _likePattern = "likePattern";
|
public final static String _likePattern = "likePattern";
|
||||||
|
|
|
@ -3,11 +3,10 @@ package eu.eudat.service.prefilling;
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import eu.eudat.authorization.AuthorizationFlags;
|
import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.commons.JsonHandlingService;
|
|
||||||
import eu.eudat.commons.XmlHandlingService;
|
import eu.eudat.commons.XmlHandlingService;
|
||||||
import eu.eudat.commons.types.descriptiontemplate.FieldEntity;
|
import eu.eudat.commons.types.descriptiontemplate.FieldEntity;
|
||||||
import eu.eudat.commons.types.descriptiontemplate.FieldSetEntity;
|
import eu.eudat.commons.types.descriptiontemplate.FieldSetEntity;
|
||||||
import eu.eudat.commons.types.prefilling.PrefillingEntity;
|
import eu.eudat.commons.types.prefillingsource.PrefillingEntity;
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
import eu.eudat.data.DescriptionTemplateEntity;
|
import eu.eudat.data.DescriptionTemplateEntity;
|
||||||
import eu.eudat.model.*;
|
import eu.eudat.model.*;
|
||||||
|
@ -20,11 +19,9 @@ import eu.eudat.model.descriptionproperties.PropertyDefinitionFieldSetItem;
|
||||||
import eu.eudat.model.persist.DescriptionProfilingRequest;
|
import eu.eudat.model.persist.DescriptionProfilingRequest;
|
||||||
import eu.eudat.model.persist.DescriptionProfilingWithDataRequest;
|
import eu.eudat.model.persist.DescriptionProfilingWithDataRequest;
|
||||||
import eu.eudat.service.remotefetcher.ExternalUrlConfigProvider;
|
import eu.eudat.service.remotefetcher.ExternalUrlConfigProvider;
|
||||||
import eu.eudat.service.remotefetcher.RemoteFetcherService;
|
|
||||||
import eu.eudat.service.remotefetcher.config.entities.*;
|
import eu.eudat.service.remotefetcher.config.entities.*;
|
||||||
import eu.eudat.service.remotefetcher.criteria.ExternalReferenceCriteria;
|
import eu.eudat.service.remotefetcher.criteria.ExternalReferenceCriteria;
|
||||||
import gr.cite.tools.data.builder.BuilderFactory;
|
import gr.cite.tools.data.builder.BuilderFactory;
|
||||||
import gr.cite.tools.data.query.QueryFactory;
|
|
||||||
import gr.cite.tools.exception.MyApplicationException;
|
import gr.cite.tools.exception.MyApplicationException;
|
||||||
import gr.cite.tools.exception.MyNotFoundException;
|
import gr.cite.tools.exception.MyNotFoundException;
|
||||||
import gr.cite.tools.fieldset.BaseFieldSet;
|
import gr.cite.tools.fieldset.BaseFieldSet;
|
||||||
|
|
|
@ -5,6 +5,7 @@ import eu.eudat.authorization.Permission;
|
||||||
import eu.eudat.commons.XmlHandlingService;
|
import eu.eudat.commons.XmlHandlingService;
|
||||||
import eu.eudat.commons.enums.IsActive;
|
import eu.eudat.commons.enums.IsActive;
|
||||||
import eu.eudat.commons.enums.ReferenceTypeSourceType;
|
import eu.eudat.commons.enums.ReferenceTypeSourceType;
|
||||||
|
import eu.eudat.commons.types.externalfetcher.*;
|
||||||
import eu.eudat.commons.types.referencetype.*;
|
import eu.eudat.commons.types.referencetype.*;
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
import eu.eudat.data.ReferenceTypeEntity;
|
import eu.eudat.data.ReferenceTypeEntity;
|
||||||
|
@ -134,13 +135,13 @@ public class ReferenceTypeServiceImpl implements ReferenceTypeService {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
private @NotNull ReferenceTypeSourceBaseConfigurationEntity buildSourceBaseConfigEntity(ReferenceTypeSourceBaseConfigurationPersist persist){
|
private @NotNull ExternalFetcherBaseSourceConfigurationEntity buildSourceBaseConfigEntity(ReferenceTypeSourceBaseConfigurationPersist persist){
|
||||||
if (persist == null) return new ReferenceTypeSourceExternalApiConfigurationEntity();
|
if (persist == null) return new ExternalFetcherApiSourceConfigurationEntity();
|
||||||
|
|
||||||
ReferenceTypeSourceBaseConfigurationEntity data;
|
ExternalFetcherBaseSourceConfigurationEntity data;
|
||||||
|
|
||||||
if (ReferenceTypeSourceType.API.equals(persist.getType())) {
|
if (ReferenceTypeSourceType.API.equals(persist.getType())) {
|
||||||
ReferenceTypeSourceExternalApiConfigurationEntity apiEntity = new ReferenceTypeSourceExternalApiConfigurationEntity();
|
ExternalFetcherApiSourceConfigurationEntity apiEntity = new ExternalFetcherApiSourceConfigurationEntity();
|
||||||
|
|
||||||
apiEntity.setUrl(((ReferenceTypeSourceExternalApiConfigurationPersist) persist).getUrl());
|
apiEntity.setUrl(((ReferenceTypeSourceExternalApiConfigurationPersist) persist).getUrl());
|
||||||
if (((ReferenceTypeSourceExternalApiConfigurationPersist) persist).getResults() != null ) {
|
if (((ReferenceTypeSourceExternalApiConfigurationPersist) persist).getResults() != null ) {
|
||||||
|
@ -164,7 +165,7 @@ public class ReferenceTypeServiceImpl implements ReferenceTypeService {
|
||||||
|
|
||||||
data = apiEntity;
|
data = apiEntity;
|
||||||
}else {
|
}else {
|
||||||
ReferenceTypeSourceStaticOptionConfigurationEntity staticEntity = new ReferenceTypeSourceStaticOptionConfigurationEntity();
|
ExternalFetcherStaticOptionSourceConfigurationEntity staticEntity = new ExternalFetcherStaticOptionSourceConfigurationEntity();
|
||||||
|
|
||||||
if (!this.conventionService.isListNullOrEmpty(((ReferenceTypeSourceStaticOptionConfigurationPersist) persist).getOptions())){
|
if (!this.conventionService.isListNullOrEmpty(((ReferenceTypeSourceStaticOptionConfigurationPersist) persist).getOptions())){
|
||||||
staticEntity.setOptions(new ArrayList<>());
|
staticEntity.setOptions(new ArrayList<>());
|
||||||
|
@ -254,8 +255,8 @@ public class ReferenceTypeServiceImpl implements ReferenceTypeService {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
private @NotNull ReferenceTypeStaticOptionEntity buildStaticOptionEntity(ReferenceTypeStaticOptionPersist persist){
|
private @NotNull StaticOptionEntity buildStaticOptionEntity(ReferenceTypeStaticOptionPersist persist){
|
||||||
ReferenceTypeStaticOptionEntity data = new ReferenceTypeStaticOptionEntity();
|
StaticOptionEntity data = new StaticOptionEntity();
|
||||||
if (persist == null) return data;
|
if (persist == null) return data;
|
||||||
|
|
||||||
data.setCode(persist.getCode());
|
data.setCode(persist.getCode());
|
||||||
|
|
Loading…
Reference in New Issue