state_dataset.jsp 8.26 KB
Newer Older
1
2
3
4
5
6
7
8
<%@ 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" />
9
<c:set var="ep_icon" value="fas fa-check-circle" />
10
11
12
13
<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" />
14
		<c:set var="ep_icon" value="fas fa-exclamation-circle" />
15
16
17
18
		<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" />
19
		<c:set var="ep_icon" value="fas fa-exclamation-circle" />
20
21
22
23
		<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" />
24
		<c:set var="ep_icon" value="fas fa-question-circle" />
25
26
27
28
29
		<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" />
30
<c:set var="ds_icon" value="fas fa-check-circle" />
31
32
33
34
<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" />
35
		<c:set var="ds_icon" value="fas fa-exclamation-circle" />
36
37
38
39
		<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" />
40
		<c:set var="ds_icon" value="fas fa-exclamation-circle" />
41
42
43
44
		<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" />
45
		<c:set var="ds_icon" value="fas fa-exclamation-circle" />
46
47
48
49
		<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" />
50
		<c:set var="ds_icon" value="fas fa-sync-alt" />
51
52
53
54
		<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" />
55
		<c:set var="ds_icon" value="fas fa-clock" />
56
57
58
59
		<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" />
60
		<c:set var="ds_icon" value="fas fa-question-circle" />
61
62
63
64
		<c:set var="ds_state_message" value="~eu.dariah.de.minfba.search.states.dataset.unprocessed" />
	</c:when>
</c:choose>

65
66
<h3><s:message code="~eu.dariah.de.minfba.search.model.endpoint" /></h3>
<table class="table state-table">
67
68
	<tr class="state-row-${ep_status}">
		<th class="state-${ep_status}">
69
			<i class="${ep_icon} fa-lg" aria-hidden="true"></i>
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
		</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>

105
106
<h3><s:message code="~eu.dariah.de.minfba.search.model.dataset" /></h3>
<table class="table state-table">
107
108
	<tr class="state-row-${ds_status}">
		<th class="state-${ds_status}">
109
			<i class="${ds_icon} fa-lg" aria-hidden="true"></i>
110
111
112
113
114
115
116
		</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>
117
118
119
120
121
122
123
124
125
126
127
128
129
130
				<li>
					<span class="state-heading"><s:message code="~eu.dariah.de.minfba.search.metamodel_view.model.${ep.method=='OAI-PMH' ? 'oaipmh_prefix' : 'alias'}" />:</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>
					<span>${prefix}</span>&nbsp;
				</li>
131
132
133
134
				<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>
Gradl, Tobias's avatar
Gradl, Tobias committed
135
136
137
138
139
140
141
142
143
				<c:if test="${ep.method!='OPAC'}">
					<li>
						<span class="state-heading">
							<i class="fa fa-color-info fa-info-circle" aria-hidden="true"  data-toggle="tooltip" data-placement="top" title="<s:message code="~eu.dariah.de.minfba.search.view.dataset.label.document_count" />"></i> 
							<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>
				</c:if>
144
145
146
147
148
149
				<li>
					<span class="state-heading">
						<i class="fa fa-color-info fa-info-circle" aria-hidden="true"  data-toggle="tooltip" data-placement="top" title="<s:message code="~eu.dariah.de.minfba.search.view.dataset.label.additional_data" />"></i>
						<s:message code="~eu.dariah.de.minfba.search.metamodel_view.endpoint.additional_data" />:
					</span>
					<span class="no-break-out"><fmt:formatNumber value="${data.fileCount}" /> <s:message code="~eu.dariah.de.minfba.common.view.label.files_sm" /> (${data.readableSize})</span> 
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
				</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}">
169
	<h3><s:message code="~eu.dariah.de.minfba.common.link.available_actions" /></h3>
170
171
	<div>
		<c:choose>
Gradl, Tobias's avatar
Gradl, Tobias committed
172
			<c:when test="${currentCrawl!=null && ep.method!='OPAC'}">
173
				<button class="btn-cancel-crawl btn btn-primary" data-crawl-id="${currentCrawl.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>		
174
175
			</c:when>
			<c:otherwise>
Gradl, Tobias's avatar
Gradl, Tobias committed
176
				<c:if test="${!ep.error && !ep.unaccessible && !ds.errorLock && ds.datamodelPojo.available && ep.method!='OPAC'}">
177
					<button class="btn-crawl-online btn btn-primary" 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>
178
				</c:if>
179
				<button class="btn-clear-index btn btn-primary" onclick="editor.clearData('${ep.id}','${ds.id}', ${data.exists && data.fileCount>0});"><i class="fa fa-trash "></i> <s:message code="~eu.dariah.de.minfba.search.actions.dataset.clear" /></button>					
180
181
182
183
			</c:otherwise>
		</c:choose>
	</div>
</c:if>