diff --git a/productMods/edit/forms/addAuthorsToInformationResource.jsp b/productMods/edit/forms/addAuthorsToInformationResource.jsp index 149269f2..ccfe4ea3 100644 --- a/productMods/edit/forms/addAuthorsToInformationResource.jsp +++ b/productMods/edit/forms/addAuthorsToInformationResource.jsp @@ -24,6 +24,7 @@ core:authorInAuthorship (Person : Authorship) - inverse of linkedAuthor <%@ page import="java.util.ArrayList" %> <%@ page import="java.util.Arrays" %> <%@ page import="java.util.Collections" %> +<%@ page import="java.net.URLEncoder" %> <%@ page import="com.hp.hpl.jena.rdf.model.Model" %> <%@ page import="com.hp.hpl.jena.vocabulary.XSD" %> @@ -287,13 +288,15 @@ SPARQL queries for existing values. --%> 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()); %> - +
  • - ${author.URI} - ${author.name} + ${author.name} Remove
  • @@ -302,7 +305,7 @@ SPARQL queries for existing values. --%> } // A new author will be ranked last when added. - // This doesn't handle gaps in the ranking: vreq.setAttribute("rank", authorships.size()+1); + // This wouldn't handle gaps in the ranking: vreq.setAttribute("rank", authorships.size()+1); vreq.setAttribute("rank", rank + 1); %> diff --git a/productMods/edit/forms/js/addAuthorsToInformationResource.js b/productMods/edit/forms/js/addAuthorsToInformationResource.js index 4c0795fa..83f03ada 100644 --- a/productMods/edit/forms/js/addAuthorsToInformationResource.js +++ b/productMods/edit/forms/js/addAuthorsToInformationResource.js @@ -168,7 +168,7 @@ var addAuthorForm = { var cache = {}; var url = $('#acUrl').val(); var existingAuthorUris = addAuthorForm.getExistingAuthorUris(); - + jQuery.each(existingAuthorUris, function(index, element) { url += '&filter=' + element; }); @@ -208,9 +208,10 @@ var addAuthorForm = { }, getExistingAuthorUris: function() { - var authorUris = $('span.existingAuthorUri'); - return authorUris.map(function() { - return $(this).html(); + + var existingAuthors = $('#authors .existingAuthor'); + return existingAuthors.map(function() { + return $(this).attr('id'); }); },