From 7a1edd05126e5f00eb38718167778e37be26272c Mon Sep 17 00:00:00 2001 From: Reguel Wermelinger Date: Tue, 14 Nov 2023 09:45:47 +0100 Subject: [PATCH 1/2] fix: import dialog not closing after successful import --- .../util/excel/importer/wizard/ExcelImportWizardPage.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/excel-importer/src/com/axonivy/util/excel/importer/wizard/ExcelImportWizardPage.java b/excel-importer/src/com/axonivy/util/excel/importer/wizard/ExcelImportWizardPage.java index d33d0cb..ad3d042 100644 --- a/excel-importer/src/com/axonivy/util/excel/importer/wizard/ExcelImportWizardPage.java +++ b/excel-importer/src/com/axonivy/util/excel/importer/wizard/ExcelImportWizardPage.java @@ -2,6 +2,7 @@ import java.io.File; import java.lang.reflect.InvocationTargetException; +import java.util.LinkedList; import java.util.List; import java.util.stream.Stream; @@ -90,7 +91,7 @@ protected void handleInputChanged() { } private void saveDialogSettings() { - List destinations = getImportHistory(); + List destinations = new LinkedList<>(getImportHistory()); String path = state.file.getSelection(); String lowerCasePath = path.toLowerCase(); if (destinations.contains(path)) { From a17bd5a33759da60dea79173774a56fe69825d93 Mon Sep 17 00:00:00 2001 From: Reguel Wermelinger Date: Tue, 14 Nov 2023 10:01:32 +0100 Subject: [PATCH 2/2] provide full stack trace in log, in case the importer fails --- .../util/excel/importer/wizard/ExcelImportProcessor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/excel-importer/src/com/axonivy/util/excel/importer/wizard/ExcelImportProcessor.java b/excel-importer/src/com/axonivy/util/excel/importer/wizard/ExcelImportProcessor.java index 05ff0bf..747ff4d 100644 --- a/excel-importer/src/com/axonivy/util/excel/importer/wizard/ExcelImportProcessor.java +++ b/excel-importer/src/com/axonivy/util/excel/importer/wizard/ExcelImportProcessor.java @@ -41,11 +41,14 @@ import ch.ivyteam.ivy.scripting.dataclass.IEntityClass; import ch.ivyteam.ivy.scripting.dataclass.IProjectDataClassManager; import ch.ivyteam.ivy.search.restricted.ProjectRelationSearchScope; +import ch.ivyteam.log.Logger; import ch.ivyteam.util.io.resource.FileResource; import ch.ivyteam.util.io.resource.nio.NioFileSystemProvider; public class ExcelImportProcessor implements IWizardSupport, IRunnableWithProgress { + private static final Logger LOGGER = Logger.getLogger(ExcelImportProcessor.class); + private IIvyProject selectedSourceProject; private FileResource importFile; private IStatus status = Status.OK_STATUS; @@ -122,6 +125,7 @@ private void importExcel(IProjectDataClassManager manager, FileResource excel, I var entries = importData(sheet, newEntity, pmv); loaded = entries.size(); } catch (Exception ex) { + LOGGER.error("Excel data import failed", ex); status = EclipseUtil.createErrorStatus("Loading of Excel data failed", ex); } monitor.setTaskName("Loaded Excel rows into Database "+loaded);