From 24bba51a4778a4093fd6163056884af14d5ba6a0 Mon Sep 17 00:00:00 2001 From: hjkhjk54 Date: Mon, 18 Jul 2011 20:27:28 +0000 Subject: [PATCH] Ensuring name of class shows correctly on internal class page --- .../IndividualsForClassesDataGetter.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/pageDataGetter/IndividualsForClassesDataGetter.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/pageDataGetter/IndividualsForClassesDataGetter.java index 48781f013..bc19a3803 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/pageDataGetter/IndividualsForClassesDataGetter.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/pageDataGetter/IndividualsForClassesDataGetter.java @@ -73,8 +73,7 @@ public class IndividualsForClassesDataGetter implements PageDataGetter{ for(VClass v: vclassList) { int oldCount = v.getEntityCount(); //Making a copy so as to ensure we don't touch the values in the cache - VClass copyVClass = new VClass(v.getURI()); - copyVClass.setEntityCount(oldCount); + VClass copyVClass = makeCopyVClass(v); int count = retrieveCount(vreq, context, v, restrictClasses); if(oldCount != count) { log.debug("Old count was " + v.getEntityCount() + " and New count for " + v.getURI() + " is " + count); @@ -88,6 +87,16 @@ public class IndividualsForClassesDataGetter implements PageDataGetter{ } } + private VClass makeCopyVClass(VClass v) { + VClass copyVClass = new VClass(v.getURI()); + copyVClass.setLocalName(copyVClass.getLocalName()); + copyVClass.setDisplayRank(v.getDisplayRank()); + copyVClass.setName(v.getName()); + copyVClass.setNamespace(v.getNamespace()); + copyVClass.setEntityCount(v.getEntityCount()); + return copyVClass; + } + //update class count based on restrict classes private int retrieveCount(VitroRequest vreq, ServletContext context, VClass v, List restrictClasses) { //Execute solr query that returns only count of individuals