From 6e00e1e9976bbf8d04264b877ac72e45568f2ba3 Mon Sep 17 00:00:00 2001 From: bdc34 Date: Wed, 2 Feb 2011 20:16:11 +0000 Subject: [PATCH] Changing individualJena.getMoniker() so that it doesn't return a VClass name when the moniker is not in the model --- .../vitro/webapp/dao/jena/IndividualJena.java | 49 ++++++++++--------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualJena.java index fccb912de..13bcbdc65 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualJena.java @@ -342,29 +342,34 @@ public class IndividualJena extends IndividualImpl implements Individual { try { moniker = webappDaoFactory.getJenaBaseDao().getPropertyStringValue(ind,webappDaoFactory.getJenaBaseDao().MONIKER); if (moniker == null) { - try { - // trying to deal with the fact that an entity may have more than 1 VClass - List clasList = this.getVClasses(true); - if (clasList == null || clasList.size() < 2) { - moniker = getVClass().getName(); - } else { - VClass preferredClass = null; - for (VClass clas : clasList) { - if (clas.getCustomDisplayView() != null && clas.getCustomDisplayView().length()>0) { - // arbitrarily deciding that the preferred class (could be >1) is one with a custom view - preferredClass = clas; - log.debug("Found direct class ["+clas.getName()+"] with custom view "+clas.getCustomDisplayView()+"; resetting entity vClass to this class"); - } - } - if (preferredClass == null) { - // no basis for selecting a preferred class name to use - moniker = null; // was this.getVClass().getName(); - } else { - moniker = preferredClass.getName(); - } - } - } catch (Exception e) {} + //Changing behavior to moniker because it is taking extra time to get the vclass + //alternative if the moniker isn't filled out. That time is wasted if the vclass alternative isn't desired. + //see NIHVIVO-2001 + moniker = ""; } +// try { +// // trying to deal with the fact that an entity may have more than 1 VClass +// List clasList = this.getVClasses(true); +// if (clasList == null || clasList.size() < 2) { +// moniker = getVClass().getName(); +// } else { +// VClass preferredClass = null; +// for (VClass clas : clasList) { +// if (clas.getCustomDisplayView() != null && clas.getCustomDisplayView().length()>0) { +// // arbitrarily deciding that the preferred class (could be >1) is one with a custom view +// preferredClass = clas; +// log.debug("Found direct class ["+clas.getName()+"] with custom view "+clas.getCustomDisplayView()+"; resetting entity vClass to this class"); +// } +// } +// if (preferredClass == null) { +// // no basis for selecting a preferred class name to use +// moniker = null; // was this.getVClass().getName(); +// } else { +// moniker = preferredClass.getName(); +// } +// } +// } catch (Exception e) {} +// } return moniker; } finally { ind.getOntModel().leaveCriticalSection();