From 3273fce539a5dad51f7eddf9f4628afc80b543f9 Mon Sep 17 00:00:00 2001 From: tworrall Date: Fri, 13 Jan 2012 15:22:37 +0000 Subject: [PATCH] qrCodes changes to handle exception more gracefully, grants list view now displays the dates from the grant if they are not at the role level. --- .../listViewConfig-hasInvestigatorRole.xml | 81 ++++++++++++++----- .../body/foaf-person--exportQrCode.ftl | 11 ++- .../individual/individual-qrCodeGenerator.ftl | 4 +- .../propStatement-hasInvestigatorRole.ftl | 6 +- 4 files changed, 75 insertions(+), 27 deletions(-) diff --git a/productMods/config/listViewConfig-hasInvestigatorRole.xml b/productMods/config/listViewConfig-hasInvestigatorRole.xml index 57b741f3..f177837a 100644 --- a/productMods/config/listViewConfig-hasInvestigatorRole.xml +++ b/productMods/config/listViewConfig-hasInvestigatorRole.xml @@ -18,7 +18,9 @@ ?adminedBy ?awardedByLabel ?adminedByLabel - ?dateTimeStart ?dateTimeEnd WHERE { + ?dateTimeStartRole ?dateTimeEndRole + ?dateTimeStartGrant ?dateTimeEndGrant + WHERE { ?subject ?property ?role @@ -48,12 +50,22 @@ } OPTIONAL { ?role rdfs:label ?roleLabel } - OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart + OPTIONAL { ?role core:dateTimeInterval ?dateTimeIntervalRole + OPTIONAL { ?dateTimeIntervalRole core:start ?dateTimeStartValueRole . + ?dateTimeStartValueRole core:dateTime ?dateTimeStartRole } - OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd + OPTIONAL { ?dateTimeIntervalRole core:end ?dateTimeEndValueRole . + ?dateTimeEndValueRole core:dateTime ?dateTimeEndRole + } + } + OPTIONAL { ?role rdfs:label ?roleLabel } + OPTIONAL { ?role core:roleContributesTo ?grant . + ?grant core:dateTimeInterval ?dateTimeIntervalGrant + OPTIONAL { ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant . + ?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant + } + OPTIONAL { ?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant . + ?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant } } @@ -149,14 +161,14 @@ PREFIX core: <http://vivoweb.org/ontology/core#> CONSTRUCT { ?subject ?property ?role . - ?role core:dateTimeInterval ?dateTimeInterval . - ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart + ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:start ?dateTimeStartValueRole . + ?dateTimeStartValueRole core:dateTime ?dateTimeStartRole } WHERE { ?subject ?property ?role . - ?role core:dateTimeInterval ?dateTimeInterval . - ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart + ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:start ?dateTimeStartValueRole . + ?dateTimeStartValueRole core:dateTime ?dateTimeStartRole } @@ -164,14 +176,47 @@ PREFIX core: <http://vivoweb.org/ontology/core#> CONSTRUCT { ?subject ?property ?role . - ?role core:dateTimeInterval ?dateTimeInterval . - ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd + ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:end ?dateTimeEndValueRole . + ?dateTimeEndValueRole core:dateTime ?dateTimeEndRole } WHERE { ?subject ?property ?role . - ?role core:dateTimeInterval ?dateTimeInterval . - ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd + ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:end ?dateTimeEndValueRole . + ?dateTimeEndValueRole core:dateTime ?dateTimeEndRole + } + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role core:roleContributesTo ?grant . + ?grant core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant . + ?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant + } WHERE { + ?subject ?property ?role . + ?role core:roleContributesTo ?grant . + ?grant core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant . + ?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role core:roleContributesTo ?grant . + ?grant core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant . + ?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant + } WHERE { + ?subject ?property ?role . + ?role core:roleContributesTo ?grant . + ?grant core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant . + ?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant } diff --git a/productMods/templates/freemarker/body/foaf-person--exportQrCode.ftl b/productMods/templates/freemarker/body/foaf-person--exportQrCode.ftl index bc0ed3b2..f0787de4 100644 --- a/productMods/templates/freemarker/body/foaf-person--exportQrCode.ftl +++ b/productMods/templates/freemarker/body/foaf-person--exportQrCode.ftl @@ -1,11 +1,10 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> <#-- Page providing options for disseminating QR codes --> +<#assign qrCodeWidth = "150"> <#include "individual-qrCodeGenerator.ftl"> -<#assign qrCodeWidth = "150"> -

Export QR Code (What is this?)

<#assign thumbUrl = individual.thumbUrl! "${urls.images}/placeholders/person.thumbnail.jpg" > @@ -15,17 +14,17 @@

VCard

- <@qrCodeVCard qrCodeWidth="150" /> + <@qrCodeVCard qrCodeWidth /> <#t>

Hyperlink

- <@qrCodeLink qrCodeWidth="150" /> + <@qrCodeLink qrCodeWidth /> <#t>
diff --git a/productMods/templates/freemarker/body/partials/individual/individual-qrCodeGenerator.ftl b/productMods/templates/freemarker/body/partials/individual/individual-qrCodeGenerator.ftl index a28245cc..ed020e51 100644 --- a/productMods/templates/freemarker/body/partials/individual/individual-qrCodeGenerator.ftl +++ b/productMods/templates/freemarker/body/partials/individual/individual-qrCodeGenerator.ftl @@ -4,7 +4,7 @@ <#macro qrCodeVCard qrCodeWidth> - <#local qrCodeUrl = getQrCodeUrlForVCard(qrCodeWidth)> + <#local qrCodeUrl = getQrCodeUrlForVCard(qrCodeWidth)!> <#if qrCodeUrl != ""> @@ -13,7 +13,7 @@ <#macro qrCodeLink qrCodeWidth> - <#local qrCodeUrl = getQrCodeUrlForLink(qrCodeWidth)> + <#local qrCodeUrl = getQrCodeUrlForLink(qrCodeWidth)!> <#if qrCodeUrl != ""> diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-hasInvestigatorRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-hasInvestigatorRole.ftl index c0693586..12e3b40b 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-hasInvestigatorRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-hasInvestigatorRole.ftl @@ -31,7 +31,11 @@ <#local dateTime> - <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> + <#if statement.dateTimeStartRole?has_content > + <@dt.yearIntervalSpan "${statement.dateTimeStartRole!}" "${statement.dateTimeEndRole!}" /> + <#else> + <@dt.yearIntervalSpan "${statement.dateTimeStartGrant!}" "${statement.dateTimeEndGrant!}" /> + ${linkedIndividual} ${awardOrAdminBy} ${dateTime!}