From a47a480552df1bfffec62fde8d65d85a7b524d6f Mon Sep 17 00:00:00 2001 From: ryounes Date: Tue, 29 Mar 2011 13:46:28 +0000 Subject: [PATCH] NIHVIVO-2325 Retrieve property in core:hasRole list view query, since the view supports multiple properties, so the template knows which property is being displayed. --- productMods/config/listViewConfig-hasRole.xml | 4 ++-- .../individual/propStatement-authorInAuthorship.ftl | 8 ++++++-- .../individual/propStatement-dateTimeInterval.ftl | 6 +++++- .../partials/individual/propStatement-dateTimeValue.ftl | 6 +++++- .../individual/propStatement-educationalTraining.ftl | 6 +++++- .../body/partials/individual/propStatement-hasRole.ftl | 9 +++++++-- .../propStatement-informationResourceInAuthorship.ftl | 6 +++++- .../individual/propStatement-organizationForPosition.ftl | 6 +++++- .../individual/propStatement-personInPosition.ftl | 6 +++++- .../partials/individual/propStatement-relatedRole.ftl | 6 +++++- 10 files changed, 50 insertions(+), 13 deletions(-) diff --git a/productMods/config/listViewConfig-hasRole.xml b/productMods/config/listViewConfig-hasRole.xml index 1a16b704..1a9b9ed4 100644 --- a/productMods/config/listViewConfig-hasRole.xml +++ b/productMods/config/listViewConfig-hasRole.xml @@ -10,6 +10,8 @@ PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> SELECT DISTINCT ?subclass + # send the property to the template, since this view supports multiple role properties + ?property ?role ?startDateOnly ?roleLabel @@ -18,8 +20,6 @@ ?subject ?property ?role - LET (?startDateOnly := (?property = core:hasPresenterRole) ) - OPTIONAL { ?role core:roleIn ?activity . ?activity rdfs:label ?activityName } diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-authorInAuthorship.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-authorInAuthorship.ftl index 851aea43..85bdbba3 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-authorInAuthorship.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-authorInAuthorship.ftl @@ -1,7 +1,11 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#authorInAuthorship --> - +<#-- Custom object property statement view for http://vivoweb.org/ontology/core#authorInAuthorship. + + This template must be self-contained and not rely on other variables set for the individual page, because it + is also used to generate the property statement during a deletion. + --> + <#import "lib-sequence.ftl" as s> <#import "lib-datetime.ftl" as dt> diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeInterval.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeInterval.ftl index b0a7a410..91702a2b 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeInterval.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeInterval.ftl @@ -1,6 +1,10 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#dateTimeInterval --> +<#-- Custom object property statement view for http://vivoweb.org/ontology/core#dateTimeInterval. + + This template must be self-contained and not rely on other variables set for the individual page, because it + is also used to generate the property statement during a deletion. + --> <#import "lib-datetime.ftl" as dt> diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeValue.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeValue.ftl index d6122d45..c6096ac9 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeValue.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeValue.ftl @@ -1,6 +1,10 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#dateTimeValue --> +<#-- Custom object property statement view for http://vivoweb.org/ontology/core#dateTimeValue. + + This template must be self-contained and not rely on other variables set for the individual page, because it + is also used to generate the property statement during a deletion. + --> <#import "lib-datetime.ftl" as dt> diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl index 906cb01c..7c1b0c1b 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl @@ -1,6 +1,10 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#educationalTraining --> +<#-- Custom object property statement view for http://vivoweb.org/ontology/core#educationalTraining. + + This template must be self-contained and not rely on other variables set for the individual page, because it + is also used to generate the property statement during a deletion. + --> <#import "lib-sequence.ftl" as s> <#import "lib-datetime.ftl" as dt> diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl index 94151f16..d654aa91 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl @@ -1,6 +1,10 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#hasRole and its child properties --> +<#-- Custom object property statement view for http://vivoweb.org/ontology/core#hasRole and its child properties. + + This template must be self-contained and not rely on other variables set for the individual page, because it + is also used to generate the property statement during a deletion. + --> <#import "lib-sequence.ftl" as s> <#import "lib-datetime.ftl" as dt> @@ -19,8 +23,9 @@ + <#local core = "http://vivoweb.org/ontology/core#"> <#local dateTime> - <#if statement.startDateOnly == "true"> + <#if statement.property == "${core}hasPresenterRole"> <@dt.yearSpan statement.dateTimeStart! /> <#else> <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-informationResourceInAuthorship.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-informationResourceInAuthorship.ftl index 1ec51f00..da5af9ec 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-informationResourceInAuthorship.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-informationResourceInAuthorship.ftl @@ -1,6 +1,10 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#informationResourceInAuthorship --> +<#-- Custom object property statement view for http://vivoweb.org/ontology/core#informationResourceInAuthorship. + + This template must be self-contained and not rely on other variables set for the individual page, because it + is also used to generate the property statement during a deletion. + --> <#import "lib-sequence.ftl" as s> diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl index b7957428..9bdf6aa6 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl @@ -1,6 +1,10 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#organizationForPosition --> +<#-- Custom object property statement view for http://vivoweb.org/ontology/core#organizationForPosition. + + This template must be self-contained and not rely on other variables set for the individual page, because it + is also used to generate the property statement during a deletion. + --> <#import "lib-sequence.ftl" as s> <#import "lib-datetime.ftl" as dt> diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-personInPosition.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-personInPosition.ftl index 2f659aca..1d66d016 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-personInPosition.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-personInPosition.ftl @@ -1,6 +1,10 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#personInPosition --> +<#-- Custom object property statement view for http://vivoweb.org/ontology/core#personInPosition. + + This template must be self-contained and not rely on other variables set for the individual page, because it + is also used to generate the property statement during a deletion. + --> <#import "lib-sequence.ftl" as s> <#import "lib-datetime.ftl" as dt> diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl index 5d7d7793..cb03cb77 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl @@ -1,6 +1,10 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#relatedRole --> +<#-- Custom object property statement view for http://vivoweb.org/ontology/core#relatedRole. + + This template must be self-contained and not rely on other variables set for the individual page, because it + is also used to generate the property statement during a deletion. + --> <#import "lib-sequence.ftl" as s> <#import "lib-datetime.ftl" as dt>