VIVO-224 Get rid of REBUILD_VCLASS_GROUP_CACHE.

Since we build the cache from Solr, we no longer provide the option to rebuild it.
This commit is contained in:
j2blake 2014-01-03 15:26:33 -05:00
parent 3c59098525
commit 03dfbfc2c5
6 changed files with 1 additions and 35 deletions

View file

@ -56,8 +56,6 @@ public class SimplePermission extends Permission {
NAMESPACE + "QueryFullModel");
public static final SimplePermission QUERY_USER_ACCOUNTS_MODEL = new SimplePermission(
NAMESPACE + "QueryUserAccountsModel");
public static final SimplePermission REBUILD_VCLASS_GROUP_CACHE = new SimplePermission(
NAMESPACE + "RebuildVClassGroupCache");
public static final SimplePermission REFRESH_VISUALIZATION_CACHE = new SimplePermission(
NAMESPACE + "RefreshVisualizationCache");
public static final SimplePermission SEE_CONFIGURATION = new SimplePermission(

View file

@ -66,7 +66,6 @@ public class BaseSiteAdminController extends FreemarkerHttpServlet {
if (PolicyHelper.isAuthorizedForActions(vreq, SimplePermission.USE_MISCELLANEOUS_ADMIN_PAGES.ACTIONS)) {
urls.put("recomputeInferences", UrlBuilder.getUrl("/RecomputeInferences"));
urls.put("rebuildClassGroupCache", UrlBuilder.getUrl("/browse?clearcache=1"));
}
if (PolicyHelper.isAuthorizedForActions(vreq, IndexController.REQUIRED_ACTIONS)) {

View file

@ -10,9 +10,6 @@ import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission;
import edu.cornell.mannlib.vitro.webapp.auth.policy.PolicyHelper;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.Actions;
import edu.cornell.mannlib.vitro.webapp.beans.VClassGroup;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
@ -33,29 +30,12 @@ public class BrowseController extends FreemarkerHttpServlet {
return "Index of Contents";
}
@Override
protected Actions requiredActions(VitroRequest vreq) {
if ( vreq.getParameter("clearcache") != null )
return SimplePermission.REBUILD_VCLASS_GROUP_CACHE.ACTIONS;
else
return Actions.AUTHORIZED;
}
@Override
protected ResponseValues processRequest(VitroRequest vreq) {
Map<String, Object> body = new HashMap<String, Object>();
String templateName = TEMPLATE_DEFAULT;
if ( vreq.getParameter("clearcache") != null ) {
//mainly for debugging
if( PolicyHelper.isAuthorizedForActions(vreq, SimplePermission.REBUILD_VCLASS_GROUP_CACHE.ACTIONS) ){
clearGroupCache();
}
}
List<VClassGroup> groups = null;
VClassGroupsForRequest vcgc = VClassGroupCache.getVClassGroups(vreq);
groups =vcgc.getGroups();
@ -67,8 +47,4 @@ public class BrowseController extends FreemarkerHttpServlet {
return new TemplateResponseValues(templateName, body);
}
protected void clearGroupCache(){
VClassGroupCache.getVClassGroupCache(getServletContext()).doSynchronousRebuild();
}
}
}