From: Tuukka Lehtonen Date: Fri, 21 Apr 2017 03:39:55 +0000 (+0300) Subject: Removed deprecated ProCore matter to make the platform less heavy X-Git-Tag: v1.43.0~136^2~132 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=fe866f9e4d3f464c3ac33b6651ad52df16c5d2fc Removed deprecated ProCore matter to make the platform less heavy Removed: * deprecated org.simantics.db.build.zip and related code. * windows and linux procore executables from org.simantics.db.server * org.simantics.db.procore.server.environment In total almost 25MiB removed from the platform. gitlab #109 Change-Id: I0b7532b0948676f925e0d0f619aadc5e06ea7ea1 --- diff --git a/bundles/org.simantics.db.procore.server.environment/.classpath b/bundles/org.simantics.db.procore.server.environment/.classpath deleted file mode 100644 index eca7bdba8..000000000 --- a/bundles/org.simantics.db.procore.server.environment/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/bundles/org.simantics.db.procore.server.environment/.project b/bundles/org.simantics.db.procore.server.environment/.project deleted file mode 100644 index 4a0c12be4..000000000 --- a/bundles/org.simantics.db.procore.server.environment/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.simantics.db.procore.server.environment - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/bundles/org.simantics.db.procore.server.environment/.settings/org.eclipse.jdt.core.prefs b/bundles/org.simantics.db.procore.server.environment/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 0c68a61dc..000000000 --- a/bundles/org.simantics.db.procore.server.environment/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/bundles/org.simantics.db.procore.server.environment/META-INF/MANIFEST.MF b/bundles/org.simantics.db.procore.server.environment/META-INF/MANIFEST.MF deleted file mode 100644 index af12d597a..000000000 --- a/bundles/org.simantics.db.procore.server.environment/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: ProCore Database Server Environment Checking Utilities -Bundle-SymbolicName: org.simantics.db.procore.server.environment -Bundle-Version: 1.1.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: org.simantics.db.procore.server.environment, - org.simantics.db.procore.server.environment.windows -Bundle-Vendor: Semantum Oy -Require-Bundle: org.eclipse.core.runtime;bundle-version="3.6.0" -Bundle-NativeCode: msijni.dll; - processor=x86; osname=win32, - msijni64.dll; - processor=x86_64; osname=win32, - * -Automatic-Module-Name: org.simantics.db.procore.server.environment diff --git a/bundles/org.simantics.db.procore.server.environment/VC90.2008.SP1.KB2467174.redist.x64.exe b/bundles/org.simantics.db.procore.server.environment/VC90.2008.SP1.KB2467174.redist.x64.exe deleted file mode 100644 index 5ecef5ec5..000000000 Binary files a/bundles/org.simantics.db.procore.server.environment/VC90.2008.SP1.KB2467174.redist.x64.exe and /dev/null differ diff --git a/bundles/org.simantics.db.procore.server.environment/VC90.2008.SP1.KB2467174.redist.x86.exe b/bundles/org.simantics.db.procore.server.environment/VC90.2008.SP1.KB2467174.redist.x86.exe deleted file mode 100644 index 823345da7..000000000 Binary files a/bundles/org.simantics.db.procore.server.environment/VC90.2008.SP1.KB2467174.redist.x86.exe and /dev/null differ diff --git a/bundles/org.simantics.db.procore.server.environment/build.properties b/bundles/org.simantics.db.procore.server.environment/build.properties deleted file mode 100644 index a64b63b7b..000000000 --- a/bundles/org.simantics.db.procore.server.environment/build.properties +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################### -# Copyright (c) 2007, 2010 Association for Decentralized Information Management -# in Industry THTH ry. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# VTT Technical Research Centre of Finland - initial API and implementation -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - msijni.dll,\ - msijni64.dll,\ - VC90.2008.SP1.KB2467174.redist.x64.exe,\ - VC90.2008.SP1.KB2467174.redist.x86.exe -src.includes = native/ diff --git a/bundles/org.simantics.db.procore.server.environment/msijni.dll b/bundles/org.simantics.db.procore.server.environment/msijni.dll deleted file mode 100644 index 8009884ed..000000000 Binary files a/bundles/org.simantics.db.procore.server.environment/msijni.dll and /dev/null differ diff --git a/bundles/org.simantics.db.procore.server.environment/msijni64.dll b/bundles/org.simantics.db.procore.server.environment/msijni64.dll deleted file mode 100644 index df7497910..000000000 Binary files a/bundles/org.simantics.db.procore.server.environment/msijni64.dll and /dev/null differ diff --git a/bundles/org.simantics.db.procore.server.environment/native/compile.bat b/bundles/org.simantics.db.procore.server.environment/native/compile.bat deleted file mode 100644 index 47efc2f66..000000000 --- a/bundles/org.simantics.db.procore.server.environment/native/compile.bat +++ /dev/null @@ -1,12 +0,0 @@ -@rem *************************************************************************** -@rem Copyright (c) 2007, 2010 Association for Decentralized Information Management -@rem in Industry THTH ry. -@rem All rights reserved. This program and the accompanying materials -@rem are made available under the terms of the Eclipse Public License v1.0 -@rem which accompanies this distribution, and is available at -@rem http://www.eclipse.org/legal/epl-v10.html -@rem -@rem Contributors: -@rem VTT Technical Research Centre of Finland - initial API and implementation -@rem *************************************************************************** -gcc -mno-cygwin "-I%JAVA_HOME%/include" "-I%JAVA_HOME%/include/win32" -Wl,--add-stdcall-alias -shared -o ../msijni.dll msijni.c diff --git a/bundles/org.simantics.db.procore.server.environment/native/compile.sh b/bundles/org.simantics.db.procore.server.environment/native/compile.sh deleted file mode 100644 index aa239f6be..000000000 --- a/bundles/org.simantics.db.procore.server.environment/native/compile.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -# *************************************************************************** -# Copyright (c) 2007, 2010 Association for Decentralized Information Management -# in Industry THTH ry. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# VTT Technical Research Centre of Finland - initial API and implementation -# *************************************************************************** - -gcc "-I%JAVA_HOME%/include" "-I%JAVA_HOME%/include/win32" -Wl,--add-stdcall-alias -shared -o ../msijni.dll msijni.c diff --git a/bundles/org.simantics.db.procore.server.environment/native/compile_x64.bat b/bundles/org.simantics.db.procore.server.environment/native/compile_x64.bat deleted file mode 100644 index 0a34900dc..000000000 --- a/bundles/org.simantics.db.procore.server.environment/native/compile_x64.bat +++ /dev/null @@ -1,13 +0,0 @@ -@rem *************************************************************************** -@rem Copyright (c) 2007, 2010 Association for Decentralized Information Management -@rem in Industry THTH ry. -@rem All rights reserved. This program and the accompanying materials -@rem are made available under the terms of the Eclipse Public License v1.0 -@rem which accompanies this distribution, and is available at -@rem http://www.eclipse.org/legal/epl-v10.html -@rem -@rem Contributors: -@rem VTT Technical Research Centre of Finland - initial API and implementation -@rem *************************************************************************** -cl /O2 /Oi /GL "-I%JAVA_HOME%/include" "-I%JAVA_HOME%/include/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "MSIJNI_EXPORTS" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /LD /FD /Gy /W3 /nologo /c /Zi /TC /errorReport:prompt /Fomsijni.obj msijni.c -link /OUT:"..\src\msijni64.dll" /DLL /MACHINE:X64 Msi.lib msijni.obj diff --git a/bundles/org.simantics.db.procore.server.environment/native/compile_x86.bat b/bundles/org.simantics.db.procore.server.environment/native/compile_x86.bat deleted file mode 100644 index fab911fc8..000000000 --- a/bundles/org.simantics.db.procore.server.environment/native/compile_x86.bat +++ /dev/null @@ -1,13 +0,0 @@ -@rem *************************************************************************** -@rem Copyright (c) 2007, 2010 Association for Decentralized Information Management -@rem in Industry THTH ry. -@rem All rights reserved. This program and the accompanying materials -@rem are made available under the terms of the Eclipse Public License v1.0 -@rem which accompanies this distribution, and is available at -@rem http://www.eclipse.org/legal/epl-v10.html -@rem -@rem Contributors: -@rem VTT Technical Research Centre of Finland - initial API and implementation -@rem *************************************************************************** -cl /O2 /Oi /GL "-I%JAVA_HOME%/include" "-I%JAVA_HOME%/include/win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "MSIJNI_EXPORTS" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /LD /FD /Gy /W3 /nologo /c /Zi /TC /errorReport:prompt /Fomsijni.obj msijni.c -link /OUT:"..\src\msijni.dll" /DLL /MACHINE:X86 Msi.lib msijni.obj diff --git a/bundles/org.simantics.db.procore.server.environment/native/msijni.c b/bundles/org.simantics.db.procore.server.environment/native/msijni.c deleted file mode 100644 index fe60d35a1..000000000 --- a/bundles/org.simantics.db.procore.server.environment/native/msijni.c +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -#define WIN32_LEAN_AND_MEAN -#include -#include -#include "jni.h" - -JNIEXPORT jint JNICALL Java_org_simantics_db_procore_server_environment_windows_Msi_MsiQueryProductState0( - JNIEnv* env, jclass clazz, jstring productCode -) { - int result; - const jchar* lpProductCode; - - lpProductCode = (*env)->GetStringChars(env, productCode, NULL); - if (lpProductCode == 0) - return 0; - - result = MsiQueryProductState((LPCTSTR) lpProductCode); - - (*env)->ReleaseStringChars(env, productCode, lpProductCode); - - return (jint) result; -} diff --git a/bundles/org.simantics.db.procore.server.environment/native/vs2008/msijni.sln b/bundles/org.simantics.db.procore.server.environment/native/vs2008/msijni.sln deleted file mode 100644 index ddbe9d1c0..000000000 --- a/bundles/org.simantics.db.procore.server.environment/native/vs2008/msijni.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msijni", "msijni.vcproj", "{2C249AD2-A0AE-4A88-8DCD-71F96133690E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2C249AD2-A0AE-4A88-8DCD-71F96133690E}.Debug|Win32.ActiveCfg = Debug|Win32 - {2C249AD2-A0AE-4A88-8DCD-71F96133690E}.Debug|Win32.Build.0 = Debug|Win32 - {2C249AD2-A0AE-4A88-8DCD-71F96133690E}.Debug|x64.ActiveCfg = Debug|x64 - {2C249AD2-A0AE-4A88-8DCD-71F96133690E}.Debug|x64.Build.0 = Debug|x64 - {2C249AD2-A0AE-4A88-8DCD-71F96133690E}.Release|Win32.ActiveCfg = Release|Win32 - {2C249AD2-A0AE-4A88-8DCD-71F96133690E}.Release|Win32.Build.0 = Release|Win32 - {2C249AD2-A0AE-4A88-8DCD-71F96133690E}.Release|x64.ActiveCfg = Release|x64 - {2C249AD2-A0AE-4A88-8DCD-71F96133690E}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/bundles/org.simantics.db.procore.server.environment/native/vs2008/msijni.vcproj b/bundles/org.simantics.db.procore.server.environment/native/vs2008/msijni.vcproj deleted file mode 100644 index cec55e0d3..000000000 --- a/bundles/org.simantics.db.procore.server.environment/native/vs2008/msijni.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/ARCHType.java b/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/ARCHType.java deleted file mode 100644 index 67fbee589..000000000 --- a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/ARCHType.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.procore.server.environment; - -/** - * @author Tuukka Lehtonen - */ -public enum ARCHType { - PPC, PPC_64, SPARC, X86, X86_64, UNKNOWN -} \ No newline at end of file diff --git a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/ExecutionEnvironment.java b/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/ExecutionEnvironment.java deleted file mode 100644 index 10831342a..000000000 --- a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/ExecutionEnvironment.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.procore.server.environment; - - -/** - * @author Tuukka Lehtonen - */ -public final class ExecutionEnvironment { - - public final OSType os; - public final ARCHType arch; - - private ExecutionEnvironment(OSType os, ARCHType arch) { - this.os = os; - this.arch = arch; - } - - public static ExecutionEnvironment calculate() { - return new ExecutionEnvironment(calculateOS(), calculateArch()); - } - - public static ARCHType calculateArch() { - String osArch = System.getProperty("os.arch", ""); - osArch = osArch.toLowerCase(); - if (osArch.equals("i386") || osArch.equals("i586") || osArch.equals("i686") || osArch.equals("x86")) - return ARCHType.X86; - if (osArch.startsWith("amd64") || osArch.startsWith("x86_64")) - return ARCHType.X86_64; - if (osArch.equals("ppc")) - return ARCHType.PPC; - if (osArch.startsWith("ppc")) - return ARCHType.PPC_64; - if (osArch.startsWith("sparc")) - return ARCHType.SPARC; - return ARCHType.UNKNOWN; - } - - public static OSType calculateOS() { - String osName = System.getProperty("os.name", ""); - osName = osName.toLowerCase(); - if (osName.startsWith("mac os x")) - return OSType.APPLE; - if (osName.startsWith("windows")) - return OSType.WINDOWS; - if (osName.startsWith("linux")) - return OSType.LINUX; - if (osName.startsWith("sun")) - return OSType.SUN; - return OSType.UNKNOWN; - } - -} diff --git a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/ExecutionEnvironmentException.java b/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/ExecutionEnvironmentException.java deleted file mode 100644 index 5630a0914..000000000 --- a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/ExecutionEnvironmentException.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.procore.server.environment; - -import java.util.List; - -import org.simantics.db.procore.server.environment.windows.Product; - - -/** - * @author Tuukka Lehtonen - */ -public class ExecutionEnvironmentException extends Exception { - - private static final long serialVersionUID = -4189715696439554271L; - - public List requiredProducts; - - public ExecutionEnvironmentException(List requiredProducts) { - super(); - this.requiredProducts = requiredProducts; - } - - public ExecutionEnvironmentException(String message, List requiredProducts) { - super(message); - this.requiredProducts = requiredProducts; - } - -} diff --git a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/InstallException.java b/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/InstallException.java deleted file mode 100644 index 8dd0caa39..000000000 --- a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/InstallException.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.procore.server.environment; - -import java.util.List; - -import org.simantics.db.procore.server.environment.windows.Product; - - -/** - * @author Tuukka Lehtonen - */ -public class InstallException extends Exception { - - private static final long serialVersionUID = -4189715696439554271L; - - public List products; - - public InstallException(List products) { - super(); - this.products = products; - } - - public InstallException(String message, List products) { - super(message); - this.products = products; - } - - public InstallException(Throwable cause, List products) { - super(cause); - this.products = products; - } - - public InstallException(String message, Throwable cause, List products) { - super(message, cause); - this.products = products; - } - -} diff --git a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/OSType.java b/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/OSType.java deleted file mode 100644 index 8b9009548..000000000 --- a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/OSType.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.procore.server.environment; - -/** - * @author Tuukka Lehtonen - */ -public enum OSType { - APPLE, LINUX, SUN, WINDOWS, UNKNOWN -} \ No newline at end of file diff --git a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/RebootRequiredException.java b/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/RebootRequiredException.java deleted file mode 100644 index df7b0f4a1..000000000 --- a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/RebootRequiredException.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.procore.server.environment; - -import java.util.List; - -import org.simantics.db.procore.server.environment.windows.Product; - - -/** - * @author Tuukka Lehtonen - */ -public class RebootRequiredException extends InstallException { - - private static final long serialVersionUID = -4189715696439554271L; - - public RebootRequiredException(List success) { - super(success); - } - -} diff --git a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/ServerEnvironment.java b/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/ServerEnvironment.java deleted file mode 100644 index 5de87a27e..000000000 --- a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/ServerEnvironment.java +++ /dev/null @@ -1,129 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.procore.server.environment; - -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.Arrays; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.IProgressMonitor; -import org.simantics.db.procore.server.environment.windows.Msi; -import org.simantics.db.procore.server.environment.windows.Product; -import org.simantics.db.procore.server.environment.windows.ProductCodes; - -/** - * @author Tuukka Lehtonen - */ -public final class ServerEnvironment { - - // http://msdn.microsoft.com/en-us/library/aa368542(v=vs.85).aspx - private static final int ERROR_SUCCESS = 0; - private static final int ERROR_SUCCESS_REBOOT_REQUIRED = 3010; - - /** - * Checks whether the current running environment has all the necessary - * components installed to run the ProCore database server. - * - * @throws ExecutionEnvironmentException if dependencies for running the - * database server are not met - */ - public static void ensureServerDependenciesMet() throws ExecutionEnvironmentException { - ExecutionEnvironment env = ExecutionEnvironment.calculate(); - switch (env.os) { - case WINDOWS: { - switch (env.arch) { - case X86: - Msi.checkOneOfProductsInstalled(ProductCodes.VISUAL_CPP_2008_SP1_REDIST_X86_KB2467174); - break; - case X86_64: - Msi.checkProductsInstalled(ProductCodes.VISUAL_CPP_2008_SP1_REDIST_X86_KB2467174, ProductCodes.VISUAL_CPP_2008_SP1_REDIST_X64_KB2467174); - break; - } - break; - } - } - } - - /** - * Checks whether the current running environment has all the necessary - * components installed to run the ProCore database server. - * - * @throws ExecutionEnvironmentException if dependencies for running the - * database server are not met - */ - public static void tryInstallDependencies(IProgressMonitor monitor) throws InstallException { - ExecutionEnvironment env = ExecutionEnvironment.calculate(); - switch (env.os) { - case WINDOWS: { - switch (env.arch) { - case X86: - runInstaller(monitor, ProductCodes.VISUAL_CPP_2008_SP1_REDIST_X86_KB2467174, "VC90.2008.SP1.KB2467174.redist.x86.exe"); - break; - case X86_64: - runInstaller(monitor, ProductCodes.VISUAL_CPP_2008_SP1_REDIST_X86_KB2467174, "VC90.2008.SP1.KB2467174.redist.x86.exe"); - runInstaller(monitor, ProductCodes.VISUAL_CPP_2008_SP1_REDIST_X64_KB2467174, "VC90.2008.SP1.KB2467174.redist.x64.exe"); - break; - } - break; - } - } - } - - private static void runInstaller(IProgressMonitor monitor, Product product, String installerPath) throws InstallException { - try { - URL url = FileLocator.find(new URL("platform:/plugin/org.simantics.db.procore.server.environment/" + installerPath)); - URL fileUrl = FileLocator.toFileURL(url); - final File file = new File(fileUrl.getFile()); - System.out.println(file); - - Process installer = new ProcessBuilder("cmd.exe", "/C", file.toString(), "/qb").start(); - while (true) { - try { - int exitValue = installer.exitValue(); - //System.out.println("installation done, exit code: " + exitValue); - switch (exitValue) { - case ERROR_SUCCESS: - return; - case ERROR_SUCCESS_REBOOT_REQUIRED: - throw new RebootRequiredException(Arrays.asList(product)); - } - throw new InstallException("Installation of " + product.getDescription() + " failed with error code " + exitValue, Arrays.asList(product)); - } catch (IllegalThreadStateException e) { -// if (monitor.isCanceled()) { -// installer.destroy(); -// } - // Not done yet. - try { - //System.out.println("sleeping"); - Thread.sleep(250); - } catch (InterruptedException ie) { - } - } - } - } catch (IOException e) { - throw new InstallException(e, Arrays.asList(product)); - } - } - - // ------------------------------------------------------------------------- - - public static void main(String[] args) { - try { - ensureServerDependenciesMet(); - } catch (ExecutionEnvironmentException e) { - e.printStackTrace(); - } - } - -} diff --git a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/windows/Msi.java b/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/windows/Msi.java deleted file mode 100644 index 19a55c494..000000000 --- a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/windows/Msi.java +++ /dev/null @@ -1,245 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.procore.server.environment.windows; - -import java.io.Closeable; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.net.URLDecoder; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.Arrays; - -import org.simantics.db.procore.server.environment.ExecutionEnvironment; -import org.simantics.db.procore.server.environment.ExecutionEnvironmentException; - -/** - * Provides Java access to Windows Msi API functions: - *
    - *
  • {@link #MsiQueryProductState(String)} (see MSDN)
  • - *
- * - * @author Tuukka Lehtonen - */ -public class Msi { - - public static void checkOneOfProductsInstalled(Product... products) throws ExecutionEnvironmentException { - StringBuilder sb = new StringBuilder(); - sb.append("None of the following products are installed properly:\n"); - for (Product product : products) { - ProductState state = Msi.MsiQueryProductState(product.getCode()); - switch (state) { - case DEFAULT: - // One of the listed products is installed OK. - return; - default: - sb.append("\t" + product); - sb.append(" - MsiQueryProductState returned "); - sb.append(state); - sb.append("\n"); - } - } - throw new ExecutionEnvironmentException("Cannot run ProCore database server in this environment due to the following problems:\n" + sb.toString(), Arrays.asList(products)); - } - - public static void checkProductsInstalled(Product... products) throws ExecutionEnvironmentException { - StringBuilder sb = new StringBuilder(); - for (Product product : products) { - ProductState state = Msi.MsiQueryProductState(product.getCode()); - switch (state) { - case DEFAULT: - // Installed OK - continue; - default: - sb.append("\tProduct " + product + " is not installed properly, MsiQueryProductState returned " + state); - sb.append("\n"); - } - } - if (sb.length() > 0) { - // Something is not installed right, throw exception - throw new ExecutionEnvironmentException("Cannot run ProCore database server in this environment due to the following problems:\n" + sb.toString(), Arrays.asList(products)); - } - } - - // ------------------------------------------------------------------------- - - public static ProductState MsiQueryProductState(String productCode) { - int result = MsiQueryProductState0(productCode); - return ProductState.of(result); - } - - private static native int MsiQueryProductState0(String productCode); - - // ------------------------------------------------------------------------- - - private static final String DLL_NAME = "msijni.dll"; - private static final String DLL_NAME_64 = "msijni64.dll"; - - static { - initialize(); - } - - private static void initialize() { - ExecutionEnvironment env = ExecutionEnvironment.calculate(); - String libName = null; - switch (env.arch) { - case X86: - libName = DLL_NAME; - break; - case X86_64: - libName = DLL_NAME_64; - break; - default: - return; - } - - URL libURL = Msi.class.getResource("/" + libName); - if (libURL != null) { - try { - if ("file".equals(libURL.getProtocol())) { - File path = new File(URLDecoder.decode(libURL.getPath(), "UTF-8")); - initialize(path); - } else { - File libFile = extractLib(libURL, libName); - initialize(libFile); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - private static void initialize(File path) { - //System.out.println("load msijni: " + path); - System.load(path.toString()); - } - - /** - * Extracts the specified source file in the specified bundle into the - * specified local directory. - * - * @param url the source URL to stream the resource from - * @param targetFile the target file to write the resource to - * @param deleteOnExit true to use {@link File#deleteOnExit()} - * on the resulting file. Note that this does not guarantee that the - * file is deleted when the JVM exits - * @return the resulting file - * @throws FileNotFoundException - */ - private static File copyResource(URL url, File targetFile) throws IOException, FileNotFoundException { - FileOutputStream os = null; - InputStream is = null; - try { - if (targetFile.exists()) - targetFile.delete(); - - is = url.openStream(); - int read; - byte [] buffer = new byte [16384]; - os = new FileOutputStream (targetFile); - while ((read = is.read (buffer)) != -1) { - os.write(buffer, 0, read); - } - os.close (); - is.close (); - - return targetFile; - } finally { - uncheckedClose(os); - uncheckedClose(is); - } - } - - - private static void uncheckedClose(Closeable closeable) { - try { - if (closeable != null) - closeable.close(); - } catch (IOException e) { - //ignore - } - } - - private static File extractLib(URL libURL, String libName) throws FileNotFoundException, IOException { - String tmpDirStr = System.getProperty("java.io.tmpdir"); - if (tmpDirStr == null) - throw new NullPointerException("java.io.tmpdir property is null"); - File tmpDir = new File(tmpDirStr); - File libFile = new File(tmpDir, libName); - - if (libFile.exists()) { - if (libFile.isFile()) { - try { - byte[] origSum = computeSum(libURL); - byte[] targetSum = computeSum(libFile); - if (Arrays.equals(origSum, targetSum)) - return libFile; - } catch (NoSuchAlgorithmException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - - return copyResource(libURL, libFile); - } - - public static byte[] computeSum(InputStream in) throws IOException { - if (in == null) - throw new IllegalArgumentException("Input cannot be null!"); - - try { - MessageDigest md = MessageDigest.getInstance("MD5"); - byte[] data = new byte[64 * 1024]; - - while (true) { - int read = in.read(data); - if (read == -1) { - return md.digest(); - } - md.update(data, 0, read); - } - } catch (NoSuchAlgorithmException e) { - // Should not be possible for MD5 - throw new IOException(e); - } - } - - public static byte[] computeSum(File f) throws IOException, NoSuchAlgorithmException { - InputStream in = null; - try { - in = new FileInputStream(f); - return computeSum(in); - } finally { - if (in != null) - in.close(); - } - } - - public static byte[] computeSum(URL url) throws IOException, NoSuchAlgorithmException { - InputStream in = null; - try { - in = url.openStream(); - return computeSum(in); - } finally { - if (in != null) - in.close(); - } - } - -} \ No newline at end of file diff --git a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/windows/Product.java b/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/windows/Product.java deleted file mode 100644 index 098dd1d1a..000000000 --- a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/windows/Product.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.procore.server.environment.windows; - -/** - * @author Tuukka Lehtonen - */ -public class Product { - - private final String code; - private final String description; - - public Product(String code, String description) { - this.code = code; - this.description = description; - } - - public String getCode() { - return code; - } - - public String getDescription() { - return description; - } - - @Override - public String toString() { - return description + " - " + code; - } - -} diff --git a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/windows/ProductCodes.java b/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/windows/ProductCodes.java deleted file mode 100644 index 493f4d4cf..000000000 --- a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/windows/ProductCodes.java +++ /dev/null @@ -1,116 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.procore.server.environment.windows; - -/** - * @author Tuukka Lehtonen - */ -public final class ProductCodes { - -// // Visual C++ 2008 runtime files -// -// // Visual C++ 2008 Redistributable Package (x86) -// // {FF66E9F6-83E7-3A3E-AF14-8DE9A809A6A4} -// public static final Product VISUAL_CPP_2008_REDIST_X86 = new Product("{FF66E9F6-83E7-3A3E-AF14-8DE9A809A6A4}", -// "Visual C++ 2008 Redistributable Package (x86)"); -// -// // Visual C++ 2008 Redistributable Package (x64) -// // {350AA351-21FA-3270-8B7A-835434E766AD} -// public static final Product VISUAL_CPP_2008_REDIST_X64 = new Product("{350AA351-21FA-3270-8B7A-835434E766AD}", -// "Visual C++ 2008 Redistributable Package (x64)"); -// -// // Visual C++ 2008 Redistributable Package (ia64) -// // {2B547B43-DB50-3139-9EBE-37D419E0F5FA} -// public static final Product VISUAL_CPP_2008_REDIST_IA64 = new Product("{2B547B43-DB50-3139-9EBE-37D419E0F5FA}", -// "Visual C++ 2008 Redistributable Package (ia64)"); - - // Visual C++ 2008 SP1 runtime files - - // THIS ONE IS CURRENTLY USED BY ProCore - - // Visual C++ 2008 SP1 Redistributable Package (x86) - // {9A25302D-30C0-39D9-BD6F-21E6EC160475} - // Date Published: 9/16/2008 - // 9.0.30729.17 - // http://www.microsoft.com/downloads/en/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en - public static final Product VISUAL_CPP_2008_SP1_REDIST_X86 = new Product("{9A25302D-30C0-39D9-BD6F-21E6EC160475}", - "Visual C++ 2008 SP1 Redistributable Package (x86) (v9.0.30729.17)"); - - // Visual C++ 2008 SP1 Redistributable Package (x86) KB2467174 - // {86CE85E6-DBAC-3FFD-B977-E4B79F83C909} - // Date Published: 4/12/2011 - // 9.0.30729.5570 - // http://support.microsoft.com/kb/2467174 - // http://www.microsoft.com/downloads/en/details.aspx?familyid=05ce856d-8128-408b-96fa-5e1f57b097d8&displaylang=en - public static final Product VISUAL_CPP_2008_SP1_REDIST_X86_KB2467174 = new Product("{86CE85E6-DBAC-3FFD-B977-E4B79F83C909}", - "Microsoft Visual C++ 2008 Redistributable - KB2467174 - x86 9.0.30729.5570"); - - // Visual C++ 2008 SP1 Redistributable Package (x64) - // {8220EEFE-38CD-377E-8595-13398D740ACE} - // Date Published: 8/9/2008 - // 9.0.30729.17 - // http://www.microsoft.com/downloads/en/details.aspx?familyid=BA9257CA-337F-4B40-8C14-157CFDFFEE4E&displaylang=en - public static final Product VISUAL_CPP_2008_SP1_REDIST_X64 = new Product("{8220EEFE-38CD-377E-8595-13398D740ACE}", - "Visual C++ 2008 SP1 Redistributable Package (x64) (v9.0.30729.17)"); - - // Visual C++ 2008 SP1 Redistributable Package (x64) KB2467174 - // {8338783A-0968-3B85-AFC7-BAAE0A63DC50} - // Date Published: 4/12/2011 - // 9.0.30729.5570 - // http://support.microsoft.com/kb/2467174 - // http://www.microsoft.com/downloads/en/details.aspx?familyid=05ce856d-8128-408b-96fa-5e1f57b097d8&displaylang=en - public static final Product VISUAL_CPP_2008_SP1_REDIST_X64_KB2467174 = new Product("{8338783A-0968-3B85-AFC7-BAAE0A63DC50}", - "Microsoft Visual C++ 2008 Redistributable - KB2467174 - x64 9.0.30729.5570"); - -// // Visual C++ 2008 SP1 Redistributable Package (ia64) -// // {5827ECE1-AEB0-328E-B813-6FC68622C1F9} -// // Date Published: 8/9/2008 -// // 9.0.30729.17 -// // http://www.microsoft.com/downloads/en/details.aspx?FamilyID=DCC211E6-AB82-41D6-8DEC-C79937393FE8&displaylang=en -// public static final Product VISUAL_CPP_2008_SP1_REDIST_IA64 = new Product("{5827ECE1-AEB0-328E-B813-6FC68622C1F9}", -// "Visual C++ 2008 SP1 Redistributable Package (ia64) (v9.0.30729.17)"); - - // Visual C++ 2010 runtime files - - // Visual C++ 2010 Redistributable Package (x86) - // {196BB40D-1578-3D01-B289-BEFC77A11A1E} - public static final Product VISUAL_CPP_2010_REDIST_X86 = new Product("{196BB40D-1578-3D01-B289-BEFC77A11A1E}", - "Visual C++ 2010 Redistributable Package (x86)"); - - // Visual C++ 2010 Redistributable Package (x64) - // {DA5E371C-6333-3D8A-93A4-6FD5B20BCC6E} - public static final Product VISUAL_CPP_2010_REDIST_X64 = new Product("{DA5E371C-6333-3D8A-93A4-6FD5B20BCC6E}", - "Visual C++ 2010 Redistributable Package (x64)"); - - // Visual C++ 2010 Redistributable Package (ia64) - // {C1A35166-4301-38E9-BA67-02823AD72A1B} - public static final Product VISUAL_CPP_2010_REDIST_IA64 = new Product("{C1A35166-4301-38E9-BA67-02823AD72A1B}", - "Visual C++ 2010 Redistributable Package (ia64)"); - - // Visual C++ 2010 SP1 runtime files - - // Visual C++ 2010 SP1 Redistributable Package (x86) - // {F0C3E5D1-1ADE-321E-8167-68EF0DE699A5} - public static final Product VISUAL_CPP_2010_SP1_REDIST_X86 = new Product("{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}", - "Visual C++ 2010 SP1 Redistributable Package (x86)"); - - // Visual C++ 2010 SP1 Redistributable Package (x64) - // {1D8E6291-B0D5-35EC-8441-6616F567A0F7} - public static final Product VISUAL_CPP_2010_SP1_REDIST_X64 = new Product("{1D8E6291-B0D5-35EC-8441-6616F567A0F7}", - "Visual C++ 2010 SP1 Redistributable Package (x64)"); - - // Visual C++ 2010 SP1 Redistributable Package (ia64) - // {88C73C1C-2DE5-3B01-AFB8-B46EF4AB41CD} - public static final Product VISUAL_CPP_2010_SP1_REDIST_IA64 = new Product("{88C73C1C-2DE5-3B01-AFB8-B46EF4AB41CD}", - "Visual C++ 2010 SP1 Redistributable Package (ia64)"); - -} diff --git a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/windows/ProductState.java b/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/windows/ProductState.java deleted file mode 100644 index d57199936..000000000 --- a/bundles/org.simantics.db.procore.server.environment/src/org/simantics/db/procore/server/environment/windows/ProductState.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.procore.server.environment.windows; - -/** - * The possible return values of Win32 API call MsiQueryProductState enumerated. - * - * @author Tuukka Lehtonen - */ -public enum ProductState { - - /** - * An invalid parameter was passed to the function. - */ - INVALIDARG(-2), - - /** - * The product is not advertised or installed. - */ - UNKNOWN(-1), - - /** - * Indicates invocation of {@link Msi#MsiQueryProductState(String)} failed. - */ - FAILED(0), - - /** - * The product is advertised but not installed. - */ - ADVERTISED(1), - - /** - * The product is installed for a different user. - */ - ABSENT(2), - - /** - * The product is installed for a different user. - */ - DEFAULT(5); - - int code; - - ProductState(int code) { - this.code = code; - } - - public static ProductState of(int code) { - switch (code) { - case -2: return INVALIDARG; - case -1: return UNKNOWN; - case 0: return FAILED; - case 1: return ADVERTISED; - case 2: return ABSENT; - case 5: return DEFAULT; - default: throw new IllegalArgumentException("unrecognized product install state return code: " + code); - } - } - - @Override - public String toString() { - return name() + "(" + code + ")"; - } - -} diff --git a/bundles/org.simantics.db.server/build.properties b/bundles/org.simantics.db.server/build.properties index 9b0a72394..f69fe447b 100644 --- a/bundles/org.simantics.db.server/build.properties +++ b/bundles/org.simantics.db.server/build.properties @@ -12,7 +12,4 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ - .,\ - win32.x86/,\ - win32.x86_64/,\ - linux.x86_64/ + . \ No newline at end of file diff --git a/bundles/org.simantics.db.server/linux.x86_64/ProCoreServer b/bundles/org.simantics.db.server/linux.x86_64/ProCoreServer deleted file mode 100644 index fdfbdc0a3..000000000 Binary files a/bundles/org.simantics.db.server/linux.x86_64/ProCoreServer and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86/ACE.dll b/bundles/org.simantics.db.server/win32.x86/ACE.dll deleted file mode 100644 index 5717358e9..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86/ACE.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86/ProCoreServer.exe b/bundles/org.simantics.db.server/win32.x86/ProCoreServer.exe deleted file mode 100644 index a74c8fdc7..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86/ProCoreServer.exe and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86/boost_chrono-vc110-mt-1_55.dll b/bundles/org.simantics.db.server/win32.x86/boost_chrono-vc110-mt-1_55.dll deleted file mode 100644 index 7c3816f1e..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86/boost_chrono-vc110-mt-1_55.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86/boost_date_time-vc110-mt-1_55.dll b/bundles/org.simantics.db.server/win32.x86/boost_date_time-vc110-mt-1_55.dll deleted file mode 100644 index cf0e781a7..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86/boost_date_time-vc110-mt-1_55.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86/boost_filesystem-vc110-mt-1_55.dll b/bundles/org.simantics.db.server/win32.x86/boost_filesystem-vc110-mt-1_55.dll deleted file mode 100644 index 38550ee47..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86/boost_filesystem-vc110-mt-1_55.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86/boost_regex-vc110-mt-1_55.dll b/bundles/org.simantics.db.server/win32.x86/boost_regex-vc110-mt-1_55.dll deleted file mode 100644 index b0caf246c..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86/boost_regex-vc110-mt-1_55.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86/boost_system-vc110-mt-1_55.dll b/bundles/org.simantics.db.server/win32.x86/boost_system-vc110-mt-1_55.dll deleted file mode 100644 index 158ecc9c0..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86/boost_system-vc110-mt-1_55.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86/boost_thread-vc110-mt-1_55.dll b/bundles/org.simantics.db.server/win32.x86/boost_thread-vc110-mt-1_55.dll deleted file mode 100644 index c7112dcb0..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86/boost_thread-vc110-mt-1_55.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86/msvcp110.dll b/bundles/org.simantics.db.server/win32.x86/msvcp110.dll deleted file mode 100644 index 93fab5683..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86/msvcp110.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86/msvcr110.dll b/bundles/org.simantics.db.server/win32.x86/msvcr110.dll deleted file mode 100644 index 1ce960d75..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86/msvcr110.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86_64/ACE.dll b/bundles/org.simantics.db.server/win32.x86_64/ACE.dll deleted file mode 100644 index 58be406c9..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86_64/ACE.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86_64/ProCoreServer.exe b/bundles/org.simantics.db.server/win32.x86_64/ProCoreServer.exe deleted file mode 100644 index 89b1f7191..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86_64/ProCoreServer.exe and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86_64/boost_chrono-vc110-mt-1_55.dll b/bundles/org.simantics.db.server/win32.x86_64/boost_chrono-vc110-mt-1_55.dll deleted file mode 100644 index 14fb2741f..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86_64/boost_chrono-vc110-mt-1_55.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86_64/boost_date_time-vc110-mt-1_55.dll b/bundles/org.simantics.db.server/win32.x86_64/boost_date_time-vc110-mt-1_55.dll deleted file mode 100644 index fc91104a7..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86_64/boost_date_time-vc110-mt-1_55.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86_64/boost_filesystem-vc110-mt-1_55.dll b/bundles/org.simantics.db.server/win32.x86_64/boost_filesystem-vc110-mt-1_55.dll deleted file mode 100644 index 44c8bce76..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86_64/boost_filesystem-vc110-mt-1_55.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86_64/boost_regex-vc110-mt-1_55.dll b/bundles/org.simantics.db.server/win32.x86_64/boost_regex-vc110-mt-1_55.dll deleted file mode 100644 index 62938b2d7..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86_64/boost_regex-vc110-mt-1_55.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86_64/boost_system-vc110-mt-1_55.dll b/bundles/org.simantics.db.server/win32.x86_64/boost_system-vc110-mt-1_55.dll deleted file mode 100644 index 0e0a2305c..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86_64/boost_system-vc110-mt-1_55.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86_64/boost_thread-vc110-mt-1_55.dll b/bundles/org.simantics.db.server/win32.x86_64/boost_thread-vc110-mt-1_55.dll deleted file mode 100644 index 3606c30c7..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86_64/boost_thread-vc110-mt-1_55.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86_64/lzo2.dll b/bundles/org.simantics.db.server/win32.x86_64/lzo2.dll deleted file mode 100644 index 1c777649e..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86_64/lzo2.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86_64/msvcp110.dll b/bundles/org.simantics.db.server/win32.x86_64/msvcp110.dll deleted file mode 100644 index 7e278956d..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86_64/msvcp110.dll and /dev/null differ diff --git a/bundles/org.simantics.db.server/win32.x86_64/msvcr110.dll b/bundles/org.simantics.db.server/win32.x86_64/msvcr110.dll deleted file mode 100644 index dd484a588..000000000 Binary files a/bundles/org.simantics.db.server/win32.x86_64/msvcr110.dll and /dev/null differ diff --git a/bundles/org.simantics.db.testing/src/org/simantics/db/testing/common/TestHandler.java b/bundles/org.simantics.db.testing/src/org/simantics/db/testing/common/TestHandler.java deleted file mode 100644 index ecda4ccb6..000000000 --- a/bundles/org.simantics.db.testing/src/org/simantics/db/testing/common/TestHandler.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.simantics.db.testing.common; - -import java.io.File; -import java.io.IOException; -import java.util.Properties; - -import org.eclipse.core.runtime.Platform; -import org.simantics.db.Driver; -import org.simantics.db.Driver.Management; -import org.simantics.db.Manager; -import org.simantics.db.ServerI; -import org.simantics.db.Session; -import org.simantics.db.SessionManager; -import org.simantics.db.SessionReference; -import org.simantics.db.exception.DatabaseException; - -import fi.vtt.simantics.procore.ProCoreServerReference; -import fi.vtt.simantics.procore.ProCoreSessionReference; -import fi.vtt.simantics.procore.SessionManagerSource; - -/** - * ProCore specific test handler. - * - */ -public class TestHandler { -// private final TestSettings testSettings; - private final Driver driver; - private final File dbFolder; - TestHandler(TestSettings testSettings, String dbFolderName) throws DatabaseException { -// this.testSettings = testSettings; - driver = Manager.getDriver("procore"); - if (null == dbFolderName) - dbFolder = Platform.getLocation().append("db").toFile(); - else - dbFolder = new File(dbFolderName); - } - void initNew() throws DatabaseException { - Management m = getManagement(); - if (m.exist()) - m.delete(); - m.create(); - } - void initIfNeccessary() throws DatabaseException { - Management m = getManagement(); - if (!m.exist()) - m.create(); - } - public Session getSession() throws DatabaseException { - // Note that we normally user authentication agent for user identification. - Properties props = new Properties(); - props.setProperty("user", "Default User"); - props.setProperty("password", ""); - return driver.getSession(dbFolder.getAbsolutePath(), props); - } - public ServerI getServer() throws DatabaseException { - return driver.getServer(dbFolder.getAbsolutePath(), null); - } - public Management getManagement() throws DatabaseException { - return driver.getManagement(dbFolder.getAbsolutePath(), null); - } - public Session regSession(long sessionId) throws DatabaseException, IOException { - SessionManager sm = SessionManagerSource.getSessionManager(); - ProCoreServerReference ser = new ProCoreServerReference(dbFolder.toPath()); - SessionReference ses = new ProCoreSessionReference(ser, sessionId); - return sm.createSession(ses, null); - } - -} \ No newline at end of file diff --git a/bundles/org.simantics.project/src/org/simantics/project/management/ServerManagerFactory.java b/bundles/org.simantics.project/src/org/simantics/project/management/ServerManagerFactory.java index 444585bbd..feec73dc9 100644 --- a/bundles/org.simantics.project/src/org/simantics/project/management/ServerManagerFactory.java +++ b/bundles/org.simantics.project/src/org/simantics/project/management/ServerManagerFactory.java @@ -11,16 +11,7 @@ *******************************************************************************/ package org.simantics.project.management; -import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLDecoder; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; import org.simantics.db.DatabaseUserAgent; import org.simantics.db.Driver; @@ -42,168 +33,5 @@ public class ServerManagerFactory { driver.setDatabaseUserAgent(address, agent); return new ServerManager(driver); } - /** - * Create a server manager in OSGi platform. - * - * @return - * @throws IOException - * @throws ClassNotFoundException - * @throws RuntimeException unexpected problem with OSGi environment - */ - public static ServerManager createOSGI() throws IOException, RuntimeException { - try { - ClassLoader cl = ServerManager.class.getClassLoader(); - - // Object bundle = Platform.getBundle("org.simantics.db.build"); - Class Platform_class = cl.loadClass("org.eclipse.core.runtime.Platform"); - Method Platform_getBundle = Platform_class.getMethod("getBundle", String.class); - Object bundle = Platform_getBundle.invoke(null, "org.simantics.db.build"); - if (bundle==null) throw new RuntimeException("Bundle org.simantics.db.build not found."); - - // URL db_build_url = bundle.getEntry("/"); - Class Bundle_class = cl.loadClass("org.osgi.framework.Bundle"); - Method Bundle_getEntry = Bundle_class.getMethod("getEntry", String.class); - URL db_build_url = (URL) Bundle_getEntry.invoke(bundle, "/"); - - // URL db_build_file_url = FileLocator.toFileURL( db_build_url ); - Class FileLocator_class = cl.loadClass("org.eclipse.core.runtime.FileLocator"); - Method FileLocator_toFileURL = FileLocator_class.getMethod("toFileURL", URL.class); - URL db_build_file_url = (URL) FileLocator_toFileURL.invoke(null, db_build_url); - - @SuppressWarnings("unused") - String buildFile = URLDecoder.decode(db_build_file_url.getPath(), "UTF-8"); - -// File db_build_file = new File( buildFile ); - //return new ServerManager( db_build_file ); - throw new RuntimeException("ServerManager.createOSGI not implemented."); - } catch( ClassNotFoundException e ) { - throw new RuntimeException(e); - } catch (SecurityException e) { - throw new RuntimeException(e); - } catch (NoSuchMethodException e) { - throw new RuntimeException(e); - } catch (IllegalArgumentException e) { - throw new RuntimeException(e); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (InvocationTargetException e) { - throw new RuntimeException(e.getCause()); - } - } - - /** - * Create a server manager in an POJO environment. - * - * @return - * @throws IOException - */ - public static ServerManager createPOJO() throws IOException { - String tempPath = System.getenv("tmp"); - if (tempPath==null) tempPath = "c:/temp/"; - File driverDir = new File(tempPath+"/core_drivers"); - if (!driverDir.exists()) { - System.out.println("Extracting Core drivers to "+driverDir); - driverDir.mkdirs(); - ServerManagerFactory.extractDrivers(driverDir); - } else { - System.out.println("Loading Core drivers from "+driverDir); - } - //return new ServerManager(driverDir); - throw new RuntimeException("ServerManager.createPOJO not implemented."); - } - - public static ServerManager createPOJO(File driverDir) throws IOException { - //return new ServerManager(driverDir); - throw new RuntimeException("ServerManager.createPOJO not implemented."); - } - - static ServerManager cached; - - public static boolean isOSGi() { - try { - ServerManager.class.getClassLoader().loadClass("org.osgi.framework.Bundle"); - return true; - } catch (ClassNotFoundException e) { - return false; - } - } - - public synchronized static ServerManager getServerManager() { - if (cached!=null) return cached; - try { - try { - return createOSGI(); - } catch(RuntimeException e) { - return createPOJO(); - } - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - - /** - * Extracts drivers files to a location. - * - * @param path location where to extract application files - * @throws IOException - */ - public static void extractDrivers(File path) - throws IOException - { - // Extract org.simantics.db.build.zip to workspace - InputStream is = ServerManager.class.getResource("org.simantics.db.build.zip").openStream(); - try { - extractZip(is, path); - } finally { - is.close(); - } - } - - /** - * Extract a zip file into a directory - * - * @param zipInput - * @param dst directory - * @throws IOException - */ - private static void extractZip(InputStream zipInput, File dst) throws IOException { - byte[] buf = new byte[8192]; - ZipInputStream zis = new ZipInputStream(zipInput); - ZipEntry entry; - - entry = zis.getNextEntry(); - while (entry != null) { - // for each entry to be extracted - String name = entry.getName(); - LOGGER.debug("Extracting "+name); - File file = new File(dst, name); - - if (entry.isDirectory()) - { - if ( !file.exists() ) file.mkdirs(); - } else { - File parent = file.getParentFile(); - if (!parent.exists()) parent.mkdirs(); - if (!file.exists()) file.createNewFile(); - - FileOutputStream fileoutputstream = new FileOutputStream(file); - try { - int n = 0; - while ((n = zis.read(buf, 0, buf.length)) > -1) - fileoutputstream.write(buf, 0, n); - } finally { - fileoutputstream.close(); - } - } - - zis.closeEntry(); - entry = zis.getNextEntry(); - }// while - - zis.close(); - } - - -} +} \ No newline at end of file diff --git a/bundles/org.simantics.project/src/org/simantics/project/management/org.simantics.db.build.zip b/bundles/org.simantics.project/src/org/simantics/project/management/org.simantics.db.build.zip deleted file mode 100644 index e31cdabd4..000000000 Binary files a/bundles/org.simantics.project/src/org/simantics/project/management/org.simantics.db.build.zip and /dev/null differ diff --git a/bundles/org.simantics.project/src/org/simantics/project/management/server_template.cnfg b/bundles/org.simantics.project/src/org/simantics/project/management/server_template.cnfg deleted file mode 100644 index 840437855..000000000 --- a/bundles/org.simantics.project/src/org/simantics/project/management/server_template.cnfg +++ /dev/null @@ -1,27 +0,0 @@ -# Journal options. -# If 0 then write journal. (default) -# If 1 then write journal with additional debug information. -# If 2 then do not write journal. -journal_reportFileMode=1 - -# Log file. -common_logFile=../server.log - -# Log levels. -#common_logLevels=trace -#common_logLevels=debug -#common_logLevels=info -#common_logLevels=warning - -# Log packages. -#common_logPackages=main -#common_logPackages=session -#common_logPackages=memory -#common_logPackages=transaction -#common_logPackages=extension -#common_logPackages=utility -#common_logPackages=test -#common_logPackages=value -#common_logPackages=revision -#common_logPackages=graph -#common_logPackages=page diff --git a/bundles/org.simantics.workbench/META-INF/MANIFEST.MF b/bundles/org.simantics.workbench/META-INF/MANIFEST.MF index 5b183ad68..47e0c5c7e 100644 --- a/bundles/org.simantics.workbench/META-INF/MANIFEST.MF +++ b/bundles/org.simantics.workbench/META-INF/MANIFEST.MF @@ -27,7 +27,6 @@ Require-Bundle: com.ibm.icu, org.simantics.layer0;bundle-version="1.0.0", org.simantics.graph.db;bundle-version="1.0.0", org.simantics.editors;bundle-version="1.0.0", - org.simantics.db.procore.server.environment;bundle-version="1.1.0", org.simantics;bundle-version="1.0.0";visibility:=reexport, org.simantics.workbench.ontology;bundle-version="1.0.0", org.simantics.workbench.search;bundle-version="1.5.0", @@ -37,7 +36,6 @@ Require-Bundle: com.ibm.icu, org.simantics.simulation.ui;bundle-version="1.1.0";visibility:=reexport, org.simantics.scenegraph.profile;bundle-version="1.0.0";visibility:=reexport, org.simantics.browsing.ui.model;bundle-version="1.0.0";visibility:=reexport, - org.simantics.db.procore.ui, org.eclipse.ui.workbench, org.eclipse.e4.ui.workbench;bundle-version="1.3.0", org.eclipse.e4.ui.model.workbench;bundle-version="1.1.100.v20150407-1430", diff --git a/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchAdvisor.java b/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchAdvisor.java index 6f70bc56e..cb1ee16d3 100644 --- a/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchAdvisor.java +++ b/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchAdvisor.java @@ -96,8 +96,6 @@ import org.simantics.application.arguments.IArguments; import org.simantics.application.arguments.SimanticsArguments; import org.simantics.db.common.Indexing; import org.simantics.db.indexing.DatabaseIndexing; -import org.simantics.db.procore.server.environment.RebootRequiredException; -import org.simantics.db.procore.server.environment.windows.Product; import org.simantics.project.IProject; import org.simantics.project.ProjectKeys; import org.simantics.ui.SimanticsUI; @@ -465,19 +463,7 @@ public class SimanticsWorkbenchAdvisor extends WorkbenchAdvisor { return false; } catch (Exception e) { log.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e)); - - Throwable cause = e.getCause(); - if (cause instanceof RebootRequiredException) { - RebootRequiredException rre = (RebootRequiredException) cause; - StringBuilder msg = new StringBuilder(); - msg.append("The application must be restarted after installing the following products:\n"); - for (Product product : rre.products) - msg.append("\t" + product + "\n"); - msg.append("\nThe application will now close."); - MessageDialog.openInformation(null, "Restart Required", msg.toString()); - } else { - new ShowError("Platform Startup Failed", "Simantics Platform startup failed:\n\n" + e.getMessage(), e, true); - } + new ShowError("Platform Startup Failed", "Simantics Platform startup failed:\n\n" + e.getMessage(), e, true); return false; } diff --git a/bundles/org.simantics/META-INF/MANIFEST.MF b/bundles/org.simantics/META-INF/MANIFEST.MF index dcc2bf9ef..1a1102e20 100644 --- a/bundles/org.simantics/META-INF/MANIFEST.MF +++ b/bundles/org.simantics/META-INF/MANIFEST.MF @@ -9,7 +9,6 @@ Require-Bundle: org.eclipse.core.runtime;visibility:=reexport, org.simantics.db.layer0;bundle-version="1.1.0";visibility:=reexport, org.simantics.db.management;bundle-version="1.1.0";visibility:=reexport, org.simantics.project;bundle-version="1.0.1";visibility:=reexport, - org.simantics.db.procore.server.environment;bundle-version="1.1.0", org.simantics.graph.db;bundle-version="1.1.5", org.eclipse.equinox.p2.metadata;bundle-version="2.0.0", org.apache.log4j;bundle-version="1.2.15", diff --git a/bundles/org.simantics/src/org/simantics/internal/SessionUtil.java b/bundles/org.simantics/src/org/simantics/internal/SessionUtil.java deleted file mode 100644 index 86bc76467..000000000 --- a/bundles/org.simantics/src/org/simantics/internal/SessionUtil.java +++ /dev/null @@ -1,102 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Semantum Oy - initial API and implementation - *******************************************************************************/ -package org.simantics.internal; - -import java.io.File; -import java.util.Properties; -import java.util.UUID; - -import org.eclipse.core.runtime.IProduct; -import org.eclipse.core.runtime.Platform; -import org.simantics.db.ServerEx; -import org.simantics.db.Session; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.service.LifecycleSupport; -import org.simantics.db.service.XSupport; -import org.simantics.project.management.ServerManager; -import org.simantics.project.management.ServerManagerFactory; - -/** - * An as-simple-as-possible utility class for starting a Simantics database - * instance and opening a connection ({@link Session}) to it. - * - *

- * To get up and running, simply invoke: - *

- *     SessionUtil util = new SessionUtil("my-client-id");
- *     try {
- *         File workspaceLocation = ...;
- *         Session session = util.openSession(workspaceLocation);
- *         // do something with the database session
- *     } finally {
- *         util.close();
- *     }
- * 
- * - *

- * This class is a provisional utility, pending for public inclusion. - * - * @author Tuukka Lehtonen - * @see Session - */ -public class SessionUtil { - - private String clientId; - @SuppressWarnings("unused") - private File workspace; - - private ServerManager serverManager; - private ServerEx server; - private Session session; - - public static String getApplicationClientId() { - IProduct product = Platform.getProduct(); - if(product == null) return "noProduct"; - String application = product.getApplication(); - return application != null ? application : UUID.randomUUID().toString(); - } - - public SessionUtil() { - this(UUID.randomUUID().toString()); - } - - public SessionUtil(String clientId) { - serverManager = ServerManagerFactory.getServerManager(); - this.clientId = clientId; - } - - public void close() throws DatabaseException { - if (session != null) { - session.getService(LifecycleSupport.class).close(); - } - serverManager.close(); - } - -// public Session open(File workspace) throws IOException, DatabaseException { -// File dbDir = new File(workspace, "db"); -// if (!dbDir.exists() || !dbDir.isDirectory()) -// throw new FileNotFoundException("database directory " + dbDir + " not found"); -// server = serverManager.getServer(dbDir); -// server.start(null); -// session = openSession(server, dbDir); -// this.workspace = workspace; -// return session; -// } - - private Session openSession(ServerEx server, File dbDir) throws DatabaseException { - Properties info = new Properties(ServerManager.DEFAULT); - session = server.createSession(info); - session.getService(XSupport.class).setServiceMode(true, true); - return session; - } - -} diff --git a/bundles/pom.xml b/bundles/pom.xml index 6469aaff9..e90980faf 100644 --- a/bundles/pom.xml +++ b/bundles/pom.xml @@ -88,7 +88,6 @@ org.simantics.db.layer0 org.simantics.db.management org.simantics.db.procore - org.simantics.db.procore.server.environment org.simantics.db.procore.ui org.simantics.db.server org.simantics.db.services diff --git a/features/org.simantics.db.client.feature/feature.xml b/features/org.simantics.db.client.feature/feature.xml index c7c3a7c01..9a8ddfb72 100644 --- a/features/org.simantics.db.client.feature/feature.xml +++ b/features/org.simantics.db.client.feature/feature.xml @@ -67,12 +67,6 @@ version="0.0.0" unpack="false"/> - - - -