1
|
<%@page import="org.codehaus.jackson.node.ArrayNode"
|
2
|
%><%@ page contentType="application/json;charset=UTF-8" language="java"
|
3
|
%><%@page import="eu.etaxonomy.cdm.server.Bootloader"
|
4
|
%><%@page import="eu.etaxonomy.cdm.server.instance.CdmInstance"
|
5
|
%><%@page import="java.util.Set"
|
6
|
%><%@page import="java.net.URL"
|
7
|
%><%@page import="org.codehaus.jackson.map.ObjectMapper"
|
8
|
%><%@page import="org.codehaus.jackson.JsonNode"
|
9
|
%><%@page import="org.codehaus.jackson.node.ObjectNode"
|
10
|
%><%@page import="eu.etaxonomy.cdm.server.instance.Configuration"
|
11
|
%><%//////////////////////////////////////////////////////////////////////////////////
|
12
|
//
|
13
|
// The BootloaderService service exposes the Bootloader.getConfigAndStatus()
|
14
|
// property as webservice. Before beeing serialized to JSON the ConfigAndStatus
|
15
|
// properties will be extended by the basePath of the cdm-remote instances.
|
16
|
// For security the password field will be hidden!
|
17
|
//
|
18
|
//////////////////////////////////////////////////////////////////////////////////
|
19
|
|
20
|
ObjectMapper jsonMapper = new ObjectMapper();
|
21
|
|
22
|
response.setHeader("Content-Type", "application/json;charset=UTF-8");
|
23
|
|
24
|
// the servelt context must use the class loader of the Bootloader class otherwise
|
25
|
// getting the status will not work in multihreading environments !!!
|
26
|
Bootloader bootloader = Bootloader.getBootloader();
|
27
|
|
28
|
ObjectNode infoNode = jsonMapper.createObjectNode();
|
29
|
infoNode.put("cdmlibServicesVersion", bootloader.getCdmlibServicesVersion());
|
30
|
infoNode.put("cdmlibServicesLastModified", bootloader.getCdmlibServicesLastModified());
|
31
|
|
32
|
out.append(infoNode.toString());
|
33
|
%>
|