Project

General

Profile

Download (6.83 KB) Statistics
| Branch: | Tag: | Revision:
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
<%!
10

    
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
%>
16

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

    
19
<head>
20
  <title>CDM Server</title>
21
  <link type="text/css" rel="stylesheet" media="all" href="../css/style.css" />
22
  <link type="text/css" rel="stylesheet" media="all" 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">
34
              </div>
35
        <h1>CDM Server</h1>
36
          </div><!-- /header-first -->
37
        </div><!-- /header -->
38
      </div><!-- /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><!-- /primary_menu -->
44
      </div><!-- /primary-menu-wrapper -->
45

    
46
      <div id="main-wrapper">
47
        <div id="main" class="clearfix">
48

    
49
          <div id="sidebar-first">
50
          </div><!-- /sidebar-first -->
51

    
52
          <div id="content-wrapper">
53
            <div id="content">
54
                <!-- ============================= -->
55
                <div class="block-wrapper">
56
                  <h2 class="title block-title pngfix">Server Status</h2>
57
                  <div class="block" id="status"><!-- The memory status will be rendered by memory-status.js --></div>
58
                </div>
59

    
60

    
61
                <div class="block-wrapper">
62
                  <div class="block" id="datasources">
63
                    <h2 class="title block-title pngfix">CDM Server Instances</h2>
64
                    <div class="container">
65
                    <table>
66
                      <tr><th>Path</th><th> </th><th>Database Url</th><th>Status</th><th>OAI-PMH Provider</th></tr>
67
                                            <%
68
                                           java.util.List<CdmInstanceProperties> configAndStatus = bootloader.getConfigAndStatus();
69
                                           if(configAndStatus != null){
70
                                             int i = 0;
71
                                             for(CdmInstanceProperties props : configAndStatus){
72
                                               i++;
73

    
74
                                               String basePath = props.getDataSourceName();
75
                                                  /*  URL fullURL = new URL(request.getScheme(),
76
                                                           request.getServerName(),
77
                                                           request.getServerPort(),
78
                                                           basePath); */
79

    
80
                                                   String fullURL = "../" + basePath;
81

    
82
                                                   String oddOrEven = i % 2 == 0 ? "odd" : "even";
83
                                                   String noBottomBorder = props.getStatus().equals(CdmInstanceProperties.Status.error) ? " style=\"border-bottom:none;\"" : "";
84

    
85
                                                   out.append("<tr id=\""+basePath+"\" class=\"entry " + oddOrEven + "\" " +noBottomBorder+ ">");
86
                                                   out.append("<td class=\"base-url\"><a href=\"" + fullURL + "\">" + basePath + "</a></td>");
87
                                                   out.append("<td class=\"test-url\"><a href=\"" + fullURL + "/portal/classification\">Test</a></td>");
88
                                                   out.append("<td class=\"db-url\">" + props.getUrl() + "</td>");
89
                                                   out.append("<td class=\"status " + props.getStatus() + "\">" + props.getStatus() + "</td>");
90

    
91
                                                   // OAI-PMH Status will be requested using javascript
92
                                                   out.append("<td class=\"oai-pmh\">requesting status ...</td>");
93
                                                   out.append("</tr>");
94
                                                   if(props.getStatus().equals(CdmInstanceProperties.Status.error) || !props.isEnabled()){
95
                                                     out.append("<tr id=\""+basePath+"-error-log\" class=\"error-log " + oddOrEven + "\">");
96
                                                     out.append("<td></td><td  class=\"error\" colspan=\"4\">");
97
                                                         for( String problem : props.getProblems()){
98
                                                           out.append("<div>" + problem + "</div>");
99
                                                         }
100
                                                     out.append("</td>");
101
                                                     out.append("</tr>");
102
                                                   }
103
                                             }
104
                                           }
105
                                           %>
106
                    </table>
107
                    </div>
108
                  </div>
109
                </div>
110
<%/*
111
                <div class="block-wrapper">
112
                  <div class="block" id="test">
113
                    <h2 class="title block-title pngfix">Test your CDM Server (using the default data base)</h2>
114
                    <form name="input" action="/default/portal/taxon/find" method="get">
115
                    <input type="text" name="query"></br>
116
                    <input type="submit" value="submit">
117
                    </form>
118
                  </div>
119
                </div><!-- test -->
120
*/
121
%>
122
                <!-- ============================= -->
123
            </div><!-- /content -->
124
          </div><!-- /content-wrapper -->
125

    
126
          <div id="footer" class="clearfix">
127
          The CDM Server is a component of the <a href="http://wp5.e-taxonomy.eu/">EDIT Platform for Cybertaxonomy</a>.
128
          </div><!-- /footer -->
129

    
130
        </div><!-- /main -->
131
      </div><!-- /main-wrapper -->
132
    </div><!-- /page -->
133
</body>
134
</html>
(3-3/3)