state_dataset.jsp 7.53 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>

<%@ taglib prefix="joda" uri="http://www.joda.org/joda/time/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<c:set var="ep_status" value="ok" />
<c:set var="ep_icon" value="check" />
<c:set var="ep_state_message" value="~eu.dariah.de.minfba.search.states.endpoint.accessible" />
<c:choose>
	<c:when test="${ep.error}">
		<c:set var="ep_status" value="error" />
		<c:set var="ep_icon" value="exclamation" />
		<c:set var="ep_state_message" value="~eu.dariah.de.minfba.search.states.endpoint.error" />
	</c:when>
	<c:when test="${ep.unaccessible}">
		<c:set var="ep_status" value="warning" />
		<c:set var="ep_icon" value="exclamation" />
		<c:set var="ep_state_message" value="~eu.dariah.de.minfba.search.states.endpoint.unaccessible" />
	</c:when>
	<c:when test="${ep.unprocessed}">
		<c:set var="ep_status" value="info" />
		<c:set var="ep_icon" value="question" />
		<c:set var="ep_state_message" value="~eu.dariah.de.minfba.search.states.endpoint.unprocessed" />
	</c:when>
</c:choose>

<c:set var="ds_status" value="ok" />
<c:set var="ds_icon" value="check" />
<c:set var="ds_state_message" value="~eu.dariah.de.minfba.search.states.ok" />
<c:choose>
	<c:when test="${ds.errorLock}">
		<c:set var="ds_status" value="error" />
		<c:set var="ds_icon" value="exclamation" />
		<c:set var="ds_state_message" value="~eu.dariah.de.minfba.search.states.dataset.error" />
	</c:when>
	<c:when test="${!ds.datamodelPojo.available}">
		<c:set var="ds_status" value="error" />
		<c:set var="ds_icon" value="exclamation" />
		<c:set var="ds_state_message" value="~eu.dariah.de.minfba.search.states.datamodel.unavailable" />	
	</c:when>
	<c:when test="${ds.warning}">
		<c:set var="ds_status" value="warning" />
		<c:set var="ds_icon" value="exclamation" />
		<c:set var="ds_state_message" value="~eu.dariah.de.minfba.search.states.dataset.outdated" />
	</c:when>
	<c:when test="${ds.processing}">
		<c:set var="ds_status" value="info" />
		<c:set var="ds_icon" value="refresh" />
		<c:set var="ds_state_message" value="~eu.dariah.de.minfba.search.states.dataset.busy" />
	</c:when>
	<c:when test="${ds.waiting}">
		<c:set var="ds_status" value="info" />
		<c:set var="ds_icon" value="clock-o" />
		<c:set var="ds_state_message" value="~eu.dariah.de.minfba.search.states.dataset.waiting" />
	</c:when>
	<c:when test="${ds.docs==0}">
		<c:set var="ds_status" value="info" />
		<c:set var="ds_icon" value="question" />
		<c:set var="ds_state_message" value="~eu.dariah.de.minfba.search.states.dataset.unprocessed" />
	</c:when>
</c:choose>

<h4><s:message code="~eu.dariah.de.minfba.search.model.endpoint" /></h4>
<table class="state-table">
	<tr class="state-row-${ep_status}">
		<th class="state-${ep_status}">
			<i class="fa fa-lg fa-${ep_icon}" aria-hidden="true"></i>
		</th>
		<td>
			<ul class="inner-state-list">
				<li>
					<span class="state-heading"><s:message code="~eu.dariah.de.minfba.metamodel.endpoint.url" />:</span>
					<span class="no-break-out">${ep.url}</span>
				</li>
				<li>
					<span class="state-heading"><s:message code="~eu.dariah.de.minfba.metamodel.endpoint.type" />:</span>
					<span class="no-break-out">${ep.method}</span>
					<c:if test="${ep.method=='OAI-PMH'}">
						<div class="inline-button ${prefix_state}" onclick="editor.clearEndpointSchemaIndex('${ep.id}','${ds.id}');">
							<a href="${ep.url}?verb=Identify" target="_blank"><i class="fa fa-globe"></i> <s:message code="~eu.dariah.de.minfba.search.metamodel_view.model.check_availability" /></a>
						</div>
					</c:if>
				</li>
				<li>
					<span class="state-heading"><s:message code="~eu.dariah.de.minfba.metamodel.common.id" />:</span>
					<span class="no-break-out">${ep.id}</span>
				</li>
				<c:if test="${ep.method=='OAI-PMH'}">
					<li>
						<span class="state-heading"><s:message code="~eu.dariah.de.minfba.metamodel.endpoint.set" />:</span>
						<span class="no-break-out">${ep.set}</span>
					</li>
				</c:if>
				<li>
					<span class="state-heading"><s:message code="~eu.dariah.de.minfba.common.status" />:</span>
					<span class="state-${ep_status}"><s:message code="${ep_state_message}" /></span>
				</li>
			</ul>
		</td>
	</tr>
</table>

<h4><s:message code="~eu.dariah.de.minfba.search.model.dataset" /></h4>
<table class="state-table">
	<tr class="state-row-${ds_status}">
		<th class="state-${ds_status}">
			<i class="fa fa-lg fa-${ds_icon}" aria-hidden="true"></i>
		</th>
		<td>
			<ul class="inner-state-list">
				<li>
					<span class="state-heading"><s:message code="~eu.dariah.de.minfba.metamodel.model" />:</span>
					<span class="no-break-out">${ds.datamodelPojo.name}</span>
				</li>
				<c:if test="${ep.method=='OAI-PMH'}">
					<li>
						<span class="state-heading"><s:message code="~eu.dariah.de.minfba.search.metamodel_view.model.oaipmh_prefix" />:</span>
						<c:choose>
							<c:when test="${ds.remoteAlias!=null && fn:length(ds.remoteAlias) > 0}">
								<c:set var="prefix" value="${ds.remoteAlias}" />
								<c:set var="prefix_state" value="state-${ds_status}" />
							</c:when>
							<c:otherwise>
								<s:message code="~eu.dariah.de.minfba.common.status.undefined" var="prefix" />
								<c:set var="prefix_state" value="state-warning" />
							</c:otherwise>
						</c:choose>
						<c:if test="${_auth.level >= 100}">
							<div class="inline-button ${prefix_state}" onclick="editor.editPrefix('${ep.id}','${ds.id}','${ds.remoteAlias}', '.oaipmh-metadata-prefix');">
								<i class="fa fa-pencil-square-o"></i> <span class="oaipmh-metadata-prefix">${prefix}</span>
							</div>
						</c:if>
					</li>
				</c:if>
				<li>
					<span class="state-heading"><s:message code="~eu.dariah.de.minfba.metamodel.common.id" />:</span>
					<span class="no-break-out">${ds.id}</span>
				</li>
				<li>
					<span class="state-heading"><s:message code="~eu.dariah.de.minfba.search.metamodel_view.endpoint.document_count" />:</span>
					<span class="no-break-out"><fmt:formatNumber value="${ds.docs}" /></span> 
				</li>
				<li>
					<span class="state-heading"><s:message code="~eu.dariah.de.minfba.common.status" />:</span>
					<span class="crawl-state-container state-${ds_status}">
						<c:choose>
							<c:when test="${currentCrawl==null}">
								<%@ include file="state_crawl.jsp" %>				
							</c:when>
							<c:otherwise>
								<%@ include file="state_crawl.jsp" %>	
							</c:otherwise>
						</c:choose>
					</span>
				</li>
			</ul>
		</td>
	</tr>
</table>
<c:if test="${_auth.level >= 100}">
	<h4><s:message code="~eu.dariah.de.minfba.common.link.available_actions" /></h4>
	<div>
		<c:choose>
			<c:when test="${currentCrawl!=null}">
				<button class="btn-cancel-crawl btn btn-link" data-crawl-id="" onclick="editor.cancelCrawl(this);"><i class="fa fa-ban fa-color-danger"></i> <s:message code="~eu.dariah.de.minfba.search.actions.crawls.cancel" /></button>		
			</c:when>
			<c:otherwise>
				<c:if test="${!ep.error && !ep.unaccessible && !ds.errorLock && ds.datamodelPojo.available}">
					<button class="btn-crawl-online btn btn-link" onclick="editor.crawlOnline('${ep.id}','${ds.id}');"><i class="fa fa-refresh"></i><s:message code="~eu.dariah.de.minfba.search.view.crawl.crawl_online" /></button>
				</c:if>
				<button class="btn-clear-index btn btn-link" onclick="editor.clearEndpointSchemaIndex('${ep.id}','${ds.id}');"><i class="fa fa-trash "></i> <s:message code="~eu.dariah.de.minfba.search.actions.dataset.clear" /></button>	
			</c:otherwise>
		</c:choose>
	</div>
</c:if>