From f5a9669cf6221ce4b507ca6f1e2655acf6791dda Mon Sep 17 00:00:00 2001 From: ryounes Date: Thu, 18 Aug 2011 15:46:25 +0000 Subject: [PATCH] Improvements to mailing address list view. Removed unnecessary construct query from terminologyAnnotation list view. --- doc/list_view_configuration_guidelines.txt | 16 ++++++++++------ .../PropertyStatementTemplateModel.java | 4 ++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/doc/list_view_configuration_guidelines.txt b/doc/list_view_configuration_guidelines.txt index f29097f10..df61ce938 100644 --- a/doc/list_view_configuration_guidelines.txt +++ b/doc/list_view_configuration_guidelines.txt @@ -51,18 +51,22 @@ the same type of inefficiency. Instead, use multiple construct queries to constr model that includes all the necessary data. - In the absence of any construct queries, the select query is run against the -entire dataset. +entire dataset. If your select query does not involve a lot of OPTIONAL clauses, you do not +need to include construct queries. - The construct queries must be designed to collect all the data that the select query will request. They can be flexibly constructed to contain more data than -is currently selected, to allow for possible future expansion of the SELECT. For example, one -of the construct queries for core:hasRole includes +is currently selected, to allow for possible future expansion of the SELECT and to +simplify the WHERE clause. For example, one of the construct queries for core:hasRole +includes: +CONSTRUCT { ?role ?roleProperty ?roleValue . - -WHERE - + ... +} WHERE { ?role ?roleProperty ?roleValue . + ... +} That is, it includes all the properties of the role, rather than just those currently selected by the select query. diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyStatementTemplateModel.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyStatementTemplateModel.java index 87d4ea3d6..b645f83e6 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyStatementTemplateModel.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyStatementTemplateModel.java @@ -43,5 +43,9 @@ public abstract class PropertyStatementTemplateModel extends BaseTemplateModel { public String getDeleteUrl() { return deleteUrl; } + + public boolean isEditable() { + return ! editUrl.isEmpty(); + } }