NIHVIVO-1317 Migrated custom list view from vitro:primaryLink and vitro:additionalLink to core:webpage

This commit is contained in:
ryounes 2011-07-07 20:34:11 +00:00
parent 4a2877abfa
commit c5c4ecd394
6 changed files with 4 additions and 102 deletions

View file

@ -22,8 +22,7 @@ public abstract class BaseTemplateModel {
this.vreq = vreq;
}
// Some BaseTemplateModel classes don't need vreq, so provide an
// argumentless constructor.
// Provide no-arg constructor for types that don't need vreq.
protected BaseTemplateModel() {
this.vreq = null;
};

View file

@ -1,41 +0,0 @@
<?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 vitro link properties
See guidelines in vitro/doc/list_view_configuration_guidelines.txt -->
<list-view-config>
<query-select>
PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt;
PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt;
SELECT ?link
(afn:localname(?link) AS ?linkName)
?anchor
?url WHERE {
?subject ?property ?link
OPTIONAL { ?link vitro:linkAnchor ?anchor }
OPTIONAL { ?link vitro:linkURL ?url }
OPTIONAL { ?link vitro:linkDisplayRank ?rank }
<critical-data-required>
FILTER ( bound(?anchor) &amp;&amp; bound(?url) )
</critical-data-required>
} ORDER BY ?rank
</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-vitroLink.ftl</template>
</list-view-config>

View file

@ -51,7 +51,7 @@
#individual-intro a.icon-rdf {
font-size: 1.125em;
}
ul#links-additional{
ul#webpages{
margin-bottom: 5px;
}
/* <------ INDIVIDUAL INTRO FOR PERSON*/
@ -169,8 +169,8 @@ ul.individual-emails li {
font-size: .875em;
line-height: 1.3em;
}
ul#links-additional li,
ul#links-primary li,
ul#webpages li,
ul#primary-email li,
ul#additional-emails li {
word-wrap: break-word;

View file

@ -48,9 +48,6 @@
</ul>
</nav>
<#-- Links -->
<@p.vitroLinks propertyGroups namespaces editable />
<#if individualProductExtension??>
${individualProductExtension}
<#else>

View file

@ -1,19 +0,0 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Template for vitro:primaryLink and vitro:additionalLink.
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>
${linkText} (no url provided for link)
</#if>

View file

@ -184,40 +184,6 @@ name will be used as the label. -->
Macros for specific properties
------------------------------------------------------------------------------>
<#-- Vitro namespace links
Currently the page displays the vitro namespace links properties. Future versions
will use the vivo core ontology links property, eliminating the need for special handling.
Note that this macro has a side-effect in the calls to propertyGroups.pullProperty().
-->
<#macro vitroLinks propertyGroups namespaces editable linkListClass="individual-urls">
<#local primaryLink = propertyGroups.pullProperty("${namespaces.vitro}primaryLink")!>
<#local additionalLinks = propertyGroups.pullProperty("${namespaces.vitro}additionalLink")!>
<#if (primaryLink?has_content || additionalLinks?has_content)> <#-- true when the property is in the list, even if not populated (when editing) -->
<nav role="navigation">
<#local primaryLinkLabel = "Primary Web Page">
<#if primaryLink.statements?has_content> <#-- if there are any statements -->
<#if editable><@propertyLabel primaryLink primaryLinkLabel /></#if>
<ul class="${linkListClass}" id="links-primary" role="list">
<@objectPropertyList primaryLink editable />
</ul>
<#else>
<#-- Show add link only if there isn't a primaryLink already (displayLimitAnnnot not
supported for object properties). -->
<@addLinkWithLabel primaryLink editable primaryLinkLabel />
</#if>
<@addLinkWithLabel additionalLinks editable "Additional Web Pages" />
<#if additionalLinks.statements?has_content> <#-- if there are any statements -->
<ul class="${linkListClass}" id="links-additional" role="list">
<@objectPropertyList additionalLinks editable />
</ul>
</#if>
</nav>
</#if>
</#macro>
<#-- Image
Values for showPlaceholder: "always", "never", "with_add_link"