<%
// 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 ) {
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 ) {
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);
%>
<%-- --%>
<%-- ${rankDatatypeUri}--%>
<%-- 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. --%>
${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. --%>