From 0d9f3890afa3abdccb994bfb0dc68c21fd54ad89 Mon Sep 17 00:00:00 2001 From: sgiannopoulos Date: Thu, 10 Oct 2024 10:46:24 +0300 Subject: [PATCH] migration fixes --- .../PropertyDefinitionFieldSetItemEntity.java | 9 --------- .../PropertyDefinitionFieldSetItemBuilder.java | 1 - .../description/PropertyDefinitionFieldSetItem.java | 11 ----------- .../service/description/DescriptionServiceImpl.java | 1 - .../eudat/migration/DatasetMigrationService.java | 13 +------------ 5 files changed, 1 insertion(+), 34 deletions(-) diff --git a/backend/core/src/main/java/org/opencdmp/commons/types/description/PropertyDefinitionFieldSetItemEntity.java b/backend/core/src/main/java/org/opencdmp/commons/types/description/PropertyDefinitionFieldSetItemEntity.java index 9ca9d98de..547474ac7 100644 --- a/backend/core/src/main/java/org/opencdmp/commons/types/description/PropertyDefinitionFieldSetItemEntity.java +++ b/backend/core/src/main/java/org/opencdmp/commons/types/description/PropertyDefinitionFieldSetItemEntity.java @@ -4,7 +4,6 @@ import java.util.Map; public class PropertyDefinitionFieldSetItemEntity { private Map fields; - private String comment; private int ordinal; public Map getFields() { @@ -15,14 +14,6 @@ public class PropertyDefinitionFieldSetItemEntity { this.fields = fields; } - public String getComment() { - return this.comment; - } - - public void setComment(String comment) { - this.comment = comment; - } - public int getOrdinal() { return this.ordinal; } diff --git a/backend/core/src/main/java/org/opencdmp/model/builder/description/PropertyDefinitionFieldSetItemBuilder.java b/backend/core/src/main/java/org/opencdmp/model/builder/description/PropertyDefinitionFieldSetItemBuilder.java index 4217c6ca0..a58101ee6 100644 --- a/backend/core/src/main/java/org/opencdmp/model/builder/description/PropertyDefinitionFieldSetItemBuilder.java +++ b/backend/core/src/main/java/org/opencdmp/model/builder/description/PropertyDefinitionFieldSetItemBuilder.java @@ -58,7 +58,6 @@ public class PropertyDefinitionFieldSetItemBuilder extends BaseBuilder models = new ArrayList<>(); for (PropertyDefinitionFieldSetItemEntity d : data) { PropertyDefinitionFieldSetItem m = new PropertyDefinitionFieldSetItem(); - if (fields.hasField(this.asIndexer(PropertyDefinitionFieldSetItem._comment))) m.setComment(d.getComment()); if (fields.hasField(this.asIndexer(PropertyDefinitionFieldSetItem._ordinal))) m.setOrdinal(d.getOrdinal()); if (!fieldsFields.isEmpty() && d.getFields() != null && !d.getFields().isEmpty()) { m.setFields(new HashMap<>()); 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 560f9ec83..76a2ba3e9 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 @@ -7,9 +7,6 @@ public class PropertyDefinitionFieldSetItem { public final static String _fields = "fields"; private Map fields; - public final static String _comment = "comment"; - private String comment; - public final static String _ordinal = "ordinal"; private Integer ordinal; @@ -21,14 +18,6 @@ public class PropertyDefinitionFieldSetItem { this.fields = fields; } - public String getComment() { - return this.comment; - } - - public void setComment(String comment) { - this.comment = comment; - } - public Integer getOrdinal() { return this.ordinal; } diff --git a/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java index 3acd35912..56825dd41 100644 --- a/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java @@ -425,7 +425,6 @@ public class DescriptionServiceImpl implements DescriptionService { if (data == null) return cleanData; if (data.getFields() != null && !data.getFields().isEmpty()){ cleanData.setOrdinal(data.getOrdinal()); - cleanData.setComment(data.getComment()); cleanData.setFields(new HashMap<>()); for (String key: data.getFields().keySet()) { org.opencdmp.commons.types.descriptiontemplate.FieldEntity fieldEntity = fieldSetEntity != null ? fieldSetEntity.getFieldById(key).stream().findFirst().orElse(null) : null; diff --git a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/DatasetMigrationService.java b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/DatasetMigrationService.java index 4bb901f26..2f7985cbd 100644 --- a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/DatasetMigrationService.java +++ b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/DatasetMigrationService.java @@ -427,18 +427,7 @@ public class DatasetMigrationService { propertyDefinitionFieldSetEntity.setItems(new ArrayList<>()); propertyDefinitionEntity.getFieldSets().put(currentFieldSet.getId().trim(), propertyDefinitionFieldSetEntity); } - - PropertyDefinitionFieldSetItemEntity propertyDefinitionFieldSetItemEntity; - if (this.conventionService.isListNullOrEmpty(propertyDefinitionFieldSetEntity.getItems())){ - propertyDefinitionFieldSetItemEntity = new PropertyDefinitionFieldSetItemEntity(); - propertyDefinitionFieldSetItemEntity.setFields(new HashMap<>()); - propertyDefinitionFieldSetItemEntity.setOrdinal(SimpleFieldSetOrdinal); - propertyDefinitionFieldSetEntity.getItems().add(propertyDefinitionFieldSetItemEntity); - } else { - propertyDefinitionFieldSetItemEntity = propertyDefinitionFieldSetEntity.getItems().getFirst(); - } - - propertyDefinitionFieldSetItemEntity.setComment(comment); + propertyDefinitionFieldSetEntity.setComment(comment); } private FieldEntity buildField(Dataset item, org.opencdmp.commons.types.descriptiontemplate.FieldEntity currentField, Object propertyValue, Map referenceTypeDefinitionEntityMap, Map referenceMap, int ordinal, List createdDescriptionReferenceEntities, Map savedTagIdsByName, HashSet existingTagIds){