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() {
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);
}
}

View File

@ -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<String, String> 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;
}

View File

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

View File

@ -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;