From cf64f9cf8501107a04a55c6a9ac3320334492982 Mon Sep 17 00:00:00 2001 From: Tim Worrall Date: Mon, 2 Jun 2014 11:28:56 -0400 Subject: [PATCH 01/13] updates to list view to correctly access name parts --- ...Config-informationResourceInAuthorship.xml | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/productMods/config/listViewConfig-informationResourceInAuthorship.xml b/productMods/config/listViewConfig-informationResourceInAuthorship.xml index ad97811c..9ba1da67 100644 --- a/productMods/config/listViewConfig-informationResourceInAuthorship.xml +++ b/productMods/config/listViewConfig-informationResourceInAuthorship.xml @@ -31,7 +31,14 @@ } OPTIONAL { ?authorship core:relates ?author . ?author a vcard:Kind . - ?author rdfs:label ?authorName + ?author vcard:hasName ?vName . + ?vName vcard:givenName ?firstName . + ?vName core:middleName ?middleName . + ?vName vcard:familyName ?lastName . + bind ( COALESCE(?firstName, "") As ?firstName1) . + bind ( COALESCE(?middleName, "") As ?middleName1) . + bind ( COALESCE(?lastName, "") As ?lastName1) . + bind (concat(str(?lastName1 + ", "),str(?middleName1 + " "),str(?firstName1)) as ?authorName) . OPTIONAL { ?authorship core:relates ?author . ?author a vcard:Kind . @@ -97,7 +104,10 @@ ?authorship ?authorshipProperty ?authorshipValue . ?authorship core:relates ?author . ?author a vcard:Kind . - ?author rdfs:label ?authorName . + ?author vcard:hasName ?vName . + ?vName vcard:familyName ?lastName . + ?vName vcard:givenName ?firstName . + ?vName core:middleName ?middleName . ?author vitro:mostSpecificType ?subclass . ?subclass rdfs:subClassOf vcard:Kind } WHERE { @@ -113,13 +123,30 @@ ?authorship a core:Authorship . ?authorship core:relates ?author . ?author a vcard:Kind . - ?author rdfs:label ?authorName + ?author vcard:hasName ?vName . + ?vName vcard:familyName ?lastName . } UNION { + ?subject ?property ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?author . + ?author a vcard:Kind . + ?author vcard:hasName ?vName . + ?vName vcard:familyName ?lastName . + ?vName vcard:givenName ?firstName . + } UNION { + ?subject ?property ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?author . + ?author a vcard:Kind . + ?author vcard:hasName ?vName . + ?vName vcard:familyName ?lastName . + ?vName vcard:givenName ?firstName . + ?vName core:middleName ?middleName . + } UNION { ?subject ?property ?authorship . ?authorship a core:Authorship . ?authorship core:relates ?author . ?author a vcard:Kind . - ?author rdfs:label ?authorName . ?author vitro:mostSpecificType ?subclass . ?subclass rdfs:subClassOf vcard:Kind } From b823bb4eae405648061af7f64c372ff3324dac5a Mon Sep 17 00:00:00 2001 From: j2blake Date: Tue, 3 Jun 2014 10:28:27 -0400 Subject: [PATCH 02/13] VIVO-773 Remove "connectDB" function of advanced data tools. It was tied up with RDB. It could have been converted, but there was little interest. --- productMods/jenaIngest/ingestMenu.jsp | 1 - 1 file changed, 1 deletion(-) diff --git a/productMods/jenaIngest/ingestMenu.jsp b/productMods/jenaIngest/ingestMenu.jsp index 882ec420..3168e6d7 100644 --- a/productMods/jenaIngest/ingestMenu.jsp +++ b/productMods/jenaIngest/ingestMenu.jsp @@ -8,7 +8,6 @@

Ingest Menu

From 78ee69ee001f5984e90ee44dc6750c04cff8d876 Mon Sep 17 00:00:00 2001 From: Tim Worrall Date: Tue, 3 Jun 2014 13:02:24 -0400 Subject: [PATCH 03/13] VIVO-743: new custom forms for adding participant to project andcontributor to grant/contract --- .../themes/wilma/i18n/all_es_GO.properties | 4 +- .../edit/forms/grantHasContributor.ftl | 185 +++++++++++++++++ .../edit/forms/js/grantHasContributorUtils.js | 80 ++++++++ .../edit/forms/projectHasParticipant.ftl | 2 +- rdf/display/everytime/PropertyConfig.n3 | 2 + .../GrantHasContributorGenerator.java | 190 ++++++++++++++++++ .../ProjectHasParticipantGenerator.java | 8 +- themes/wilma/i18n/all.properties | 4 +- 8 files changed, 468 insertions(+), 7 deletions(-) create mode 100644 productMods/templates/freemarker/edit/forms/grantHasContributor.ftl create mode 100644 productMods/templates/freemarker/edit/forms/js/grantHasContributorUtils.js create mode 100644 src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/GrantHasContributorGenerator.java diff --git a/languages/es_GO/themes/wilma/i18n/all_es_GO.properties b/languages/es_GO/themes/wilma/i18n/all_es_GO.properties index 88e99c11..3f645749 100644 --- a/languages/es_GO/themes/wilma/i18n/all_es_GO.properties +++ b/languages/es_GO/themes/wilma/i18n/all_es_GO.properties @@ -878,4 +878,6 @@ missing_credential = falta credencial grant_administered_by = conceder administrado por missing_grant = falta de subvención editor_of_entry = editor de para -researcher_role = El papel del investigador en el proyecto +role_type = Tipo de papel +add_capitalized = Añadir +researcher_role = El papel del investigador \ No newline at end of file diff --git a/productMods/templates/freemarker/edit/forms/grantHasContributor.ftl b/productMods/templates/freemarker/edit/forms/grantHasContributor.ftl new file mode 100644 index 00000000..43a42ce3 --- /dev/null +++ b/productMods/templates/freemarker/edit/forms/grantHasContributor.ftl @@ -0,0 +1,185 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- this is in request.subject.name --> + +<#-- leaving this edit/add mode code in for reference in case we decide we need it --> + +<#import "lib-vivo-form.ftl" as lvf> + +<#assign subjectName=""/> +<#assign roleActivityUri="mysteryRoleActivityURI"/> +<#assign personLabel="mysteryPersonLabel"/> + +<#--Retrieve certain edit configuration information--> +<#assign editMode = editConfiguration.pageData.editMode /> +<#assign htmlForElements = editConfiguration.pageData.htmlForElements /> + +<#--The blank sentinel indicates what value should be put in a URI when no autocomplete result has been selected. +If the blank value is non-null or non-empty, n3 editing for an existing object will remove the original relationship +if nothing is selected for that object--> +<#assign blankSentinel = "" /> +<#if editConfigurationConstants?has_content && editConfigurationConstants?keys?seq_contains("BLANK_SENTINEL")> + <#assign blankSentinel = editConfigurationConstants["BLANK_SENTINEL"] /> + + +<#--This flag is for clearing the label field on submission for an existing object being selected from autocomplete. +Set this flag on the input acUriReceiver where you would like this behavior to occur. --> +<#assign flagClearLabelForExisting = "flagClearLabelForExisting" /> + +<#--Retrieve variables needed--> +<#assign firstNameValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "firstName")/> +<#assign lastNameValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "lastName") /> +<#assign personLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "personLabel") /> +<#assign personLabelDisplayValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "personLabelDisplay") /> +<#assign existingPersonValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingPerson") /> +<#assign roleTypeValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "roleType")/> + +<#-- If edit submission exists, then retrieve validation errors if they exist--> +<#if editSubmission?has_content && editSubmission.submissionExists = true && editSubmission.validationErrors?has_content> + <#assign submissionErrors = editSubmission.validationErrors/> + + +<#if editMode == "edit" || editMode == "repair"> + <#assign titleVerb="${i18n().edit_capitalized}"> + <#assign submitButtonText="${i18n().save_changes}"> + <#assign disabledVal="disabled"> +<#else> + <#assign titleVerb="${i18n().add_capitalized}"> + <#assign submitButtonText="${i18n().create_entry}"> + <#assign disabledVal=""/> + + +<#assign requiredHint = " *" /> +<#assign yearHint = "(${i18n().year_hint_format})" /> + + +

${titleVerb} ${i18n().researcher} ${i18n().to} ${editConfiguration.subjectName}

+ +<#--Display error messages if any--> +<#if submissionErrors?has_content> + <#if personLabelDisplayValue?has_content > + <#assign personLabelValue = personLabelDisplayValue /> + + + + +<@lvf.unsupportedBrowser urls.base /> + +
+ +
+

+ + + +
+ + +

+ +
+

+ + + (${i18n().verify_match_capitalized} ${i18n().or} + ${i18n().change_selection}) +

+ +
+ + + <#assign roleTypeOpts = editConfiguration.pageData.roleType /> + + + <#--End draw elements--> + +

+ ${i18n().or} + ${i18n().cancel_link} +

+ +

* ${i18n().required_fields}

+ +
+ + + + +
+ +${stylesheets.add('')} +${stylesheets.add('')} +${stylesheets.add('')} + + +${scripts.add('', + '', + '', + '', + '', + '', + '')} + + diff --git a/productMods/templates/freemarker/edit/forms/js/grantHasContributorUtils.js b/productMods/templates/freemarker/edit/forms/js/grantHasContributorUtils.js new file mode 100644 index 00000000..23d1630b --- /dev/null +++ b/productMods/templates/freemarker/edit/forms/js/grantHasContributorUtils.js @@ -0,0 +1,80 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +var grantHasContributorUtils = { + + onLoad: function(blankSentinel) { + this.sentinel = ''; + if ( blankSentinel ) { this.sentinel = blankSentinel; } + + this.initObjectReferences(); + this.bindEventListeners(); + + $.extend(this, vitro.customFormUtils); + $.extend(this, i18nStrings); + + if ( this.findValidationErrors() ) { + this.resetLastNameLabel(); + } + }, + + initObjectReferences: function() { + + this.form = $('#grantHasContributor'); + this.person = $('#person'); + this.fauxLabel = $('#maskLabelBuilding'); + this.firstName = $('#firstName'); + this.lastName = $('#lastName'); + this.personUri = $('#personUri'); + + // may not need this + this.firstName.attr('disabled', ''); + + }, + + bindEventListeners: function() { + this.idCache = {}; + + this.form.submit(function() { + grantHasContributorUtils.resolveFirstLastNames(); + }); + }, + + resolveFirstLastNames: function() { + var firstName, + lastName, + name; + + // If selecting an existing person, don't submit name fields + if (this.personUri.val() == '' || this.personUri.val() == this.sentinel ) { + firstName = this.firstName.val(); + lastName = this.person.val(); + + name = lastName; + + if (firstName) { + name += ', ' + firstName; + } + + // we don't want the user to see the label getting built, so hide the acSelector + // field and display a bogus field that just has the last name in it. + this.fauxLabel.val(lastName); + this.person.hide(); + this.fauxLabel.show(); + this.person.val(name); + this.lastName.val(lastName); + } + else { + this.firstName.attr('disabled', 'disabled'); + this.lastName.attr('disabled', 'disabled'); + } + }, + + resetLastNameLabel: function() { + var indx = this.person.val().indexOf(", "); + if ( indx != -1 ) { + var temp = this.person.val().substr(0,indx); + this.person.val(temp); + } + }, + +} diff --git a/productMods/templates/freemarker/edit/forms/projectHasParticipant.ftl b/productMods/templates/freemarker/edit/forms/projectHasParticipant.ftl index 1e1aeba5..d73d6636 100644 --- a/productMods/templates/freemarker/edit/forms/projectHasParticipant.ftl +++ b/productMods/templates/freemarker/edit/forms/projectHasParticipant.ftl @@ -44,7 +44,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o <#assign submitButtonText="${i18n().save_changes}"> <#assign disabledVal="disabled"> <#else> - <#assign titleVerb="${i18n().create_capitalized}"> + <#assign titleVerb="${i18n().add_capitalized}"> <#assign submitButtonText="${i18n().create_entry}"> <#assign disabledVal=""/> diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index 5ec9d41a..f8bc0c66 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -1762,6 +1762,7 @@ local:grantRelatesConfig a :ObjectPropertyDisplayConfig ; vitro:displayRankAnnot 55; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody ; + vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.GrantHasContributorGenerator"^^ ; :propertyGroup . local:contractRelatesContext a :ConfigContext ; @@ -1776,6 +1777,7 @@ local:contractRelatesConfig a :ObjectPropertyDisplayConfig ; vitro:displayRankAnnot 55; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:nobody ; + vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.GrantHasContributorGenerator"^^ ; :propertyGroup . ### faux properties for dateTimeValue ### diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/GrantHasContributorGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/GrantHasContributorGenerator.java new file mode 100644 index 00000000..5dbf4fde --- /dev/null +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/GrantHasContributorGenerator.java @@ -0,0 +1,190 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ +package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +import javax.servlet.http.HttpSession; + +import com.hp.hpl.jena.vocabulary.XSD; + +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.FirstAndLastNameValidator; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.DateTimeIntervalValidationVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.DateTimeWithPrecisionVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ChildVClassesOptions; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ChildVClassesWithParent; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.IndividualsViaVClassOptions; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators.AntiXssValidation; +import edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils.EditMode; +import edu.cornell.mannlib.vitro.webapp.utils.generators.EditModeUtils; + +public class GrantHasContributorGenerator extends VivoBaseGenerator implements EditConfigurationGenerator{ + + // NOTE: This generator is for contract as well as grants. + //TODO: can we get rid of the session and get it form the vreq? + public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { + + EditConfigurationVTwo conf = new EditConfigurationVTwo(); + + initBasics(conf, vreq); + initPropertyParameters(vreq, session, conf); + initObjectPropForm(conf, vreq); + + conf.setTemplate("grantHasContributor.ftl"); + + conf.setVarNameForSubject("subject"); + conf.setVarNameForPredicate("predicate"); + conf.setVarNameForObject("theRole"); + + conf.setN3Required( Arrays.asList( n3ForNewProjectRole, roleTypeAssertion ) ); + conf.setN3Optional(Arrays.asList( n3ForNewPerson, n3ForExistingPerson, firstNameAssertion, lastNameAssertion ) ); + + conf.addNewResource("theRole", DEFAULT_NS_FOR_NEW_RESOURCE); + conf.addNewResource("newPerson",DEFAULT_NS_FOR_NEW_RESOURCE); + conf.addNewResource("vcardPerson", DEFAULT_NS_FOR_NEW_RESOURCE); + conf.addNewResource("vcardName", DEFAULT_NS_FOR_NEW_RESOURCE); + + //uris in scope: none + //literals in scope: none + + conf.setUrisOnform( Arrays.asList( "existingPerson", "roleType")); + conf.setLiteralsOnForm( Arrays.asList("personLabel", "personLabelDisplay", "firstName", "lastName")); + + conf.addSparqlForExistingLiteral("personLabel", personLabelQuery); + + conf.addSparqlForExistingUris("existingPerson", existingPersonQuery); + conf.addSparqlForExistingUris("roleType", roleTypeQuery); + + conf.addField( new FieldVTwo(). + setName("existingPerson") + //options will be added in browser by auto complete JS + ); + + conf.addField( new FieldVTwo(). + setName("personLabel"). + setRangeDatatypeUri(XSD.xstring.toString() ). + setValidators( list("datatype:" + XSD.xstring.toString()))); + + conf.addField( new FieldVTwo(). + setName("personLabelDisplay"). + setRangeDatatypeUri(XSD.xstring.toString() )); + + conf.addField( new FieldVTwo(). + setName("firstName"). + setRangeDatatypeUri(XSD.xstring.toString() ). + setValidators( list("datatype:" + XSD.xstring.toString()) ) + ); + + conf.addField( new FieldVTwo(). + setName("lastName"). + setRangeDatatypeUri(XSD.xstring.toString() ). + setValidators( list("datatype:" + XSD.xstring.toString()) ) + ); + + conf.addField( new FieldVTwo(). + setName("roleType"). + setValidators( list("nonempty") ). + setOptions( + new ChildVClassesWithParent("http://vivoweb.org/ontology/core#ResearcherRole"))); + + + //Add validator + conf.addValidator(new AntiXssValidation()); + conf.addValidator(new FirstAndLastNameValidator("existingPerson")); + + //Adding additional data, specifically edit mode + addFormSpecificData(conf, vreq); + prepare(vreq, conf); + return conf; + } + + /* N3 assertions for working with educational training */ + + final static String n3ForNewProjectRole = + "@prefix core: <"+ vivoCore +"> .\n" + + "@prefix rdfs: <"+ rdfs +"> . \n"+ + "?subject core:relates ?theRole .\n" + + "?theRole core:relatedBy ?subject . \n" ; + + final static String roleTypeAssertion = + "?theRole a ?roleType ."; + + final static String n3ForNewPerson = + "@prefix core: <"+ vivoCore +"> .\n" + + "?theRole ?newPerson . \n" + + "?newPerson ?theRole . \n" + + "?subject core:relates ?newPerson . \n" + + "?newPerson core:relatedBy ?subject . \n" + + "?newPerson a . \n" + + "?newPerson <"+ label +"> ?personLabel . "; + + final static String n3ForExistingPerson = + "@prefix core: <"+ vivoCore +"> .\n" + + "?theRole ?existingPerson . \n" + + "?existingPerson ?theRole . \n" + + "?subject core:relates ?newPerson . \n" + + "?newPerson core:relatedBy ?subject . \n" + + " "; + + final static String firstNameAssertion = + "@prefix vcard: . \n" + + "?newPerson ?vcardPerson . \n" + + "?vcardPerson ?newPerson . \n" + + "?vcardPerson a . \n" + + "?vcardPerson vcard:hasName ?vcardName . \n" + + "?vcardName a . \n" + + "?vcardName vcard:givenName ?firstName ."; + + final static String lastNameAssertion = + "@prefix vcard: . \n" + + "?newPerson ?vcardPerson . \n" + + "?vcardPerson ?newPerson . \n" + + "?vcardPerson a . \n" + + "?vcardPerson vcard:hasName ?vcardName . \n" + + "?vcardName a . \n" + + "?vcardName vcard:familyName ?lastName ."; + + /* Queries for editing an existing educational training entry */ + + final static String roleTypeQuery = + "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + + "SELECT ?roleType WHERE { \n" + + " ?theRole vitro:mostSpecificType ?roleType . }"; + + final static String existingPersonQuery = + "PREFIX rdfs: <"+ rdfs +"> \n"+ + "SELECT ?existingPerson WHERE {\n"+ + "?theRole ?existingPerson . \n" + + "?existingPerson ?theRole . \n" + + "?existingPerson a . \n " + + " }"; + + final static String personLabelQuery = + "PREFIX rdfs: <"+ rdfs +"> \n"+ + "SELECT ?existingPersonLabel WHERE {\n"+ + "?theRole ?existingPerson . \n" + + "?existingPerson ?theRole .\n"+ + "?existingPerson <"+ label +"> ?existingPersonLabel .\n"+ + "?existingPerson a . \n " + + " }"; + + + //Adding form specific data such as edit mode + public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + HashMap formSpecificData = new HashMap(); + formSpecificData.put("editMode", getEditMode(vreq).name().toLowerCase()); + editConfiguration.setFormSpecificData(formSpecificData); + } + + public EditMode getEditMode(VitroRequest vreq) { + List predicates = new ArrayList(); + predicates.add("http://purl.obolibrary.org/obo/RO_0000053"); + return EditModeUtils.getEditMode(vreq, predicates); + } +} diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ProjectHasParticipantGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ProjectHasParticipantGenerator.java index 88642c89..57e4b507 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ProjectHasParticipantGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ProjectHasParticipantGenerator.java @@ -154,16 +154,16 @@ public class ProjectHasParticipantGenerator extends VivoBaseGenerator implement final static String existingPersonQuery = "PREFIX rdfs: <"+ rdfs +"> \n"+ "SELECT ?existingPerson WHERE {\n"+ - "?projectRole ?existingPerson . \n" + - "?existingPerson ?projectRole . \n" + + "?projectRole ?existingPerson . \n" + + "?existingPerson ?projectRole . \n" + "?existingPerson a . \n " + " }"; final static String personLabelQuery = "PREFIX rdfs: <"+ rdfs +"> \n"+ "SELECT ?existingPersonLabel WHERE {\n"+ - "?projectRole ?existingPerson . \n" + - "?existingPerson ?projectRole .\n"+ + "?projectRole ?existingPerson . \n" + + "?existingPerson ?projectRole .\n"+ "?existingPerson <"+ label +"> ?existingPersonLabel .\n"+ "?existingPerson a . \n " + " }"; diff --git a/themes/wilma/i18n/all.properties b/themes/wilma/i18n/all.properties index 9154b55a..648aae2e 100644 --- a/themes/wilma/i18n/all.properties +++ b/themes/wilma/i18n/all.properties @@ -884,4 +884,6 @@ missing_credential = missing credential grant_administered_by = grant being administered by missing_grant = missing grant editor_of_entry = editor of entry for -researcher_role = Researcher's role in the project \ No newline at end of file +role_type = Role type +add_capitalized = Add +researcher_role = Researcher Role \ No newline at end of file From 8c1e3cde9354d369ec109a047ff68e6973ed1991 Mon Sep 17 00:00:00 2001 From: Tim Worrall Date: Wed, 4 Jun 2014 16:56:49 -0400 Subject: [PATCH 04/13] VIVO-654: make role label fields on custom forms optional input, not required --- .../edit/forms/addPresenterRoleToPerson.ftl | 5 +--- .../edit/forms/addRoleToPersonTwoStage.ftl | 2 +- .../AddPresenterRoleToPersonGenerator.java | 23 +++++++++---------- .../AddRoleToPersonTwoStageGenerator.java | 3 --- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/productMods/templates/freemarker/edit/forms/addPresenterRoleToPerson.ftl b/productMods/templates/freemarker/edit/forms/addPresenterRoleToPerson.ftl index 84b7ef74..c0429914 100644 --- a/productMods/templates/freemarker/edit/forms/addPresenterRoleToPerson.ftl +++ b/productMods/templates/freemarker/edit/forms/addPresenterRoleToPerson.ftl @@ -73,9 +73,6 @@ Set this flag on the input acUriReceiver where you would like this behavior to o <#if lvf.submissionErrorExists(editSubmission, "presentationLabel")> ${i18n().select_or_enter_name} - <#if lvf.submissionErrorExists(editSubmission, "roleLabel")> - ${i18n().enter_new_role_value} - <#list submissionErrors?keys as errorFieldName> <#if errorFieldName == "startField"> <#if submissionErrors[errorFieldName]?contains("before")> @@ -128,7 +125,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o -

+

diff --git a/productMods/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl b/productMods/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl index b8e5981f..892af9e8 100644 --- a/productMods/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl +++ b/productMods/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl @@ -179,7 +179,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o <#if showRoleLabelField = true> -

+

diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPresenterRoleToPersonGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPresenterRoleToPersonGenerator.java index 78a1f6ce..ed2591be 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPresenterRoleToPersonGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPresenterRoleToPersonGenerator.java @@ -58,9 +58,9 @@ public class AddPresenterRoleToPersonGenerator extends VivoBaseGenerator impleme conf.setVarNameForPredicate("predicate"); conf.setVarNameForObject("role"); - conf.setN3Required( Arrays.asList( n3ForNewRole, - roleLabelAssertion) ); - conf.setN3Optional( Arrays.asList( n3ForNewPresentation, + conf.setN3Required( Arrays.asList( n3ForNewRole ) ); + conf.setN3Optional( Arrays.asList( n3ForRoleLabelAssertion, + n3ForNewPresentation, n3ForExistingPresentation, n3ForNewConferenceNewPres, n3ForNewConferenceExistingPres, @@ -125,10 +125,9 @@ public class AddPresenterRoleToPersonGenerator extends VivoBaseGenerator impleme ); conf.addField( new FieldVTwo(). - setName("roleLabel") - .setRangeDatatypeUri( XSD.xstring.toString() ). - setValidators( list("nonempty") ) - ); + setName("roleLabel"). + setRangeDatatypeUri( XSD.xstring.toString() ). + setValidators(list("datatype:" + XSD.xstring.toString()))); conf.addField( new FieldVTwo(). // an autocomplete field setName("existingConference") @@ -169,14 +168,14 @@ public class AddPresenterRoleToPersonGenerator extends VivoBaseGenerator impleme /* N3 assertions */ final static String n3ForNewRole = - "@prefix core: <" + vivoCore + "> . \n\n" + + "@prefix core: <" + vivoCore + "> . \n" + "?person <" + hasRolePred + "> ?role . \n" + - "?role a <" + roleClass + "> . \n" + + "?role a <" + roleClass + "> . \n" + "?role <" + roleOfPred + "> ?person . "; + + final static String n3ForRoleLabelAssertion = + "?role <" + label + "> ?roleLabel . "; - final static String roleLabelAssertion = - "?role <" + label + "> ?roleLabel ."; - final static String n3ForNewPresentation = "?role <" + roleRealizedInPred + "> ?presentation . \n" + "?presentation <" + realizedRolePred + "> ?role . \n" + diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java index ea76d04b..575c0345 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java @@ -737,9 +737,6 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura List validators = new ArrayList(); validators.add("datatype:" + stringDatatypeUri); - if(isShowRoleLabelField()) { - validators.add("nonempty"); - } field.setValidators(validators); fields.put(field.getName(), field); From a9b3bfd9c2414f20bc1067ba1a342d2d1b3ff738 Mon Sep 17 00:00:00 2001 From: Tim Worrall Date: Fri, 6 Jun 2014 11:04:23 -0400 Subject: [PATCH 05/13] VIVO-785: make middle name optional in list view and fix advisor genertor to clarify role --- .../config/listViewConfig-informationResourceInAuthorship.xml | 2 +- .../generators/PersonHasAdvisorRelationshipGenerator.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/productMods/config/listViewConfig-informationResourceInAuthorship.xml b/productMods/config/listViewConfig-informationResourceInAuthorship.xml index 9ba1da67..762b3b7c 100644 --- a/productMods/config/listViewConfig-informationResourceInAuthorship.xml +++ b/productMods/config/listViewConfig-informationResourceInAuthorship.xml @@ -33,8 +33,8 @@ ?author a vcard:Kind . ?author vcard:hasName ?vName . ?vName vcard:givenName ?firstName . - ?vName core:middleName ?middleName . ?vName vcard:familyName ?lastName . + OPTIONAL { ?vName core:middleName ?middleName . } bind ( COALESCE(?firstName, "") As ?firstName1) . bind ( COALESCE(?middleName, "") As ?middleName1) . bind ( COALESCE(?lastName, "") As ?lastName1) . diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAdvisorRelationshipGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAdvisorRelationshipGenerator.java index 987e42fa..6fffbb2a 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAdvisorRelationshipGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasAdvisorRelationshipGenerator.java @@ -315,6 +315,7 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp " ?existingAdvisee ?advisingRelationship . \n" + " ?existingAdvisee a <" + adviseeClass + "> . \n" + " ?existingAdvisee ?existingAdviseeRole . \n" + + " ?existingAdviseeRole ?advisingRelationship . \n" + " ?existingAdviseeRole a <" + adviseeRoleClass + "> . \n" + "}"; @@ -327,6 +328,7 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp " ?existingAdvisee a <" + adviseeClass + "> . \n" + " ?existingAdvisee <" + label + "> ?existingAdviseeLabel . \n" + " ?existingAdvisee ?existingAdviseeRole . \n" + + " ?existingAdviseeRole ?advisingRelationship . \n" + " ?existingAdviseeRole a <" + adviseeRoleClass + "> . \n" + "}"; From 0b51403690412e077907028660cc2918b1339a57 Mon Sep 17 00:00:00 2001 From: Tim Worrall Date: Fri, 6 Jun 2014 12:18:39 -0400 Subject: [PATCH 06/13] VIVO-559: add abiliy to delete degree candidacy in edit mode --- .../freemarker/edit/forms/personHasAdviseeRelationship.ftl | 2 +- .../freemarker/edit/forms/personHasAdvisorRelationship.ftl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/productMods/templates/freemarker/edit/forms/personHasAdviseeRelationship.ftl b/productMods/templates/freemarker/edit/forms/personHasAdviseeRelationship.ftl index d7fe9520..c9dce8b5 100644 --- a/productMods/templates/freemarker/edit/forms/personHasAdviseeRelationship.ftl +++ b/productMods/templates/freemarker/edit/forms/personHasAdviseeRelationship.ftl @@ -162,7 +162,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o <#assign degreeOpts = editConfiguration.pageData.degree /> - + <#list advisingRelTypeOpts?keys as key> From 2cc05784c7edf4149f7b682ea5cd74f3eec8d800 Mon Sep 17 00:00:00 2001 From: Tim Worrall Date: Fri, 6 Jun 2014 14:52:57 -0400 Subject: [PATCH 07/13] VIVO-508: clean up old IE css files and references --- themes/wilma/css/ie6.css | 39 --------------------------------- themes/wilma/css/ie7.css | 8 ------- themes/wilma/templates/head.ftl | 8 ------- 3 files changed, 55 deletions(-) delete mode 100644 themes/wilma/css/ie6.css delete mode 100644 themes/wilma/css/ie7.css diff --git a/themes/wilma/css/ie6.css b/themes/wilma/css/ie6.css deleted file mode 100644 index 4cbcfa25..00000000 --- a/themes/wilma/css/ie6.css +++ /dev/null @@ -1,39 +0,0 @@ -/* $This file is distributed under the terms of the license in /doc/license.txt$ */ - -/* Fix for homepage in IE6 browsers */ -body { - background-color: #f3f3f0; - background-image: url(../images/header-background.jpg); -} -#search-field { - background-image: url("../images/search-interior-pages.gif"); - height: 35px; - width: 392px; -} -#search-home-field input.search { - padding-left: 14px; -} -/* Fix for Visualization: Co-author and Co-investigator network pages */ -#ego_profile, -.sub_headings, -#sparkline-container, -.toggle_visualization{ - position: relative; -} -.easy-deselect-label a.temporal-vis-url { - margin-top: -15px; -} -#grant-count-sparkline-include { - width: 48%; -} -#coinvestigator-count-sparkline-include { - width: 48%; - clear: left; -} -#publication-count-sparkline-include { - width: 48%; -} -#coauthor-count-sparkline-include { - width: 48%; - clear: left; -} \ No newline at end of file diff --git a/themes/wilma/css/ie7.css b/themes/wilma/css/ie7.css deleted file mode 100644 index b49263ad..00000000 --- a/themes/wilma/css/ie7.css +++ /dev/null @@ -1,8 +0,0 @@ -/* $This file is distributed under the terms of the license in /doc/license.txt$ */ - -/* Fix browser issues in IE7 browsers */ - -/* Fix for homepage */ -#search-home-field input.search { - padding-left: 14px; -} diff --git a/themes/wilma/templates/head.ftl b/themes/wilma/templates/head.ftl index 181af24b..eef17c30 100644 --- a/themes/wilma/templates/head.ftl +++ b/themes/wilma/templates/head.ftl @@ -22,14 +22,6 @@ <#include "headScripts.ftl"> - - - - From 9ef66e87643b897c71e6a335c7a78a4582cac0d2 Mon Sep 17 00:00:00 2001 From: Tim Worrall Date: Fri, 6 Jun 2014 16:22:18 -0400 Subject: [PATCH 08/13] VIVO-694: resolved null pointer exception with web pages --- .../templates/freemarker/edit/forms/addEditWebpageForm.ftl | 2 ++ .../freemarker/edit/forms/manageWebpagesForIndividual.ftl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/productMods/templates/freemarker/edit/forms/addEditWebpageForm.ftl b/productMods/templates/freemarker/edit/forms/addEditWebpageForm.ftl index 8b9810d7..8fd73c2b 100644 --- a/productMods/templates/freemarker/edit/forms/addEditWebpageForm.ftl +++ b/productMods/templates/freemarker/edit/forms/addEditWebpageForm.ftl @@ -48,6 +48,8 @@
+ + <#assign urlTypeOpts = editConfiguration.pageData.urlType /> diff --git a/productMods/templates/freemarker/edit/forms/manageWebpagesForIndividual.ftl b/productMods/templates/freemarker/edit/forms/manageWebpagesForIndividual.ftl index c4288518..6e1c81fd 100644 --- a/productMods/templates/freemarker/edit/forms/manageWebpagesForIndividual.ftl +++ b/productMods/templates/freemarker/edit/forms/manageWebpagesForIndividual.ftl @@ -40,7 +40,7 @@ <#if webpage.typeLabel??>(<#if webpage.typeLabel == "URL">Standard Web Link<#else>${webpage.typeLabel}) - ${i18n().edit_capitalized} | + ${i18n().edit_capitalized} | ${i18n().delete_button} From 15169ca894dc05344248613cec3fe7aef6e3c2fd Mon Sep 17 00:00:00 2001 From: Tim Worrall Date: Mon, 9 Jun 2014 14:34:11 -0400 Subject: [PATCH 09/13] fixed query subject in generator --- .../generators/AddPublicationToPersonGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java index 28264702..31e54461 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java @@ -937,7 +937,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement String query = "PREFIX core:<" + vivoCore + "> " + "SELECT ?pubUri WHERE { " + "<" + subject + "> core:relatedBy ?authorshipUri . " + - "?authorship a core:Authorship . " + + "?authorshipUri a core:Authorship . " + "?authorshipUri core:relates ?pubUri . }"; return query; } From c2d24cb74dae14222e08d3f3294f2e7cdbee92c2 Mon Sep 17 00:00:00 2001 From: Tim Worrall Date: Mon, 9 Jun 2014 17:11:34 -0400 Subject: [PATCH 10/13] VIVO-454 --- .../js/visualization/personlevel/person-level.js | 10 +++++----- .../utilities/UtilitiesRequestHandler.java | 4 ++-- .../visutils/AllPropertiesQueryRunner.java | 7 +++++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/productMods/js/visualization/personlevel/person-level.js b/productMods/js/visualization/personlevel/person-level.js index 3398ab36..69757f27 100644 --- a/productMods/js/visualization/personlevel/person-level.js +++ b/productMods/js/visualization/personlevel/person-level.js @@ -126,9 +126,9 @@ function setProfileMoniker(monikerContainerID, moniker, doEllipsis) { var finalDisplayMoniker; - if (moniker.length > 30 && doEllipsis) { + if (moniker.length > 40 && doEllipsis) { - finalDisplayMoniker = moniker.substr(0,30) + "..."; + finalDisplayMoniker = moniker.substr(0,40) + "..."; } else { @@ -154,9 +154,9 @@ function setProfileName(nameContainerID, name, doNameEllipsis) { var finalDisplayName; - if (name.length > 30 && doNameEllipsis) { + if (name.length > 40 && doNameEllipsis) { - finalDisplayName = name.substr(0,30) + "..."; + finalDisplayName = name.substr(0,40) + "..."; } else { @@ -188,7 +188,7 @@ function processProfileInformation(nameContainerID, mainImageURL = set[0]; - } else if (key.search(/moniker/i) > -1) { + } else if (key.search(/title/i) > -1) { moniker = set[0]; diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/utilities/UtilitiesRequestHandler.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/utilities/UtilitiesRequestHandler.java index d13624cc..242118c0 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/utilities/UtilitiesRequestHandler.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/utilities/UtilitiesRequestHandler.java @@ -68,8 +68,8 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler { String filterRule = "?predicate = j.2:mainImage " -// + "|| ?predicate = core:preferredTitle " - + "|| ?predicate = rdfs:label"; + + " || ?predicate = rdfs:label " + + " || ?predicate = "; QueryRunner profileQueryHandler = new AllPropertiesQueryRunner(individualURI, diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/visutils/AllPropertiesQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/visutils/AllPropertiesQueryRunner.java index c12d67b5..22e90f60 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/visutils/AllPropertiesQueryRunner.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/visutils/AllPropertiesQueryRunner.java @@ -99,8 +99,11 @@ public class AllPropertiesQueryRunner implements QueryRunner { + "SELECT " + " (str(?predicate) as ?" + QueryFieldLabels.PREDICATE + ") " + " (str(?object) as ?" + QueryFieldLabels.OBJECT + ") " - + "WHERE { " - + "<" + queryURI + "> ?predicate ?object. " + + "WHERE { {" + + "<" + queryURI + "> ?predicate ?object. }" + + "UNION {<" + queryURI + "> ?vCard . " + + "?vCard ?vTitle . " + + "?vTitle ?predicate ?object . }" + filterClause + "}"; From 67ce187eac453b8d3ebb6865a06d82976eca6d28 Mon Sep 17 00:00:00 2001 From: Tim Worrall Date: Tue, 10 Jun 2014 12:08:41 -0400 Subject: [PATCH 11/13] minor design and css changes for person-level visualization pages --- .../css/visualization/personlevel/page.css | 8 +++-- .../personlevel/coAuthorPersonLevel.ftl | 35 ++++++++----------- .../personlevel/coPIPersonLevel.ftl | 35 +++++++------------ 3 files changed, 32 insertions(+), 46 deletions(-) diff --git a/productMods/css/visualization/personlevel/page.css b/productMods/css/visualization/personlevel/page.css index 58f5c127..2ef22e4e 100644 --- a/productMods/css/visualization/personlevel/page.css +++ b/productMods/css/visualization/personlevel/page.css @@ -81,9 +81,10 @@ p.datatable { margin-right: 10px; } .toggle_visualization { - max-width: 180px; + max-width: 230px; float: right; display: none; + margin-top: -55PX; } #publication-count-sparkline-include { float: left; @@ -116,7 +117,8 @@ table.sparkline_wrapper_table td, th { max-width: 50%; } #ego_label { - font-size: 1.1em; + color: inherit; + font-size: 1.375em; } #ego_profile_image { float: left; @@ -236,7 +238,7 @@ table.sparkline_wrapper_table td, th { margin-right: 15px; } .graphml-file-link { - padding-top: 20px; + padding-top: 59px; height: 20px; font-size: .9em; } diff --git a/productMods/templates/freemarker/visualization/personlevel/coAuthorPersonLevel.ftl b/productMods/templates/freemarker/visualization/personlevel/coAuthorPersonLevel.ftl index 35b0253e..343b5514 100644 --- a/productMods/templates/freemarker/visualization/personlevel/coAuthorPersonLevel.ftl +++ b/productMods/templates/freemarker/visualization/personlevel/coAuthorPersonLevel.ftl @@ -127,15 +127,20 @@ $(document).ready(function(){
-
- - <#-- Label --> -

- - <#-- Moniker--> - + +


${i18n().co_author_network}

+ <#if (numOfCoAuthorShips?? && numOfCoAuthorShips > 0) || (numOfAuthors?? && numOfAuthors > 0) > + + <#else> -
+ <#if numOfAuthors?? && numOfAuthors <= 0 > + <#assign authorsText = "multi-author" /> + + +
${i18n().currently_no_papers_for(authorsText!)} + ${i18n().this_author} ${i18n().in_the_vivo_db} +
+