Commit 294f1e97 authored by Ubbo Veentjer's avatar Ubbo Veentjer
Browse files

unify agent/author handling. use id as url if not starting with 'pnd:'. closes #59

parent 1adb3aef
Pipeline #139182 passed with stages
in 12 minutes and 2 seconds
...@@ -44,31 +44,7 @@ ...@@ -44,31 +44,7 @@
<dt>${i18n['format']}</dt><dd>${metadata.object.generic.provided.format}</dd> <dt>${i18n['format']}</dt><dd>${metadata.object.generic.provided.format}</dd>
<!-- show author when available, first agent otherwise --> <!-- show author when available, first agent otherwise -->
<c:choose> <%@ include file="components/authorAndAgents.jsp" %>
<c:when test="${not empty metadata.object.edition.source[0].bibliographicCitation.author[0].value}">
<dt>${i18n['author']}</dt>
<dd>
${metadata.object.edition.source[0].bibliographicCitation.author[0].value}
<c:if test="${not empty metadata.object.edition.source[0].bibliographicCitation.author[0].id}">
(<a href="http://d-nb.info/gnd/${fn:substringAfter(metadata.object.edition.source[0].bibliographicCitation.author[0].id, 'pnd:')}">GND</a>)
</c:if>
</dd>
</c:when>
<c:when test="${not empty metadata.object.edition.agent[0].value}">
<dt>${i18n['agent']}</dt>
<c:forEach items="${metadata.object.edition.agent}" var="agent">
<dd>
${agent.value}
<c:if test="${not empty agent.role}">
(${fn:substring(agent.role, 0, 1)}${fn:toLowerCase(fn:substring(agent.role, 1, -1))})
</c:if>
<c:if test="${not empty agent.id}">
<a href="http://d-nb.info/gnd/${fn:substringAfter(agent.id, 'pnd:')}">GND</a>
</c:if>
</dd>
</c:forEach>
</c:when>
</c:choose>
<c:if test="${not empty metadata.object.edition.source[0].bibliographicCitation.dateOfPublication.date}"> <c:if test="${not empty metadata.object.edition.source[0].bibliographicCitation.dateOfPublication.date}">
<dt>${i18n['date-of-publication']}</dt><dd>${metadata.object.edition.source[0].bibliographicCitation.dateOfPublication.date}</dd> <dt>${i18n['date-of-publication']}</dt><dd>${metadata.object.edition.source[0].bibliographicCitation.dateOfPublication.date}</dd>
......
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<c:set var="agentString" value="${agent.value}"></c:set>
<dd>
<c:choose>
<c:when test="${not empty agent.id}">
<c:choose>
<c:when test="${fn:startsWith(agent.id, 'pnd:')}">
<a href="http://d-nb.info/gnd/${fn:substringAfter(agent.id, 'pnd:')}">${agentString}</a> ${agentRole}
</c:when>
<c:otherwise>
<a href="${agent.id}">${agentString}</a> ${agentRole}
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
${agentString} ${agentRole}
</c:otherwise>
</c:choose>
</dd>
\ No newline at end of file
<c:choose>
<c:when test="${not empty result.object.edition.source[0].bibliographicCitation.author[0].value}">
<dt>${i18n['author']}</dt>
<c:set var="agent" value="${result.object.edition.source[0].bibliographicCitation.author[0]}" />
<%@ include file="agent.jsp" %>
</c:when>
<c:when test="${not empty result.object.edition.agent[0].value}">
<dt>${i18n['agent']}</dt>
<c:forEach items="${result.object.edition.agent}" var="agent">
<c:if test="${not empty agent.role}">
<c:set var="agentRole">(${fn:substring(agent.role, 0, 1)}${fn:toLowerCase(fn:substring(agent.role, 1, -1))})</c:set>
</c:if>
<%@ include file="agent.jsp" %>
</c:forEach>
</c:when>
</c:choose>
\ No newline at end of file
...@@ -85,31 +85,7 @@ ...@@ -85,31 +85,7 @@
<dt>${i18n['format']}</dt> <dt>${i18n['format']}</dt>
<dd>${result.object.generic.provided.format}</dd> <dd>${result.object.generic.provided.format}</dd>
<!-- show author when available, first agent otherwise --> <!-- show author when available, first agent otherwise -->
<c:choose> <%@ include file="authorAndAgents.jsp" %>
<c:when test="${not empty result.object.edition.source[0].bibliographicCitation.author[0].value}">
<dt>${i18n['author']}</dt>
<dd>
${result.object.edition.source[0].bibliographicCitation.author[0].value}
<c:if test="${not empty result.object.edition.source[0].bibliographicCitation.author[0].id}">
(<a href="http://d-nb.info/gnd/${fn:substringAfter(result.object.edition.source[0].bibliographicCitation.author[0].id, 'pnd:')}">GND</a>)
</c:if>
</dd>
</c:when>
<c:when test="${not empty result.object.edition.agent[0].value}">
<dt>${i18n['agent']}</dt>
<c:forEach items="${result.object.edition.agent}" var="agent">
<dd>
${agent.value}
<c:if test="${not empty agent.role}">
(${fn:substring(agent.role, 0, 1)}${fn:toLowerCase(fn:substring(agent.role, 1, -1))})
</c:if>
<c:if test="${not empty agent.id}">
[<a href="http://d-nb.info/gnd/${fn:substringAfter(agent.id, 'pnd:')}">GND</a>]
</c:if>
</dd>
</c:forEach>
</c:when>
</c:choose>
<c:if test="${not empty result.object.edition.source[0].bibliographicCitation.dateOfPublication.date}"> <c:if test="${not empty result.object.edition.source[0].bibliographicCitation.dateOfPublication.date}">
<dt>${i18n['date-of-publication']}</dt> <dt>${i18n['date-of-publication']}</dt>
<dd>${result.object.edition.source[0].bibliographicCitation.dateOfPublication.date}</dd> <dd>${result.object.edition.source[0].bibliographicCitation.dateOfPublication.date}</dd>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment