From ff552159252a3d1cbe006bd0395b421f41720822 Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@hostsharing.net>
Date: Mon, 16 May 2011 13:54:15 +0200
Subject: [PATCH] URLs in web.xml aus ant-properties

---
 hsarweb/build.xml            |   12 ++++++++++++
 hsarweb/conf/WEB-INF/web.xml |   14 +++++++-------
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/hsarweb/build.xml b/hsarweb/build.xml
index 0a0d023..fa0554f 100644
--- a/hsarweb/build.xml
+++ b/hsarweb/build.xml
@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project name="hsarweb" default="war">
 
+	<property file="${user.home}/.hsar.ant.properties" />
+
 	<path id="cp">
 		<fileset dir="WebContent/WEB-INF/lib">
 		    <include name="**/*.jar"/>
@@ -11,6 +13,16 @@
 	</path>
 	
 	<target name="war" depends="compile">
+		<copy file="conf/WEB-INF/web.xml" todir="WebContent/WEB-INF/">
+			<filterset>
+				<filter token="LOGIN_HOST" value="${cas.domain.name}"/>
+				<filter token="LOGIN_PORT" value="${cas.https.port}"/>
+				<filter token="CONFIG_HOST" value="${hsar.domain.name}"/>
+				<filter token="CONFIG_PORT" value="${hsar.https.port}"/>
+				<filter token="ADMIN_HOST" value="${hsarweb.domain.name}"/>
+				<filter token="ADMIN_PORT" value="${hsarweb.https.port}"/>
+			</filterset>
+		</copy>
         <war destfile="build/hsarweb.war" basedir="WebContent">
         	<classes dir="build/cls" />
         	<classes dir="src">
diff --git a/hsarweb/WebContent/WEB-INF/web.xml b/hsarweb/conf/WEB-INF/web.xml
similarity index 82%
rename from hsarweb/WebContent/WEB-INF/web.xml
rename to hsarweb/conf/WEB-INF/web.xml
index d9b0749..fc6e8d0 100644
--- a/hsarweb/WebContent/WEB-INF/web.xml
+++ b/hsarweb/conf/WEB-INF/web.xml
@@ -11,11 +11,11 @@
 	</context-param>
 	<context-param>
 		<param-name>backendURL</param-name>
-		<param-value>https://agnes.ostwall195.de:9443/hsar/backend</param-value>
+		<param-value>https://@CONFIG_HOST@:@CONFIG_PORT@/hsar/backend</param-value>
 	</context-param>
 	<context-param>
 		<param-name>xmlrpcURL</param-name>
-		<param-value>https://agnes.ostwall195.de:9443/hsar/xmlrpc/hsadmin</param-value>
+		<param-value>https://@CONFIG_HOST@:@CONFIG_PORT@/hsar/xmlrpc/hsadmin</param-value>
 	</context-param>
 	<context-param>
 		<description>Vaadin production mode</description>
@@ -28,11 +28,11 @@
 		<filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
 		<init-param>
 			<param-name>casServerLoginUrl</param-name>
-			<param-value>https://agnes.ostwall195.de:9443/cas/login</param-value>
+			<param-value>https://@LOGIN_HOST@:@LOGIN_PORT@/cas/login</param-value>
 		</init-param>
 		<init-param>
 			<param-name>service</param-name>
-			<param-value>https://agnes.ostwall195.de:8443/hsarweb</param-value>
+			<param-value>https://@ADMIN_HOST@:@ADMIN_PORT@/hsarweb</param-value>
 		</init-param>
 	</filter>
 
@@ -41,7 +41,7 @@
 		<filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
 		<init-param>
 			<param-name>casServerUrlPrefix</param-name>
-			<param-value>https://agnes.ostwall195.de:9443/cas</param-value>
+			<param-value>https://@LOGIN_HOST@:@LOGIN_PORT@/cas</param-value>
 		</init-param>
 		<init-param>
         	<param-name>proxyReceptorUrl</param-name>
@@ -49,11 +49,11 @@
         </init-param>
         <init-param>
         	<param-name>proxyCallbackUrl</param-name>
-            <param-value>https://agnes.ostwall195.de:8443/hsarweb/proxyCallback</param-value>
+            <param-value>https://@ADMIN_HOST@:@ADMIN_PORT@/hsarweb/proxyCallback</param-value>
         </init-param>
 		<init-param>
 			<param-name>service</param-name>
-			<param-value>https://agnes.ostwall195.de:8443/hsarweb</param-value>
+			<param-value>https://@ADMIN_HOST@:@ADMIN_PORT@/hsarweb</param-value>
 		</init-param>
 	</filter>
 	

--
Gitblit v1.9.3