VIVO-285: visualization updates for ISF

This commit is contained in:
tworrall 2013-09-30 09:29:19 -04:00
parent 4202f30ea7
commit 4d5a567e36
2 changed files with 31 additions and 0 deletions

View file

@ -476,6 +476,19 @@ public class GroupedPropertyList extends BaseTemplateModel {
return null; return null;
} }
public PropertyTemplateModel getProperty(String propertyUri, String rangeUri) {
for (PropertyGroupTemplateModel pgtm : groups) {
List<PropertyTemplateModel> properties = pgtm.getProperties();
for (PropertyTemplateModel ptm : properties) {
if (propertyUri.equals(ptm.getUri()) && rangeUri.equals(ptm.getRangeUri())) {
return ptm;
}
}
}
return null;
}
public PropertyTemplateModel pullProperty(String propertyUri) { public PropertyTemplateModel pullProperty(String propertyUri) {
return pullProperty(propertyUri, null); return pullProperty(propertyUri, null);
} }

View file

@ -22,6 +22,24 @@
</#if> </#if>
</#function> </#function>
<#-- Return true iff there are statements for this property -->
<#function hasVisualizationStatements propertyGroups propertyName rangeUri>
<#local property = propertyGroups.getProperty(propertyName, rangeUri)!>
<#-- First ensure that the property is defined
(an unpopulated property while logged out is undefined) -->
<#if ! property?has_content>
<#return false>
</#if>
<#if property.collatedBySubclass!false> <#-- collated object property-->
<#return property.subclasses?has_content>
<#else>
<#return property.statements?has_content> <#-- data property or uncollated object property -->
</#if>
</#function>
<#----------------------------------------------------------------------------- <#-----------------------------------------------------------------------------
Macros for generating property lists Macros for generating property lists