From 7a2d09dce63a3c9aa0bba1d7365571e906426156 Mon Sep 17 00:00:00 2001 From: rjy7 Date: Thu, 15 Jul 2010 14:02:44 +0000 Subject: [PATCH] NIHVIVO-630 Use role name instead of the individual's moniker in role short view --- .../edit/forms/addRoleToPersonTwoStage.jsp | 2 +- productMods/edit/forms/personHasActivity.jsp | 310 ------------------ .../entity/clinicalRoleShortView.jsp | 2 - .../entity/grantCoPiRoleShortView.jsp | 2 +- .../templates/entity/grantPiRoleShortView.jsp | 2 +- .../templates/entity/grantRoleShortView.jsp | 2 +- .../templates/entity/headOfRoleShortView.jsp | 1 - .../templates/entity/memberRoleShortView.jsp | 1 - .../entity/outreachRoleShortView.jsp | 1 - .../entity/presenterRoleShortView.jsp | 1 - .../entity/researcherRoleShortView.jsp | 1 - .../templates/entity/roleShortView.jsp | 20 +- .../entity/serviceProviderRoleShortView.jsp | 1 - .../templates/entity/teacherRoleShortView.jsp | 1 - 14 files changed, 12 insertions(+), 335 deletions(-) delete mode 100644 productMods/edit/forms/personHasActivity.jsp diff --git a/productMods/edit/forms/addRoleToPersonTwoStage.jsp b/productMods/edit/forms/addRoleToPersonTwoStage.jsp index 280b7332..e8c42684 100644 --- a/productMods/edit/forms/addRoleToPersonTwoStage.jsp +++ b/productMods/edit/forms/addRoleToPersonTwoStage.jsp @@ -335,7 +335,7 @@ -

+

Dates of Participation

diff --git a/productMods/edit/forms/personHasActivity.jsp b/productMods/edit/forms/personHasActivity.jsp deleted file mode 100644 index 66e6e291..00000000 --- a/productMods/edit/forms/personHasActivity.jsp +++ /dev/null @@ -1,310 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - -<%-- Custom form for research, teaching, service, and outreach activities --%> - -<%@ page import="java.util.List" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="java.util.Arrays" %> - -<%@ page import="com.hp.hpl.jena.rdf.model.Literal"%> -<%@ page import="com.hp.hpl.jena.rdf.model.Model"%> -<%@ page import="com.hp.hpl.jena.vocabulary.XSD" %> - -<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual"%> -<%@ 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.dao.WebappDaoFactory"%> -<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest"%> -<%@ page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils"%> -<%@ page import="edu.cornell.mannlib.vitro.webapp.utils.TitleCase" %> -<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.StartDateBeforeEndDate"%> - -<%@ 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.personHasActivity.jsp"); -%> -<% - VitroRequest vreq = new VitroRequest(request); - WebappDaoFactory wdf = vreq.getWebappDaoFactory(); - vreq.setAttribute("defaultNamespace", ""); //empty string triggers default new URI behavior - - request.setAttribute("stringDatatypeUriJson", MiscWebUtils.escape(XSD.xstring.toString())); - request.setAttribute("gYearMonthDatatypeUriJson", MiscWebUtils.escape(XSD.gYearMonth.toString())); -%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<%-- Then enter a SPARQL query for each field, by convention concatenating the field id with "Existing" - to convey that the expression is used to retrieve any existing value for the field in an existing individual. - Each of these must then be referenced in the sparqlForExistingLiterals section of the JSON block below - and in the literalsOnForm --%> - - SELECT ?existingLabel WHERE { - ?activityUri <${labelUri}> ?existingLabel } - - -<%-- Pair the "existing" query with the skeleton of what will be asserted for a new statement involving this field. - The actual assertion inserted in the model will be created via string substitution into the ? variables. - NOTE the pattern of punctuation (a period after the prefix URI and after the ?field) --%> - - ?activityUri <${labelUri}> ?label . - - - - - SELECT ?existingDescription WHERE { - ?activityUri <${descriptionUri}> ?existingDescription } - - - ?activityUri <${descriptionUri}> ?description . - - - - - SELECT ?existingRole WHERE { - ?activityUri <${roleUri}> ?existingRole } - - - ?activityUri <${roleUri}> ?role . - - - - - SELECT ?existingStartYearMonth WHERE { - ?activityUri <${startYearMonthUri}> ?existingStartYearMonth } - - - ?activityUri <${startYearMonthUri}> ?startYearMonth . - - - - - SELECT ?existingEndYearMonth WHERE { - ?activityUri <${endYearMonthUri}> ?existingEndYearMonth } - - - ?activityUri <${endYearMonthUri}> ?endYearMonth . - - - - - ?activityUri <${labelUri}> ?label ; - a <${activityClass}> ; - a <${activitySuperClass}> ; - <${inverseUri}> ?person ; - <${inverseSuperPropertyUri}> ?person . - - ?person <${predicateUri}> ?activityUri ; - <${superPropertyUri}> ?activityUri . - - - - - { - "formUrl" : "${formUrl}", - "editKey" : "${editKey}", - "urlPatternToReturnTo" : "/entity", - - "subject" : ["person", "${subjectUriJson}" ], - "predicate" : ["predicate", "${predicateUriJson}" ], - "object" : ["activityUri", "${objectUriJson}", "URI" ], - - "n3required" : [ "${n3ForStmtToPerson}", "${labelAssertion}", "${descriptionAssertion}", "${roleAssertion}" ], - - "n3optional" : [ "${startYearMonthAssertion}", "${endYearMonthAssertion}" ], - - "newResources" : { "activityUri" : "${defaultNamespace}" }, - - "urisInScope" : { }, - "literalsInScope": { }, - "urisOnForm" : [ ], - "literalsOnForm" : [ "label", "description", "role", "startYearMonth", "endYearMonth" ], - "filesOnForm" : [ ], - "sparqlForLiterals" : { }, - "sparqlForUris" : { }, - "sparqlForExistingLiterals" : { - "label" : "${labelExisting}", - "description" : "${descriptionExisting}", - "role" : "${roleExisting}", - "startYearMonth" : "${startYearMonthExisting}", - "endYearMonth" : "${endYearMonthExisting}", - }, - "sparqlForExistingUris" : { }, - - "fields" : { - "label" : { - "newResource" : "false", - "validators" : [ "nonempty" ], - "optionsType" : "UNDEFINED", - "literalOptions" : [ ], - "predicateUri" : "", - "objectClassUri" : "", - "rangeDatatypeUri" : "${stringDatatypeUriJson}", - "rangeLang" : "", - "assertions" : [ "${labelAssertion}" ] - }, - "description" : { - "newResource" : "false", - "validators" : [ "nonempty" ], - "optionsType" : "UNDEFINED", - "literalOptions" : [ ], - "predicateUri" : "", - "objectClassUri" : "", - "rangeDatatypeUri" : "${stringDatatypeUriJson}", - "rangeLang" : "", - "assertions" : [ "${descriptionAssertion}" ] - }, - "role" : { - "newResource" : "false", - "validators" : [ "nonempty" ], - "optionsType" : "UNDEFINED", - "literalOptions" : [ ], - "predicateUri" : "", - "objectClassUri" : "", - "rangeDatatypeUri" : "${stringDatatypeUriJson}", - "rangeLang" : "", - "assertions" : [ "${roleAssertion}" ] - }, - "startYearMonth" : { - "newResource" : "false", - "validators" : [ "datatype:${gYearMonthDatatypeUriJson}" ], - "optionsType" : "UNDEFINED", - "literalOptions" : [ ], - "predicateUri" : "", - "objectClassUri" : "", - "rangeDatatypeUri" : "${gYearMonthDatatypeUriJson}", - "rangeLang" : "", - "assertions" : ["${startYearMonthAssertion}"] - }, - "endYearMonth" : { - "newResource" : "false", - "validators" : [ "datatype:${gYearMonthDatatypeUriJson}" ], - "optionsType" : "UNDEFINED", - "literalOptions" : [ ], - "predicateUri" : "", - "objectClassUri" : "", - "rangeDatatypeUri" : "${gYearMonthDatatypeUriJson}", - "rangeLang" : "", - "assertions" : ["${endYearMonthAssertion}"] - } - } -} - -<% - 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); - } - - editConfig.addValidator(new StartDateBeforeEndDate("startYearMonth","endYearMonth") ); - - Model model = (Model) application.getAttribute("jenaOntModel"); - String objectUri = (String) request.getAttribute("objectUri"); - if (objectUri != null) { // editing existing - editConfig.prepareForObjPropUpdate(model); - } else { // adding new - editConfig.prepareForNonUpdate(model); - } - - String subjectName = ((Individual) request.getAttribute("subject")).getName(); -%> - - - - - - - - - - - - - - - - -<% - // RY put propertyName in page context instead, and get a PageContext object - String propName = (String)request.getAttribute("propertyName"); - vreq.setAttribute("submitPropertyName", TitleCase.toTitleCase(propName)); - - if (objectUri != null) { // editing existing entry -%> - - -<% - } else { // adding new entry -%> - - -<% } - - - List customCss = new ArrayList(Arrays.asList("/edit/forms/css/customForm.css" - )); - request.setAttribute("customCss", customCss); -%> - - - - - - -

${title}

- -
" > - - - - - - - - -

- -

* required fields

- - - - diff --git a/productMods/templates/entity/clinicalRoleShortView.jsp b/productMods/templates/entity/clinicalRoleShortView.jsp index 275a6eb7..b98d3ad9 100644 --- a/productMods/templates/entity/clinicalRoleShortView.jsp +++ b/productMods/templates/entity/clinicalRoleShortView.jsp @@ -4,6 +4,4 @@ - - diff --git a/productMods/templates/entity/grantCoPiRoleShortView.jsp b/productMods/templates/entity/grantCoPiRoleShortView.jsp index 5400b2f5..e3c3770b 100644 --- a/productMods/templates/entity/grantCoPiRoleShortView.jsp +++ b/productMods/templates/entity/grantCoPiRoleShortView.jsp @@ -5,5 +5,5 @@ - +
diff --git a/productMods/templates/entity/grantPiRoleShortView.jsp b/productMods/templates/entity/grantPiRoleShortView.jsp index 2cce2ba1..b25f12f6 100644 --- a/productMods/templates/entity/grantPiRoleShortView.jsp +++ b/productMods/templates/entity/grantPiRoleShortView.jsp @@ -5,5 +5,5 @@ - + diff --git a/productMods/templates/entity/grantRoleShortView.jsp b/productMods/templates/entity/grantRoleShortView.jsp index 4390e130..20ad027f 100644 --- a/productMods/templates/entity/grantRoleShortView.jsp +++ b/productMods/templates/entity/grantRoleShortView.jsp @@ -5,5 +5,5 @@ - + diff --git a/productMods/templates/entity/headOfRoleShortView.jsp b/productMods/templates/entity/headOfRoleShortView.jsp index fd6b8089..bb6ce9d5 100644 --- a/productMods/templates/entity/headOfRoleShortView.jsp +++ b/productMods/templates/entity/headOfRoleShortView.jsp @@ -5,5 +5,4 @@ - diff --git a/productMods/templates/entity/memberRoleShortView.jsp b/productMods/templates/entity/memberRoleShortView.jsp index 8e966d00..775c94ff 100644 --- a/productMods/templates/entity/memberRoleShortView.jsp +++ b/productMods/templates/entity/memberRoleShortView.jsp @@ -5,5 +5,4 @@ - diff --git a/productMods/templates/entity/outreachRoleShortView.jsp b/productMods/templates/entity/outreachRoleShortView.jsp index 591734a0..31a87784 100644 --- a/productMods/templates/entity/outreachRoleShortView.jsp +++ b/productMods/templates/entity/outreachRoleShortView.jsp @@ -5,5 +5,4 @@ - diff --git a/productMods/templates/entity/presenterRoleShortView.jsp b/productMods/templates/entity/presenterRoleShortView.jsp index 0d9ec7e0..1e0a8af5 100644 --- a/productMods/templates/entity/presenterRoleShortView.jsp +++ b/productMods/templates/entity/presenterRoleShortView.jsp @@ -5,6 +5,5 @@ - diff --git a/productMods/templates/entity/researcherRoleShortView.jsp b/productMods/templates/entity/researcherRoleShortView.jsp index 7f9e4da3..5f19ff8e 100644 --- a/productMods/templates/entity/researcherRoleShortView.jsp +++ b/productMods/templates/entity/researcherRoleShortView.jsp @@ -5,5 +5,4 @@ - diff --git a/productMods/templates/entity/roleShortView.jsp b/productMods/templates/entity/roleShortView.jsp index c06c966c..34dfa168 100644 --- a/productMods/templates/entity/roleShortView.jsp +++ b/productMods/templates/entity/roleShortView.jsp @@ -11,7 +11,8 @@ personToRolePredicate: URI of the person to role predicate. roleToPersonPredicate: URI of the role to person predicate. roleActivityToRolePredicate: URI of the activity to role predicate. - roleLabelForPerson: human readable label for person when viewing from non-person side of role + roleLabelForPerson: human readable label for person when viewing from non-person side of role. Some short views + don't specify this value because the role name is displayed instead. roleActivityLabel: human readable label of activity used for error messages --%> @@ -20,7 +21,7 @@ - + <%-- get years off role --%> @@ -37,11 +38,11 @@ - - + + - <%-- this Role is not linked to a anything yet; use name as a placeholder and add link to the Role so user can add more information --%> + <%-- this Role is not linked to anything yet; use name as a placeholder and add link to the Role so user can add more information --%> @@ -64,12 +65,7 @@ - - - - - - + @@ -96,7 +92,7 @@ - ">${name} ${roleLabel} ${label} ${startYear}${endYear} + ">${name} ${label} ${startYear}${endYear} ${name} ${label} diff --git a/productMods/templates/entity/serviceProviderRoleShortView.jsp b/productMods/templates/entity/serviceProviderRoleShortView.jsp index 12ce62b0..ef90c5cc 100644 --- a/productMods/templates/entity/serviceProviderRoleShortView.jsp +++ b/productMods/templates/entity/serviceProviderRoleShortView.jsp @@ -5,5 +5,4 @@ - diff --git a/productMods/templates/entity/teacherRoleShortView.jsp b/productMods/templates/entity/teacherRoleShortView.jsp index f7401541..e147fde5 100644 --- a/productMods/templates/entity/teacherRoleShortView.jsp +++ b/productMods/templates/entity/teacherRoleShortView.jsp @@ -5,5 +5,4 @@ -