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
|
2010-07-05 16:58:46 +00:00
|
|
|
foaf:Person - new or existing individual being linked to
|
2010-06-11 21:11:19 +00:00
|
|
|
|
|
|
|
Data properties of Authorship:
|
|
|
|
core:authorRank
|
|
|
|
|
2010-07-06 14:05:57 +00:00
|
|
|
Object properties (domain : range):
|
2010-06-11 21:11:19 +00:00
|
|
|
|
|
|
|
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-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" %>
|
2011-05-12 16:04:28 +00:00
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.EditConfiguration" %>
|
2010-06-22 17:52:37 +00:00
|
|
|
<%@ 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
|
|
|
|
2011-07-11 21:13:05 +00:00
|
|
|
<%@ page import="org.apache.commons.lang.StringUtils" %>
|
2010-07-09 16:29:00 +00:00
|
|
|
<%@ page import="org.json.JSONObject" %>
|
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
|
|
|
|
|
|
|
|
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. --%>
|
2010-07-06 14:05:57 +00:00
|
|
|
|
2010-06-14 01:40:59 +00:00
|
|
|
<%-- 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-07-06 22:48:04 +00:00
|
|
|
<%-- This applies to both a new and an existing person --%>
|
2010-06-14 01:40:59 +00:00
|
|
|
<v:jsonset var="n3ForNewAuthorship">
|
|
|
|
@prefix core: <${vivoCore}> .
|
|
|
|
|
2010-07-08 15:08:42 +00:00
|
|
|
?authorshipUri a core:Authorship ;
|
2010-06-15 19:35:38 +00:00
|
|
|
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}> .
|
|
|
|
|
2010-07-08 15:08:42 +00:00
|
|
|
?newPerson a foaf:Person ;
|
2010-06-15 19:35:38 +00:00
|
|
|
<${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": { },
|
2010-07-06 22:48:04 +00:00
|
|
|
"urisOnForm" : [ "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>
|
|
|
|
|
2010-07-04 19:43:39 +00:00
|
|
|
<%
|
2010-06-14 01:40:59 +00:00
|
|
|
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");
|
2010-07-26 22:16:11 +00:00
|
|
|
|
|
|
|
//for some reason we are comming from the add new and that is working
|
|
|
|
//but we also come from the edit, and that is not working.
|
|
|
|
editConfig.setObject(""); //this will force the edit config to always be an add, never an update
|
|
|
|
|
2010-06-14 01:40:59 +00:00
|
|
|
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-07-06 22:48:04 +00:00
|
|
|
|
2010-07-05 17:51:44 +00:00
|
|
|
String vivoCore = "http://vivoweb.org/ontology/core#";
|
|
|
|
|
2010-07-06 22:48:04 +00:00
|
|
|
//Individual infoResource = vreq.getWebappDaoFactory().getIndividualDao().getIndividualByURI(subjectUri);
|
|
|
|
Individual infoResource = ((Individual) request.getAttribute("subject"));
|
2010-06-11 21:11:19 +00:00
|
|
|
vreq.setAttribute("infoResourceName", infoResource.getName());
|
|
|
|
|
2010-07-06 22:48:04 +00:00
|
|
|
List<Individual> authorships = infoResource.getRelatedIndividuals(predicateUri);
|
|
|
|
|
2010-06-16 15:33:16 +00:00
|
|
|
List<String> customJs = new ArrayList<String>(Arrays.asList(JavaScript.JQUERY_UI.path(),
|
|
|
|
JavaScript.CUSTOM_FORM_UTILS.path(),
|
2010-07-22 18:50:49 +00:00
|
|
|
"/js/browserUtils.js",
|
2010-06-14 20:06:53 +00:00
|
|
|
"/edit/forms/js/addAuthorsToInformationResource.js"
|
2010-07-06 22:48:04 +00:00
|
|
|
));
|
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-07-06 22:48:04 +00:00
|
|
|
"/edit/forms/css/autocomplete.css",
|
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-07-04 19:43:39 +00:00
|
|
|
|
|
|
|
String ulClass = "";
|
|
|
|
List<String> ulClasses = new ArrayList<String>();
|
|
|
|
|
|
|
|
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.
|
|
|
|
ulClasses.add("dd");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ulClasses.size() > 0) {
|
|
|
|
ulClass="class=\"" + StringUtils.join(ulClasses, " ") + "\"";
|
|
|
|
}
|
2010-06-11 21:11:19 +00:00
|
|
|
%>
|
|
|
|
|
2010-07-13 14:13:19 +00:00
|
|
|
<c:set var="title" value="<em>${infoResourceName}</em>"/>
|
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}" />
|
|
|
|
|
2011-11-14 21:28:04 +00:00
|
|
|
<h1>JSP form, must be removed for the 1.4!</h1>
|
|
|
|
|
2010-07-15 12:02:36 +00:00
|
|
|
<%-- DO NOT CHANGE IDS, CLASSES, OR HTML STRUCTURE ON THIS PAGE WITHOUT UNDERSTANDING THE IMPACT ON THE JAVASCRIPT! --%>
|
2010-06-11 21:11:19 +00:00
|
|
|
<h2>${title}</h2>
|
2010-06-29 22:08:28 +00:00
|
|
|
|
2010-07-22 18:50:49 +00:00
|
|
|
<%@ include file="unsupportedBrowserMessage.jsp" %>
|
|
|
|
|
|
|
|
<div class="noIE67">
|
2010-07-13 14:13:19 +00:00
|
|
|
<h3>Manage Authors</h3>
|
|
|
|
|
2010-07-02 18:29:08 +00:00
|
|
|
<ul id="authorships" <%= ulClass %>>
|
2010-07-05 16:58:46 +00:00
|
|
|
<%
|
2010-08-25 18:27:46 +00:00
|
|
|
String rankPredicateUri = vivoCore + "authorRank";
|
|
|
|
|
2010-07-05 16:58:46 +00:00
|
|
|
DataPropertyComparator comp = new DataPropertyComparator(rankPredicateUri);
|
|
|
|
Collections.sort(authorships, comp);
|
2010-07-02 18:29:08 +00:00
|
|
|
|
2010-07-05 16:58:46 +00:00
|
|
|
int maxRank = 0;
|
2010-08-19 14:41:14 +00:00
|
|
|
int authorshipCount = authorships.size();
|
2010-07-05 18:17:33 +00:00
|
|
|
|
2010-08-16 18:52:10 +00:00
|
|
|
%>
|
|
|
|
<script type="text/javascript">
|
|
|
|
var authorshipData = [];
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<%
|
2010-07-05 16:58:46 +00:00
|
|
|
for ( Individual authorship : authorships ) {
|
2010-07-05 20:57:37 +00:00
|
|
|
|
|
|
|
request.setAttribute("authorshipUri", authorship.getURI());
|
|
|
|
request.setAttribute("authorshipName", authorship.getName());
|
|
|
|
|
|
|
|
DataPropertyStatement rankStmt = authorship.getDataPropertyStatement(rankPredicateUri);
|
|
|
|
if (rankStmt != null) {
|
2010-08-25 18:27:46 +00:00
|
|
|
maxRank = Integer.parseInt(rankStmt.getData());
|
2010-07-05 20:57:37 +00:00
|
|
|
}
|
2010-07-05 21:13:15 +00:00
|
|
|
|
2010-08-19 14:41:14 +00:00
|
|
|
request.setAttribute("author", authorship.getRelatedIndividual(vivoCore + "linkedAuthor"));
|
|
|
|
|
2010-07-05 20:57:37 +00:00
|
|
|
%>
|
2010-08-16 21:45:33 +00:00
|
|
|
<li class="authorship">
|
2010-07-05 20:57:37 +00:00
|
|
|
<%-- span.author will be used in the next phase, when we display a message that the author has been
|
2010-07-14 13:28:11 +00:00
|
|
|
removed. That text will replace the a.authorName, which will be removed. --%>
|
2010-07-05 20:57:37 +00:00
|
|
|
<span class="author">
|
2010-07-14 13:28:11 +00:00
|
|
|
<%-- This span is here to assign a width to. We can't assign directly to the a.authorName,
|
2010-07-05 21:29:16 +00:00
|
|
|
for the case when it's followed by an em tag - we want the width to apply to the whole thing. --%>
|
2010-07-14 13:28:11 +00:00
|
|
|
<span class="authorNameWrapper">
|
2010-08-25 18:27:46 +00:00
|
|
|
<c:choose>
|
|
|
|
<c:when test="${!empty author}">
|
|
|
|
<c:set var="authorUri" value="${author.URI}" />
|
2010-08-16 18:52:10 +00:00
|
|
|
<c:set var="authorName" value="${author.name}" />
|
2010-08-25 18:27:46 +00:00
|
|
|
<c:url var="authorHref" value="/individual">
|
|
|
|
<c:param name="uri" value="${authorUri}"/>
|
|
|
|
</c:url>
|
|
|
|
<span class="authorName">${authorName}</span>
|
|
|
|
</c:when>
|
|
|
|
|
|
|
|
<c:otherwise>
|
|
|
|
<c:set var="authorUri" value="" />
|
2010-08-16 18:52:10 +00:00
|
|
|
<c:set var="authorName" value="" />
|
2010-08-25 18:27:46 +00:00
|
|
|
<c:url var="authorshipHref" value="/individual">
|
|
|
|
<c:param name="uri" value="${authorshipUri}"/>
|
|
|
|
</c:url>
|
|
|
|
<span class="authorName">${authorshipName}</span><em> (no linked author)</em>
|
|
|
|
</c:otherwise>
|
|
|
|
</c:choose>
|
2010-07-05 21:29:16 +00:00
|
|
|
</span>
|
2010-07-05 20:57:37 +00:00
|
|
|
<c:url var="deleteAuthorshipHref" value="/edit/primitiveDelete" />
|
2010-07-05 16:58:46 +00:00
|
|
|
<a href="${deleteAuthorshipHref}" class="remove">Remove</a>
|
2010-07-05 20:57:37 +00:00
|
|
|
<%-- <a href="${undoHref}" class="undo">Undo</a> --%>
|
|
|
|
</span>
|
2010-08-16 18:52:10 +00:00
|
|
|
</li>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
authorshipData.push({
|
|
|
|
"authorshipUri": "${authorshipUri}",
|
|
|
|
"authorUri": "${authorUri}",
|
|
|
|
"authorName": "${authorName}"
|
|
|
|
});
|
|
|
|
</script>
|
2010-07-05 20:57:37 +00:00
|
|
|
<%
|
2010-07-05 16:58:46 +00:00
|
|
|
}
|
2010-08-25 18:27:46 +00:00
|
|
|
|
2010-07-05 16:58:46 +00:00
|
|
|
// A new author will be ranked last when added.
|
2010-07-08 21:57:05 +00:00
|
|
|
// This value is now inserted by JavaScript, but leave it here as a safety net in case page
|
|
|
|
// load reordering returns an error.
|
2010-07-05 16:58:46 +00:00
|
|
|
request.setAttribute("newRank", maxRank + 1);
|
2010-08-25 18:27:46 +00:00
|
|
|
request.setAttribute("rankPredicate", rankPredicateUri);
|
2010-07-05 16:58:46 +00:00
|
|
|
%>
|
2010-06-11 21:11:19 +00:00
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
2010-07-05 20:57:37 +00:00
|
|
|
<% if (authorshipCount == 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-15 12:02:36 +00:00
|
|
|
<%-- DO NOT CHANGE IDS, CLASSES, OR HTML STRUCTURE IN THIS FORM WITHOUT UNDERSTANDING THE IMPACT ON THE JAVASCRIPT! --%>
|
2010-12-08 14:04:45 +00:00
|
|
|
<form id="addAuthorForm" class="customForm" action="<c:url value="/edit/processRdfForm2.jsp"/>" >
|
2010-06-22 17:52:37 +00:00
|
|
|
|
|
|
|
<h3>Add an Author</h3>
|
2010-08-16 18:52:10 +00:00
|
|
|
|
2010-09-20 21:11:58 +00:00
|
|
|
<p class="inline"><v:input type="text" id="lastName" label="Last name ${requiredHint}" cssClass="acSelector" size="35" /></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 -->
|
|
|
|
|
2010-07-06 22:48:04 +00:00
|
|
|
<div id="selectedAuthor" class="acSelection">
|
2010-06-22 17:52:37 +00:00
|
|
|
<%-- RY maybe make this a label and input field. See what looks best. --%>
|
2010-07-09 16:29:00 +00:00
|
|
|
<p class="inline"><label>Selected author: </label><span class="acSelectionInfo" id="selectedAuthorName"></span></p>
|
2010-06-22 17:52:37 +00:00
|
|
|
<input type="hidden" id="personUri" name="personUri" value="" /> <!-- Field value populated by JavaScript -->
|
|
|
|
</div>
|
2010-08-16 18:52:10 +00:00
|
|
|
|
2010-07-01 18:27:07 +00:00
|
|
|
<input type="hidden" name="rank" id="rank" value="${newRank}" />
|
2010-06-17 14:27:03 +00:00
|
|
|
<p class="submit"><v:input type="submit" id="submit" value="Add Author" cancel="true" /></p>
|
2010-08-16 18:52:10 +00:00
|
|
|
|
2010-06-11 21:11:19 +00:00
|
|
|
<p id="requiredLegend" class="requiredHint">* required fields</p>
|
|
|
|
</form>
|
2010-07-22 18:50:49 +00:00
|
|
|
</div>
|
2010-06-11 21:11:19 +00:00
|
|
|
|
2011-06-28 19:18:07 +00:00
|
|
|
<c:url var="acUrl" value="/autocomplete?type=${foaf}Person&tokenize=false" />
|
2010-08-25 18:27:46 +00:00
|
|
|
<c:url var="reorderUrl" value="/edit/reorder" />
|
2010-07-12 14:47:35 +00:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
var customFormData = {
|
2010-08-25 18:27:46 +00:00
|
|
|
rankPredicate: '${rankPredicate}',
|
|
|
|
acUrl: '${acUrl}',
|
|
|
|
reorderUrl: '${reorderUrl}'
|
2010-07-12 14:47:35 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
2010-06-11 21:11:19 +00:00
|
|
|
<jsp:include page="${postForm}"/>
|
|
|
|
|