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
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
8
|
|
9
|
<head>
|
10
|
<title>CDM Server</title>
|
11
|
<meta http-equiv="refresh" content="3; URL=/" />
|
12
|
<link type="text/css" rel="stylesheet" media="all" href="/css/style.css" />
|
13
|
<link type="text/css" rel="stylesheet" media="all" href="/css/server.css" />
|
14
|
<script type="text/javascript" src="/js/jquery.js"></script>
|
15
|
<script type="text/javascript" src="/js/oai-pmh-status.js"></script>
|
16
|
</head>
|
17
|
<body class="layout-main">
|
18
|
<div id="page" class="clearfix">
|
19
|
<div id="header-wrapper">
|
20
|
<div id="header" class="clearfix">
|
21
|
<div id="header-first">
|
22
|
<div id="logo">
|
23
|
</div>
|
24
|
<h1>CDM Server</h1>
|
25
|
</div><!-- /header-first -->
|
26
|
</div><!-- /header -->
|
27
|
</div><!-- /header-wrapper -->
|
28
|
|
29
|
<div id="primary-menu-wrapper" class="clearfix">
|
30
|
<div id="primary-menu">
|
31
|
</div><!-- /primary_menu -->
|
32
|
</div><!-- /primary-menu-wrapper -->
|
33
|
|
34
|
<div id="main-wrapper">
|
35
|
<div id="main" class="clearfix">
|
36
|
|
37
|
<div id="sidebar-first">
|
38
|
</div><!-- /sidebar-first -->
|
39
|
|
40
|
<div id="content-wrapper">
|
41
|
<div id="content">
|
42
|
<!-- ============================= -->
|
43
|
<div class="block-wrapper">
|
44
|
<h2 class="title block-title pngfix">Server Status</h2>
|
45
|
<div class="block" id="status">
|
46
|
Status: <div class="status_value">RUNNING</div>
|
47
|
</div>
|
48
|
</div>
|
49
|
|
50
|
|
51
|
<div class="block-wrapper">
|
52
|
<div class="block" id="datasources">
|
53
|
<h2 class="title block-title pngfix">CDM Server Instances</h2>
|
54
|
<table>
|
55
|
<tr><th>Path</th><th>Database Url</th><th>Status</th><th>OAI-PMH Provider</th></tr>
|
56
|
<%
|
57
|
// the servelt context must use the class loader of the Bootloader class otherwise
|
58
|
// getting the status will not work in mulithreading environments !!!
|
59
|
Bootloader bootloader = Bootloader.getBootloader();
|
60
|
java.util.Set<CdmInstanceProperties> configAndStatus = bootloader.getConfigAndStatus();
|
61
|
if(configAndStatus != null){
|
62
|
int i = 0;
|
63
|
for(CdmInstanceProperties props : configAndStatus){
|
64
|
i++;
|
65
|
String basePath = "/" + props.getDataSourceName();
|
66
|
URL fullURL = new URL(request.getScheme(),
|
67
|
request.getServerName(),
|
68
|
request.getServerPort(),
|
69
|
basePath);
|
70
|
|
71
|
String oddOrEven = i % 2 == 0 ? "odd" : "even";
|
72
|
String noBottomBorder = props.getStatus().equals(CdmInstanceProperties.Status.error) ? " style=\"border-bottom:none;\"" : "";
|
73
|
|
74
|
out.append("<tr class=\"entry " + oddOrEven + "\" " +noBottomBorder+ ">");
|
75
|
out.append("<td class=\"base-url\"><a href=\"" + fullURL + "/portal/taxonTree\">" + basePath + "</a></td>");
|
76
|
out.append("<td class=\"db-url\">" + props.getUrl() + "</td>");
|
77
|
out.append("<td class=\"status " + props.getStatus() + "\">" + props.getStatus() + "</td>");
|
78
|
|
79
|
// OAI-PMH Status will be requested using javascript
|
80
|
out.append("<td class=\"oai-pmh\">requesting status ...</td>");
|
81
|
out.append("</tr>");
|
82
|
if(props.getStatus().equals(CdmInstanceProperties.Status.error) || !props.isEnabled()){
|
83
|
out.append("<tr class=\"error-log " + oddOrEven + "\">");
|
84
|
out.append("<td></td><td class=\"error\" colspan=\"3\">");
|
85
|
for( String problem : props.getProblems()){
|
86
|
out.append("<div>" + problem + "</div>");
|
87
|
}
|
88
|
out.append("</td>");
|
89
|
out.append("</tr>");
|
90
|
}
|
91
|
}
|
92
|
}
|
93
|
%>
|
94
|
</table>
|
95
|
</div>
|
96
|
</div>
|
97
|
<%/*
|
98
|
<div class="block-wrapper">
|
99
|
<div class="block" id="test">
|
100
|
<h2 class="title block-title pngfix">Test your CDM Server (using the default data base)</h2>
|
101
|
<form name="input" action="/default/portal/taxon/find" method="get">
|
102
|
<input type="text" name="query"></br>
|
103
|
<input type="submit" value="submit">
|
104
|
</form>
|
105
|
</div>
|
106
|
</div><!-- test -->
|
107
|
*/
|
108
|
%>
|
109
|
<!-- ============================= -->
|
110
|
</div><!-- /content -->
|
111
|
</div><!-- /content-wrapper -->
|
112
|
|
113
|
<div id="footer" class="clearfix">
|
114
|
The CDM Server is a component of the <a href="http://wp5.e-taxonomy.eu/">EDIT Platform for Cybertaxonomy</a>.
|
115
|
</div><!-- /footer -->
|
116
|
|
117
|
</div><!-- /main -->
|
118
|
</div><!-- /main-wrapper -->
|
119
|
</div><!-- /page -->
|
120
|
</body>
|
121
|
</html>
|