From ccf0a7958af9b3dd9a5d1e46cfe9e1b91f342ba5 Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Tue, 5 Oct 2010 19:43:30 +0000 Subject: [PATCH] Konfiguration in web.xml --- hsarweb/src/de/hsadmin/web/Context.java | 7 ++++++- hsarweb/src/de/hsadmin/web/Remote.java | 26 ++++++++++++++++-------- hsarweb/webapp/WEB-INF/web.xml | 8 ++++++++ hsarweb/webapp/resources/styles/hsar.css | 3 +++ 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/hsarweb/src/de/hsadmin/web/Context.java b/hsarweb/src/de/hsadmin/web/Context.java index 8139f8a..7b257b1 100644 --- a/hsarweb/src/de/hsadmin/web/Context.java +++ b/hsarweb/src/de/hsadmin/web/Context.java @@ -28,10 +28,15 @@ public class Context { } public String getProxyTicket() { - return getPrincipal().getProxyTicketFor("https://agnes.ostwall195.de:9443/hsar/backend"); + String backendURL = getContextParam("backendURL"); + return getPrincipal().getProxyTicketFor(backendURL); } public String getContextPath() { return getExternalContext().getRequestContextPath(); } + + public String getContextParam(String name) { + return getExternalContext().getInitParameter(name); + } } diff --git a/hsarweb/src/de/hsadmin/web/Remote.java b/hsarweb/src/de/hsadmin/web/Remote.java index ad61670..388f3ed 100644 --- a/hsarweb/src/de/hsadmin/web/Remote.java +++ b/hsarweb/src/de/hsadmin/web/Remote.java @@ -22,14 +22,7 @@ public class Remote { private Context context; public Remote() throws HsarwebException { - XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); - try { - config.setServerURL(new URL("https://agnes.ostwall195.de:9443/hsar/xmlrpc/hsadmin")); - } catch (MalformedURLException e) { - throw new HsarwebException("error in remote server url", e); - } - client = new XmlRpcClient(); - client.setConfig(config); + client = null; } public Object callSearch(String module, String user, Map where) throws HsarwebException { @@ -39,13 +32,28 @@ public class Remote { params[2] = where; Object res; try { - res = client.execute(module + ".search", params); + res = getClient().execute(module + ".search", params); } catch (XmlRpcException e) { throw new HsarwebException("error in remote server call", e); } return res; } + private XmlRpcClient getClient() throws HsarwebException { + if (client == null) { + XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); + try { + String xmlrpcURL = context.getContextParam("xmlrpcURL"); + config.setServerURL(new URL(xmlrpcURL)); + } catch (MalformedURLException e) { + throw new HsarwebException("error in remote server url", e); + } + client = new XmlRpcClient(); + client.setConfig(config); + } + return client; + } + public void setContext(Context context) { this.context = context; } diff --git a/hsarweb/webapp/WEB-INF/web.xml b/hsarweb/webapp/WEB-INF/web.xml index 1a88366..aa5f931 100644 --- a/hsarweb/webapp/WEB-INF/web.xml +++ b/hsarweb/webapp/WEB-INF/web.xml @@ -8,6 +8,14 @@ serverName http://agnes.ostwall195.de:8180 + + backendURL + https://agnes.ostwall195.de:9443/hsar/backend + + + xmlrpcURL + https://agnes.ostwall195.de:9443/hsar/xmlrpc/hsadmin + CAS Authentication Filter diff --git a/hsarweb/webapp/resources/styles/hsar.css b/hsarweb/webapp/resources/styles/hsar.css index 4d2f7d7..2157e31 100644 --- a/hsarweb/webapp/resources/styles/hsar.css +++ b/hsarweb/webapp/resources/styles/hsar.css @@ -66,6 +66,9 @@ body { padding-top:0px; padding-left:10px; padding-right:10px; + border-left-style: solid; + border-left-width: 1px; + border-left-color: #dd4901; } .footer { width:944px;