NIHVIVO-1341 Added notes to list view config files on required and optional elements and how to structure the query. Removed edit-object since this can be derived from the ?subject ?property ?object statement in the query where clause.

This commit is contained in:
rjy7 2010-12-21 13:41:09 +00:00
parent 555fd93962
commit 1c0aa39da5
5 changed files with 29 additions and 11 deletions

View file

@ -91,13 +91,11 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
private static final String NODE_NAME_TEMPLATE = "template"; private static final String NODE_NAME_TEMPLATE = "template";
private static final String NODE_NAME_COLLATION_TARGET = "collation-target"; private static final String NODE_NAME_COLLATION_TARGET = "collation-target";
private static final String NODE_NAME_POSTPROCESSOR = "postprocessor"; private static final String NODE_NAME_POSTPROCESSOR = "postprocessor";
private static final String NODE_NAME_EDIT_OBJECT = "edit-object";
private String queryString; private String queryString;
private String templateName; private String templateName;
private String collationTarget; private String collationTarget;
private String postprocessor; private String postprocessor;
private String editObject;
PropertyListConfig(ObjectProperty op, VitroRequest vreq) throws Exception { PropertyListConfig(ObjectProperty op, VitroRequest vreq) throws Exception {
@ -170,7 +168,6 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
// Required values // Required values
queryString = getConfigValue(doc, NODE_NAME_QUERY); queryString = getConfigValue(doc, NODE_NAME_QUERY);
templateName = getConfigValue(doc, NODE_NAME_TEMPLATE); templateName = getConfigValue(doc, NODE_NAME_TEMPLATE);
editObject = getConfigValue(doc, NODE_NAME_EDIT_OBJECT);
// Optional values // Optional values
collationTarget = getConfigValue(doc, NODE_NAME_COLLATION_TARGET); collationTarget = getConfigValue(doc, NODE_NAME_COLLATION_TARGET);

View file

@ -1,5 +1,22 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ --> <!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<!--
Required elements:
- query: the sparql query used to retrieve the data
- template: the name of the template used to display a single property statement
Optional elements:
postprocessor: a Java class that postprocesses the data retrieved from the query before
sending it to the template
Query requirements:
- WHERE clause must contain a statement ?subject ?property ?objectvariable, with the variables
?subject and ?property named as such. The objectvariable can be given any name, but it must be
included in the SELECT terms retrieved by the query. This is the statement that will be edited
from the edit links.
-->
<list-view-config> <list-view-config>
<query> <query>
PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt; PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt;
@ -14,8 +31,6 @@
<collation-target>object</collation-target> <collation-target>object</collation-target>
<edit-object>object</edit-object>
<postprocessor>edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.DefaultObjectPropertyDataPostprocessor</postprocessor> <postprocessor>edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.DefaultObjectPropertyDataPostprocessor</postprocessor>
<template>propStatement-default.ftl</template> <template>propStatement-default.ftl</template>

View file

@ -0,0 +1,7 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Template to list statements for a data property -->
<#list property.statements as statement>
<li role="listitem">${statement.value}</li>
</#list>

View file

@ -24,9 +24,7 @@
<ul class="property-list" role="list"> <ul class="property-list" role="list">
<#-- data property --> <#-- data property -->
<#if property.type == "data"> <#if property.type == "data">
<#list property.statements as statement> <#include "dataPropertyList-statements.ftl">
<li role="listitem">${statement.value}</li>
</#list>
<#-- object property --> <#-- object property -->
<#elseif property.collatedBySubclass> <#elseif property.collatedBySubclass>

View file

@ -1,6 +1,7 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> <#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Template to list statements for an object property --> <#-- Template to list statements for an object property -->
<#list property.statements as statement> <#list property.statements as statement>
<li role="listitem"> <li role="listitem">
<#include "${property.template}"> <#include "${property.template}">