1
|
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
|
2
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
|
3
|
<%@page import="eu.etaxonomy.cdm.server.Bootloader"%>
|
4
|
<%@page import="java.util.Set"%>
|
5
|
<%@page import="java.net.URL"%>
|
6
|
<%@page import="eu.etaxonomy.cdm.server.CdmInstanceProperties"%>
|
7
|
<%@page import="eu.etaxonomy.cdm.server.JvmManager"%>
|
8
|
<%@page import="java.io.IOException"%>
|
9
|
<%!// the servelt context must use the class loader of the Bootloader class otherwise
|
10
|
// getting the status will not work in mulithreading environments !!!
|
11
|
Bootloader bootloader = Bootloader.getBootloader();%>
|
12
|
|
13
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
14
|
|
15
|
<head>
|
16
|
<title>CDM Server</title>
|
17
|
<link type="text/css" rel="stylesheet" media="all"
|
18
|
href="../css/style.css" />
|
19
|
<link type="text/css" rel="stylesheet" media="all"
|
20
|
href="../css/server.css" />
|
21
|
<script type="text/javascript" src="../js/jquery.js"></script>
|
22
|
<script type="text/javascript" src="../js/oai-pmh-status.js"></script>
|
23
|
<script type="text/javascript" src="../js/memory-status.js"></script>
|
24
|
<script type="text/javascript" src="../js/instance-status.js"></script>
|
25
|
</head>
|
26
|
<body class="layout-main">
|
27
|
<div id="page" class="clearfix">
|
28
|
<div id="header-wrapper">
|
29
|
<div id="header" class="clearfix">
|
30
|
<div id="header-first">
|
31
|
<div id="logo"></div>
|
32
|
<h1>CDM Server</h1>
|
33
|
</div>
|
34
|
<!-- /header-first -->
|
35
|
</div>
|
36
|
<!-- /header -->
|
37
|
</div>
|
38
|
<!-- /header-wrapper -->
|
39
|
|
40
|
<div id="primary-menu-wrapper" class="clearfix">
|
41
|
<div id="primary-menu">
|
42
|
<div id="version"><%=bootloader.readCdmRemoteVersion()%></div>
|
43
|
</div>
|
44
|
<!-- /primary_menu -->
|
45
|
</div>
|
46
|
<!-- /primary-menu-wrapper -->
|
47
|
|
48
|
<div id="main-wrapper">
|
49
|
<div id="main" class="clearfix">
|
50
|
|
51
|
<div id="sidebar-first"></div>
|
52
|
<!-- /sidebar-first -->
|
53
|
|
54
|
<div id="content-wrapper">
|
55
|
<div id="content">
|
56
|
<!-- ============================= -->
|
57
|
<div class="block-wrapper">
|
58
|
<h2 class="title block-title pngfix">Server Status</h2>
|
59
|
<div class="block" id="status">
|
60
|
<!-- The memory status will be rendered by memory-status.js -->
|
61
|
</div>
|
62
|
</div>
|
63
|
|
64
|
|
65
|
<div class="block-wrapper">
|
66
|
<div class="block" id="datasources">
|
67
|
<h2 class="title block-title pngfix">CDM Server Instances</h2>
|
68
|
<div class="container">
|
69
|
<table>
|
70
|
<tr>
|
71
|
<th>Path</th>
|
72
|
<th></th>
|
73
|
<th>Database Url</th>
|
74
|
<th>Status</th>
|
75
|
<th>OAI-PMH Provider</th>
|
76
|
</tr>
|
77
|
<%
|
78
|
java.util.List<CdmInstanceProperties> configAndStatus = bootloader.getConfigAndStatus();
|
79
|
if (configAndStatus != null) {
|
80
|
int i = 0;
|
81
|
for (CdmInstanceProperties props : configAndStatus) {
|
82
|
i++;
|
83
|
|
84
|
String basePath = props.getDataSourceName();
|
85
|
/* URL fullURL = new URL(request.getScheme(),
|
86
|
request.getServerName(),
|
87
|
request.getServerPort(),
|
88
|
basePath); */
|
89
|
|
90
|
String fullURL = "../" + basePath;
|
91
|
|
92
|
String oddOrEven = i % 2 == 0 ? "odd" : "even";
|
93
|
String noBottomBorder = props.getStatus().equals(CdmInstanceProperties.Status.error) ? " style=\"border-bottom:none;\""
|
94
|
: "";
|
95
|
|
96
|
out.append("<tr id=\"" + basePath + "\" class=\"entry " + oddOrEven + "\" " + noBottomBorder + ">");
|
97
|
out.append("<td class=\"base-url\"><a href=\"" + fullURL + "/\">" + basePath + "</a></td>");
|
98
|
out.append("<td class=\"test-url\"><a href=\"" + fullURL + "/portal/classification\">Test</a></td>");
|
99
|
out.append("<td class=\"db-url\">" + props.getUrl() + "</td>");
|
100
|
out.append("<td class=\"status " + props.getStatus() + "\">" + props.getStatus() + "</td>");
|
101
|
|
102
|
// OAI-PMH Status will be requested using javascript
|
103
|
out.append("<td class=\"oai-pmh\">requesting status ...</td>");
|
104
|
out.append("</tr>");
|
105
|
if (props.getStatus().equals(CdmInstanceProperties.Status.error) || !props.isEnabled()) {
|
106
|
out.append("<tr id=\"" + basePath + "-error-log\" class=\"error-log " + oddOrEven + "\">");
|
107
|
out.append("<td></td><td class=\"error\" colspan=\"4\">");
|
108
|
for (String problem : props.getProblems()) {
|
109
|
out.append("<div>" + problem + "</div>");
|
110
|
}
|
111
|
out.append("</td>");
|
112
|
out.append("</tr>");
|
113
|
}
|
114
|
}
|
115
|
}
|
116
|
%>
|
117
|
</table>
|
118
|
</div>
|
119
|
</div>
|
120
|
</div>
|
121
|
<%
|
122
|
/*
|
123
|
<div class="block-wrapper">
|
124
|
<div class="block" id="test">
|
125
|
<h2 class="title block-title pngfix">Test your CDM Server (using the default data base)</h2>
|
126
|
<form name="input" action="/default/portal/taxon/find" method="get">
|
127
|
<input type="text" name="query"></br>
|
128
|
<input type="submit" value="submit">
|
129
|
</form>
|
130
|
</div>
|
131
|
</div><!-- test -->
|
132
|
*/
|
133
|
%>
|
134
|
<!-- ============================= -->
|
135
|
</div>
|
136
|
<!-- /content -->
|
137
|
</div>
|
138
|
<!-- /content-wrapper -->
|
139
|
|
140
|
<div id="footer" class="clearfix">
|
141
|
The CDM Server is a component of the <a
|
142
|
href="http://wp5.e-taxonomy.eu/">EDIT Platform for
|
143
|
Cybertaxonomy</a>.
|
144
|
</div>
|
145
|
<!-- /footer -->
|
146
|
|
147
|
</div>
|
148
|
<!-- /main -->
|
149
|
</div>
|
150
|
<!-- /main-wrapper -->
|
151
|
</div>
|
152
|
<!-- /page -->
|
153
|
</body>
|
154
|
</html>
|