Merge remote-tracking branch 'origin/dmp-refactoring' into dmp-refactoring

This commit is contained in:
amentis 2023-10-26 12:09:36 +03:00
commit f006587f4a
8 changed files with 47 additions and 17 deletions

View File

@ -26,7 +26,7 @@ public class ExtraFieldBuilder extends FieldBuilder<ExtraField, ExtraFieldEntity
}
protected ExtraField buildChild(FieldSet fields, ExtraFieldEntity data, ExtraField model) {
if (fields.hasField(this.asIndexer(ExtraField._type))) model.setType(data.getType());
if (fields.hasField(this.asIndexer(ExtraField._dataType))) model.setDataType(data.getType());
return model;
}
}

View File

@ -59,6 +59,7 @@ public abstract class FieldBuilder<Model extends Field, Entity extends FieldEnti
if (fields.hasField(this.asIndexer(Model._placeholder))) m.setPlaceholder(d.getPlaceholder());
if (fields.hasField(this.asIndexer(Model._ordinal))) m.setOrdinal(d.getOrdinal());
if (fields.hasField(this.asIndexer(Model._required))) m.setRequired(d.isRequired());
this.buildChild(fields, d, m);
models.add(m);
}
this.logger.debug("build {} items", Optional.of(models).map(List::size).orElse(0));

View File

@ -26,7 +26,7 @@ public class SystemFieldBuilder extends FieldBuilder<SystemField, SystemFieldEnt
}
protected SystemField buildChild(FieldSet fields, SystemFieldEntity data, SystemField model) {
if (fields.hasField(this.asIndexer(SystemField._type))) model.setType(data.getType());
if (fields.hasField(this.asIndexer(SystemField._systemFieldType))) model.setSystemFieldType(data.getType());
return model;
}
}

View File

@ -4,14 +4,14 @@ import eu.eudat.commons.enums.DmpBlueprintExtraFieldDataType;
public class ExtraField extends Field {
public final static String _type = "type";
private DmpBlueprintExtraFieldDataType type;
public final static String _dataType = "dataType";
private DmpBlueprintExtraFieldDataType dataType;
public DmpBlueprintExtraFieldDataType getType() {
return type;
public DmpBlueprintExtraFieldDataType getDataType() {
return dataType;
}
public void setType(DmpBlueprintExtraFieldDataType type) {
this.type = type;
public void setDataType(DmpBlueprintExtraFieldDataType dataType) {
this.dataType = dataType;
}
}

View File

@ -4,14 +4,14 @@ import eu.eudat.commons.enums.DmpBlueprintSystemFieldType;
public class SystemField extends Field {
public final static String _type = "type";
private DmpBlueprintSystemFieldType type;
public final static String _systemFieldType = "systemFieldType";
private DmpBlueprintSystemFieldType systemFieldType;
public DmpBlueprintSystemFieldType getType() {
return type;
public DmpBlueprintSystemFieldType getSystemFieldType() {
return systemFieldType;
}
public void setType(DmpBlueprintSystemFieldType type) {
this.type = type;
public void setSystemFieldType(DmpBlueprintSystemFieldType systemFieldType) {
this.systemFieldType = systemFieldType;
}
}

View File

@ -16,8 +16,8 @@ import java.util.UUID;
include = JsonTypeInfo.As.PROPERTY,
property = "category")
@JsonSubTypes({
@JsonSubTypes.Type(value = SystemFieldPersist.class, name = "System"),
@JsonSubTypes.Type(value = ExtraFieldPersist.class, name = "Extra")
@JsonSubTypes.Type(value = SystemFieldPersist.class, name = "0"),
@JsonSubTypes.Type(value = ExtraFieldPersist.class, name = "1")
})
public abstract class FieldPersist {
@NotNull(message = "{validation.empty}")

View File

@ -17,4 +17,5 @@ spring:
optional:classpath:config/external.yml[.yml], optional:classpath:config/external-${spring.profiles.active}.yml[.yml], optional:file:../config/external-${spring.profiles.active}.yml[.yml],
optional:classpath:config/cors.yml[.yml], optional:classpath:config/cors-${spring.profiles.active}.yml[.yml], optional:file:../config/cors-${spring.profiles.active}.yml[.yml],
optional:classpath:config/swagger.yml[.yml], optional:classpath:config/swagger-${spring.profiles.active}.yml[.yml], optional:file:../config/swagger-${spring.profiles.active}.yml[.yml],
optional:classpath:config/deposit.yml[.yml], optional:classpath:config/deposit-${spring.profiles.active}.yml[.yml], optional:file:../config/deposit-${spring.profiles.active}.yml[.yml]
optional:classpath:config/deposit.yml[.yml], optional:classpath:config/deposit-${spring.profiles.active}.yml[.yml], optional:file:../config/deposit-${spring.profiles.active}.yml[.yml],
optional:classpath:config/errors.yml[.yml], optional:classpath:config/errors-${spring.profiles.active}.yml[.yml], optional:file:../config/errors-${spring.profiles.active}.yml[.yml]

View File

@ -0,0 +1,28 @@
error-thesaurus:
hash-conflict:
code: 100
message: there is a hash conflict for the item modifed. please reload to get the latest changes
forbidden:
code: 101
message: insufficient rights
system-error:
code: 102
message: an unexpected system error occured
missing-tenant:
code: 103
message: tenant scope not provided
model-validation:
code: 106
message: validation error
tenant-code-required:
code: 108
message: tenant code required
tenant-name-required:
code: 109
message: tenant name required
index-already-exists:
code: 110
message: index already exists
tenant-not-allowed:
code: 113
message: tenant not allowed