diff --git a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/FunderMigrationService.java b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/FunderMigrationService.java index 0f5b55ccc..be7373323 100644 --- a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/FunderMigrationService.java +++ b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/FunderMigrationService.java @@ -56,7 +56,7 @@ public class FunderMigrationService { ReferenceEntity data = new ReferenceEntity(); data.setId(item.getId()); data.setLabel(item.getLabel()); - data.setIsActive(Funder.Status.fromInteger(item.getStatus()).equals(Funder.Status.ACTIVE) ? IsActive.Active : IsActive.Inactive); + data.setIsActive(IsActive.Active); data.setTypeId(ReferenceTypeIds.Funder); data.setCreatedAt(item.getCreated().toInstant()); data.setUpdatedAt(item.getModified().toInstant()); diff --git a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/GrantMigrationService.java b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/GrantMigrationService.java index 704339566..5025b6667 100644 --- a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/GrantMigrationService.java +++ b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/GrantMigrationService.java @@ -21,7 +21,8 @@ import java.util.List; import java.util.Locale; @Service -public class GrantMigrationService { +public class +GrantMigrationService { private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(GrantMigrationService.class)); private static final int PageSize = 500; @@ -63,7 +64,7 @@ public class GrantMigrationService { data.setLabel(item.getLabel()); data.setDescription(item.getDescription()); data.setAbbreviation(item.getAbbreviation()); - data.setIsActive(Grant.Status.fromInteger(item.getStatus()).equals(Grant.Status.ACTIVE) ? IsActive.Active : IsActive.Inactive); + data.setIsActive(IsActive.Active); data.setTypeId(ReferenceTypeIds.Grants); data.setCreatedAt(item.getCreated().toInstant()); data.setUpdatedAt(item.getModified().toInstant()); diff --git a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ProjectMigrationService.java b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ProjectMigrationService.java index 10b1e2c71..0ac989cf9 100644 --- a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ProjectMigrationService.java +++ b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ProjectMigrationService.java @@ -64,8 +64,8 @@ public class ProjectMigrationService { data.setLabel(item.getLabel()); data.setAbbreviation(item.getAbbreviation()); data.setDescription(item.getDescription()); - data.setIsActive(Project.Status.ACTIVE.equals(Project.Status.fromInteger(item.getStatus())) ? IsActive.Active : IsActive.Inactive); - data.setTypeId(ReferenceTypeIds.DataRepositories); + data.setIsActive(IsActive.Active); + data.setTypeId(ReferenceTypeIds.Project); data.setCreatedAt(item.getCreated().toInstant()); data.setUpdatedAt(item.getModified().toInstant()); if (item.getCreationUser() != null) data.setCreatedById(item.getCreationUser().getId()); diff --git a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/StorageFileMigrationService.java b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/StorageFileMigrationService.java index 632063ef2..e1aa920f1 100644 --- a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/StorageFileMigrationService.java +++ b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/StorageFileMigrationService.java @@ -63,9 +63,9 @@ public class StorageFileMigrationService { logger.debug("Migrate FileUpload " + page * PageSize + " of " + total); for (FileUpload item : items) { entityManager.detach(item); - File file = new File(this.environment.getProperty("file.storage") + item.getId().toString()); - if (!file.exists()) file = new File(this.environment.getProperty("temp.temp") + item.getId().toString()); - if (!file.exists()) throw new MyApplicationException("Storage file not exist " + item.getId().toString()); +// File file = new File(this.environment.getProperty("file.storage") + item.getId().toString()); +// if (!file.exists()) file = new File(this.environment.getProperty("temp.temp") + item.getId().toString()); +// if (!file.exists()) throw new MyApplicationException("Storage file not exist " + item.getId().toString()); StorageFileEntity data = new StorageFileEntity(); data.setId(item.getId()); @@ -80,11 +80,11 @@ public class StorageFileMigrationService { data.setPurgedAt(null); if (item.getCreator() == null) data.setOwnerId(item.getCreator().getId()); - File destinationFile = new File(Paths.get(this.environment.getProperty("file.mainstorage"), data.getFileRef()).toString()); - boolean fileCopied = FileCopyUtils.copy(file, destinationFile) > 0; - if (!fileCopied) throw new MyApplicationException("Storage file not copied " + data.getId().toString()); - - filesToDelete.add(file); +// File destinationFile = new File(Paths.get(this.environment.getProperty("file.mainstorage"), data.getFileRef()).toString()); +// boolean fileCopied = FileCopyUtils.copy(file, destinationFile) > 0; +// if (!fileCopied) throw new MyApplicationException("Storage file not copied " + data.getId().toString()); +// +// filesToDelete.add(file); this.entityManager.persist(data); }