hierarchyElement.jsp 2.39 KB
Newer Older
1
2
3
4
5
<%@page import="de.unibamberg.minf.processing.model.helper.ResourceHelper"%>
<%@page import="de.unibamberg.minf.processing.model.base.Resource"%>
<%@page import="java.util.List"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
6
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

<c:set var="hierarchyElementTitle" scope="request" value="" />
<c:choose>
	<c:when test="${idTitleMap!=null && fn:length(idTitleMap)>0}">
		<c:forEach items="${idTitleMap}" var="e">
			<c:if test="${e.key==hierarchyElement.id}">
				<c:forEach items="${e.value}" var="title">
					<c:set var="hierarchyElementTitle" scope="request" value="${hierarchyElementTitle} ${fn:replace(title.value, newLineChar, ' ')}" />
				</c:forEach>
			</c:if>
		</c:forEach>
	</c:when>
</c:choose>

<c:if test="${fn:length(hierarchyElementTitle)==0}">
22
23
24
	<c:set var="hierarchyElementTitle" scope="request">
		<s:message code="~eu.dariah.de.minfba.search.view.result.no_title" />
	</c:set>
25
26
</c:if>

27
<li class="${hierarchyElement.id==item.id ? 'item-detail-hierarchy-element-selected' : 'item-detail-hierarchy-element'}">
28
29
	<c:choose>
		<c:when test="${hierarchyElement.id==item.id}">
Gradl, Tobias's avatar
Gradl, Tobias committed
30
			${hierarchyElementTitle} 
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
		</c:when>
		<c:otherwise>
			<a href="/item/${type}/${hierarchyElement.id}/">${hierarchyElementTitle}</a>		
		</c:otherwise>
	</c:choose>
	
	<c:if test="${hierarchyElement.relatedElementsMap!=null && fn:length(hierarchyElement.relatedElementsMap)>0}">
		<ul class="item-detail-hierarchy">
			<c:forEach items="${hierarchyElement.relatedElementsMap}" var="e">
				<c:if test="${e.key=='PARENT_OF'}">
					<c:set var="placeholderElements" value="false" />
					<c:forEach items="${e.value}" var="childElement">						
						<c:choose>
							<c:when test="${!childElement.placeholder}">
				    			<c:set var="hierarchyElement" value="${childElement}" scope="request"/>
				    			<jsp:include page="hierarchyElement.jsp" />
				    		</c:when>
							<c:otherwise>
								<c:set var="placeholderElements" value="true" />
							</c:otherwise>
						</c:choose>	
			    	</c:forEach>
			    	
			    	<c:if test="${placeholderElements}">
55
			    		<li class="item-detail-hierarchy-placeholder">... ${fn:length(e.value)} <s:message code="~eu.dariah.de.minfba.search.view.result.subelements_total" /></li>
56
57
58
59
60
61
			    	</c:if>
			    </c:if>
			</c:forEach>
		</ul>
	</c:if>
</li>