From a4f188f47459206c8c30219727f13f8ca2735cc7 Mon Sep 17 00:00:00 2001 From: claur Date: Fri, 12 Apr 2019 01:04:42 +0200 Subject: [PATCH] Fix issues when importing old POD file --- .../projectlibre1/exchange/FileImporter.java | 9 + .../exchange/LocalFileImporter.java | 160 ++++++++++++++---- .../projectlibre1/session/LoadOptions.java | 9 + .../projectlibre1/session/LocalSession.java | 1 + .../projectlibre1/strings/client.properties | 1 + .../com/projectlibre1/util/VersionUtils.java | 2 +- .../core/pm/exchange/MspImporter.java | 3 +- .../exchange/MicrosoftImporter.java | 11 +- 8 files changed, 156 insertions(+), 40 deletions(-) diff --git a/projectlibre_core/src/com/projectlibre1/exchange/FileImporter.java b/projectlibre_core/src/com/projectlibre1/exchange/FileImporter.java index 17d5080..2c43c7f 100644 --- a/projectlibre_core/src/com/projectlibre1/exchange/FileImporter.java +++ b/projectlibre_core/src/com/projectlibre1/exchange/FileImporter.java @@ -69,6 +69,7 @@ import com.projectlibre1.pm.task.ProjectFactory; public abstract class FileImporter /*implements Runnable*/ { protected JobQueue jobQueue=null; protected String fileName; + protected InputStream fileInputStream; protected Project project; protected ResourceMappingForm resourceMapping; protected ProjectFactory projectFactory=null; @@ -136,6 +137,14 @@ public abstract class FileImporter /*implements Runnable*/ { public void setResourceMapping(ResourceMappingForm resourceMapping) { this.resourceMapping = resourceMapping; } + + public InputStream getFileInputStream() { + return fileInputStream; + } + + public void setFileInputStream(InputStream fileInputStream) { + this.fileInputStream = fileInputStream; + } diff --git a/projectlibre_core/src/com/projectlibre1/exchange/LocalFileImporter.java b/projectlibre_core/src/com/projectlibre1/exchange/LocalFileImporter.java index 0c380f1..9a73966 100644 --- a/projectlibre_core/src/com/projectlibre1/exchange/LocalFileImporter.java +++ b/projectlibre_core/src/com/projectlibre1/exchange/LocalFileImporter.java @@ -68,6 +68,8 @@ import java.io.ObjectOutputStream; import java.io.OutputStream; import java.util.Scanner; +import javax.swing.SwingUtilities; + import com.projectlibre1.grouping.core.model.DefaultNodeModel; import com.projectlibre1.job.Job; import com.projectlibre1.job.JobRunnable; @@ -76,6 +78,7 @@ import com.projectlibre1.pm.resource.ResourcePoolFactory; import com.projectlibre1.pm.task.Project; import com.projectlibre1.server.data.DataUtil; import com.projectlibre1.server.data.DocumentData; +import com.projectlibre1.session.LoadOptions; import com.projectlibre1.session.LocalSession; import com.projectlibre1.session.SessionFactory; import com.projectlibre1.strings.Messages; @@ -88,6 +91,7 @@ import com.projectlibre1.util.Alert; public class LocalFileImporter extends FileImporter { public static final String VERSION="1.0.0"; //$NON-NLS-1$ private static final String PROJECT_LIBRE_FILE_SEPARATOR="@@@@@@@@@@ProjectLibreSeparator_MSXML@@@@@@@@@@"; + private static final String OLD_FILE="com.projity.server.data.ProjectData"; private static final String XML_FILE_START="