diff --git a/productMods/WEB-INF/ontologies/app/listViewConfig.owl b/productMods/WEB-INF/ontologies/app/listViewConfig.owl index 31feb055..d3877d0a 100644 --- a/productMods/WEB-INF/ontologies/app/listViewConfig.owl +++ b/productMods/WEB-INF/ontologies/app/listViewConfig.owl @@ -138,11 +138,8 @@ listViewConfig-dateTimeValue.xml - - listViewConfig-vitroLink.xml - - - listViewConfig-vitroLink.xml + + listViewConfig-webpage.xml diff --git a/productMods/config/listViewConfig-webpage.xml b/productMods/config/listViewConfig-webpage.xml new file mode 100644 index 00000000..7bbeaada --- /dev/null +++ b/productMods/config/listViewConfig-webpage.xml @@ -0,0 +1,43 @@ + + + + + + + + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + PREFIX core: <http://vivoweb.org/ontology/core#> + + SELECT ?link + (afn:localname(?link) AS ?linkName) + ?anchor + ?url + ?rank WHERE { + ?subject ?property ?link + OPTIONAL { ?link core:linkAnchorText ?anchor } + OPTIONAL { ?link core:linkURI ?url } + OPTIONAL { ?link core:rank ?rank } + + FILTER ( bound(?anchor) && bound(?url) ) + + } ORDER BY ?rank ?anchor + + + + CONSTRUCT { + ?subject ?property ?link . + ?link ?linkProp ?linkObj + } WHERE { + { + ?subject ?property ?link + } UNION { + ?subject ?property ?link . + ?link ?linkProp ?linkObj + } + } + + + + diff --git a/productMods/templates/freemarker/body/individual/individual--foaf-person.ftl b/productMods/templates/freemarker/body/individual/individual--foaf-person.ftl index faf1be46..6511a239 100644 --- a/productMods/templates/freemarker/body/individual/individual--foaf-person.ftl +++ b/productMods/templates/freemarker/body/individual/individual--foaf-person.ftl @@ -4,6 +4,7 @@ <#include "individual-setup.ftl"> <#import "individual-qrCodeGenerator.ftl" as qr> +<#import "lib-vivo-properties.ftl" as vp>
@@ -41,7 +42,7 @@ <#include "individual-contactInfo.ftl"> <#-- Links --> - <@p.vitroLinks propertyGroups namespaces editable "individual-urls-people" /> + <@vp.webpages propertyGroups editable "individual-urls-people" />
diff --git a/productMods/templates/freemarker/body/individual/individual.ftl b/productMods/templates/freemarker/body/individual/individual.ftl index 378da375..751b4cdd 100644 --- a/productMods/templates/freemarker/body/individual/individual.ftl +++ b/productMods/templates/freemarker/body/individual/individual.ftl @@ -3,10 +3,12 @@ <#-- Default VIVO individual profile page template (extends individual.ftl in vitro) --> <#include "individual-setup.ftl"> +<#import "lib-vivo-properties.ftl" as vp> <#assign individualProductExtension> <#-- Include for any class specific template additions --> ${classSpecificExtension!} + <@vp.webpages propertyGroups editable /> <#include "individual-overview.ftl">
diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-webpage.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-webpage.ftl new file mode 100644 index 00000000..a88df623 --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-webpage.ftl @@ -0,0 +1,19 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Template for core:webpage. + + 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. + --> + +<#assign linkText> + <#if statement.anchor??>${statement.anchor} + <#else>${statement.linkName} (no anchor text provided for link) + + + +<#if statement.url??> + ${linkText} +<#else> + ${linkText} (no url provided for link) + \ No newline at end of file diff --git a/productMods/templates/freemarker/lib/lib-vivo-properties.ftl b/productMods/templates/freemarker/lib/lib-vivo-properties.ftl index ec8fd8bc..696a11fe 100644 --- a/productMods/templates/freemarker/lib/lib-vivo-properties.ftl +++ b/productMods/templates/freemarker/lib/lib-vivo-properties.ftl @@ -4,6 +4,8 @@ <#import "lib-properties.ftl" as p> +<#assign core = "http://vivoweb.org/ontology/core#"> + <#-- Display preferredTitle if it exists; otherwise display mostSpecificTypes --> <#macro displayTitle individual> <#if individual.preferredTitle?has_content> @@ -11,4 +13,25 @@ <#else> <@p.mostSpecificTypes individual /> + + + +<#-- core:webpage + + Note that this macro has a side-effect in the call to propertyGroups.pullProperty(). +--> +<#macro webpages propertyGroups editable linkListClass="individual-urls"> + <#local webpage = propertyGroups.pullProperty("${core}webpage")!> + + <#if webpage?has_content> <#-- true when the property is in the list, even if not populated (when editing) --> + + \ No newline at end of file