diff --git a/backend/core/src/main/java/org/opencdmp/commons/enums/DmpUserRole.java b/backend/core/src/main/java/org/opencdmp/commons/enums/DmpUserRole.java index b641e64d5..647622754 100644 --- a/backend/core/src/main/java/org/opencdmp/commons/enums/DmpUserRole.java +++ b/backend/core/src/main/java/org/opencdmp/commons/enums/DmpUserRole.java @@ -21,7 +21,7 @@ public enum DmpUserRole implements DatabaseEnum { @Override @JsonValue public Short getValue() { - return value; + return this.value; } private static final Map map = EnumUtils.getEnumValueMap(DmpUserRole.class); diff --git a/backend/core/src/main/java/org/opencdmp/model/description/PropertyDefinitionFieldSetItem.java b/backend/core/src/main/java/org/opencdmp/model/description/PropertyDefinitionFieldSetItem.java index ca7a69d0e..560f9ec83 100644 --- a/backend/core/src/main/java/org/opencdmp/model/description/PropertyDefinitionFieldSetItem.java +++ b/backend/core/src/main/java/org/opencdmp/model/description/PropertyDefinitionFieldSetItem.java @@ -14,7 +14,7 @@ public class PropertyDefinitionFieldSetItem { private Integer ordinal; public Map getFields() { - return fields; + return this.fields; } public void setFields(Map fields) { @@ -22,7 +22,7 @@ public class PropertyDefinitionFieldSetItem { } public String getComment() { - return comment; + return this.comment; } public void setComment(String comment) { @@ -30,7 +30,7 @@ public class PropertyDefinitionFieldSetItem { } public Integer getOrdinal() { - return ordinal; + return this.ordinal; } public void setOrdinal(Integer ordinal) { diff --git a/backend/core/src/main/java/org/opencdmp/service/prefillingsource/PrefillingSourceServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/prefillingsource/PrefillingSourceServiceImpl.java index 32fc4ad14..d8b4e7ecb 100644 --- a/backend/core/src/main/java/org/opencdmp/service/prefillingsource/PrefillingSourceServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/prefillingsource/PrefillingSourceServiceImpl.java @@ -422,10 +422,10 @@ public class PrefillingSourceServiceImpl implements PrefillingSourceService { List issuedFieldEntities = definition.getAllField().stream().filter(x -> x.getSchematics() != null && x.getSchematics().contains("rda.dataset.issued")).toList(); if (!this.conventionService.isListNullOrEmpty(issuedFieldEntities)) { String issuedIdNode = issuedFieldEntities.getFirst().getId(); - String issuedValue = this.conventionService.isNullOrEmpty(issuedIdNode) ? null : description.getProperties().getFieldSets().values().stream().map(PropertyDefinitionFieldSet::getItems).flatMap(List::stream) - .filter(x -> x.getFields() != null && x.getFields().containsKey(issuedIdNode)).map(x -> x.getFields().get(issuedIdNode).getTextValue()).filter(Objects::nonNull).findFirst().orElse(null); + Instant issuedValue = this.conventionService.isNullOrEmpty(issuedIdNode) ? null : description.getProperties().getFieldSets().values().stream().map(PropertyDefinitionFieldSet::getItems).flatMap(List::stream) + .filter(x -> x.getFields() != null && x.getFields().containsKey(issuedIdNode)).map(x -> x.getFields().get(issuedIdNode).getDateValue()).filter(Objects::nonNull).findFirst().orElse(null); - if (!this.conventionService.isNullOrEmpty(issuedValue)) { + if (issuedValue != null) { List licStartFieldSetsEntities = definition.getAllFieldSets().stream().filter(x -> x.getAllField() != null && x.getAllField().stream().anyMatch(y -> y.getSchematics() != null && y.getSchematics().contains("rda.dataset.distribution.license.start_date"))).toList(); for (FieldSetEntity licStartFieldSetEntity : licStartFieldSetsEntities) { List licStartEntities = licStartFieldSetEntity.getAllField().stream().filter(x -> x.getSchematics() != null && x.getSchematics().contains("rda.dataset.distribution.license.start_date")).toList(); @@ -433,7 +433,7 @@ public class PrefillingSourceServiceImpl implements PrefillingSourceService { this.ensureFieldSetEntity(description, licStartFieldSetEntity); for (FieldEntity licStartDateNode : licStartEntities) { - description.getProperties().getFieldSets().get(licStartFieldSetEntity.getId()).getItems().getFirst().getFields().put(licStartDateNode.getId(), this.buildPropertyDefinitionFieldItemValue(descriptionReferences,licStartDateNode, semanticTarget, issuedValue, type)); + description.getProperties().getFieldSets().get(licStartFieldSetEntity.getId()).getItems().getFirst().getFields().put(licStartDateNode.getId(), this.buildPropertyDefinitionFieldItemValue(descriptionReferences,licStartDateNode, semanticTarget, issuedValue.toString(), type)); } } } @@ -497,7 +497,7 @@ public class PrefillingSourceServiceImpl implements PrefillingSourceService { if (fieldEntity == null || fieldEntity.getData() == null || fieldEntity.getData().getFieldType() == null || this.conventionService.isNullOrEmpty(value)) return field; try{ switch (fieldEntity.getData().getFieldType()){ - case FREE_TEXT, TEXT_AREA, RICH_TEXT_AREA, RADIO_BOX -> field.setTextValue(value.toLowerCase(Locale.ROOT)); + case FREE_TEXT, TEXT_AREA, RICH_TEXT_AREA, RADIO_BOX -> field.setTextValue(value); case CHECK_BOX, BOOLEAN_DECISION ->{ if (!this.conventionService.isNullOrEmpty(value)) { field.setBooleanValue("true".equals(value.trim().toLowerCase(Locale.ROOT)));