From 38c6b4310c8fa3dd22d7613c6378c75ba184a0aa Mon Sep 17 00:00:00 2001 From: rjy7 Date: Thu, 3 Feb 2011 15:08:39 +0000 Subject: [PATCH] NIHVIVO-2012 Remove call to BaseObjectPropertyDataPostProcessor.getMoniker() because now it only returns the moniker, not the vclass, so provides no additional data over the sparql query (see NIHVIVO-2001). --- doc/list_view_configuration_guidelines.txt | 16 +++++++++------- .../BaseObjectPropertyDataPostProcessor.java | 17 +++++++++++------ .../DefaultListViewDataPostProcessor.java | 4 ++-- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/doc/list_view_configuration_guidelines.txt b/doc/list_view_configuration_guidelines.txt index 2f11d4377..550d5397a 100644 --- a/doc/list_view_configuration_guidelines.txt +++ b/doc/list_view_configuration_guidelines.txt @@ -26,9 +26,15 @@ OPTIONAL ELEMENTS THE QUERY --------- --------------------------- -General query requirements --------------------------- +----------------- +Construct queries +----------------- + + - forthcoming - + +--------------------------------- +General select query requirements +--------------------------------- - Use a SELECT DISTINCT clause rather than a simple SELECT. There can still be cases where the same individual is retrieved more than once, if there are multiple solutions to the @@ -47,10 +53,6 @@ due to the possibility of incomplete data. Make sure the query does the followin display the local name in the absence of the linked individual. Alternatively, this can be retrieved in the template using the localname(uri) method. -### TO BE AMENDED - use uniongraph instead -- Each assertion or set of optional assertions must reference a different graph variable, so that -no requirement about which assertions are in the same graph is imposed (unless this is desired -in a specific case). --------------------------- Query for collated property diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/BaseObjectPropertyDataPostProcessor.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/BaseObjectPropertyDataPostProcessor.java index 15727950a..76bf47ebc 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/BaseObjectPropertyDataPostProcessor.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/BaseObjectPropertyDataPostProcessor.java @@ -70,12 +70,17 @@ public abstract class BaseObjectPropertyDataPostProcessor implements * properties) will be removed. In addition, this type of logic (display x if it exists, otherwise y) * will be moved into the display modules (Editing and Display Configuration Improvements). */ - protected void addMoniker(Map map, String monikerKey, String objectKey) { - String moniker = map.get(monikerKey); - if (moniker == null) { - map.put(monikerKey, getIndividual(map.get(objectKey)).getMoniker()); - } - } +// rjy7 Now Individual.getMoniker() returns only the moniker, not the VClass, so no reason to call the method +// if the sparql query returns a null moniker. +// protected void addMoniker(Map map, String monikerKey, String objectKey) { +// String moniker = map.get(monikerKey); +// if (moniker == null) { +// Individual ind = getIndividual(map.get(objectKey)); +// if (ind != null) { +// map.put(monikerKey, ind.getMoniker()); +// } +// } +// } protected Individual getIndividual(String uri) { return wdf.getIndividualDao().getIndividualByURI(uri); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/DefaultListViewDataPostProcessor.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/DefaultListViewDataPostProcessor.java index 1b4016676..60eacf181 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/DefaultListViewDataPostProcessor.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/DefaultListViewDataPostProcessor.java @@ -16,7 +16,7 @@ public class DefaultListViewDataPostProcessor extends private static final Log log = LogFactory.getLog(DefaultListViewDataPostProcessor.class); private static final String KEY_NAME = "name"; - private static final String KEY_MONIKER = "moniker"; + // private static final String KEY_MONIKER = "moniker"; private static final String KEY_OBJECT = "object"; public DefaultListViewDataPostProcessor(ObjectPropertyTemplateModel optm, WebappDaoFactory wdf) { @@ -27,7 +27,7 @@ public class DefaultListViewDataPostProcessor extends /* Apply processing specific to this postprocessor */ protected void process(Map map) { addName(map, KEY_NAME, KEY_OBJECT); - addMoniker(map, KEY_MONIKER, KEY_OBJECT); + // addMoniker(map, KEY_MONIKER, KEY_OBJECT); } } \ No newline at end of file