Konfiguration in web.xml

This commit is contained in:
Peter Hormanns 2010-10-05 19:43:30 +00:00
parent 726244a061
commit ccf0a7958a
4 changed files with 34 additions and 10 deletions

View File

@ -28,10 +28,15 @@ public class Context {
} }
public String getProxyTicket() { public String getProxyTicket() {
return getPrincipal().getProxyTicketFor("https://agnes.ostwall195.de:9443/hsar/backend"); String backendURL = getContextParam("backendURL");
return getPrincipal().getProxyTicketFor(backendURL);
} }
public String getContextPath() { public String getContextPath() {
return getExternalContext().getRequestContextPath(); return getExternalContext().getRequestContextPath();
} }
public String getContextParam(String name) {
return getExternalContext().getInitParameter(name);
}
} }

View File

@ -22,14 +22,7 @@ public class Remote {
private Context context; private Context context;
public Remote() throws HsarwebException { public Remote() throws HsarwebException {
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); client = null;
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);
} }
public Object callSearch(String module, String user, Map<String, String> where) throws HsarwebException { public Object callSearch(String module, String user, Map<String, String> where) throws HsarwebException {
@ -39,13 +32,28 @@ public class Remote {
params[2] = where; params[2] = where;
Object res; Object res;
try { try {
res = client.execute(module + ".search", params); res = getClient().execute(module + ".search", params);
} catch (XmlRpcException e) { } catch (XmlRpcException e) {
throw new HsarwebException("error in remote server call", e); throw new HsarwebException("error in remote server call", e);
} }
return res; 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) { public void setContext(Context context) {
this.context = context; this.context = context;
} }

View File

@ -8,6 +8,14 @@
<param-name>serverName</param-name> <param-name>serverName</param-name>
<param-value>http://agnes.ostwall195.de:8180</param-value> <param-value>http://agnes.ostwall195.de:8180</param-value>
</context-param> </context-param>
<context-param>
<param-name>backendURL</param-name>
<param-value>https://agnes.ostwall195.de:9443/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>
</context-param>
<filter> <filter>
<filter-name>CAS Authentication Filter</filter-name> <filter-name>CAS Authentication Filter</filter-name>

View File

@ -66,6 +66,9 @@ body {
padding-top:0px; padding-top:0px;
padding-left:10px; padding-left:10px;
padding-right:10px; padding-right:10px;
border-left-style: solid;
border-left-width: 1px;
border-left-color: #dd4901;
} }
.footer { .footer {
width:944px; width:944px;