view_meta_ajax.jsp 17.8 KB
Newer Older
1 2 3
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
4 5
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://org.ow2.weblab/taglib" prefix="weblab"%>
6 7 8 9 10 11


<portlet:defineObjects />

<fmt:setLocale value="${pageContext.request.locale}" />
<fmt:setBundle basename="meta_portlet" />
12
<portlet:resourceURL var="editURL" escapeXml="false" id="editmeta" />
13 14 15

<!-- alert user when leaving weblab -->
<script type="text/javascript">
16 17 18 19 20 21 22 23 24
	// Leave WebLab
	jQuery('.warnUserOnClick').live("click", function() {
		jQuery(this).target = "_blank";
		var answer = window.confirm('<fmt:message key="portlet.leave" />');
		if (answer) {
			window.open($(this).prop('href'));
		}
		return false;
	});
25 26 27 28
</script>

<!-- meta-data -->
<div>
29 30
	<table class="meta_data_table">
		<tbody>
31 32
			<c:if
				test="${metaDisplay['title'] && weblab:hasValue(resource, rdfProperties['title'])}">
33
				<tr>
34 35 36
					<th><fmt:message key="meta.title" /></th>
					<td><b><i><weblab:getPropertyValues
									uri="${rdfProperties['title']}" /></i></b></td>
37 38
				</tr>
			</c:if>
39 40
			<c:if
				test="${metaDisplay['source'] && weblab:hasValue(resource, rdfProperties['source'])}">
41
				<tr>
42 43 44 45 46
					<th><fmt:message key="meta.source" /></th>
					<td><weblab:renderValues style="anchor"
							cssClass="meta_link warnUserOnClick">
							<weblab:getPropertyValues uri="${rdfProperties['source'] }" />
						</weblab:renderValues></td>
47 48
				</tr>
			</c:if>
49 50
			<c:if
				test="${metaDisplay['mainsource'] && weblab:hasValue(resource, rdfProperties['mainsource'])}">
51
				<tr>
52 53 54 55 56
					<th><fmt:message key="meta.mainsource" /></th>
					<td><weblab:renderValues style="anchor"
							cssClass="meta_link warnUserOnClick">
							<weblab:getPropertyValues uri="${rdfProperties['mainsource'] }" />
						</weblab:renderValues></td>
57 58
				</tr>
			</c:if>
59 60
			<c:if
				test="${metaDisplay['format'] && weblab:hasValue(resource, rdfProperties['format'])}">
61
				<tr>
62 63 64 65 66
					<th><fmt:message key="meta.format" /></th>
					<td><weblab:renderValues style="icon+text"
							cssClass="meta_data_formatIconText">
							<weblab:getPropertyValues uri="${rdfProperties['format'] }" />
						</weblab:renderValues></td>
67 68
				</tr>
			</c:if>
69 70
			<c:if
				test="${metaDisplay['language'] && weblab:hasValue(resource, rdfProperties['language'])}">
71
				<tr>
72 73 74 75 76
					<th><fmt:message key="meta.language" /></th>
					<td><weblab:renderValues style="icon+text"
							cssClass="meta_data_formatIconText">
							<weblab:getPropertyValues uri="${rdfProperties['language'] }" />
						</weblab:renderValues></td>
77 78
				</tr>
			</c:if>
79
			<c:if test="${metaDisplay['translation'] && !empty(translations)}">
80
				<tr>
81 82 83 84 85
					<th><fmt:message key="meta.availableTranslations" /></th>



					<td><portlet:actionURL var="selectOriginalVersion">
86
							<portlet:param name="action" value="selectOriginalVersion" />
87 88 89 90 91 92
						</portlet:actionURL> <a href="${selectOriginalVersion }"> <weblab:renderValues
								style="icon" cssClass="meta_data_formatIconText">
								<weblab:getPropertyValues uri="${rdfProperties['language'] }" />
							</weblab:renderValues> <fmt:message key="meta.originalLanguageVersion" />
					</a> <br /> <br /> <i> <c:forEach var="translation"
								items="${translations }" varStatus="status">
93
								<c:if test="${status.count != 1}">
94
									<br />
95
								</c:if>
96

97 98 99 100 101
								<portlet:actionURL var="selectTranslation">
									<portlet:param name="action" value="selectTranslation" />
									<portlet:param name="language" value="${translation.key }" />
									<portlet:param name="service" value="${translation.value.uri}" />
								</portlet:actionURL>
102 103 104

								<a href="${selectTranslation }"> <weblab:renderValues
										style="icon+text" cssClass="meta_data_formatIconText">
105 106 107
										${translation.key }
									</weblab:renderValues></a>(${translation.value.label })
								
108 109
							</c:forEach>
					</i></td>
110 111
				</tr>
			</c:if>
112 113 114 115
			<c:if
				test="${metaDisplay['created'] && weblab:hasValue(resource, rdfProperties['created'])}">
				<weblab:getPropertyValues uri="${rdfProperties['created'] }"
					var="createdDates" />
116
				<c:set var="createdDatesStr" value="" />
117 118
				<c:forEach items="${createdDates}" var="createdDate"
					varStatus="createdDateStatus">
119 120 121 122
					<c:if test="${createdDateStatus.count != 1}">
						<c:set var="createdDatesStr" value="${createdDatesStr}<br />" />
					</c:if>
					<c:catch var="createdDatesError">
123 124 125 126
						<fmt:formatDate value="${createdDate}" type="BOTH"
							dateStyle="FULL" var="createdDateStr" />
						<c:set var="createdDatesStr"
							value="${createdDatesStr}${createdDateStr}" />
127 128 129 130
					</c:catch>
				</c:forEach>
				<c:if test="${createdDatesError == null}">
					<tr>
131 132 133
						<th><fmt:message key="meta.created" /></th>
						<td><i> <c:out value="${createdDatesStr}" />
						</i></td>
134 135 136
					</tr>
				</c:if>
			</c:if>
137 138 139 140
			<c:if
				test="${metaDisplay['modified'] && weblab:hasValue(resource, rdfProperties['modified'])}">
				<weblab:getPropertyValues uri="${rdfProperties['modified'] }"
					var="modifiedDates" />
141
				<c:set var="modifiedDatesStr" value="" />
142 143
				<c:forEach items="${modifiedDates}" var="modifiedDate"
					varStatus="modifiedDateStatus">
144
					<c:if test="${modifiedDateStatus.count != 1}">
145
						<c:set var="modifiedDatesStr" value="${modifiedDatesStr} ; " />
146 147
					</c:if>
					<c:catch var="modifiedDatesError">
148 149 150 151
						<fmt:formatDate value="${modifiedDate}" type="BOTH"
							dateStyle="FULL" var="modifiedDateStr" />
						<c:set var="modifiedDatesStr"
							value="${modifiedDatesStr}${modifiedDateStr}" />
152 153 154 155
					</c:catch>
				</c:forEach>
				<c:if test="${modifiedDatesError == null}">
					<tr>
156 157 158
						<th><fmt:message key="meta.modified" /></th>
						<td><i> <c:out value="${modifiedDatesStr}" />
						</i></td>
159 160 161
					</tr>
				</c:if>
			</c:if>
162 163 164 165
			<c:if
				test="${metaDisplay['gatheringDate'] && weblab:hasValue(resource, rdfProperties['gatheringDate'])}">
				<weblab:getPropertyValues uri="${rdfProperties['gatheringDate'] }"
					var="gatheringDates" />
166
				<c:set var="gatheringDatesStr" value="" />
167 168
				<c:forEach items="${gatheringDates}" var="gatheringDate"
					varStatus="gatheringDateStatus">
169 170 171 172
					<c:if test="${gatheringDateStatus.count != 1}">
						<c:set var="gatheringDatesStr" value="${gatheringDatesStr}<br />" />
					</c:if>
					<c:catch var="gatheringDatesError">
173 174 175 176
						<fmt:formatDate value="${gatheringDate}" type="BOTH"
							dateStyle="FULL" var="gatheringDateStr" />
						<c:set var="gatheringDatesStr"
							value="${gatheringDatesStr}${gatheringDateStr}" />
177 178 179 180
					</c:catch>
				</c:forEach>
				<c:if test="${gatheringDatesError == null}">
					<tr>
181 182 183
						<th><fmt:message key="meta.gatheringDate" /></th>
						<td><i> <c:out value="${gatheringDatesStr}" />
						</i></td>
184 185 186
					</tr>
				</c:if>
			</c:if>
187 188
			<c:if
				test="${metaDisplay['creator'] && weblab:hasValue(resource, rdfProperties['creator'])}">
189
				<tr>
190 191 192 193
					<th><fmt:message key="meta.creator" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['creator'] }" /></i></td>
				</tr>
194
			</c:if>
195 196
			<c:if
				test="${metaDisplay['contributor'] && weblab:hasValue(resource, rdfProperties['contributor'])}">
197
				<tr>
198 199 200 201 202
					<th><fmt:message key="meta.contributor" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['contributor'] }" var="contributors" /> <c:forEach
								var="contributor" items="${contributors}" varStatus="status">
								<c:if test="${status.count != 1}">
203 204 205
							,
							</c:if>
							${contributor}
206 207
						</c:forEach></i></td>
				</tr>
208
			</c:if>
209 210 211 212
			<c:if
				test="${metaDisplay['date'] && weblab:hasValue(resource, rdfProperties['date'])}">
				<weblab:getPropertyValues uri="${rdfProperties['date'] }"
					var="dates" />
213 214 215 216 217 218
				<c:set var="datesStr" value="" />
				<c:forEach items="${dates}" var="date" varStatus="dateStatus">
					<c:if test="${dateStatus.count != 1}">
						<c:set var="datesStr" value="${datesStr}<br />" />
					</c:if>
					<c:catch var="datesError">
219 220
						<fmt:formatDate value="${date}" type="BOTH" dateStyle="FULL"
							var="dateStr" />
221 222 223 224 225
						<c:set var="datesStr" value="${datesStr}${dateStr}" />
					</c:catch>
				</c:forEach>
				<c:if test="${datesError == null}">
					<tr>
226 227 228
						<th><fmt:message key="meta.date" /></th>
						<td><i> <c:out value="${datesStr}" />
						</i></td>
229 230
					</tr>
				</c:if>
231
			</c:if>
232 233
			<c:if
				test="${metaDisplay['identifier'] && weblab:hasValue(resource, rdfProperties['identifier'])}">
234
				<tr>
235 236 237
					<th><fmt:message key="meta.identifier" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['identifier'] }" /></i></td>
238 239
				</tr>
			</c:if>
240 241
			<c:if
				test="${metaDisplay['hasScore'] && weblab:hasValue(resource, rdfProperties['hasScore'])}">
242
				<tr>
243 244 245
					<th><fmt:message key="meta.hasScore" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['hasScore'] }" /></i></td>
246 247
				</tr>
			</c:if>
248 249
			<c:if
				test="${metaDisplay['hasNativeContent'] && weblab:hasValue(resource, rdfProperties['hasNativeContent'])}">
250
				<tr>
251 252 253
					<th><fmt:message key="meta.hasNativeContent" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['hasNativeContent'] }" /></i></td>
254 255
				</tr>
			</c:if>
256 257
			<c:if
				test="${metaDisplay['hasNormalisedContent'] && weblab:hasValue(resource, rdfProperties['hasNormalisedContent'])}">
258
				<tr>
259 260 261
					<th><fmt:message key="meta.hasNormalisedContent" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['hasNormalisedContent'] }" /></i></td>
262 263
				</tr>
			</c:if>
264 265
			<c:if
				test="${metaDisplay['isExposedAs'] && weblab:hasValue(resource, rdfProperties['isExposedAs'])}">
266
				<tr>
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282
					<th><fmt:message key="meta.isExposedAs" /></th>
					<td><c:choose>
						<c:when test="${metaDisplay['hasOriginalFileName'] && weblab:hasValue(resource, rdfProperties['hasOriginalFileName'])}">
							<i>
<a href="${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}<weblab:getPropertyValues
								uri="${rdfProperties['isExposedAs'] }" />
							"><weblab:getPropertyValues
								uri="${rdfProperties['hasOriginalFileName'] }" /></a></i>
						</c:when>
						<c:otherwise>
							<weblab:renderValues style="anchor" cssClass="meta_link">
							 ${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}<weblab:getPropertyValues
								uri="${rdfProperties['isExposedAs'] }" />
							</weblab:renderValues>
						</c:otherwise>
					</c:choose> 
283 284 285
					</td>
				</tr>
			</c:if>
286 287
			<c:if
				test="${metaDisplay['isGeneratedFrom'] && weblab:hasValue(resource, rdfProperties['isGeneratedFrom'])}">
288
				<tr>
289 290 291
					<th><fmt:message key="meta.isGeneratedFrom" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['isGeneratedFrom'] }" /></i></td>
292 293
				</tr>
			</c:if>
294 295
			<c:if
				test="${metaDisplay['abstract'] && weblab:hasValue(resource, rdfProperties['abstract'])}">
296
				<tr>
297 298 299
					<th><fmt:message key="meta.abstract" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['abstract'] }" /></i></td>
300 301
				</tr>
			</c:if>
302 303
			<c:if
				test="${metaDisplay['isProducedFrom'] && weblab:hasValue(resource, rdfProperties['isProducedFrom'])}">
304
				<tr>
305 306 307
					<th><fmt:message key="meta.isProducedFrom" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['isProducedFrom'] }" /></i></td>
308
				</tr>
309
			</c:if>
310 311
			<c:if
				test="${metaDisplay['description'] && weblab:hasValue(resource, rdfProperties['description'])}">
312
				<tr>
313 314 315
					<th><fmt:message key="meta.description" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['description'] }" /></i></td>
316 317
				</tr>
			</c:if>
318 319
			<c:if
				test="${metaDisplay['subject'] && weblab:hasValue(resource, rdfProperties['subject'])}">
320
				<tr>
321 322 323 324
					<th><fmt:message key="meta.subject" /></th>
					<td><i> <weblab:getPropertyValues
								uri="${rdfProperties['subject'] }" var="subjects" /> <c:forEach
								var="subject" items="${subjects }" varStatus="status">
325 326 327 328
								<c:if test="${status.count != 1}">
								,
								</c:if>
								${subject }
329 330
							</c:forEach>
					</i></td>
331 332
				</tr>
			</c:if>
333 334
			<c:if
				test="${metaDisplay['catego'] && weblab:hasValue(resource, rdfProperties['catego'])}">
335
				<tr>
336 337 338 339
					<th><fmt:message key="meta.catego" /></th>
					<td><i> <weblab:getPropertyValues
								uri="${rdfProperties['catego'] }" var="categories" /> <c:forEach
								var="catego" items="${categories}" varStatus="status">
340 341 342 343 344
								<c:if test="${status.count != 1}">
								,
								</c:if>
								${catego }
							</c:forEach>
345
					</i></td>
346 347
				</tr>
			</c:if>
348 349
			<c:if
				test="${metaDisplay['type'] && weblab:hasValue(resource, rdfProperties['type'])}">
350
				<tr>
351 352 353
					<th><fmt:message key="meta.type" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['type'] }" /></i></td>
354 355
				</tr>
			</c:if>
356 357
			<c:if
				test="${metaDisplay['coverage'] && weblab:hasValue(resource, rdfProperties['coverage'])}">
358
				<tr>
359 360 361
					<th><fmt:message key="meta.coverage" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['coverage'] }" /></i></td>
362 363
				</tr>
			</c:if>
364 365
			<c:if
				test="${metaDisplay['extent'] && weblab:hasValue(resource, rdfProperties['extent'])}">
366
				<tr>
367 368 369 370 371
					<th><fmt:message key="meta.extent" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['extent'] }" var="extents" /> <c:forEach
								var="extent" items="${extents}" varStatus="status">
								<c:if test="${status.count != 1}">
372 373 374
							,
							</c:if>
							${extent}
375
						</c:forEach></i></td>
376 377
				</tr>
			</c:if>
378 379
			<c:if
				test="${metaDisplay['projectName'] && weblab:hasValue(resource, rdfProperties['projectName'])}">
380
				<tr>
381 382 383
					<th><fmt:message key="meta.projectName" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['projectName'] }" /></i></td>
384 385
				</tr>
			</c:if>
386 387
			<c:if
				test="${metaDisplay['hasOriginalFileSize'] && weblab:hasValue(resource, rdfProperties['hasOriginalFileSize'])}">
388
				<tr>
389 390 391 392
					<th><fmt:message key="meta.hasOriginalFileSize" /></th>
					<td><weblab:getPropertyValues
							uri="${rdfProperties['hasOriginalFileSize'] }" var="fileSizes" />
						<weblab:renderValues style="fileSize" value="${fileSizes}" /></td>
393 394
				</tr>
			</c:if>
395 396
			<c:if
				test="${metaDisplay['refersTo'] && weblab:hasValue(resource, rdfProperties['refersTo'])}">
397
				<tr>
398 399 400 401 402 403 404 405 406 407 408
					<th><fmt:message key="meta.refersTo" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['refersTo'] }" /></i></td>
				</tr>
			</c:if>
			<c:if
				test="${metaDisplay['seeAlso'] && weblab:hasValue(resource, rdfProperties['seeAlso'])}">
				<tr>
					<th><fmt:message key="meta.seeAlso" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['seeAlso'] }" /></i></td>
409 410
				</tr>
			</c:if>
411 412
			<c:if
				test="${metaDisplay['rate'] && weblab:hasValue(resource, rdfProperties['rate'])}">
413
				<tr>
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477
					<th><fmt:message key="meta.rate" /></th>
					<td><c:set var="starSelected">
							<weblab:getPropertyValues uri="${rdfProperties['rate'] }" />
						</c:set>
						<div class="displayStar">
							<c:if test="${starSelected != 5}">
								<c:forEach begin="0" end="${5-starSelected-1}" varStatus="count">
									<span id="star${5-count.index}">&#9734</span>
								</c:forEach>
							</c:if>
							<c:forEach begin="0" end="${starSelected-1}">
								<span class="colorStar">&#9733</span>
							</c:forEach>
						</div></td>
				</tr>
			</c:if>
			<c:if
				test="${metaDisplay['comment'] && weblab:hasValue(resource, rdfProperties['comment'])}">
				<tr>
					<th><fmt:message key="meta.commented" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['comment'] }" /></i></td>
				</tr>
			</c:if>
			<c:if
				test="${metaDisplay['credibility'] && weblab:hasValue(resource, rdfProperties['credibility'])}">
				<tr>
					<th><fmt:message key="meta.credibility" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['credibility'] }" /></i></td>
				</tr>
			</c:if>
			<c:if
				test="${metaDisplay['reliability'] && weblab:hasValue(resource, rdfProperties['reliability'])}">
				<tr>
					<th><fmt:message key="meta.reliability" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['reliability'] }" /></i></td>
				</tr>
			</c:if>
			<c:if
				test="${metaDisplay['subjects'] && weblab:hasValue(resource, rdfProperties['subjects'])}">
				<tr>
					<th><fmt:message key="meta.subjects" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['subjects'] }" /> </i></td>
				</tr>
			</c:if>
			<c:if
				test="${metaDisplay['toKeep'] && weblab:hasValue(resource, rdfProperties['toKeep'])}">
				<tr>
					<th><fmt:message key="meta.toKeep" /></th>
					<td><i><weblab:getPropertyValues
								uri="${rdfProperties['toKeep'] }" /></i></td>
				</tr>
			</c:if>
			<c:if
				test="${metaDisplay['lat'] && weblab:hasValue(resource, rdfProperties['lat'])}">
				<input id="lat" type="hidden" value="<weblab:getPropertyValues
								uri="${rdfProperties['lat'] }" />">
				<input id="long" type="hidden" value="<weblab:getPropertyValues
								uri="${rdfProperties['long'] }" />">
				<tr>
					<th><fmt:message key="meta.location" /></th>
478
					<td>
479 480 481
						<div class="mapContener">
							<div id="displayMap"></div>
						</div>
482 483 484
					</td>
				</tr>
			</c:if>
485

486 487
		</tbody>
	</table>
488
</div>
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508

<div id="editView">
	<input id="buttonAdd" class="right-button addButton" type="button"
		value="Edit">
</div>

<script type="text/javascript">
	jQuery(document).ready(function() {
						openLayerMap(
								'${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}');
						jQuery("#buttonAdd").click(function($) {
							jQuery("#editView").slideDown(function() {
								jQuery(".meta_data_table").hide();
								jQuery("#editView").load("${editURL}");
							});
						});

					});
</script>