Cleaned up some miscellaneous cruft
This commit is contained in:
parent
eac8f2fcd5
commit
d83382ab73
9 changed files with 2 additions and 178 deletions
|
@ -43,7 +43,7 @@ public class ApplicationBeanRetryController extends BaseEditController {
|
||||||
try {
|
try {
|
||||||
super.doGet(request,response);
|
super.doGet(request,response);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("PortalRetryController encountered exception calling super.doGet()");
|
log.error(e,e);
|
||||||
}
|
}
|
||||||
|
|
||||||
//create an EditProcessObject for this and put it in the session
|
//create an EditProcessObject for this and put it in the session
|
||||||
|
@ -88,7 +88,7 @@ public class ApplicationBeanRetryController extends BaseEditController {
|
||||||
|
|
||||||
RequestDispatcher rd = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
RequestDispatcher rd = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
||||||
request.setAttribute("bodyJsp","/templates/edit/formBasic.jsp");
|
request.setAttribute("bodyJsp","/templates/edit/formBasic.jsp");
|
||||||
request.setAttribute("formJsp","/templates/edit/specific/portal_retry.jsp");
|
request.setAttribute("formJsp","/templates/edit/specific/applicationBean_retry.jsp");
|
||||||
request.setAttribute("scripts","/templates/edit/formBasic.js");
|
request.setAttribute("scripts","/templates/edit/formBasic.js");
|
||||||
request.setAttribute("title","Site Information Editing Form");
|
request.setAttribute("title","Site Information Editing Form");
|
||||||
request.setAttribute("_action",action);
|
request.setAttribute("_action",action);
|
||||||
|
|
|
@ -118,8 +118,6 @@ public interface WebappDaoFactory {
|
||||||
public LinksDao getLinksDao();
|
public LinksDao getLinksDao();
|
||||||
public LinktypeDao getLinktypeDao();
|
public LinktypeDao getLinktypeDao();
|
||||||
|
|
||||||
public FlagDao getFlagDao();
|
|
||||||
|
|
||||||
// TODO This goes away when the UserAccounts stuff is fully implemented - jblake.
|
// TODO This goes away when the UserAccounts stuff is fully implemented - jblake.
|
||||||
public UserDao getUserDao();
|
public UserDao getUserDao();
|
||||||
|
|
||||||
|
|
|
@ -179,10 +179,6 @@ public class WebappDaoFactoryFiltering implements WebappDaoFactory {
|
||||||
return innerWebappDaoFactory.getUserURI();
|
return innerWebappDaoFactory.getUserURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FlagDao getFlagDao() {
|
|
||||||
return innerWebappDaoFactory.getFlagDao();
|
|
||||||
}
|
|
||||||
|
|
||||||
public KeywordIndividualRelationDao getKeys2EntsDao() {
|
public KeywordIndividualRelationDao getKeys2EntsDao() {
|
||||||
return innerWebappDaoFactory.getKeys2EntsDao();
|
return innerWebappDaoFactory.getKeys2EntsDao();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.dao.jena;
|
|
||||||
|
|
||||||
import com.hp.hpl.jena.rdf.model.Statement;
|
|
||||||
|
|
||||||
public interface ExternalTripleStoreInterface {
|
|
||||||
|
|
||||||
public abstract void addToExternalStore(Statement stmt) throws TripleStoreUnavailableException;
|
|
||||||
|
|
||||||
public abstract void removeFromExternalStore(Statement stmt) throws TripleStoreUnavailableException;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.dao.jena;
|
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hp.hpl.jena.ontology.OntModel;
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.FlagDao;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
|
||||||
|
|
||||||
public class FlagDaoJena extends JenaBaseDao implements FlagDao {
|
|
||||||
|
|
||||||
public FlagDaoJena(WebappDaoFactoryJena wadf) {
|
|
||||||
super(wadf);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String convertNumericFlagToInsertString(int numeric, String column,
|
|
||||||
String table) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String convertNumericFlagToInsertString(int numeric,
|
|
||||||
String flagColumns) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFlagNames(String table, String field) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,108 +0,0 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.dao.jena;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.servlet.ServletContextEvent;
|
|
||||||
import javax.servlet.ServletContextListener;
|
|
||||||
|
|
||||||
//import org.openrdf.repository.Repository;
|
|
||||||
//import org.openrdf.repository.RepositoryConnection;
|
|
||||||
//import org.openrdf.repository.RepositoryResult;
|
|
||||||
//import org.openrdf.repository.http.HTTPRepository;
|
|
||||||
//import org.openrdf.repository.sail.SailRepository;
|
|
||||||
//import org.openrdf.rio.RDFFormat;
|
|
||||||
//import org.openrdf.sail.memory.MemoryStore;
|
|
||||||
|
|
||||||
import com.hp.hpl.jena.ontology.OntModel;
|
|
||||||
import com.hp.hpl.jena.rdf.listeners.StatementListener;
|
|
||||||
import com.hp.hpl.jena.rdf.model.Model;
|
|
||||||
import com.hp.hpl.jena.rdf.model.ModelFactory;
|
|
||||||
import com.hp.hpl.jena.rdf.model.Statement;
|
|
||||||
import com.hp.hpl.jena.rdf.model.StmtIterator;
|
|
||||||
|
|
||||||
public class JenaToExternalTripleStoreSynchronizer extends StatementListener implements ServletContextListener {
|
|
||||||
|
|
||||||
private ExternalTripleStoreInterface extStore;
|
|
||||||
|
|
||||||
public JenaToExternalTripleStoreSynchronizer(ExternalTripleStoreInterface extStore, Model additionsQueue, Model retractionsQueue) {
|
|
||||||
this.extStore = extStore;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Model additionsQueue = ModelFactory.createDefaultModel();
|
|
||||||
private Model retractionsQueue = ModelFactory.createDefaultModel();
|
|
||||||
|
|
||||||
// TODO: add a statement filter to filter out password props
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addedStatement(Statement stmt) {
|
|
||||||
if (!retractionsQueue.contains(stmt)) {
|
|
||||||
additionsQueue.add(stmt);
|
|
||||||
} else {
|
|
||||||
retractionsQueue.remove(stmt);
|
|
||||||
}
|
|
||||||
// try {
|
|
||||||
StmtIterator sit = retractionsQueue.listStatements();
|
|
||||||
while (sit.hasNext()) {
|
|
||||||
Statement s = sit.nextStatement();
|
|
||||||
|
|
||||||
}
|
|
||||||
// } catch (TripleStoreUnavailableException e) {
|
|
||||||
// // log something?
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void removedStatement(Statement stmt) {
|
|
||||||
processUpdate(stmt, REMOVE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void processUpdate(Statement stmt, boolean mode) {
|
|
||||||
// Repository myRepository = new HTTPRepository(sesameServer, repositoryID);
|
|
||||||
// myRepository.initialize();
|
|
||||||
// RepositoryConnection myConn = myRepository.getConnection();
|
|
||||||
// System.out.println(myConn.size()+" statements in remote Sesame");
|
|
||||||
//
|
|
||||||
// Repository tempRepository = new SailRepository(new MemoryStore());
|
|
||||||
// tempRepository.initialize();
|
|
||||||
// tempRepository.getConnection().add(retractionsFile, null, RDFFormat.N3);
|
|
||||||
// System.out.println(tempRepository.getConnection().size()+" statements to retract");
|
|
||||||
// RepositoryResult<Statement> retractStmts = tempRepository.getConnection().getStatements(null, null, null, false);
|
|
||||||
// System.out.println("Retracting statements from repository...");
|
|
||||||
// //myConn.remove(retractStmts);
|
|
||||||
// while (retractStmts.hasNext()) {
|
|
||||||
// Statement stmt = retractStmts.next();
|
|
||||||
// myConn.remove(stmt.getSubject(), stmt.getPredicate(), null);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static final boolean ADD = true;
|
|
||||||
public static final boolean REMOVE = false;
|
|
||||||
|
|
||||||
public static final int SESAME_SERVER_URI = 0;
|
|
||||||
public static final int SESAME_REPOSITORY_NAME = 1;
|
|
||||||
|
|
||||||
public List<String[]> getSesameRepositories() {
|
|
||||||
List<String[]> sesameRepositoryList = new ArrayList<String[]>();
|
|
||||||
String[] testRepository = new String[2];
|
|
||||||
testRepository[SESAME_SERVER_URI] = "http://vivosesame.mannlib.cornell.edu:8080/openrdf-sesame";
|
|
||||||
testRepository[SESAME_REPOSITORY_NAME] = "syncTest";
|
|
||||||
sesameRepositoryList.add(testRepository);
|
|
||||||
return sesameRepositoryList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void contextInitialized(ServletContextEvent sce) {
|
|
||||||
|
|
||||||
OntModel jenaOntModel = (OntModel) sce.getServletContext().getAttribute(JenaBaseDao.JENA_ONT_MODEL_ATTRIBUTE_NAME);
|
|
||||||
jenaOntModel.getBaseModel().register(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void contextDestroyed(ServletContextEvent sce) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -444,13 +444,6 @@ public class WebappDaoFactoryJena implements WebappDaoFactory {
|
||||||
return entityWebappDao = new IndividualDaoJena(this);
|
return entityWebappDao = new IndividualDaoJena(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FlagDao getFlagDao() {
|
|
||||||
if (flagDao != null)
|
|
||||||
return flagDao;
|
|
||||||
else
|
|
||||||
return flagDao = new FlagDaoJena(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public KeywordIndividualRelationDao getKeys2EntsDao() {
|
public KeywordIndividualRelationDao getKeys2EntsDao() {
|
||||||
if (keys2EntsDao != null)
|
if (keys2EntsDao != null)
|
||||||
return keys2EntsDao;
|
return keys2EntsDao;
|
||||||
|
|
|
@ -214,12 +214,6 @@ public class WebappDaoFactoryStub implements WebappDaoFactory {
|
||||||
"WebappDaoFactory.getLinktypeDao() not implemented.");
|
"WebappDaoFactory.getLinktypeDao() not implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public FlagDao getFlagDao() {
|
|
||||||
throw new RuntimeException(
|
|
||||||
"WebappDaoFactory.getFlagDao() not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO This goes away when the UserAccounts stuff is fully implemented -- jb
|
// TODO This goes away when the UserAccounts stuff is fully implemented -- jb
|
||||||
@Override
|
@Override
|
||||||
public UserDao getUserDao() {
|
public UserDao getUserDao() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue