From 38c04dbd19cd066457ab51e689c48d47b9bcb070 Mon Sep 17 00:00:00 2001
From: Nils Christian Ehmke <nie@informatik.uni-kiel.de>
Date: Sun, 12 May 2013 16:59:14 +0200
Subject: [PATCH] Started with the version string problem.

---
 .../webgui/persistence/impl/FSProjectDAOImpl.java      |  7 +++++--
 .../web/beans/application/GlobalPropertiesBean.java    | 10 ++++++++++
 Kieker.WebGUI/src/main/resources/global.properties     |  3 +++
 .../src/main/webapp/WEB-INF/spring-bean-config.xml     |  1 +
 4 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/FSProjectDAOImpl.java b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/FSProjectDAOImpl.java
index 9e674b61..9c791acd 100644
--- a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/FSProjectDAOImpl.java
+++ b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/FSProjectDAOImpl.java
@@ -67,6 +67,7 @@ import kieker.webgui.persistence.impl.util.Class2ModelInstanceConverter;
 import kieker.webgui.persistence.impl.util.CloseableURLClassLoader;
 import kieker.webgui.persistence.impl.util.PluginFinder;
 import kieker.webgui.persistence.impl.util.SimpleCastFunction;
+import kieker.webgui.web.beans.application.GlobalPropertiesBean;
 
 import org.primefaces.model.UploadedFile;
 
@@ -89,7 +90,7 @@ public class FSProjectDAOImpl implements IProjectDAO, ReleaseListener {
 	private static final Log LOG = LogFactory.getLog(FSProjectDAOImpl.class);
 
 	private static final MIAnalysisMetaModelFactory FACTORY = MIAnalysisMetaModelFactory.eINSTANCE;
-	private static final String KIEKER_LIB = "kieker-1.8-SNAPSHOT-emf.jar";
+	// private static final String KIEKER_LIB = "kieker-1.8-SNAPSHOT-emf.jar";
 	private static final String META_FILE = "meta.dat";
 	private static final String KAX_EXTENSION = "kax";
 	private static final String LIB_EXTENSION = "jar";
@@ -101,6 +102,8 @@ public class FSProjectDAOImpl implements IProjectDAO, ReleaseListener {
 	private static final String PROPERTY_KEY_ANALYSIS_LAYOUT = "analysis layout";
 	private static final String PROPERTY_KEY_COCKPIT_LAYOUT = "cockpit layout";
 
+	@Autowired
+	private GlobalPropertiesBean globalPropertiesBean;
 	@Autowired
 	private PluginFinder pluginFinder;
 	@Autowired
@@ -716,7 +719,7 @@ public class FSProjectDAOImpl implements IProjectDAO, ReleaseListener {
 	 * @return The kieker url.
 	 */
 	private URL getKiekerURL() {
-		return Thread.currentThread().getContextClassLoader().getResource(FSProjectDAOImpl.KIEKER_LIB);
+		return Thread.currentThread().getContextClassLoader().getResource(this.globalPropertiesBean.getKiekerJarFileName());
 	}
 
 	/*
diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/application/GlobalPropertiesBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/application/GlobalPropertiesBean.java
index 8299dd86..5746a8d5 100644
--- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/application/GlobalPropertiesBean.java
+++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/application/GlobalPropertiesBean.java
@@ -74,6 +74,8 @@ public class GlobalPropertiesBean implements Serializable {
 	private String analysisEditorDefaultGridSize;
 	private String analysisEditorDefaultGridColor;
 
+	private String kiekerJarFileName;
+
 	/**
 	 * Default constructor. <b>Do not use this constructor. This bean is Spring managed.</b>
 	 */
@@ -145,6 +147,14 @@ public class GlobalPropertiesBean implements Serializable {
 		return this.themeCookieName;
 	}
 
+	public String getKiekerJarFileName() {
+		return this.kiekerJarFileName;
+	}
+
+	public void setKiekerJarFileName(final String kiekerJarFileName) {
+		this.kiekerJarFileName = kiekerJarFileName;
+	}
+
 	public String getMsgProjectLoadingException() {
 		return GlobalPropertiesBean.getLocalizedString(GlobalPropertiesBean.PROPERTY_MSG_PROJECT_LOADING_EXCEPTION);
 	}
diff --git a/Kieker.WebGUI/src/main/resources/global.properties b/Kieker.WebGUI/src/main/resources/global.properties
index 01314c96..fa0e9278 100644
--- a/Kieker.WebGUI/src/main/resources/global.properties
+++ b/Kieker.WebGUI/src/main/resources/global.properties
@@ -23,3 +23,6 @@ kieker.webgui.config.analysisEditor.defaultGridColor = dbdbdb
 #------------------------------------------------------------------------------
 
 kieker.webgui.page.projectOverview = projectOverview
+
+
+kieker.webgui.common.kieker.jar = kieker-1.8-SNAPSHOT-emf.jar
\ No newline at end of file
diff --git a/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-bean-config.xml b/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-bean-config.xml
index 4f6555c9..f25e6799 100644
--- a/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-bean-config.xml
+++ b/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-bean-config.xml
@@ -18,6 +18,7 @@
         <property name="analysisEditorGridColorCookieName" value="${kieker.webgui.config.analysisEditor.gridColor.cookieName}"/>
         <property name="analysisEditorDefaultGridSize" value="${kieker.webgui.config.analysisEditor.defaultGridSize}"/>
         <property name="analysisEditorDefaultGridColor" value="${kieker.webgui.config.analysisEditor.defaultGridColor}"/>
+        <property name="kiekerJarFileName" value="${kieker.webgui.common.kieker.jar}"/>
     </bean>
     
     <bean id="themeSwitcherBean" class="kieker.webgui.web.beans.application.ThemeSwitcherBean">
-- 
GitLab