<%
String ulClass = "";
if (authorships.size() > 1) {
// This class triggers application of dd styles. Don't wait for js to add
// the ui-sortable class, because then the page flashes as the styles are updated.
ulClass = "dd";
}
if (! "".equals(ulClass)) {
ulClass = "class='" + ulClass + "'";
}
%>
>
<%
int rank = 0;
int index = 0;
for ( Individual authorship : authorships ) {
String rankDatatypeUri = "";
DataPropertyStatement rankStmt = authorship.getDataPropertyStatement(rankPredicateUri);
if (rankStmt != null) {
rank = Integer.valueOf(rankStmt.getData());
rankDatatypeUri = rankStmt.getDatatypeURI();
}
Individual author = authorship.getRelatedIndividual(linkedAuthorProperty);
if ( author != null ) {
index++;
request.setAttribute("authorName", author.getName());
// Doesn't seem to need urlencoding to add as id attribute value
//request.setAttribute("authorUri", URLEncoder.encode(author.getURI(), "UTF-8"));
request.setAttribute("authorUri", author.getURI());
request.setAttribute("authorshipUri", authorship.getURI());
request.setAttribute("rankValue", rank + "_" + rankDatatypeUri);
request.setAttribute("rank", rank);
// 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. It's easier to
// reposition the element using ordering.
request.setAttribute("position", index);
%>
<%-- This span 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. --%>
${authorName}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", rank + 1);
request.setAttribute("rankPred", rankPredicateUri);
%>
<%
if (authorships.size() == 0) {
%>
This publication currently has no authors specified.
<%
}
%>
">
">
" >
Add an Author
<%-- RY maybe make this a label and input field. See what looks best. --%>