Updating definitions info on migrated licenses

This commit is contained in:
Thomas Georgios Giannos 2023-12-20 10:21:44 +02:00
parent b3b619d354
commit 306053acba
1 changed files with 9 additions and 9 deletions

View File

@ -202,13 +202,12 @@ public class DmpMigrationService {
if (licenseMap.containsKey("name")) {
referenceEntity.setLabel(licenseMap.get("name"));
}
if (licenseMap.containsKey("uri")) {
referenceEntity.setReference(licenseMap.get("uri"));
if (!this.conventionService.isNullOrEmpty(licenseMap.get("uri"))){
if (licenseMap.containsKey("pid")) {
if (!this.conventionService.isNullOrEmpty(licensePid)){
FieldEntity fieldEntity = new FieldEntity();
fieldEntity.setCode("uri");
fieldEntity.setCode("pid");
fieldEntity.setDataType(ReferenceFieldDataType.Text);
fieldEntity.setValue(licenseMap.get("uri"));
fieldEntity.setValue(licensePid);
fields.add(fieldEntity);
}
}
@ -221,12 +220,13 @@ public class DmpMigrationService {
fields.add(fieldEntity);
}
}
if (licenseMap.containsKey("hint")) {
if (!this.conventionService.isNullOrEmpty(licenseMap.get("hint"))){
if (licenseMap.containsKey("uri")) {
referenceEntity.setReference(licenseMap.get("uri"));
if (!this.conventionService.isNullOrEmpty(licenseMap.get("uri"))){
FieldEntity fieldEntity = new FieldEntity();
fieldEntity.setCode("hint");
fieldEntity.setCode("uri");
fieldEntity.setDataType(ReferenceFieldDataType.Text);
fieldEntity.setValue(licenseMap.get("hint"));
fieldEntity.setValue(licenseMap.get("uri"));
fields.add(fieldEntity);
}
}