From dbbe25b65cdf341f1e79b4de718ca482edd64ea5 Mon Sep 17 00:00:00 2001 From: rjy7 Date: Thu, 13 Jan 2011 21:11:19 +0000 Subject: [PATCH] NIHVIVO-1332 Editing links for vitro:primaryLink and vitro:additionalLink properties --- .../webapp/dao/jena/DataPropertyDaoJena.java | 25 ++++++++++++ .../dao/jena/ObjectPropertyDaoJena.java | 29 ++++++++++++++ .../webapp/dao/jena/PropertyDaoJena.java | 22 ---------- .../individual/GroupedPropertyList.java | 40 ++++++++++++++----- .../individual/IndividualTemplateModel.java | 5 +-- .../ListedIndividualTemplateModel.java | 24 ++++++----- .../ObjectPropertyStatementTemplateModel.java | 30 ++++++++++---- .../ObjectPropertyTemplateModel.java | 1 + .../web/config/listViewConfig-vitroLink.xml | 22 ++++++++++ webapp/web/css/individual/individual.css | 10 ++--- .../partials/individual/individual-links.ftl | 28 +++++++++---- .../partials/individual/lib-properties.ftl | 9 ++--- .../individual/propStatement-vitroLink.ftl | 15 +++++++ 13 files changed, 190 insertions(+), 70 deletions(-) create mode 100644 webapp/web/config/listViewConfig-vitroLink.xml create mode 100644 webapp/web/templates/freemarker/body/partials/individual/propStatement-vitroLink.ftl diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyDaoJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyDaoJena.java index bd4900bcd..822559685 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyDaoJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyDaoJena.java @@ -3,6 +3,7 @@ package edu.cornell.mannlib.vitro.webapp.dao.jena; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Comparator; @@ -55,12 +56,36 @@ import edu.cornell.mannlib.vitro.webapp.dao.VClassDao; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.jena.event.EditEvent; import edu.cornell.mannlib.vitro.webapp.dao.jena.pellet.PelletListener; +import edu.cornell.mannlib.vitro.webapp.utils.StringUtils; public class DataPropertyDaoJena extends PropertyDaoJena implements DataPropertyDao { protected static final Log log = LogFactory.getLog(DataPropertyDaoJena.class.getName()); + /* This may be the intent behind JenaBaseDao.NONUSER_NAMESPACES, but that + * value does not contain all of these namespaces. + */ + protected static final List EXCLUDED_NAMESPACES = Arrays.asList( + "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#", + "http://vitro.mannlib.cornell.edu/ns/vitro/public#", + "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "http://www.w3.org/2000/01/rdf-schema#", + "http://www.w3.org/2002/07/owl#" + ); + + /* + * This is a hack to throw out properties in the vitro, rdf, rdfs, and owl namespaces. + * It will be implemented in a better way in v1.3 (Editing and Display Configuration). + */ + protected static String propertyFilters = null; + static { + List namespaceFilters = new ArrayList(); + for (String s : EXCLUDED_NAMESPACES) { + namespaceFilters.add("afn:namespace(?property) != \"" + s + "\""); + } + propertyFilters = "FILTER (" + StringUtils.join(namespaceFilters, " && \n") + ")\n"; + } protected static final String dataPropertyQueryString = PREFIXES + "\n" + "SELECT DISTINCT ?property WHERE { \n" + diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyDaoJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyDaoJena.java index 5d5fe76b7..6ff8bb3ac 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyDaoJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyDaoJena.java @@ -3,6 +3,7 @@ package edu.cornell.mannlib.vitro.webapp.dao.jena; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; @@ -48,10 +49,38 @@ import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao; import edu.cornell.mannlib.vitro.webapp.dao.OntologyDao; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.jena.event.EditEvent; +import edu.cornell.mannlib.vitro.webapp.utils.StringUtils; public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectPropertyDao { private static final Log log = LogFactory.getLog(ObjectPropertyDaoJena.class.getName()); + /* This may be the intent behind JenaBaseDao.NONUSER_NAMESPACES, but that + * value does not contain all of these namespaces. + */ + protected static final List EXCLUDED_NAMESPACES = Arrays.asList( + //"http://vitro.mannlib.cornell.edu/ns/vitro/0.7#", + //"http://vitro.mannlib.cornell.edu/ns/vitro/public#", + "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "http://www.w3.org/2000/01/rdf-schema#", + "http://www.w3.org/2002/07/owl#" + ); + /* + * This is a hack to throw out properties in the vitro, rdf, rdfs, and owl namespaces. + * It will be implemented in a better way in v1.3 (Editing and Display Configuration). + */ + protected static String propertyFilters = ""; + static { + List namespaceFilters = new ArrayList(); + for (String s : EXCLUDED_NAMESPACES) { + namespaceFilters.add("afn:namespace(?property) != \"" + s + "\""); + } + // A hack to include the vitro:primaryLink and vitro:additionalLink properties in the list +// namespaceFilters.add("( ?property = ||" + +// "?property = ||" + +// "afn:namespace(?property) != \"http://vitro.mannlib.cornell.edu/ns/vitro/0.7#\" )"); + propertyFilters = "FILTER (" + StringUtils.join(namespaceFilters, " && \n") + ")\n"; + } + protected static final String objectPropertyQueryString = PREFIXES + "\n" + "SELECT DISTINCT ?property WHERE { \n" + diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/PropertyDaoJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/PropertyDaoJena.java index 6e86460d3..0d34af086 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/PropertyDaoJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/PropertyDaoJena.java @@ -47,28 +47,6 @@ public class PropertyDaoJena extends JenaBaseDao implements PropertyDao { "PREFIX vitro: \n" + "PREFIX owl: \n" + "PREFIX afn: "; - - /* This may be the intent behind JenaBaseDao.NONUSER_NAMESPACES, but that - * value does not contain all of these namespaces. - */ - protected static final List EXCLUDED_NAMESPACES = Arrays.asList( - "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#", - "http://vitro.mannlib.cornell.edu/ns/vitro/public#", - "http://www.w3.org/1999/02/22-rdf-syntax-ns#", - "http://www.w3.org/2000/01/rdf-schema#", - "http://www.w3.org/2002/07/owl#" - ); - - /* - * This is a hack to throw out properties in the vitro, rdf, rdfs, and owl namespaces. - * It will be implemented in a better way in v1.3 (Editing and Display Configuration). - */ - protected static String propertyFilters = ""; - static { - for (String s : EXCLUDED_NAMESPACES) { - propertyFilters += "FILTER (afn:namespace(?property) != \"" + s + "\") \n"; - } - } private DatasetWrapperFactory dwf; diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java index b5acf4431..3b9efde18 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java @@ -6,7 +6,9 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; +import java.util.HashSet; import java.util.List; +import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -23,6 +25,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyDao; import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao; import edu.cornell.mannlib.vitro.webapp.dao.PropertyGroupDao; import edu.cornell.mannlib.vitro.webapp.dao.PropertyInstanceDao; +import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; import edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep; import edu.cornell.mannlib.vitro.webapp.web.templatemodels.BaseTemplateModel; @@ -42,6 +45,12 @@ public class GroupedPropertyList extends BaseTemplateModel { private static final Log log = LogFactory.getLog(GroupedPropertyList.class); private static final int MAX_GROUP_DISPLAY_RANK = 99; + private static final List VITRO_PROPS_TO_ADD_TO_LIST = new ArrayList() {{ + add(VitroVocabulary.PRIMARY_LINK); + add(VitroVocabulary.ADDITIONAL_LINK); + //add(VitroVocabulary.IND_MAIN_IMAGE); + }}; + private Individual subject; private VitroRequest vreq; private WebappDaoFactory wdf; @@ -142,30 +151,39 @@ public class GroupedPropertyList extends BaseTemplateModel { PropertyInstanceDao piDao = wdf.getPropertyInstanceDao(); Collection allPropInstColl = piDao.getAllPossiblePropInstForIndividual(subject.getURI()); if (allPropInstColl != null) { + ObjectPropertyDao opDao = wdf.getObjectPropertyDao(); for (PropertyInstance pi : allPropInstColl) { if (pi != null) { - // RY Do we need to check this before checking if it's on the property list?? if (! alreadyOnObjectPropertyList(objectPropertyList, pi)) { - ObjectPropertyDao opDao = wdf.getObjectPropertyDao(); - ObjectProperty op = opDao.getObjectPropertyByURI(pi.getPropertyURI()); - if (op == null) { - log.error("ObjectProperty op returned null from opDao.getObjectPropertyByURI()"); - } else if (op.getURI() == null) { - log.error("ObjectProperty op returned with null propertyURI from opDao.getObjectPropertyByURI()"); - } else if (! alreadyOnPropertyList(propertyList, op)) { - //op.setLabel(op.getDomainPublic()); - propertyList.add(op); - } + addIfNotAlreadyOnList(propertyList, pi.getPropertyURI(), opDao); } } else { log.error("a property instance in the Collection created by PropertyInstanceDao.getAllPossiblePropInstForIndividual() is unexpectedly null"); } } + // These properties are outside the ontologies (in vitro and vitro public) but need to be added to the list + // In future, vitro ns props will be phased out. Vitro public properties should be changed so they do no + // constitute a special case. + for (String propertyUri : VITRO_PROPS_TO_ADD_TO_LIST) { + addIfNotAlreadyOnList(propertyList, propertyUri, opDao); + } } else { log.error("a null Collection is returned from PropertyInstanceDao.getAllPossiblePropInstForIndividual()"); } } + private void addIfNotAlreadyOnList(List propertyList, String propertyUri, ObjectPropertyDao opDao) { + + ObjectProperty op = opDao.getObjectPropertyByURI(propertyUri); + if (op == null) { + log.error("ObjectProperty op returned null from opDao.getObjectPropertyByURI()"); + } else if (op.getURI() == null) { + log.error("ObjectProperty op returned with null propertyURI from opDao.getObjectPropertyByURI()"); + } else if (! alreadyOnPropertyList(propertyList, op)) { + propertyList.add(op); + } + } + protected void mergeAllPossibleDataProperties(List propertyList) { DataPropertyDao dpDao = wdf.getDataPropertyDao(); Collection allDatapropColl = dpDao.getAllPossibleDatapropsForIndividual(subject.getURI()); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/IndividualTemplateModel.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/IndividualTemplateModel.java index 303f5147c..5c10c5acb 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/IndividualTemplateModel.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/IndividualTemplateModel.java @@ -16,8 +16,6 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Route; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep; -import edu.cornell.mannlib.vitro.webapp.web.ViewFinder; -import edu.cornell.mannlib.vitro.webapp.web.ViewFinder.ClassView; import edu.cornell.mannlib.vitro.webapp.web.templatemodels.BaseTemplateModel; public class IndividualTemplateModel extends BaseTemplateModel { @@ -68,6 +66,7 @@ public class IndividualTemplateModel extends BaseTemplateModel { return isPerson() ? getUrl(Route.VISUALIZATION_AJAX.path(), "uri", getUri()) : null; } + // ** Remove these when the new methods are written public String getImageUrl() { String imageUrl = individual.getImageUrl(); return imageUrl == null ? null : getUrl(imageUrl); @@ -133,7 +132,7 @@ public class IndividualTemplateModel extends BaseTemplateModel { links.addAll(additionalLinks); return links; } - + public GroupedPropertyList getPropertyList() { if (propertyList == null) { propertyList = new GroupedPropertyList(individual, vreq, policyHelper); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ListedIndividualTemplateModel.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ListedIndividualTemplateModel.java index fdfb9025d..f65cdaedf 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ListedIndividualTemplateModel.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ListedIndividualTemplateModel.java @@ -43,11 +43,26 @@ public class ListedIndividualTemplateModel extends BaseTemplateModel { return models; } + private String getView(ClassView view) { + ViewFinder vf = new ViewFinder(view); + return vf.findClassView(individual, vreq); + } + /* Access methods for templates */ public String getProfileUrl() { return UrlBuilder.getIndividualProfileUrl(individual, vreq.getWebappDaoFactory()); } + + public String getImageUrl() { + String imageUrl = individual.getImageUrl(); + return imageUrl == null ? null : getUrl(imageUrl); + } + + public String getThumbUrl() { + String thumbUrl = individual.getThumbUrl(); + return thumbUrl == null ? null : getUrl(thumbUrl); + } public Link getPrimaryLink() { Link primaryLink = null; @@ -92,13 +107,4 @@ public class ListedIndividualTemplateModel extends BaseTemplateModel { return getView(ClassView.SEARCH); } - public String getDisplayView() { - return getView(ClassView.DISPLAY); - } - - private String getView(ClassView view) { - ViewFinder vf = new ViewFinder(view); - return vf.findClassView(individual, vreq); - } - } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ObjectPropertyStatementTemplateModel.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ObjectPropertyStatementTemplateModel.java index 02dd45955..2d6d53f5d 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ObjectPropertyStatementTemplateModel.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ObjectPropertyStatementTemplateModel.java @@ -2,8 +2,6 @@ package edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual; -import java.util.ArrayList; -import java.util.List; import java.util.Map; import org.apache.commons.logging.Log; @@ -14,17 +12,16 @@ import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.DropObject import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.EditObjPropStmt; import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement; import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatementImpl; +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.ParamMap; -import edu.cornell.mannlib.vitro.webapp.web.templatemodels.BaseTemplateModel; +import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyStatementDao; public class ObjectPropertyStatementTemplateModel extends PropertyStatementTemplateModel { private static final Log log = LogFactory.getLog(ObjectPropertyStatementTemplateModel.class); private static final String EDIT_PATH = "edit/editRequestDispatch.jsp"; - - private Map data; @@ -36,12 +33,30 @@ public class ObjectPropertyStatementTemplateModel extends PropertyStatementTempl super(subjectUri, propertyUri, policyHelper); this.data = data; + objectUri = data.get(objectKey); + setEditAccess(policyHelper); + } + + /** + * This method handles the special case where we are creating a DataPropertyStatementTemplateModel + * outside the GroupedPropertyList. Specifically, it allows vitro:primaryLink and vitro:additionalLink + * to be treated like data property statements and thus have editing links. (In a future version, + * these properties will be replaced by vivo core ontology properties.) It could potentially be used + * for other properties outside the property list as well. + */ + ObjectPropertyStatementTemplateModel(String subjectUri, String propertyUri, + VitroRequest vreq, EditingPolicyHelper policyHelper) { + super(subjectUri, propertyUri, policyHelper); + ObjectPropertyStatementDao opsDao = vreq.getWebappDaoFactory().getObjectPropertyStatementDao(); + + } + + private void setEditAccess(EditingPolicyHelper policyHelper) { // If the policyHelper is non-null, we are in edit mode, so create the list of editing permissions. // We do this now rather than in getEditUrl() and getDeleteUrl(), because getEditUrl() also needs to know // whether a delete is allowed. if (policyHelper != null) { - objectUri = data.get(objectKey); ObjectPropertyStatement objectPropertyStatement = new ObjectPropertyStatementImpl(subjectUri, propertyUri, objectUri); // Determine whether the statement can be edited @@ -55,9 +70,8 @@ public class ObjectPropertyStatementTemplateModel extends PropertyStatementTempl if (policyHelper.isAuthorizedAction(action)) { markDeletable(); } - } + } } - /* Access methods for templates */ diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ObjectPropertyTemplateModel.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ObjectPropertyTemplateModel.java index d6124b117..476fe8424 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ObjectPropertyTemplateModel.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ObjectPropertyTemplateModel.java @@ -94,6 +94,7 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel } } + protected String getQueryString() { return config.queryString; } diff --git a/webapp/web/config/listViewConfig-vitroLink.xml b/webapp/web/config/listViewConfig-vitroLink.xml new file mode 100644 index 000000000..2a2bdee3f --- /dev/null +++ b/webapp/web/config/listViewConfig-vitroLink.xml @@ -0,0 +1,22 @@ + + + + + + + + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + + SELECT ?link (afn:localname(?link) AS ?linkName) ?anchor ?url WHERE { + GRAPH ?g1 { ?subject ?property ?link } + OPTIONAL { GRAPH ?g2 { ?link vitro:linkAnchor ?anchor } } + OPTIONAL { GRAPH ?g3 { ?link vitro:linkURL ?url } } + OPTIONAL { GRAPH ?g4 { ?link vitro:linkDisplayRank ?rank } } + } ORDER BY ?rank + + + + diff --git a/webapp/web/css/individual/individual.css b/webapp/web/css/individual/individual.css index f49c2babd..d1a4ab87b 100644 --- a/webapp/web/css/individual/individual.css +++ b/webapp/web/css/individual/individual.css @@ -161,27 +161,27 @@ ul#individual-phone li:first-child{ .icon-phone, .icon-email{ padding-right: 5px; } -ul#individual-urls{ +ul.individual-urls{ list-style-type: circle; margin-left: 10px; float: left; margin-bottom: 30px; } -ul#individual-urls li{ +ul.individual-urls li{ font-size: .875em; line-height: 1.2em; } -ul#individual-urls li a{ +ul.individual-urls li a{ color: #2485ae; } -ul#individual-urls-people{ +ul.individual-urls-people{ clear: both; margin-top: 20px; list-style: none; list-style-type: circle; padding-left: 24px; } -ul#individual-urls-people li{ +ul.individual-urls-people li{ font-size: .875em; line-height: 1.2em; } diff --git a/webapp/web/templates/freemarker/body/partials/individual/individual-links.ftl b/webapp/web/templates/freemarker/body/partials/individual/individual-links.ftl index d29d6b508..8d2b0709d 100644 --- a/webapp/web/templates/freemarker/body/partials/individual/individual-links.ftl +++ b/webapp/web/templates/freemarker/body/partials/individual/individual-links.ftl @@ -6,10 +6,24 @@ will use the vivo core ontology links property, eliminating the need for special handling. --> - \ No newline at end of file +<#assign vitroNs = "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#"> +<#assign primaryLink = propertyGroups.getPropertyAndRemoveFromList("${vitroNs}primaryLink")!> +<#assign additionalLinks = propertyGroups.getPropertyAndRemoveFromList("${vitroNs}additionalLink")!> +<#assign linkListClass = linkListClass!"individual-urls"> + +<#if (primaryLink?has_content || additionalLinks?has_content)> <#-- true when the property is in the list, even if not populated (when editing) --> + + \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl b/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl index f6a00d158..c3e9f419a 100644 --- a/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl +++ b/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl @@ -33,11 +33,12 @@ <#-- Some properties usually display without a label. But if there's an add link, -we need to also show the property label. --> -<#macro addLinkWithLabel property showEditingLinks> +we need to also show the property label. If no label is specified, the property +name will be used as the label. --> +<#macro addLinkWithLabel property showEditingLinks label="${property.name?capitalize}"> <#local addLink><@addLink property showEditingLinks /> <#if addLink?has_content> -

${property.name?capitalize} ${addLink}

+

${label} ${addLink}

@@ -77,5 +78,3 @@ we need to also show the property label. --> delete - -<#-- Macros for specific properties --> \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/partials/individual/propStatement-vitroLink.ftl b/webapp/web/templates/freemarker/body/partials/individual/propStatement-vitroLink.ftl new file mode 100644 index 000000000..122d2a3a6 --- /dev/null +++ b/webapp/web/templates/freemarker/body/partials/individual/propStatement-vitroLink.ftl @@ -0,0 +1,15 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Template for vitro:primaryLink and vitro:additionalLink --> + +<#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