NIHVIVO-1510 Collated custom list views

This commit is contained in:
rjy7 2010-12-22 23:10:12 +00:00
parent e16ad50d5c
commit dd4acf965b
2 changed files with 10 additions and 9 deletions

View file

@ -33,10 +33,10 @@ public class CollatedObjectPropertyTemplateModel extends ObjectPropertyTemplateM
super(op, subject, vreq); super(op, subject, vreq);
// RY Temporarily throw an error because collation hasn't been implemented yet. // RY Temporarily throw an error because collation hasn't been implemented yet.
boolean error = true; // boolean error = true;
if (error) { // if (error) {
throw new Exception("Collated object property not implemented yet"); // throw new Exception("Collated object property not implemented yet");
} // }
/* Change the approach to collation: /* Change the approach to collation:
* Custom views can get the subclasses in the query. Must use a term ?subclass - throw error if not. * Custom views can get the subclasses in the query. Must use a term ?subclass - throw error if not.

View file

@ -32,7 +32,7 @@
<#-- object property --> <#-- object property -->
<#elseif property.collatedBySubclass> <#elseif property.collatedBySubclass>
<@objectPropertySubclassList property /> <@collatedObjectPropertyList property />
<#else> <#else>
<@objectPropertyList property.statements property.template /> <@objectPropertyList property.statements property.template />
</#if> </#if>
@ -52,10 +52,11 @@
</#list> </#list>
</#macro> </#macro>
<#macro objectPropertySubclassList property> <#macro collatedObjectPropertyList property>
<#list property.subclasses as subclass> <#assign subclasses = property.subclasses>
<h3>${subclass}</h3> <#list subclasses?keys as subclass>
<@objectPropertyList subclass.statements property.template /> <h3>${subclass?lower_case}</h3>
<@objectPropertyList subclasses[subclass] property.template />
</#list> </#list>
</#macro> </#macro>