From 8cfaaa25c7fde8d8ed9bb200b75192da9a267b19 Mon Sep 17 00:00:00 2001 From: tworrall Date: Thu, 22 May 2014 13:25:28 -0400 Subject: [PATCH] new list view to display degrees on educational process objects --- .../themes/wilma/i18n/all_es_GO.properties | 1 + .../config/listViewConfig-degreeEarned.xml | 60 +++++++++++++++++++ .../individual/propStatement-degreeEarned.ftl | 38 ++++++++++++ rdf/display/everytime/PropertyConfig.n3 | 2 +- themes/wilma/i18n/all.properties | 1 + 5 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 productMods/config/listViewConfig-degreeEarned.xml create mode 100644 productMods/templates/freemarker/body/partials/individual/propStatement-degreeEarned.ftl 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 15e845cc..bcc8f557 100644 --- a/languages/es_GO/themes/wilma/i18n/all_es_GO.properties +++ b/languages/es_GO/themes/wilma/i18n/all_es_GO.properties @@ -484,6 +484,7 @@ org_type_capitalized = Tipo de Organización educational_training_type = Tipo de Formación Educativa dept_or_school_name = Departamento o Nombre de la escuela en el degree = Grado +missing_degree = falta de grado major_field = Importante sobre el terreno de Grado supplemental_information = Información Complementaria supplemental_information_hint = (Por ejemplo, título de la tesis, la información de transferencia, etc) diff --git a/productMods/config/listViewConfig-degreeEarned.xml b/productMods/config/listViewConfig-degreeEarned.xml new file mode 100644 index 00000000..7abddc27 --- /dev/null +++ b/productMods/config/listViewConfig-degreeEarned.xml @@ -0,0 +1,60 @@ + + + + + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> + + SELECT DISTINCT ?degree + ?degreeName + ?degreeAbbr + WHERE { + ?subject ?property ?edProcess . + ?edProcess a core:EducationalProcess + OPTIONAL { ?edProcess <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + ?awardedDegree core:relates ?degree . + ?degree a core:AcademicDegree . + ?degree rdfs:label ?degreeName + } + OPTIONAL { ?edProcess <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + ?awardedDegree core:relates ?degree . + ?degree a core:AcademicDegree . + ?degree core:abbreviation ?degreeAbbr + } + } + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + + CONSTRUCT { + ?degree a core:AcademicDegree . + ?degree rdfs:label ?degreeName . + ?degree core:abbreviation ?degreeAbbr + } WHERE { + { + ?subject ?property ?edProcess . + ?edProcess a core:EducationalProcess . + ?edProcess <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + ?awardedDegree core:relates ?degree . + ?degree a core:AcademicDegree . + ?degree rdfs:label ?degreeName + } UNION { + ?subject ?property ?edProcess . + ?edProcess a core:EducationalProcess . + ?edProcess <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + ?awardedDegree core:relates ?degree . + ?degree a core:AcademicDegree . + ?degree core:abbreviation ?degreeAbbr + } + } + + + + diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-degreeEarned.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-degreeEarned.ftl new file mode 100644 index 00000000..b3d90908 --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-degreeEarned.ftl @@ -0,0 +1,38 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Custom object property statement view for faux property "education and training". See the PropertyConfig.3 file for details. + + 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> +<#-- Coming from propDelete, individual is not defined, but we are editing. --> +<@showEducationalTraining statement=statement editable=(!individual?? || individual.editable) /> + +<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the + next statement --> +<#macro showEducationalTraining statement editable> + + <#local degree> + <#if statement.degreeName??> + ${statement.degreeAbbr!statement.degreeName} + <#if statement.majorField??> ${i18n().in} ${statement.majorField} + <#elseif statement.typeName??> + ${statement.typeName!} + + + + <#local linkedIndividual> + <#if statement.degree??> + ${statement.degreeAbbr!statement.degreeName} + <#else> + <#-- Show the link to the context node only if the user is editing the page. --> + ${i18n().missing_degree} + + + + ${linkedIndividual} + + diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index 016e33fd..79f702e5 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -537,7 +537,7 @@ local:educationalProcessDegreeContext a :ConfigContext ; :qualifiedBy . local:educationalProcessDegreeConfig a :ObjectPropertyDisplayConfig ; - :listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ; + :listViewConfigFile "listViewConfig-degreeEarned.xml"^^xsd:string ; :displayName "degree earned" ; vitro:displayRankAnnot 20; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; diff --git a/themes/wilma/i18n/all.properties b/themes/wilma/i18n/all.properties index 8143af61..d1c4bd51 100644 --- a/themes/wilma/i18n/all.properties +++ b/themes/wilma/i18n/all.properties @@ -490,6 +490,7 @@ org_type_capitalized = Organization Type educational_training_type = Type of Educational Training dept_or_school_name = Department or School Name within the degree = Degree +missing_degree = missing degree major_field = Major Field of Degree supplemental_information = Supplemental Information supplemental_information_hint = (e.g., Thesis title, Transfer info, etc.)