NIHVIVO-1317 Migrated custom list view from vitro:primaryLink and vitro:additionalLink to core:webpage
This commit is contained in:
parent
5f5df56304
commit
7c82474f19
6 changed files with 91 additions and 6 deletions
|
@ -138,11 +138,8 @@
|
||||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-dateTimeValue.xml</display:listViewConfigFile>
|
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-dateTimeValue.xml</display:listViewConfigFile>
|
||||||
</rdf:Description>
|
</rdf:Description>
|
||||||
|
|
||||||
<rdf:Description rdf:about="http://vitro.mannlib.cornell.edu/ns/vitro/0.7#primaryLink">
|
<rdf:Description rdf:about="http://vivoweb.org/ontology/core#webpage">
|
||||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-vitroLink.xml</display:listViewConfigFile>
|
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-webpage.xml</display:listViewConfigFile>
|
||||||
</rdf:Description>
|
|
||||||
<rdf:Description rdf:about="http://vitro.mannlib.cornell.edu/ns/vitro/0.7#additionalLink">
|
|
||||||
<display:listViewConfigFile rdf:datatype="http://www.w3.org/2001/XMLSchema#string">listViewConfig-vitroLink.xml</display:listViewConfigFile>
|
|
||||||
</rdf:Description>
|
</rdf:Description>
|
||||||
|
|
||||||
<rdf:Description rdf:about="http://vitro.mannlib.cornell.edu/ontologies/display/1.1#hasElement">
|
<rdf:Description rdf:about="http://vitro.mannlib.cornell.edu/ontologies/display/1.1#hasElement">
|
||||||
|
|
43
productMods/config/listViewConfig-webpage.xml
Normal file
43
productMods/config/listViewConfig-webpage.xml
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||||
|
|
||||||
|
<!-- Custom list view config file for core:webpage
|
||||||
|
|
||||||
|
See guidelines in vitro/doc/list_view_configuration_guidelines.txt -->
|
||||||
|
|
||||||
|
<list-view-config>
|
||||||
|
<query-select>
|
||||||
|
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 }
|
||||||
|
<critical-data-required>
|
||||||
|
FILTER ( bound(?anchor) && bound(?url) )
|
||||||
|
</critical-data-required>
|
||||||
|
} ORDER BY ?rank ?anchor
|
||||||
|
</query-select>
|
||||||
|
|
||||||
|
<query-construct>
|
||||||
|
CONSTRUCT {
|
||||||
|
?subject ?property ?link .
|
||||||
|
?link ?linkProp ?linkObj
|
||||||
|
} WHERE {
|
||||||
|
{
|
||||||
|
?subject ?property ?link
|
||||||
|
} UNION {
|
||||||
|
?subject ?property ?link .
|
||||||
|
?link ?linkProp ?linkObj
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</query-construct>
|
||||||
|
|
||||||
|
<template>propStatement-webpage.ftl</template>
|
||||||
|
</list-view-config>
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
<#include "individual-setup.ftl">
|
<#include "individual-setup.ftl">
|
||||||
<#import "individual-qrCodeGenerator.ftl" as qr>
|
<#import "individual-qrCodeGenerator.ftl" as qr>
|
||||||
|
<#import "lib-vivo-properties.ftl" as vp>
|
||||||
|
|
||||||
<section id="individual-intro" class="vcard person" role="region">
|
<section id="individual-intro" class="vcard person" role="region">
|
||||||
|
|
||||||
|
@ -41,7 +42,7 @@
|
||||||
<#include "individual-contactInfo.ftl">
|
<#include "individual-contactInfo.ftl">
|
||||||
|
|
||||||
<#-- Links -->
|
<#-- Links -->
|
||||||
<@p.vitroLinks propertyGroups namespaces editable "individual-urls-people" />
|
<@vp.webpages propertyGroups editable "individual-urls-people" />
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="individual-info" ${infoClass!} role="region">
|
<section id="individual-info" ${infoClass!} role="region">
|
||||||
|
|
|
@ -3,10 +3,12 @@
|
||||||
<#-- Default VIVO individual profile page template (extends individual.ftl in vitro) -->
|
<#-- Default VIVO individual profile page template (extends individual.ftl in vitro) -->
|
||||||
|
|
||||||
<#include "individual-setup.ftl">
|
<#include "individual-setup.ftl">
|
||||||
|
<#import "lib-vivo-properties.ftl" as vp>
|
||||||
|
|
||||||
<#assign individualProductExtension>
|
<#assign individualProductExtension>
|
||||||
<#-- Include for any class specific template additions -->
|
<#-- Include for any class specific template additions -->
|
||||||
${classSpecificExtension!}
|
${classSpecificExtension!}
|
||||||
|
<@vp.webpages propertyGroups editable />
|
||||||
<!--PREINDIVIDUAL OVERVIEW.FTL-->
|
<!--PREINDIVIDUAL OVERVIEW.FTL-->
|
||||||
<#include "individual-overview.ftl">
|
<#include "individual-overview.ftl">
|
||||||
</section> <!-- #individual-info -->
|
</section> <!-- #individual-info -->
|
||||||
|
|
|
@ -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>
|
||||||
|
</#assign>
|
||||||
|
|
||||||
|
<#if statement.url??>
|
||||||
|
<a href="${statement.url}">${linkText}</a>
|
||||||
|
<#else>
|
||||||
|
<a href="${profileUrl(statement.link)}">${linkText}</a> (no url provided for link)
|
||||||
|
</#if>
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
<#import "lib-properties.ftl" as p>
|
<#import "lib-properties.ftl" as p>
|
||||||
|
|
||||||
|
<#assign core = "http://vivoweb.org/ontology/core#">
|
||||||
|
|
||||||
<#-- Display preferredTitle if it exists; otherwise display mostSpecificTypes -->
|
<#-- Display preferredTitle if it exists; otherwise display mostSpecificTypes -->
|
||||||
<#macro displayTitle individual>
|
<#macro displayTitle individual>
|
||||||
<#if individual.preferredTitle?has_content>
|
<#if individual.preferredTitle?has_content>
|
||||||
|
@ -11,4 +13,25 @@
|
||||||
<#else>
|
<#else>
|
||||||
<@p.mostSpecificTypes individual />
|
<@p.mostSpecificTypes individual />
|
||||||
</#if>
|
</#if>
|
||||||
|
</#macro>
|
||||||
|
|
||||||
|
|
||||||
|
<#-- 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) -->
|
||||||
|
<nav role="navigation">
|
||||||
|
<#local label = "Web Pages">
|
||||||
|
<@p.addLinkWithLabel webpage editable label />
|
||||||
|
<#if webpage.statements?has_content> <#-- if there are any statements -->
|
||||||
|
<ul class="${linkListClass}" id="webpages" role="list">
|
||||||
|
<@p.objectPropertyList webpage editable />
|
||||||
|
</ul>
|
||||||
|
</#if>
|
||||||
|
</nav>
|
||||||
|
</#if>
|
||||||
</#macro>
|
</#macro>
|
Loading…
Add table
Add a link
Reference in a new issue