Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

cdm-server / src / main / webapp / manage / index.jsp @ 929a8c09

History | View | Annotate | Download (5.83 KB)

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.instance.Configuration"%>
7
<%@page import="eu.etaxonomy.cdm.server.instance.CdmInstance"%>
8
<%@page import="eu.etaxonomy.cdm.server.instance.Status"%>
9
<%@page import="eu.etaxonomy.cdm.server.JvmManager"%>
10
<%@page import="java.io.IOException"%>
11
<%!// the servelt context must use the class loader of the Bootloader class otherwise
12
    // getting the status will not work in mulithreading environments !!!
13
    Bootloader bootloader = Bootloader.getBootloader();%>
14

    
15
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
16

    
17
<head>
18
<title>CDM Server</title>
19
<link type="text/css" rel="stylesheet" media="all"
20
	href="../css/style.css" />
21
<link type="text/css" rel="stylesheet" media="all"
22
	href="../css/server.css" />
23
<script type="text/javascript" src="../js/jquery.js"></script>
24
<script type="text/javascript" src="../js/oai-pmh-status.js"></script>
25
<script type="text/javascript" src="../js/memory-status.js"></script>
26
<script type="text/javascript" src="../js/instance-status.js"></script>
27
</head>
28
<body class="layout-main">
29
	<div id="page" class="clearfix">
30
		<div id="header-wrapper">
31
			<div id="header" class="clearfix">
32
				<div id="header-first">
33
					<div id="logo"></div>
34
					<h1>CDM Server</h1>
35
				</div>
36
				<!-- /header-first -->
37
			</div>
38
			<!-- /header -->
39
		</div>
40
		<!-- /header-wrapper -->
41

    
42
		<div id="primary-menu-wrapper" class="clearfix">
43
			<div id="primary-menu">
44
				<div id="version"><%=bootloader.readCdmRemoteVersion()%></div>
45
			</div>
46
			<!-- /primary_menu -->
47
		</div>
48
		<!-- /primary-menu-wrapper -->
49

    
50
		<div id="main-wrapper">
51
			<div id="main" class="clearfix">
52

    
53
				<div id="sidebar-first"></div>
54
				<!-- /sidebar-first -->
55

    
56
				<div id="content-wrapper">
57
					<div id="content">
58
						<!-- ============================= -->
59
						<div class="block-wrapper">
60
							<h2 class="title block-title pngfix">Server Status</h2>
61
							<div class="block" id="status">
62
								<!-- The memory status will be rendered by memory-status.js -->
63
							</div>
64
						</div>
65

    
66

    
67
						<div class="block-wrapper">
68
							<div class="block" id="datasources">
69
								<h2 class="title block-title pngfix">CDM Server Instances</h2>
70
								<div class="container">
71
									<table>
72
										<tr>
73
											<th>Path</th>
74
											<th></th>
75
											<th>Database Url</th>
76
											<th>Status</th>
77
											<th>OAI-PMH Provider</th>
78
										</tr>
79
										<%
80
										    java.util.List<CdmInstance> instances = bootloader.getCdmInstances();
81
										    if (instances != null) {
82
										        int i = 0;
83
										        for (CdmInstance instance : instances) {
84
										            i++;
85
										            Configuration props = instance.getConfiguration();
86

    
87
										            String basePath = props.getInstanceName();
88
										            /*  URL fullURL = new URL(request.getScheme(),
89
										                     request.getServerName(),
90
										                     request.getServerPort(),
91
										                     basePath); */
92

    
93
										            String fullURL = "../" + basePath;
94

    
95
										            String oddOrEven = i % 2 == 0 ? "odd" : "even";
96
										            String noBottomBorder = instance.getStatus().equals(Status.error) ? " style=\"border-bottom:none;\""
97
										                    : "";
98

    
99
										            out.append("<tr id=\"" + basePath + "\" class=\"entry " + oddOrEven + "\" " + noBottomBorder + ">");
100
										            out.append("<td class=\"base-url\"><a href=\"" + fullURL + "/\">" + basePath + "</a></td>");
101
										            out.append("<td class=\"test-url\"><a href=\"" + fullURL + "/portal/classification\">Test</a></td>");
102
										            out.append("<td class=\"db-url\">" + props.getDataSourceUrl() + "</td>");
103
										            out.append("<td class=\"status " + instance.getStatus() + "\">" + instance.getStatus() + "</td>");
104

    
105
										            // OAI-PMH Status will be requested using javascript
106
										            out.append("<td class=\"oai-pmh\">requesting status ...</td>");
107
										            out.append("</tr>");
108
										            if (instance.getStatus().equals(Status.error) || !instance.isEnabled()) {
109
										                out.append("<tr id=\"" + basePath + "-error-log\" class=\"error-log " + oddOrEven + "\">");
110
										                out.append("<td></td><td  class=\"error\" colspan=\"4\">");
111
										                for (String problem : instance.getProblems()) {
112
										                    out.append("<div>" + problem + "</div>");
113
										                }
114
										                out.append("</td>");
115
										                out.append("</tr>");
116
										            }
117
										        }
118
										    }
119
										%>
120
									</table>
121
								</div>
122
							</div>
123
						</div>
124
						<%
125
						    /*
126
						     <div class="block-wrapper">
127
						     <div class="block" id="test">
128
						     <h2 class="title block-title pngfix">Test your CDM Server (using the default data base)</h2>
129
						     <form name="input" action="/default/portal/taxon/find" method="get">
130
						     <input type="text" name="query"></br>
131
						     <input type="submit" value="submit">
132
						     </form>
133
						     </div>
134
						     </div><!-- test -->
135
						     */
136
						%>
137
						<!-- ============================= -->
138
					</div>
139
					<!-- /content -->
140
				</div>
141
				<!-- /content-wrapper -->
142

    
143
				<div id="footer" class="clearfix">
144
					The CDM Server is a component of the <a
145
						href="http://wp5.e-taxonomy.eu/">EDIT Platform for
146
						Cybertaxonomy</a>.
147
				</div>
148
				<!-- /footer -->
149

    
150
			</div>
151
			<!-- /main -->
152
		</div>
153
		<!-- /main-wrapper -->
154
	</div>
155
	<!-- /page -->
156
</body>
157
</html>
Add picture from clipboard (Maximum size: 40 MB)