<%
// Try this in order to get the new author hightlighted after page reload.
// If we do an ajax submit, we won't need it.
//String processedForm = (String) vreq.getAttribute("processedForm");
//String ulClass = "";
//if (processedForm != null && processedForm.equals("true")) {
// ulClass = "class='processedSubmission'";
//}
//System.out.println(vreq.getAttribute("entToReturnTo"));
%>
<%
int rank = 0;
for ( Individual authorship : authorships ) {
int rank1 = Integer.valueOf(authorship.getDataValue(rankUri));
String rankValue = authorship.getDataValue(rankUri); // full value, including xsd type if present
if (rankValue == null) {
rankValue = "";
rank = 0;
} else {
rank = Integer.valueOf(rankValue); // just the integer value
}
Individual author = authorship.getRelatedIndividual(linkedAuthorProperty);
if ( author != null ) {
request.setAttribute("author", author);
// 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("rank", rank);
%>
<%-- --%>
<%-- 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. --%>
${author.name}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);
vreq.setAttribute("newRank", rank + 1);
vreq.setAttribute("rankPred", rankUri);
%>
<%
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. --%>