From 7afcd3c090bb6f4f1a1c6ea237c261d7950e4c1c Mon Sep 17 00:00:00 2001
From: tluutho <tluutho@chuv.ch>
Date: Thu, 25 Feb 2016 18:31:54 +0100
Subject: [PATCH] final : prod URL

---
 pom.xml                                       |  3 +
 src/main/resources/hibernate.cfg.xml          | 64 +++++++++----------
 .../resources/spring/application-context.xml  | 14 +---
 start.bat                                     |  1 +
 4 files changed, 35 insertions(+), 47 deletions(-)
 create mode 100644 start.bat

diff --git a/pom.xml b/pom.xml
index 94ff7bd03..c27428f13 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,6 +30,7 @@
 				<connection.password>root</connection.password>
 				<hibernate.dialect>org.hibernate.dialect.H2Dialect</hibernate.dialect>
 				<schema.deploy>true</schema.deploy>
+                <frontend.redirect>http://frontend/#/home</frontend.redirect>
 			</properties>
 		</profile>
 		<profile>
@@ -43,6 +44,7 @@
 				<connection.password>iaezXODVLb1e70I</connection.password>
 				<hibernate.dialect>org.hibernate.dialect.PostgreSQL82Dialect</hibernate.dialect>
 				<schema.deploy>false</schema.deploy>
+                <frontend.redirect>https://mip.humanbrainproject.eu/#/home</frontend.redirect>
 			</properties>
 		</profile>
         <profile>
@@ -56,6 +58,7 @@
                 <connection.password>test</connection.password>
                 <hibernate.dialect>org.hibernate.dialect.PostgreSQL82Dialect</hibernate.dialect>
                 <schema.deploy>false</schema.deploy>
+                <frontend.redirect>http://frontend/#/home</frontend.redirect>
             </properties>
         </profile>
 	</profiles>
diff --git a/src/main/resources/hibernate.cfg.xml b/src/main/resources/hibernate.cfg.xml
index 044c40c22..8cfe9a4c0 100644
--- a/src/main/resources/hibernate.cfg.xml
+++ b/src/main/resources/hibernate.cfg.xml
@@ -1,34 +1,30 @@
-<?xml version='1.0' encoding='utf-8'?>
-<!DOCTYPE hibernate-configuration PUBLIC
-        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
-        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
-
-<hibernate-configuration>
-    <session-factory>
-        <property name="connection.driver_class">${connection.driver_class}</property>
-        <property name="connection.url">${connection.url}</property>
-        <property name="connection.username">${connection.username}</property>
-        <property name="connection.password">${connection.password}</property>
-        <property name="hibernate.format_sql">true</property>
-        <property name="connection.pool_size">1</property>
-        <property name="hibernate.dialect">${hibernate.dialect}</property>
-        <property name="current_session_context_class">thread</property>
-        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
-        <property name="hibernate.show_sql">false</property>
-        <property name="hibernate.hbm2ddl.auto">update</property>
-
-        <mapping class="org.hbp.mip.model.Article"/>
-        <mapping class="org.hbp.mip.model.Chart"/>
-        <mapping class="org.hbp.mip.model.ChartConfigSet"/>
-        <mapping class="org.hbp.mip.model.Dataset"/>
-        <mapping class="org.hbp.mip.model.Model"/>
-        <mapping class="org.hbp.mip.model.Query"/>
-        <mapping class="org.hbp.mip.model.Tag"/>
-        <mapping class="org.hbp.mip.model.User"/>
-        <mapping class="org.hbp.mip.model.Value"/>
-        <mapping class="org.hbp.mip.model.Variable"/>
-        <mapping class="org.hbp.mip.model.Filter"/>
-        <mapping class="org.hbp.mip.model.Group"/>
-
-    </session-factory>
-</hibernate-configuration>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+                                         "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+ <session-factory name="">
+  <property name="connection.driver_class">${connection.driver_class}</property>
+  <property name="connection.url">${connection.url}</property>
+  <property name="connection.username">${connection.username}</property>
+  <property name="connection.password">${connection.password}</property>
+  <property name="hibernate.format_sql">true</property>
+  <property name="connection.pool_size">1</property>
+  <property name="hibernate.dialect">${hibernate.dialect}</property>
+  <property name="current_session_context_class">thread</property>
+  <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
+  <property name="hibernate.show_sql">false</property>
+  <property name="hibernate.hbm2ddl.auto">update</property>
+  <mapping class="org.hbp.mip.model.Article"/>
+  <mapping class="org.hbp.mip.model.Chart"/>
+  <mapping class="org.hbp.mip.model.ChartConfigSet"/>
+  <mapping class="org.hbp.mip.model.Dataset"/>
+  <mapping class="org.hbp.mip.model.Model"/>
+  <mapping class="org.hbp.mip.model.Query"/>
+  <mapping class="org.hbp.mip.model.Tag"/>
+  <mapping class="org.hbp.mip.model.User"/>
+  <mapping class="org.hbp.mip.model.Value"/>
+  <mapping class="org.hbp.mip.model.Variable"/>
+  <mapping class="org.hbp.mip.model.Filter"/>
+  <mapping class="org.hbp.mip.model.Group"/>
+ </session-factory>
+</hibernate-configuration>
diff --git a/src/main/resources/spring/application-context.xml b/src/main/resources/spring/application-context.xml
index f2a04f231..fb31f6f72 100644
--- a/src/main/resources/spring/application-context.xml
+++ b/src/main/resources/spring/application-context.xml
@@ -8,18 +8,6 @@
 	<context:component-scan base-package="org.hbp.mip" />
 
 	<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
-<!-- 
-		<property name="dataSource">
-			<bean id="idDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
-				<property name="driverClassName" value="${connection.driver_class}" />
-				<property name="url" value="${connection.url}" />
-				<property name="username" value="${connection.username}" />
-				<property name="password" value="${connection.password}" />
-			</bean>
-
-		</property>
- -->
-		
 		<property name="packagesToScan">
  			<list>
  				<value>org.hbp.mip.model</value>
@@ -37,7 +25,7 @@
 		<constructor-arg value="/login/hbp"></constructor-arg>
 		<property name="authenticationSuccessHandler">
 			<bean class="org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler">
-				<property name="defaultTargetUrl" value="http://frontend/#/home" />
+				<property name="defaultTargetUrl" value="${frontend.redirect}" />
 			</bean>
 		</property>
 		<property name="restTemplate">
diff --git a/start.bat b/start.bat
new file mode 100644
index 000000000..af12a1b52
--- /dev/null
+++ b/start.bat
@@ -0,0 +1 @@
+start java -jar target\backend-services-0.0.1-SNAPSHOT.jar  --spring.config.location=config\application.yml
\ No newline at end of file
-- 
GitLab