merging avoidance of entity counts to trunk

This commit is contained in:
bjl23 2010-09-16 21:22:16 +00:00
parent e04b50e459
commit 0d93be55d4
5 changed files with 17 additions and 13 deletions

View file

@ -120,7 +120,7 @@ public class BrowseController extends VitroHttpServlet {
if( grp == null ){
log.debug("needed to build vclassGroups for portal " + portalId);
// Get all classgroups, each populated with a list of their member vclasses
List groups = vcgDao.getPublicGroupsWithVClasses(ORDER_BY_DISPLAYRANK, !INCLUDE_UNINSTANTIATED);
List groups = vcgDao.getPublicGroupsWithVClasses(ORDER_BY_DISPLAYRANK, !INCLUDE_UNINSTANTIATED, INCLUDE_ENTITY_COUNT);
// now cull out the groups with no populated classes
//removeUnpopulatedClasses( groups);
@ -135,6 +135,7 @@ public class BrowseController extends VitroHttpServlet {
private static boolean ORDER_BY_DISPLAYRANK = true;
private static boolean INCLUDE_UNINSTANTIATED = true;
private static boolean INCLUDE_ENTITY_COUNT = true;
// private void removeUnpopulatedClasses( List<VClassGroup> groups){
// if( groups == null || groups.size() == 0 ) return;

View file

@ -119,7 +119,7 @@ public class BrowseController extends FreemarkerHttpServlet {
if( grp == null ){
log.debug("needed to build vclassGroups for portal " + portalId);
// Get all classgroups, each populated with a list of their member vclasses
List groups = vcgDao.getPublicGroupsWithVClasses(ORDER_BY_DISPLAYRANK, !INCLUDE_UNINSTANTIATED);
List groups = vcgDao.getPublicGroupsWithVClasses(ORDER_BY_DISPLAYRANK, !INCLUDE_UNINSTANTIATED, INCLUDE_INDIVIDUAL_COUNT);
// remove classes that have been configured to be hidden
// from search results
@ -156,6 +156,7 @@ public class BrowseController extends FreemarkerHttpServlet {
private static boolean ORDER_BY_DISPLAYRANK = true;
private static boolean INCLUDE_UNINSTANTIATED = true;
private static boolean INCLUDE_INDIVIDUAL_COUNT = true;
// private void removeUnpopulatedClasses( List<VClassGroup> groups){
// if( groups == null || groups.size() == 0 ) return;

View file

@ -59,7 +59,7 @@ public class VClassGroupDaoFiltering extends BaseFiltering implements VClassGrou
return this.getPublicGroupsWithVClasses(displayOrder,true);
}
public List getPublicGroupsWithVClasses(boolean displayOrder, boolean includeUninstantiatedClasses) {
return this.getPublicGroupsWithVClasses(displayOrder,includeUninstantiatedClasses,true);
return this.getPublicGroupsWithVClasses(displayOrder,includeUninstantiatedClasses,false);
}
/** filter both vclassgroups and their vclasses */
public List getPublicGroupsWithVClasses(boolean displayOrder, boolean includeUninstantiatedClasses,

View file

@ -788,15 +788,17 @@ public class VClassDaoJena extends JenaBaseDao implements VClassDao {
VClass vcw = (VClass) getVClassByURI(cls.getURI());
if (vcw != null) {
boolean classIsInstantiated = false;
// Note: to support SDB models, may want to do this with
// SPARQL and LIMIT 1 if SDB can take advantage of it
ClosableIterator countIt = getOntModel().listStatements(null,RDF.type,cls);
try {
if (countIt.hasNext()) {
classIsInstantiated = true;
}
} finally {
countIt.close();
if (includeUninstantiatedClasses == false) {
// Note: to support SDB models, may want to do this with
// SPARQL and LIMIT 1 if SDB can take advantage of it
ClosableIterator countIt = getOntModel().listStatements(null,RDF.type,cls);
try {
if (countIt.hasNext()) {
classIsInstantiated = true;
}
} finally {
countIt.close();
}
}
//vcw.setEntityCount(count);
if (includeUninstantiatedClasses || classIsInstantiated) {

View file

@ -112,7 +112,7 @@ public class VClassGroupDaoJena extends JenaBaseDao implements VClassGroupDao {
}
public List getPublicGroupsWithVClasses(boolean displayOrder, boolean includeUninstantiatedClasses) {
return getPublicGroupsWithVClasses(displayOrder, includeUninstantiatedClasses, true);
return getPublicGroupsWithVClasses(displayOrder, includeUninstantiatedClasses, false);
}
public List getPublicGroupsWithVClasses(boolean displayOrder, boolean includeUninstantiatedClasses,