Revision 50886cfa
Added by Andreas Kohlbecker about 13 years ago
.gitattributes | ||
---|---|---|
42 | 42 |
src/main/webapp/js/jquery.js -text |
43 | 43 |
src/main/webapp/js/jquery.min.js -text |
44 | 44 |
src/main/webapp/js/oai-pmh-status.js -text |
45 |
src/main/webapp/js/server-status.js -text |
|
46 |
src/main/webapp/manage/index.jsp -text |
|
45 | 47 |
src/main/webapp/robots.txt -text |
46 | 48 |
src/site/apt/download.apt -text |
47 | 49 |
src/site/apt/getting-started.apt -text |
pom.xml | ||
---|---|---|
20 | 20 |
<!-- |
21 | 21 |
the third number in the version string |
22 | 22 |
--> |
23 |
<project.patchversion>1</project.patchversion>
|
|
23 |
<project.patchversion>2</project.patchversion>
|
|
24 | 24 |
<!-- |
25 | 25 |
${project.fullversionstring} is being used by some build plugins |
26 | 26 |
--> |
src/main/webapp/WEB-INF/web.xml | ||
---|---|---|
32 | 32 |
<security-constraint> |
33 | 33 |
<web-resource-collection> |
34 | 34 |
<web-resource-name>CDM Server Management</web-resource-name> |
35 |
<url-pattern>/index.jsp</url-pattern>
|
|
35 |
<url-pattern>/manage/*</url-pattern>
|
|
36 | 36 |
</web-resource-collection> |
37 | 37 |
<auth-constraint> |
38 | 38 |
<role-name>admin</role-name> |
src/main/webapp/index.jsp | ||
---|---|---|
46 | 46 |
Status: <div class="status_value">RUNNING</div> |
47 | 47 |
</div> |
48 | 48 |
</div> |
49 |
|
|
50 |
|
|
51 | 49 |
<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> </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 + "\">" + basePath + "</a></td>"); |
|
76 |
out.append("<td class=\"test-url\"><a href=\"" + fullURL + "/portal/classification\">Test</a></td>"); |
|
77 |
out.append("<td class=\"db-url\">" + props.getUrl() + "</td>"); |
|
78 |
out.append("<td class=\"status " + props.getStatus() + "\">" + props.getStatus() + "</td>"); |
|
79 |
|
|
80 |
// OAI-PMH Status will be requested using javascript |
|
81 |
out.append("<td class=\"oai-pmh\">requesting status ...</td>"); |
|
82 |
out.append("</tr>"); |
|
83 |
if(props.getStatus().equals(CdmInstanceProperties.Status.error) || !props.isEnabled()){ |
|
84 |
out.append("<tr class=\"error-log " + oddOrEven + "\">"); |
|
85 |
out.append("<td></td><td class=\"error\" colspan=\"3\">"); |
|
86 |
for( String problem : props.getProblems()){ |
|
87 |
out.append("<div>" + problem + "</div>"); |
|
88 |
} |
|
89 |
out.append("</td>"); |
|
90 |
out.append("</tr>"); |
|
91 |
} |
|
92 |
} |
|
93 |
} |
|
94 |
%> |
|
95 |
</table> |
|
96 |
</div> |
|
97 |
</div> |
|
98 |
<%/* |
|
99 |
<div class="block-wrapper"> |
|
100 |
<div class="block" id="test"> |
|
101 |
<h2 class="title block-title pngfix">Test your CDM Server (using the default data base)</h2> |
|
102 |
<form name="input" action="/default/portal/taxon/find" method="get"> |
|
103 |
<input type="text" name="query"></br> |
|
104 |
<input type="submit" value="submit"> |
|
105 |
</form> |
|
106 |
</div> |
|
107 |
</div><!-- test --> |
|
108 |
*/ |
|
109 |
%> |
|
50 |
Actions: |
|
51 |
<ul> |
|
52 |
<li><a href="manage/index.jsp">EDIT CDM-Server management (login required!)</a></li> |
|
53 |
</ul> |
|
54 |
</div> |
|
110 | 55 |
<!-- ============================= --> |
111 | 56 |
</div><!-- /content --> |
112 | 57 |
</div><!-- /content-wrapper --> |
src/main/webapp/js/server-status.js | ||
---|---|---|
1 |
|
|
2 |
$(document).ready(function(){ |
|
3 |
|
|
4 |
$("#datasources table .entry").each(function(){ |
|
5 |
var entry = $(this); |
|
6 |
var url = entry.find('.base-url a').attr('href'); |
|
7 |
|
|
8 |
$.getJSON( |
|
9 |
"http://wp5.e-taxonomy.eu/registry/oai/providers.php?format=json&callback=?&find="+encodeURIComponent(url), |
|
10 |
function(data){ |
|
11 |
if(data.providers != undefined && data.providers.provider != undefined){ |
|
12 |
entry.find('.oai-pmh').css('color', 'green').html("Registered"); |
|
13 |
} else { |
|
14 |
entry.find('.oai-pmh').html("<a href=\"mailto:editsupport@bgbm.org?subject=OAI-PHM Provider Registration&body=" + encodeURIComponent(url) + "\">Request for registration</a>"); |
|
15 |
} |
|
16 |
}); |
|
17 |
|
|
18 |
|
|
19 |
}); |
|
20 |
}); |
src/main/webapp/manage/index.jsp | ||
---|---|---|
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=index.jsp" /> |
|
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> </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 + "\">" + basePath + "</a></td>"); |
|
76 |
out.append("<td class=\"test-url\"><a href=\"" + fullURL + "/portal/classification\">Test</a></td>"); |
|
77 |
out.append("<td class=\"db-url\">" + props.getUrl() + "</td>"); |
|
78 |
out.append("<td class=\"status " + props.getStatus() + "\">" + props.getStatus() + "</td>"); |
|
79 |
|
|
80 |
// OAI-PMH Status will be requested using javascript |
|
81 |
out.append("<td class=\"oai-pmh\">requesting status ...</td>"); |
|
82 |
out.append("</tr>"); |
|
83 |
if(props.getStatus().equals(CdmInstanceProperties.Status.error) || !props.isEnabled()){ |
|
84 |
out.append("<tr class=\"error-log " + oddOrEven + "\">"); |
|
85 |
out.append("<td></td><td class=\"error\" colspan=\"3\">"); |
|
86 |
for( String problem : props.getProblems()){ |
|
87 |
out.append("<div>" + problem + "</div>"); |
|
88 |
} |
|
89 |
out.append("</td>"); |
|
90 |
out.append("</tr>"); |
|
91 |
} |
|
92 |
} |
|
93 |
} |
|
94 |
%> |
|
95 |
</table> |
|
96 |
</div> |
|
97 |
</div> |
|
98 |
<%/* |
|
99 |
<div class="block-wrapper"> |
|
100 |
<div class="block" id="test"> |
|
101 |
<h2 class="title block-title pngfix">Test your CDM Server (using the default data base)</h2> |
|
102 |
<form name="input" action="/default/portal/taxon/find" method="get"> |
|
103 |
<input type="text" name="query"></br> |
|
104 |
<input type="submit" value="submit"> |
|
105 |
</form> |
|
106 |
</div> |
|
107 |
</div><!-- test --> |
|
108 |
*/ |
|
109 |
%> |
|
110 |
<!-- ============================= --> |
|
111 |
</div><!-- /content --> |
|
112 |
</div><!-- /content-wrapper --> |
|
113 |
|
|
114 |
<div id="footer" class="clearfix"> |
|
115 |
The CDM Server is a component of the <a href="http://wp5.e-taxonomy.eu/">EDIT Platform for Cybertaxonomy</a>. |
|
116 |
</div><!-- /footer --> |
|
117 |
|
|
118 |
</div><!-- /main --> |
|
119 |
</div><!-- /main-wrapper --> |
|
120 |
</div><!-- /page --> |
|
121 |
</body> |
|
122 |
</html> |
Also available in: Unified diff
new index page and securing only the /manage/ path