>
<%
String rankPredicateUri = vivoCore + "authorRank";
// RY We should use whatever is used on the individual profile page to list
// this property in rank order...
DataPropertyComparator comp = new DataPropertyComparator(rankPredicateUri);
Collections.sort(authorships, comp);
int maxRank = 0;
int authorshipCount = 0;
// for ( ObjectPropertyStatement stmt : authorshipStmts) {
// Individual authorship = stmt.getObject();
for ( Individual authorship : authorships ) {
authorshipCount++;
request.setAttribute("authorshipUri", authorship.getURI());
request.setAttribute("authorshipName", authorship.getName());
String rankValue = "";
DataPropertyStatement rankStmt = authorship.getDataPropertyStatement(rankPredicateUri);
if (rankStmt != null) {
rankValue = rankStmt.getData();
maxRank = Integer.valueOf(rankValue);
String rankDatatypeUri = rankStmt.getDatatypeURI();
if ( !StringUtils.isEmpty(rankDatatypeUri) ) {
rankValue += "_" + rankDatatypeUri;
}
}
request.setAttribute("rankValue", rankValue);
request.setAttribute("author", authorship.getRelatedIndividual(vivoCore + "linkedAuthor"));
// This value is used to replace a moved element after a failed reorder.
// It's not the same as rank, because ranks may have gaps.
request.setAttribute("position", authorshipCount);
%>
<%-- span.author will be used in the next phase, when we display a message that the author has been
removed. That text will replace the a.authorLink, which will be removed. --%>
<%-- This span is here to assign a width to. We can't assign directly to the a.authorLink,
for the case when it's followed by an em tag - we want the width to apply to the whole thing. --%>
${author.name}${authorshipName} (no linked author)Remove
<%-- Undo --%>
<%
}
// A new author will be ranked last when added.
// This wouldn't handle gaps in the ranking: vreq.setAttribute("rank", authorships.size()+1);
request.setAttribute("newRank", maxRank + 1);
request.setAttribute("rankPred", rankPredicateUri);
%>
<% if (authorshipCount == 0) { %>
This publication currently has no authors specified.
<% } %>
">
">
" >
Add an Author
<%-- RY maybe make this a label and input field. See what looks best. --%>