From 7a9d46e13030067ec508f485bfa3a70cc5bf61ad Mon Sep 17 00:00:00 2001 From: tworrall Date: Thu, 20 Jun 2013 16:02:10 -0400 Subject: [PATCH] significant changes for VIVO-131. See Jira comment for more details --- .../loadedAtStartup/vivoDepartmentQueries.n3 | 161 ------------------ .../vivoOrganizationDataGetters.n3 | 144 ++++++++++++++++ .../individual--foaf-organization.ftl | 12 +- .../freemarker/body/individual/individual.ftl | 2 +- ...individual-affiliated-res-area-details.ftl | 31 ++++ .../individual-affiliated-research-areas.ftl | 40 +++++ .../individual-dept-membership-details.ftl | 26 --- .../individual-dept-memberships.ftl | 15 -- .../individual-dept-res-area-details.ftl | 4 +- .../individual-dept-research-areas.ftl | 45 ----- themes/wilma/i18n/all.properties | 9 +- 11 files changed, 228 insertions(+), 261 deletions(-) delete mode 100644 productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoDepartmentQueries.n3 create mode 100644 productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoOrganizationDataGetters.n3 create mode 100644 productMods/templates/freemarker/body/partials/individual/individual-affiliated-res-area-details.ftl create mode 100644 productMods/templates/freemarker/body/partials/individual/individual-affiliated-research-areas.ftl delete mode 100644 productMods/templates/freemarker/body/partials/individual/individual-dept-membership-details.ftl delete mode 100644 productMods/templates/freemarker/body/partials/individual/individual-dept-memberships.ftl delete mode 100644 productMods/templates/freemarker/body/partials/individual/individual-dept-research-areas.ftl diff --git a/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoDepartmentQueries.n3 b/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoDepartmentQueries.n3 deleted file mode 100644 index 62cde19a..00000000 --- a/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoDepartmentQueries.n3 +++ /dev/null @@ -1,161 +0,0 @@ -# $This file is distributed under the terms of the license in /doc/license.txt$ - -@prefix owl: . -@prefix display: . -@prefix rdf: . -@prefix rdfs: . -@prefix core: . -@prefix vivoweb: . - - - -#### queries for departmental pages #### - - display:hasDataGetter display:getResearchAreaDataGetter . - -display:getResearchAreaDataGetter - a ; - display:saveToVar "researchAreaResults"; - display:query """ - PREFIX rdfs: - PREFIX vivo: - SELECT DISTINCT (str(?researchAreaLabel) AS ?raLabel) ?ra - WHERE { - ?individualURI vivo:organizationForPosition ?posn . - ?posn vivo:positionForPerson ?person . - ?person vivo:hasResearchArea ?ra . - ?ra rdfs:label ?researchAreaLabel - } - ORDER BY ?raLabel - """ . -## This is a working example of another type of data getter that can be used. This one retrieves ## -## the organizational memberships (vivo:hasMemberRole) of all the people in an academic department. ## -## You can use this or adapt it to your needs; for example, to display clinical activities of people ## -## in a department. The templates are available for this query and the appropriate freemarker code ## -## is commented out in the individual.ftl and individual--foaf-organization.ftl templates. ## -# display:hasDataGetter display:getMembershipsDataGetter . -# -#display:getMembershipsDataGetter -# a ; -# display:saveToVar "membershipResults"; -# display:query """ -# PREFIX rdfs: -# PREFIX vivo: -# SELECT DISTINCT (str(?organizationLabel) AS ?orgLabel) ?organization -# WHERE { -# ?individualURI vivo:organizationForPosition ?posn . -# ?posn vivo:positionForPerson ?person . -# ?person vivo:hasMemberRole ?mbrRole . -# ?mbrRole vivo:roleContributesTo ?organization. -# ?organization rdfs:label ?organizationLabel -# } -# ORDER BY ?organizationLabel -# """ . - -#### detail pages for department links #### - - - a ; - - ; - - "individual-dept-active-grants.ftl" ; - - "Departmental Grants" ; - - "/deptGrants" . - - - a ; - - """ - PREFIX rdfs: - PREFIX vivo: - PREFIX afn: - SELECT DISTINCT (str (?actLabel) AS ?activityLabel) ?dt (str(?departmentLabel) AS ?deptLabel) ?activity - WHERE { - ?individualURI vivo:organizationForPosition ?posn . - ?individualURI rdfs:label ?departmentLabel . - ?posn vivo:positionForPerson ?person . - ?person ?roleProperty ?role . - ?roleProperty rdfs:subPropertyOf vivo:hasResearcherRole . - ?role vivo:roleContributesTo ?activity . - ?activity rdfs:label ?actLabel . - ?activity vivo:dateTimeInterval ?dti . - ?dti vivo:end ?end. - ?end vivo:dateTime ?dt - FILTER (?dt > afn:now()) - } - ORDER BY ?activityLabel - """ ; - - "deptGrants" . - - - a ; - - ; - - "individual-dept-res-area-details.ftl" ; - - "Departmental Research Areas" ; - - "/deptResearchAreas" . - - - a ; - - """ - PREFIX rdfs: -PREFIX vivo: -SELECT DISTINCT (str (?prsnLabel) AS ?personLabel) ?person (Str(?researchAreaLabel) AS ?raLabel) (str(?departmentLabel) AS ?deptLabel) ?raURI -WHERE { - ?deptURI vivo:organizationForPosition ?posn . - ?deptURI rdfs:label ?departmentLabel . - ?posn vivo:positionForPerson ?person . - ?person rdfs:label ?prsnLabel . - ?person vivo:hasResearchArea ?raURI . - ?raURI rdfs:label ?researchAreaLabel - -} -ORDER BY ?personLabel -""" ; - - "deptResearchAreas" . - - -## This is another part of the departmental memberships working example. This data getter gets called ## -## when a membership organization links is clicked on the academic department page. The template for ## -## this data getter (individual-dept-membership-details.ftl) is included in the VIVO source code. ## -# -# a ; -# -# ; -# -# "individual-dept-membership-details.ftl" ; -# -# "Departmental Memberships" ; -# -# "/deptMemberships" . - -# -# a ; -# -# """PREFIX vivoc: -# PREFIX rdfs: -# PREFIX vivo: -# SELECT DISTINCT (str (?prsnLabel) AS ?personLabel) (str (?departmentLabel) AS ?deptLabel) ?person #(str(?organizationLabel) AS ?orgLabel) ?orgURI -# WHERE { -# ?deptURI vivo:organizationForPosition ?posn . -# ?deptURI rdfs:label ?departmentLabel . -# ?posn vivo:positionForPerson ?person . -# ?person rdfs:label ?prsnLabel . -# ?person vivo:hasMemberRole ?role . -# ?role vivo:roleContributesTo ?orgURI . -# ?orgURI rdfs:label ?organizationLabel -# } -# ORDER BY ?personLabel -# """ ; -# -# "deptMemberships" . -# diff --git a/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoOrganizationDataGetters.n3 b/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoOrganizationDataGetters.n3 new file mode 100644 index 00000000..107ca53c --- /dev/null +++ b/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoOrganizationDataGetters.n3 @@ -0,0 +1,144 @@ +# $This file is distributed under the terms of the license in /doc/license.txt$ + +@prefix owl: . +@prefix display: . +@prefix rdf: . +@prefix rdfs: . +@prefix core: . +@prefix vivoweb: . + + +#### n3 for research areas #### + +## associate the classes with the datagetter ## + + display:hasDataGetter display:getResearchAreaDataGetter . + display:hasDataGetter display:getResearchAreaDataGetter . + display:hasDataGetter display:getResearchAreaDataGetter . + display:hasDataGetter display:getResearchAreaDataGetter . + display:hasDataGetter display:getResearchAreaDataGetter . + display:hasDataGetter display:getResearchAreaDataGetter . + display:hasDataGetter display:getResearchAreaDataGetter . + + +## define the datagetter ## + +display:getResearchAreaDataGetter + a ; + display:saveToVar "researchAreaResults"; + display:query + """ + PREFIX rdfs: + PREFIX vivo: + SELECT DISTINCT (str(?researchAreaLabel) AS ?raLabel) ?ra + WHERE { + ?individualURI vivo:organizationForPosition ?posn . + ?posn vivo:positionForPerson ?person . + ?person vivo:hasResearchArea ?ra . + ?ra rdfs:label ?researchAreaLabel + } + ORDER BY ?raLabel + """ . + +## detail page for non-academic department research areas ## + + + a ; + ; + "individual-affiliated-res-area-details.ftl" ; + "Affiliated Research Areas" ; + "/affiliatedResearchAreas" . + + + a ; + + """ + PREFIX rdfs: + PREFIX vivo: + SELECT DISTINCT (str (?prsnLabel) AS ?personLabel) + ?person + (str(?researchAreaLabel) AS ?raLabel) + (str(?organizationLabel) AS ?orgLabel) + ?raURI + WHERE { + ?orgURI vivo:organizationForPosition ?posn . + ?orgURI rdfs:label ?organizationLabel . + ?posn vivo:positionForPerson ?person . + ?person rdfs:label ?prsnLabel . + ?person vivo:hasResearchArea ?raURI . + ?raURI rdfs:label ?researchAreaLabel + } + ORDER BY ?personLabel + """ ; + "affiliatedResearchAreas" . + +## detail page for academic department research areas ## + + + a ; + ; + "individual-dept-res-area-details.ftl" ; + "Departmental Research Areas" ; + "/deptResearchAreas" . + + + a ; + + """ + PREFIX rdfs: + PREFIX vivo: + SELECT DISTINCT (str (?prsnLabel) AS ?personLabel) + ?person + (Str(?researchAreaLabel) AS ?raLabel) + (str(?departmentLabel) AS ?orgLabel) + ?raURI + WHERE { + ?orgURI vivo:organizationForPosition ?posn . + ?orgURI rdfs:label ?orgLabel . + ?posn vivo:positionForPerson ?person . + ?person rdfs:label ?prsnLabel . + ?person vivo:hasResearchArea ?raURI . + ?raURI rdfs:label ?researchAreaLabel + + } + ORDER BY ?personLabel + """ ; + + "deptResearchAreas" . + + + +#### n3 for grants #### + + + a ; + ; + "individual-dept-active-grants.ftl" ; + "Departmental Grants" ; + "/deptGrants" . + + + a ; + + """ + PREFIX rdfs: + PREFIX vivo: + PREFIX afn: + SELECT DISTINCT (str (?actLabel) AS ?activityLabel) ?dt (str(?departmentLabel) AS ?deptLabel) ?activity + WHERE { + ?individualURI vivo:organizationForPosition ?posn . + ?individualURI rdfs:label ?departmentLabel . + ?posn vivo:positionForPerson ?person . + ?person ?roleProperty ?role . + ?roleProperty rdfs:subPropertyOf vivo:hasResearcherRole . + ?role vivo:roleContributesTo ?activity . + ?activity rdfs:label ?actLabel . + ?activity vivo:dateTimeInterval ?dti . + ?dti vivo:end ?end. + ?end vivo:dateTime ?dt + FILTER (?dt > afn:now()) + } + ORDER BY ?activityLabel + """ ; + "deptGrants" . + diff --git a/productMods/templates/freemarker/body/individual/individual--foaf-organization.ftl b/productMods/templates/freemarker/body/individual/individual--foaf-organization.ftl index 7186077d..b1f7b6e5 100644 --- a/productMods/templates/freemarker/body/individual/individual--foaf-organization.ftl +++ b/productMods/templates/freemarker/body/individual/individual--foaf-organization.ftl @@ -13,6 +13,10 @@ +<#assign affiliatedResearchAreas> + <#include "individual-affiliated-research-areas.ftl"> + + <#if individual.mostSpecificTypes?seq_contains("Academic Department")> <#assign departmentalGrantsExtension> - - <#assign departmentalResearchAreas> - <#include "individual-dept-research-areas.ftl"> - - - <#assign departmentalMemberships> - <#include "individual-dept-memberships.ftl"> - <#include "individual.ftl"> diff --git a/productMods/templates/freemarker/body/individual/individual.ftl b/productMods/templates/freemarker/body/individual/individual.ftl index b4214ffb..cd2a6c43 100644 --- a/productMods/templates/freemarker/body/individual/individual.ftl +++ b/productMods/templates/freemarker/body/individual/individual.ftl @@ -12,7 +12,7 @@ <#include "individual-webpage.ftl"> <#include "individual-overview.ftl"> - ${departmentalResearchAreas!} + ${affiliatedResearchAreas!} diff --git a/productMods/templates/freemarker/body/partials/individual/individual-affiliated-res-area-details.ftl b/productMods/templates/freemarker/body/partials/individual/individual-affiliated-res-area-details.ftl new file mode 100644 index 00000000..bf62c621 --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/individual-affiliated-res-area-details.ftl @@ -0,0 +1,31 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> +<#if affiliatedResearchAreas?has_content> +
+ <#list affiliatedResearchAreas as firstRow> + <#assign firstOrgLabel = firstRow["orgLabel"]?upper_case /> + <#assign i18TextString1 = "" /> + <#if ( firstOrgLabel?index_of("THE") == 0 ) > + <#assign i18TextString1 = "${i18n().individuals_with_researh_area_one(firstRow['orgLabel'])}" /> + <#else> + <#assign i18TextString1 = "${i18n().individuals_with_researh_area_two(firstRow['orgLabel'])}" /> + +
+

${firstRow["raLabel"]}

+

${i18TextString1} ${i18n().view_all_individuals_in_area}

+
+ <#break> + +
+ +
+ + +
+ + diff --git a/productMods/templates/freemarker/body/partials/individual/individual-affiliated-research-areas.ftl b/productMods/templates/freemarker/body/partials/individual/individual-affiliated-research-areas.ftl new file mode 100644 index 00000000..d0a3ab8a --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/individual-affiliated-research-areas.ftl @@ -0,0 +1,40 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> +<#if researchAreaResults?has_content> + <#-- If the organization is an Academic Department, we use a different datagetter and detail page. This --> + <#-- is strictly a usability issue so we can refer accurately to "faculty members" within the dept. --> + <#assign urlForDetailsPage = "affiliatedResearchAreas" /> + <#assign headingText = "${i18n().affiliated_research_areas}" /> + <#if individual.mostSpecificTypes?seq_contains("Academic Department")> + <#assign urlForDetailsPage = "deptResearchAreas" /> + <#assign headingText = "${i18n().faculty_research_areas}" /> + +

+ ${headingText} +

+ + + diff --git a/productMods/templates/freemarker/body/partials/individual/individual-dept-membership-details.ftl b/productMods/templates/freemarker/body/partials/individual/individual-dept-membership-details.ftl deleted file mode 100644 index 47b4c09e..00000000 --- a/productMods/templates/freemarker/body/partials/individual/individual-dept-membership-details.ftl +++ /dev/null @@ -1,26 +0,0 @@ -<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> - -<#if deptMemberships?has_content> -
- <#list deptMemberships as firstRow> -
-

${firstRow["orgLabel"]}

-

${i18n().faculty_who_are_members_of_org(firstRow["deptLabel"])} ${i18n().view_all_members_of_org}

-
- <#break> - - -
- - -
- - - -
diff --git a/productMods/templates/freemarker/body/partials/individual/individual-dept-memberships.ftl b/productMods/templates/freemarker/body/partials/individual/individual-dept-memberships.ftl deleted file mode 100644 index 79232f43..00000000 --- a/productMods/templates/freemarker/body/partials/individual/individual-dept-memberships.ftl +++ /dev/null @@ -1,15 +0,0 @@ -<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> - -<#if membershipResults?has_content> -

${i18n().faculty_memberships}

- <#assign numberRows = membershipResults?size/> - - diff --git a/productMods/templates/freemarker/body/partials/individual/individual-dept-res-area-details.ftl b/productMods/templates/freemarker/body/partials/individual/individual-dept-res-area-details.ftl index 21fff593..6310f571 100644 --- a/productMods/templates/freemarker/body/partials/individual/individual-dept-res-area-details.ftl +++ b/productMods/templates/freemarker/body/partials/individual/individual-dept-res-area-details.ftl @@ -1,10 +1,10 @@ -<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> <#if deptResearchAreas?has_content>
<#list deptResearchAreas as firstRow>

${firstRow["raLabel"]}

-

${i18n().faculty_with_researh_area(firstRow["deptLabel"])} ${i18n().view_all_faculty_in_area}

+

${i18n().faculty_with_researh_area(firstRow["deptLabel"])} ${i18n().view_all_faculty_in_area}

<#break> diff --git a/productMods/templates/freemarker/body/partials/individual/individual-dept-research-areas.ftl b/productMods/templates/freemarker/body/partials/individual/individual-dept-research-areas.ftl deleted file mode 100644 index 2a09f64a..00000000 --- a/productMods/templates/freemarker/body/partials/individual/individual-dept-research-areas.ftl +++ /dev/null @@ -1,45 +0,0 @@ -<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#if researchAreaResults?has_content> -

- ${i18n().faculty_research_areas} -

- - <#assign numberRows = researchAreaResults?size/> -
    - <#assign totalLength = 0 > - <#assign moreDisplayed = false> - <#list researchAreaResults as resultRow> - <#if ( totalLength > 380 ) && !moreDisplayed > -
  • (...${i18n().display_more})
  • - - <#assign totalLength = totalLength + resultRow["raLabel"]?length > - - <#if ( totalLength > 380 ) > -
- - diff --git a/themes/wilma/i18n/all.properties b/themes/wilma/i18n/all.properties index 2b787cdd..ec35a8d4 100644 --- a/themes/wilma/i18n/all.properties +++ b/themes/wilma/i18n/all.properties @@ -58,12 +58,15 @@ view_all_active_grants = View all active grants faculty_who_are_members_of_org = Here are the faculty in the {0} department who are members of this organization. view_all_faculty = view all faculty view_all_members_of_org = View all the members of this organization. - faculty_memberships = Faculty Memberships -faculty_with_researh_area = Here are the faculty members in the {0} department who have an interest in this research area. -view_all_faculty_in_area = View all faculty members with an interest in this area. +individuals_with_researh_area_one = Here are the individuals in {0} who have an interest in this research area. +individuals_with_researh_area_two = Here are the individuals in the {0} who have an interest in this research area. +faculty_with_researh_area = Here are the faculty members in the {0} department who have an interest in this research area. +view_all_individuals_in_area = View all individuals with an interest in this area. +view_all_faculty_in_area = View all faculty with an interest in this area. faculty_research_areas = Faculty Research Areas +affiliated_research_areas = Affiliated Research Areas research_area = research area display_more = more display_less = less