VIVO-873 Adapt the client code to the new interface.

Create a bridge implementation of SearchIndexerImpl that just wraps around an old IndexBuilder.

Modify client code:
Application, BasicAuthenticator, SearchServiceController, SparqlUpdateApiController,
UpdateUrisInIndex and VClassGroupCache

Rewrite IndexController to use AJAX and to show the current status and history of the indexer events.
This commit is contained in:
Jim Blake 2015-01-07 16:18:41 -05:00
parent 3bc42c1456
commit 2ceab6e3df
21 changed files with 1038 additions and 204 deletions

View file

@ -4,6 +4,7 @@ package stubs.edu.cornell.mannlib.vitro.webapp.modelaccess;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.ReasoningOption.ASSERTIONS_AND_INFERENCES;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService.CONTENT;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.FULL_UNION;
import java.util.EnumMap;
import java.util.HashMap;
@ -18,6 +19,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.jena.OntModelSelector;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ContextModelAccess;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.ReasoningOption;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
/**
@ -29,10 +31,14 @@ import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
public class ContextModelAccessStub implements ContextModelAccess {
// ----------------------------------------------------------------------
// Stub infrastructure
//
// Warning: ontModelMap and rdfServiceMap are not connected, so it's up to
// the user to insure that they are consistent with each other.
// ----------------------------------------------------------------------
private final Map<ReasoningOption, WebappDaoFactory> wadfMap = new HashMap<>();
private final Map<WhichService, RDFService> rdfServiceMap = new EnumMap<>(WhichService.class);
private final Map<String, OntModel> ontModelMap = new HashMap<>();
public void setWebappDaoFactory(WebappDaoFactory wadf) {
setWebappDaoFactory(wadf, ASSERTIONS_AND_INFERENCES);
@ -46,6 +52,10 @@ public class ContextModelAccessStub implements ContextModelAccess {
public void setRDFService(WhichService which, RDFService rdfService) {
rdfServiceMap.put(which, rdfService);
}
public void setOntModel(String name, OntModel model) {
ontModelMap.put(name, model);
}
// ----------------------------------------------------------------------
// Stub methods
@ -66,6 +76,16 @@ public class ContextModelAccessStub implements ContextModelAccess {
return rdfServiceMap.get(which);
}
@Override
public OntModel getOntModel() {
return getOntModel(FULL_UNION);
}
@Override
public OntModel getOntModel(String name) {
return ontModelMap.get(name);
}
// ----------------------------------------------------------------------
// Un-implemented methods
// ----------------------------------------------------------------------
@ -94,18 +114,6 @@ public class ContextModelAccessStub implements ContextModelAccess {
"ContextModelAccessStub.getModelMaker() not implemented.");
}
@Override
public OntModel getOntModel() {
throw new RuntimeException(
"ContextModelAccessStub.getOntModel() not implemented.");
}
@Override
public OntModel getOntModel(String name) {
throw new RuntimeException(
"ContextModelAccessStub.getOntModel() not implemented.");
}
@Override
public OntModelSelector getOntModelSelector() {
throw new RuntimeException(

View file

@ -12,6 +12,7 @@ import edu.cornell.mannlib.vitro.webapp.modules.Application;
import edu.cornell.mannlib.vitro.webapp.modules.fileStorage.FileStorage;
import edu.cornell.mannlib.vitro.webapp.modules.imageProcessor.ImageProcessor;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchEngine;
import edu.cornell.mannlib.vitro.webapp.modules.searchIndexer.SearchIndexer;
import edu.cornell.mannlib.vitro.webapp.modules.tboxreasoner.TBoxReasonerModule;
import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ConfigurationTripleSource;
import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ContentTripleSource;
@ -104,9 +105,14 @@ public class ApplicationStub implements Application {
@Override
public TBoxReasonerModule getTBoxReasonerModule() {
// TODO Auto-generated method stub
throw new RuntimeException("ApplicationStub.getTBoxReasonerModule() not implemented.");
throw new RuntimeException(
"ApplicationStub.getTBoxReasonerModule() not implemented.");
}
@Override
public SearchIndexer getSearchIndexer() {
throw new RuntimeException(
"Application.getSearchIndexer() not implemented.");
}
}