Revision 929a8c09
Added by Andreas Kohlbecker almost 11 years ago
src/main/webapp/manage/index.jsp | ||
---|---|---|
3 | 3 |
<%@page import="eu.etaxonomy.cdm.server.Bootloader"%> |
4 | 4 |
<%@page import="java.util.Set"%> |
5 | 5 |
<%@page import="java.net.URL"%> |
6 |
<%@page import="eu.etaxonomy.cdm.server.CdmInstanceProperties"%> |
|
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"%> |
|
7 | 9 |
<%@page import="eu.etaxonomy.cdm.server.JvmManager"%> |
8 | 10 |
<%@page import="java.io.IOException"%> |
9 | 11 |
<%!// the servelt context must use the class loader of the Bootloader class otherwise |
... | ... | |
75 | 77 |
<th>OAI-PMH Provider</th> |
76 | 78 |
</tr> |
77 | 79 |
<% |
78 |
java.util.List<CdmInstanceProperties> configAndStatus = bootloader.getConfigAndStatus();
|
|
79 |
if (configAndStatus != null) {
|
|
80 |
java.util.List<CdmInstance> instances = bootloader.getCdmInstances();
|
|
81 |
if (instances != null) {
|
|
80 | 82 |
int i = 0; |
81 |
for (CdmInstanceProperties props : configAndStatus) {
|
|
83 |
for (CdmInstance instance : instances) {
|
|
82 | 84 |
i++; |
85 |
Configuration props = instance.getConfiguration(); |
|
83 | 86 |
|
84 |
String basePath = props.getDataSourceName();
|
|
87 |
String basePath = props.getInstanceName();
|
|
85 | 88 |
/* URL fullURL = new URL(request.getScheme(), |
86 | 89 |
request.getServerName(), |
87 | 90 |
request.getServerPort(), |
... | ... | |
90 | 93 |
String fullURL = "../" + basePath; |
91 | 94 |
|
92 | 95 |
String oddOrEven = i % 2 == 0 ? "odd" : "even"; |
93 |
String noBottomBorder = props.getStatus().equals(CdmInstanceProperties.Status.error) ? " style=\"border-bottom:none;\""
|
|
96 |
String noBottomBorder = instance.getStatus().equals(Status.error) ? " style=\"border-bottom:none;\""
|
|
94 | 97 |
: ""; |
95 | 98 |
|
96 | 99 |
out.append("<tr id=\"" + basePath + "\" class=\"entry " + oddOrEven + "\" " + noBottomBorder + ">"); |
97 | 100 |
out.append("<td class=\"base-url\"><a href=\"" + fullURL + "/\">" + basePath + "</a></td>"); |
98 | 101 |
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>");
|
|
102 |
out.append("<td class=\"db-url\">" + props.getDataSourceUrl() + "</td>");
|
|
103 |
out.append("<td class=\"status " + instance.getStatus() + "\">" + instance.getStatus() + "</td>");
|
|
101 | 104 |
|
102 | 105 |
// OAI-PMH Status will be requested using javascript |
103 | 106 |
out.append("<td class=\"oai-pmh\">requesting status ...</td>"); |
104 | 107 |
out.append("</tr>"); |
105 |
if (props.getStatus().equals(CdmInstanceProperties.Status.error) || !props.isEnabled()) {
|
|
108 |
if (instance.getStatus().equals(Status.error) || !instance.isEnabled()) {
|
|
106 | 109 |
out.append("<tr id=\"" + basePath + "-error-log\" class=\"error-log " + oddOrEven + "\">"); |
107 | 110 |
out.append("<td></td><td class=\"error\" colspan=\"4\">"); |
108 |
for (String problem : props.getProblems()) {
|
|
111 |
for (String problem : instance.getProblems()) {
|
|
109 | 112 |
out.append("<div>" + problem + "</div>"); |
110 | 113 |
} |
111 | 114 |
out.append("</td>"); |
Also available in: Unified diff
refactoring in preparation for #3471 (cdmlib-remote-webapp instances can be stopped / started individually)