Ensuring name of class shows correctly on internal class page
This commit is contained in:
parent
1d9e1fb2ae
commit
24bba51a47
1 changed files with 11 additions and 2 deletions
|
@ -73,8 +73,7 @@ public class IndividualsForClassesDataGetter implements PageDataGetter{
|
||||||
for(VClass v: vclassList) {
|
for(VClass v: vclassList) {
|
||||||
int oldCount = v.getEntityCount();
|
int oldCount = v.getEntityCount();
|
||||||
//Making a copy so as to ensure we don't touch the values in the cache
|
//Making a copy so as to ensure we don't touch the values in the cache
|
||||||
VClass copyVClass = new VClass(v.getURI());
|
VClass copyVClass = makeCopyVClass(v);
|
||||||
copyVClass.setEntityCount(oldCount);
|
|
||||||
int count = retrieveCount(vreq, context, v, restrictClasses);
|
int count = retrieveCount(vreq, context, v, restrictClasses);
|
||||||
if(oldCount != count) {
|
if(oldCount != count) {
|
||||||
log.debug("Old count was " + v.getEntityCount() + " and New count for " + v.getURI() + " is " + 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
|
//update class count based on restrict classes
|
||||||
private int retrieveCount(VitroRequest vreq, ServletContext context, VClass v, List<VClass> restrictClasses) {
|
private int retrieveCount(VitroRequest vreq, ServletContext context, VClass v, List<VClass> restrictClasses) {
|
||||||
//Execute solr query that returns only count of individuals
|
//Execute solr query that returns only count of individuals
|
||||||
|
|
Loading…
Add table
Reference in a new issue