2010-06-11 21:11:19 +00:00
|
|
|
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
|
|
|
|
|
|
|
|
<%-- Custom form for adding authors to information resources
|
|
|
|
|
|
|
|
Classes:
|
|
|
|
core:InformationResource - the information resource being edited
|
|
|
|
core:Authorship - primary new individual being created
|
|
|
|
foaf:Person - new or existing individual
|
|
|
|
|
|
|
|
Data properties of Authorship:
|
|
|
|
core:authorRank
|
|
|
|
|
|
|
|
Object properties (domain : range)
|
|
|
|
|
|
|
|
core:informationResourceInAuthorship (InformationResource : Authorship)
|
|
|
|
core:linkedInformationResource (Authorship : InformationResource) - inverse of informationResourceInAuthorship
|
|
|
|
|
|
|
|
core:linkedAuthor (Authorship : Person)
|
|
|
|
core:authorInAuthorship (Person : Authorship) - inverse of linkedAuthor
|
|
|
|
|
|
|
|
--%>
|
|
|
|
|
|
|
|
<%@ page import="java.util.List" %>
|
|
|
|
<%@ page import="java.util.ArrayList" %>
|
|
|
|
<%@ page import="java.util.Arrays" %>
|
2010-06-15 22:27:08 +00:00
|
|
|
<%@ page import="java.util.Collections" %>
|
2010-06-24 14:31:23 +00:00
|
|
|
<%@ page import="java.net.URLEncoder" %>
|
2010-06-11 21:11:19 +00:00
|
|
|
|
|
|
|
<%@ page import="com.hp.hpl.jena.rdf.model.Model" %>
|
|
|
|
<%@ page import="com.hp.hpl.jena.vocabulary.XSD" %>
|
|
|
|
|
2010-06-22 17:52:37 +00:00
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %>
|
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.DataPropertyComparator" %>
|
2010-07-01 18:27:07 +00:00
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement" %>
|
2010-06-22 17:52:37 +00:00
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary" %>
|
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %>
|
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.PublicationHasAuthorValidator" %>
|
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
|
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest" %>
|
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils" %>
|
2010-06-16 15:33:16 +00:00
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.JavaScript" %>
|
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Css" %>
|
2010-06-11 21:11:19 +00:00
|
|
|
|
|
|
|
<%@ page import="org.apache.commons.logging.Log" %>
|
|
|
|
<%@ page import="org.apache.commons.logging.LogFactory" %>
|
|
|
|
|
|
|
|
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
|
|
|
|
<%@ taglib prefix="v" uri="http://vitro.mannlib.cornell.edu/vitro/tags" %>
|
|
|
|
|
|
|
|
<%!
|
|
|
|
public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.forms.addAuthorsToInformationResource.jsp");
|
|
|
|
%>
|
|
|
|
<%
|
|
|
|
VitroRequest vreq = new VitroRequest(request);
|
|
|
|
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
|
|
|
|
vreq.setAttribute("defaultNamespace", ""); //empty string triggers default new URI behavior
|
|
|
|
|
|
|
|
String flagUri = null;
|
|
|
|
if (wdf.getApplicationDao().isFlag1Active()) {
|
|
|
|
flagUri = VitroVocabulary.vitroURI+"Flag1Value"+vreq.getPortal().getPortalId()+"Thing";
|
|
|
|
} else {
|
|
|
|
flagUri = wdf.getVClassDao().getTopConcept().getURI(); // fall back to owl:Thing if not portal filtering
|
|
|
|
}
|
|
|
|
vreq.setAttribute("flagUri",flagUri);
|
|
|
|
|
|
|
|
vreq.setAttribute("stringDatatypeUriJson", MiscWebUtils.escape(XSD.xstring.toString()));
|
2010-07-01 14:50:02 +00:00
|
|
|
|
|
|
|
String intDatatypeUri = XSD.xint.toString();
|
|
|
|
vreq.setAttribute("intDatatypeUri", intDatatypeUri);
|
|
|
|
vreq.setAttribute("intDatatypeUriJson", MiscWebUtils.escape(intDatatypeUri));
|
2010-06-14 01:40:59 +00:00
|
|
|
%>
|
|
|
|
|
|
|
|
<c:set var="vivoCore" value="http://vivoweb.org/ontology/core#" />
|
|
|
|
<c:set var="rdfs" value="<%= VitroVocabulary.RDFS %>" />
|
|
|
|
<c:set var="label" value="${rdfs}label" />
|
|
|
|
<c:set var="foaf" value="http://xmlns.com/foaf/0.1/" />
|
2010-06-22 17:52:37 +00:00
|
|
|
<c:set var="personClassUri" value="${foaf}Person" />
|
2010-06-14 01:40:59 +00:00
|
|
|
|
|
|
|
<%-- Unlike other custom forms, this form does not allow edits of existing authors, so there are no
|
|
|
|
SPARQL queries for existing values. --%>
|
|
|
|
<%-- RY Is this claim correct, or do we need them to retrieve an existing individual? --%>
|
|
|
|
<%-- Data properties --%>
|
|
|
|
|
|
|
|
<v:jsonset var="newPersonFirstNameAssertion">
|
2010-06-15 19:35:38 +00:00
|
|
|
@prefix foaf: <${foaf}> .
|
2010-06-14 01:40:59 +00:00
|
|
|
?newPerson foaf:firstName ?firstName .
|
|
|
|
</v:jsonset>
|
|
|
|
|
|
|
|
<v:jsonset var="newPersonMiddleNameAssertion">
|
2010-06-15 19:35:38 +00:00
|
|
|
@prefix core: <${vivoCore}> .
|
2010-06-14 01:40:59 +00:00
|
|
|
?newPerson core:middleName ?middleName .
|
|
|
|
</v:jsonset>
|
|
|
|
|
|
|
|
<v:jsonset var="newPersonLastNameAssertion">
|
2010-06-15 19:35:38 +00:00
|
|
|
@prefix foaf: <${foaf}> .
|
2010-06-14 01:40:59 +00:00
|
|
|
?newPerson foaf:lastName ?lastName .
|
|
|
|
</v:jsonset>
|
|
|
|
|
|
|
|
<v:jsonset var="authorshipRankAssertion">
|
2010-06-15 19:35:38 +00:00
|
|
|
@prefix core: <${vivoCore}> .
|
2010-06-14 19:22:50 +00:00
|
|
|
?authorshipUri core:authorRank ?rank .
|
2010-06-14 01:40:59 +00:00
|
|
|
</v:jsonset>
|
|
|
|
|
2010-06-14 19:22:50 +00:00
|
|
|
<%-- This applies to both new and existing person --%>
|
2010-06-14 01:40:59 +00:00
|
|
|
<v:jsonset var="n3ForNewAuthorship">
|
|
|
|
@prefix core: <${vivoCore}> .
|
|
|
|
|
|
|
|
?authorshipUri a core:Authorship ,
|
2010-06-15 19:35:38 +00:00
|
|
|
<${flagUri}> ;
|
|
|
|
core:linkedInformationResource ?infoResource ;
|
|
|
|
core:authorRank ?rank .
|
2010-06-14 01:40:59 +00:00
|
|
|
|
|
|
|
?infoResource core:informationResourceInAuthorship ?authorshipUri .
|
|
|
|
</v:jsonset>
|
|
|
|
|
|
|
|
<v:jsonset var="n3ForExistingPerson">
|
|
|
|
@prefix core: <${vivoCore}> .
|
2010-06-15 19:35:38 +00:00
|
|
|
?authorshipUri core:linkedAuthor ?personUri .
|
|
|
|
?personUri core:authorInAuthorship ?authorshipUri .
|
2010-06-14 01:40:59 +00:00
|
|
|
</v:jsonset>
|
2010-06-11 21:11:19 +00:00
|
|
|
|
2010-06-14 01:40:59 +00:00
|
|
|
<v:jsonset var="n3ForNewPerson">
|
|
|
|
@prefix foaf: <${foaf}> .
|
|
|
|
@prefix core: <${vivoCore}> .
|
|
|
|
|
|
|
|
?newPerson a foaf:Person ,
|
2010-06-15 19:35:38 +00:00
|
|
|
<${flagUri}> ;
|
|
|
|
<${label}> ?label .
|
2010-06-14 01:40:59 +00:00
|
|
|
|
2010-06-15 19:35:38 +00:00
|
|
|
?authorshipUri core:linkedAuthor ?newPerson .
|
|
|
|
?newPerson core:authorInAuthorship ?authorshipUri .
|
2010-06-14 01:40:59 +00:00
|
|
|
</v:jsonset>
|
|
|
|
|
2010-06-22 17:52:37 +00:00
|
|
|
<v:jsonset var="personClassUriJson">${personClassUri}</v:jsonset>
|
|
|
|
|
2010-06-17 14:27:03 +00:00
|
|
|
<c:set var="returnPathAfterSubmit" value="/edit/editRequestDispatch.jsp?subjectUri=${subjectUri}&predicateUri=${predicateUri}" />
|
2010-06-15 22:27:08 +00:00
|
|
|
|
2010-06-14 01:40:59 +00:00
|
|
|
<c:set var="editjson" scope="request">
|
|
|
|
{
|
|
|
|
"formUrl" : "${formUrl}",
|
|
|
|
"editKey" : "${editKey}",
|
2010-06-17 14:27:03 +00:00
|
|
|
"urlPatternToReturnTo" : "${returnPathAfterSubmit}",
|
2010-06-14 01:40:59 +00:00
|
|
|
|
|
|
|
"subject" : ["infoResource", "${subjectUriJson}" ],
|
|
|
|
"predicate" : ["predicate", "${predicateUriJson}" ],
|
|
|
|
"object" : ["authorshipUri", "${objectUriJson}", "URI" ],
|
|
|
|
|
|
|
|
"n3required" : [ "${n3ForNewAuthorship}", "${authorshipRankAssertion}" ],
|
|
|
|
|
|
|
|
"n3optional" : [ "${newPersonFirstNameAssertion}", "${newPersonMiddleNameAssertion}",
|
|
|
|
"${newPersonLastNameAssertion}",
|
|
|
|
"${n3ForNewPerson}", "${n3ForExistingPerson}" ],
|
|
|
|
|
|
|
|
"newResources" : { "authorshipUri" : "${defaultNamespace}",
|
|
|
|
"newPerson" : "${defaultNamespace}" },
|
|
|
|
|
|
|
|
"urisInScope" : { },
|
|
|
|
"literalsInScope": { },
|
|
|
|
"urisOnForm" : [ "authorshipUri", "personUri" ],
|
2010-06-15 19:35:38 +00:00
|
|
|
"literalsOnForm" : [ "firstName", "middleName", "lastName", "rank", "label" ],
|
2010-06-14 01:40:59 +00:00
|
|
|
"filesOnForm" : [ ],
|
|
|
|
"sparqlForLiterals" : { },
|
|
|
|
"sparqlForUris" : { },
|
|
|
|
"sparqlForExistingLiterals" : { },
|
|
|
|
"sparqlForExistingUris" : { },
|
|
|
|
"fields" : {
|
2010-06-15 19:35:38 +00:00
|
|
|
"label" : {
|
|
|
|
"newResource" : "false",
|
|
|
|
"validators" : [ "datatype:${stringDatatypeUriJson}" ],
|
|
|
|
"optionsType" : "UNDEFINED",
|
|
|
|
"literalOptions" : [ ],
|
|
|
|
"predicateUri" : "",
|
|
|
|
"objectClassUri" : "",
|
|
|
|
"rangeDatatypeUri" : "${stringDatatypeUriJson}",
|
|
|
|
"rangeLang" : "",
|
|
|
|
"assertions" : [ "${n3ForNewPerson}" ]
|
|
|
|
},
|
2010-06-14 01:40:59 +00:00
|
|
|
"firstName" : {
|
|
|
|
"newResource" : "false",
|
2010-06-22 17:52:37 +00:00
|
|
|
"validators" : [ "datatype:${stringDatatypeUriJson}" ],
|
2010-06-14 01:40:59 +00:00
|
|
|
"optionsType" : "UNDEFINED",
|
|
|
|
"literalOptions" : [ ],
|
|
|
|
"predicateUri" : "",
|
|
|
|
"objectClassUri" : "",
|
|
|
|
"rangeDatatypeUri" : "${stringDatatypeUriJson}",
|
|
|
|
"rangeLang" : "",
|
|
|
|
"assertions" : [ "${newPersonFirstNameAssertion}" ]
|
|
|
|
},
|
|
|
|
"middleName" : {
|
|
|
|
"newResource" : "false",
|
|
|
|
"validators" : [ "datatype:${stringDatatypeUriJson}" ],
|
|
|
|
"optionsType" : "UNDEFINED",
|
|
|
|
"literalOptions" : [ ],
|
|
|
|
"predicateUri" : "",
|
|
|
|
"objectClassUri" : "",
|
|
|
|
"rangeDatatypeUri" : "${stringDatatypeUriJson}",
|
|
|
|
"rangeLang" : "",
|
|
|
|
"assertions" : [ "${newPersonMiddleNameAssertion}" ]
|
|
|
|
},
|
|
|
|
"lastName" : {
|
|
|
|
"newResource" : "false",
|
2010-06-22 17:52:37 +00:00
|
|
|
"validators" : [ "datatype:${stringDatatypeUriJson}" ],
|
2010-06-14 01:40:59 +00:00
|
|
|
"optionsType" : "UNDEFINED",
|
|
|
|
"literalOptions" : [ ],
|
|
|
|
"predicateUri" : "",
|
|
|
|
"objectClassUri" : "",
|
|
|
|
"rangeDatatypeUri" : "${stringDatatypeUriJson}",
|
|
|
|
"rangeLang" : "",
|
|
|
|
"assertions" : [ "${newPersonLastNameAssertion}" ]
|
|
|
|
},
|
|
|
|
"rank" : {
|
|
|
|
"newResource" : "false",
|
|
|
|
"validators" : [ "nonempty" ],
|
|
|
|
"optionsType" : "UNDEFINED",
|
|
|
|
"literalOptions" : [ ],
|
|
|
|
"predicateUri" : "",
|
|
|
|
"objectClassUri" : "",
|
|
|
|
"rangeDatatypeUri" : "${intDatatypeUriJson}",
|
|
|
|
"rangeLang" : "",
|
|
|
|
"assertions" : ["${authorshipRankAssertion}"]
|
2010-06-22 17:52:37 +00:00
|
|
|
},
|
|
|
|
"personUri" : {
|
|
|
|
"newResource" : "false",
|
|
|
|
"validators" : [ ],
|
|
|
|
"optionsType" : "UNDEFINED",
|
|
|
|
"literalOptions" : [ ],
|
|
|
|
"predicateUri" : "",
|
|
|
|
"objectClassUri" : "${personClassUriJson}",
|
|
|
|
"rangeDatatypeUri" : "",
|
|
|
|
"rangeLang" : "",
|
|
|
|
"assertions" : ["${n3ForExistingPerson}"]
|
2010-06-14 01:40:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</c:set>
|
|
|
|
|
|
|
|
<%
|
|
|
|
log.debug(request.getAttribute("editjson"));
|
|
|
|
|
|
|
|
EditConfiguration editConfig = EditConfiguration.getConfigFromSession(session,request);
|
|
|
|
if (editConfig == null) {
|
|
|
|
editConfig = new EditConfiguration((String) request.getAttribute("editjson"));
|
|
|
|
EditConfiguration.putConfigInSession(editConfig,session);
|
|
|
|
}
|
2010-06-22 17:52:37 +00:00
|
|
|
|
2010-06-22 20:49:30 +00:00
|
|
|
editConfig.addValidator(new PublicationHasAuthorValidator());
|
2010-06-15 19:35:38 +00:00
|
|
|
|
2010-06-14 01:40:59 +00:00
|
|
|
Model model = (Model) application.getAttribute("jenaOntModel");
|
|
|
|
String objectUri = (String) request.getAttribute("objectUri");
|
|
|
|
editConfig.prepareForNonUpdate(model); // we're only adding new, not editing existing
|
|
|
|
|
2010-06-11 21:11:19 +00:00
|
|
|
String subjectUri = vreq.getParameter("subjectUri");
|
|
|
|
String predicateUri = vreq.getParameter("predicateUri");
|
2010-06-15 22:27:08 +00:00
|
|
|
|
|
|
|
Individual infoResource = vreq.getWebappDaoFactory().getIndividualDao().getIndividualByURI(subjectUri);
|
2010-06-11 21:11:19 +00:00
|
|
|
List<Individual> authorships = infoResource.getRelatedIndividuals(predicateUri);
|
2010-07-01 15:15:54 +00:00
|
|
|
String rankPredicateUri = "http://vivoweb.org/ontology/core#authorRank";
|
|
|
|
DataPropertyComparator comp = new DataPropertyComparator(rankPredicateUri);
|
2010-06-15 22:27:08 +00:00
|
|
|
Collections.sort(authorships, comp);
|
2010-06-15 19:35:38 +00:00
|
|
|
|
2010-06-11 21:11:19 +00:00
|
|
|
vreq.setAttribute("infoResourceName", infoResource.getName());
|
|
|
|
|
|
|
|
String linkedAuthorProperty = "http://vivoweb.org/ontology/core#linkedAuthor";
|
2010-06-16 15:33:16 +00:00
|
|
|
|
|
|
|
List<String> customJs = new ArrayList<String>(Arrays.asList(JavaScript.JQUERY_UI.path(),
|
|
|
|
JavaScript.UTILS.path(),
|
|
|
|
JavaScript.CUSTOM_FORM_UTILS.path(),
|
2010-06-14 20:06:53 +00:00
|
|
|
"/edit/forms/js/addAuthorsToInformationResource.js"
|
|
|
|
));
|
2010-06-11 21:11:19 +00:00
|
|
|
request.setAttribute("customJs", customJs);
|
|
|
|
|
2010-06-16 15:33:16 +00:00
|
|
|
List<String> customCss = new ArrayList<String>(Arrays.asList(Css.JQUERY_UI.path(),
|
|
|
|
Css.CUSTOM_FORM.path(),
|
2010-06-14 19:22:50 +00:00
|
|
|
"/edit/forms/css/addAuthorsToInformationResource.css"
|
2010-06-11 21:11:19 +00:00
|
|
|
));
|
|
|
|
request.setAttribute("customCss", customCss);
|
|
|
|
%>
|
|
|
|
|
2010-06-15 22:27:08 +00:00
|
|
|
<c:set var="title" value="<em>${infoResourceName}</em>: Authors" />
|
2010-06-11 21:11:19 +00:00
|
|
|
<c:set var="requiredHint" value="<span class='requiredHint'> *</span>" />
|
2010-06-22 22:12:33 +00:00
|
|
|
<c:set var="initialHint" value="<span class='hint'>(initial okay)</span>" />
|
2010-06-11 21:11:19 +00:00
|
|
|
|
|
|
|
<jsp:include page="${preForm}" />
|
|
|
|
|
|
|
|
<h2>${title}</h2>
|
2010-06-29 22:08:28 +00:00
|
|
|
|
|
|
|
<%
|
|
|
|
// 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"));
|
|
|
|
%>
|
|
|
|
|
2010-07-01 19:31:29 +00:00
|
|
|
<ul id="authorships">
|
2010-06-11 21:11:19 +00:00
|
|
|
<%
|
2010-07-01 14:50:02 +00:00
|
|
|
|
2010-06-16 14:29:54 +00:00
|
|
|
int rank = 0;
|
2010-07-02 03:40:06 +00:00
|
|
|
int index = 0;
|
2010-06-11 21:11:19 +00:00
|
|
|
for ( Individual authorship : authorships ) {
|
2010-07-01 18:27:07 +00:00
|
|
|
String rankDatatypeUri = "";
|
|
|
|
DataPropertyStatement rankStmt = authorship.getDataPropertyStatement(rankPredicateUri);
|
|
|
|
if (rankStmt != null) {
|
|
|
|
rank = Integer.valueOf(rankStmt.getData());
|
|
|
|
rankDatatypeUri = rankStmt.getDatatypeURI();
|
|
|
|
}
|
|
|
|
|
2010-06-14 16:36:12 +00:00
|
|
|
Individual author = authorship.getRelatedIndividual(linkedAuthorProperty);
|
|
|
|
if ( author != null ) {
|
2010-07-02 03:40:06 +00:00
|
|
|
index++;
|
2010-07-01 18:27:07 +00:00
|
|
|
request.setAttribute("authorName", author.getName());
|
2010-06-24 14:31:23 +00:00
|
|
|
// 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());
|
2010-06-29 16:15:51 +00:00
|
|
|
request.setAttribute("authorshipUri", authorship.getURI());
|
2010-07-01 18:27:07 +00:00
|
|
|
request.setAttribute("rankValue", rank + "_" + rankDatatypeUri);
|
2010-07-01 14:50:02 +00:00
|
|
|
request.setAttribute("rank", rank);
|
2010-07-02 03:40:06 +00:00
|
|
|
|
|
|
|
// 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);
|
2010-06-29 22:08:28 +00:00
|
|
|
|
2010-06-11 21:11:19 +00:00
|
|
|
%>
|
2010-06-14 16:36:12 +00:00
|
|
|
<c:url var="authorHref" value="/individual">
|
2010-06-24 14:31:23 +00:00
|
|
|
<c:param name="uri" value="${authorUri}"/>
|
2010-06-29 16:15:51 +00:00
|
|
|
</c:url>
|
2010-07-02 03:40:06 +00:00
|
|
|
<c:url var="deleteAuthorshipHref" value="/edit/primitiveDelete" />
|
2010-07-01 14:50:02 +00:00
|
|
|
|
|
|
|
<%-- <c:url var="undoHref" value="/edit/addAuthorToInformationResource" /> --%>
|
|
|
|
<li class="authorship" id="${authorshipUri}">
|
2010-07-02 03:40:06 +00:00
|
|
|
<span class="rank" id="${rankValue}"></span>
|
|
|
|
<span class="position" id="${position}"></span>
|
2010-07-01 14:50:02 +00:00
|
|
|
<%-- 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. --%>
|
2010-07-01 18:27:07 +00:00
|
|
|
<span class="author"><a href="${authorHref}" id="${authorUri}" class="authorLink">${authorName}</a>
|
2010-07-01 14:50:02 +00:00
|
|
|
<a href="${deleteAuthorshipHref}" class="remove">Remove</a>
|
|
|
|
<%-- <a href="${undoHref}" class="undo">Undo</a> --%></span>
|
2010-06-22 20:49:30 +00:00
|
|
|
</li>
|
2010-06-11 21:11:19 +00:00
|
|
|
|
|
|
|
<%
|
2010-07-01 14:50:02 +00:00
|
|
|
}
|
2010-06-11 21:11:19 +00:00
|
|
|
}
|
2010-06-15 22:27:08 +00:00
|
|
|
// A new author will be ranked last when added.
|
2010-06-24 14:31:23 +00:00
|
|
|
// This wouldn't handle gaps in the ranking: vreq.setAttribute("rank", authorships.size()+1);
|
2010-07-01 15:15:54 +00:00
|
|
|
request.setAttribute("newRank", rank + 1);
|
|
|
|
request.setAttribute("rankPred", rankPredicateUri);
|
2010-06-11 21:11:19 +00:00
|
|
|
%>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
2010-06-22 17:52:37 +00:00
|
|
|
<%
|
|
|
|
if (authorships.size() == 0) {
|
|
|
|
%><p>This publication currently has no authors specified.</p><%
|
|
|
|
}
|
|
|
|
%>
|
|
|
|
|
2010-06-14 16:36:12 +00:00
|
|
|
<div id="showAddForm">
|
2010-06-17 14:27:03 +00:00
|
|
|
<v:input type="submit" value="Add Author" id="showAddFormButton" cancel="true" cancelLabel="Return to Publication" cancelUrl="/individual" />
|
2010-06-14 16:36:12 +00:00
|
|
|
</div>
|
|
|
|
|
2010-07-02 15:09:39 +00:00
|
|
|
<div id="infoForJs">
|
|
|
|
<span class="rankPred" id="${rankPred}"></span>
|
|
|
|
<span class="rankXsdType" id="${intDatatypeUri}"></span>
|
|
|
|
<span class="acUrl" id="<c:url value="/autocomplete?type=${foaf}Person&stem=false" />"></span>
|
|
|
|
<span class="reorderUrl" id="<c:url value="/edit/primitiveRdfEdit" />"></span>
|
|
|
|
</div>
|
|
|
|
|
2010-06-11 21:11:19 +00:00
|
|
|
<form id="addAuthorForm" action="<c:url value="/edit/processRdfForm2.jsp"/>" >
|
2010-06-22 17:52:37 +00:00
|
|
|
|
|
|
|
<h3>Add an Author</h3>
|
2010-06-11 21:11:19 +00:00
|
|
|
|
2010-06-29 22:08:28 +00:00
|
|
|
<p class="inline"><v:input type="text" id="lastName" label="Name ${requiredHint}" size="30" /></p>
|
2010-06-22 22:12:33 +00:00
|
|
|
<p class="inline"><v:input type="text" id="firstName" label="First name ${requiredHint} ${initialHint}" size="20" /></p>
|
|
|
|
<p class="inline"><v:input type="text" id="middleName" label="Middle name ${initialHint}" size="20" /></p>
|
2010-06-22 17:52:37 +00:00
|
|
|
<input type="hidden" id="label" name="label" value="" /> <!-- Field value populated by JavaScript -->
|
|
|
|
|
|
|
|
<div id="selectedAuthor">
|
|
|
|
<%-- RY maybe make this a label and input field. See what looks best. --%>
|
|
|
|
<p class="inline"><label>Selected author: </label><span id="selectedAuthorName"></span></p>
|
|
|
|
<input type="hidden" id="personUri" name="personUri" value="" /> <!-- Field value populated by JavaScript -->
|
|
|
|
</div>
|
|
|
|
|
2010-07-01 18:27:07 +00:00
|
|
|
<input type="hidden" name="rank" id="rank" value="${newRank}" />
|
2010-06-22 17:52:37 +00:00
|
|
|
|
2010-06-17 14:27:03 +00:00
|
|
|
<p class="submit"><v:input type="submit" id="submit" value="Add Author" cancel="true" /></p>
|
2010-06-11 21:11:19 +00:00
|
|
|
|
|
|
|
<p id="requiredLegend" class="requiredHint">* required fields</p>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<jsp:include page="${postForm}"/>
|
|
|
|
|