NIHVIVO-962 Merge 5537 from branch
This commit is contained in:
parent
6bb9980fc3
commit
be57b724ec
2 changed files with 14 additions and 24 deletions
|
@ -10,7 +10,6 @@ import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
import com.hp.hpl.jena.rdf.model.Model;
|
import com.hp.hpl.jena.rdf.model.Model;
|
||||||
import com.hp.hpl.jena.rdf.model.ResIterator;
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||||
|
@ -193,24 +192,14 @@ public class FileStorageUpdater implements FSUController {
|
||||||
* properties, we have work to do.
|
* properties, we have work to do.
|
||||||
*/
|
*/
|
||||||
private boolean isThereAnythingToDo() {
|
private boolean isThereAnythingToDo() {
|
||||||
ResIterator haveImage = model.listResourcesWithProperty(model
|
if (!ModelWrapper.listResourcesWithProperty(model,
|
||||||
.createProperty(IMAGEFILE));
|
model.createProperty(IMAGEFILE)).isEmpty()) {
|
||||||
try {
|
return true;
|
||||||
if (haveImage.hasNext()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
haveImage.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ResIterator haveThumb = model.listResourcesWithProperty(model
|
if (!ModelWrapper.listResourcesWithProperty(model,
|
||||||
.createProperty(IMAGETHUMB));
|
model.createProperty(IMAGETHUMB)).isEmpty()) {
|
||||||
try {
|
return true;
|
||||||
if (haveThumb.hasNext()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
haveThumb.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.servlet.setup;
|
package edu.cornell.mannlib.vitro.webapp.servlet.setup;
|
||||||
|
|
||||||
import static edu.cornell.mannlib.vitro.webapp.dao.jena.JenaBaseDao.JENA_ONT_MODEL_ATTRIBUTE_NAME;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
|
@ -17,6 +15,7 @@ import com.hp.hpl.jena.ontology.OntModel;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.ConfigurationProperties;
|
import edu.cornell.mannlib.vitro.webapp.ConfigurationProperties;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.dao.jena.JenaBaseDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.filestorage.backend.FileStorage;
|
import edu.cornell.mannlib.vitro.webapp.filestorage.backend.FileStorage;
|
||||||
import edu.cornell.mannlib.vitro.webapp.filestorage.backend.FileStorageSetup;
|
import edu.cornell.mannlib.vitro.webapp.filestorage.backend.FileStorageSetup;
|
||||||
import edu.cornell.mannlib.vitro.webapp.filestorage.updater.FileStorageUpdater;
|
import edu.cornell.mannlib.vitro.webapp.filestorage.updater.FileStorageUpdater;
|
||||||
|
@ -46,11 +45,11 @@ public class UpdateUploadedFiles implements ServletContextListener {
|
||||||
ServletContext ctx = sce.getServletContext();
|
ServletContext ctx = sce.getServletContext();
|
||||||
|
|
||||||
WebappDaoFactory wadf = (WebappDaoFactory) ctx
|
WebappDaoFactory wadf = (WebappDaoFactory) ctx
|
||||||
.getAttribute("webappDaoFactory");
|
.getAttribute("assertionsWebappDaoFactory");
|
||||||
if (wadf == null) {
|
if (wadf == null) {
|
||||||
throw new IllegalStateException("Webapp DAO Factory is null. "
|
throw new IllegalStateException("Webapp DAO Factory is null. "
|
||||||
+ "The ServletContext does not contain an attribute "
|
+ "The ServletContext does not contain an attribute "
|
||||||
+ "for '" + "webappDaoFactory" + "'. "
|
+ "for '" + "assertionsWebappDaoFactory" + "'. "
|
||||||
+ "Does the log contain a previous exception from "
|
+ "Does the log contain a previous exception from "
|
||||||
+ "JenaDataSourceSetup? Is it possible that web.xml "
|
+ "JenaDataSourceSetup? Is it possible that web.xml "
|
||||||
+ "is not set up to run JenaDataSourceSetup before "
|
+ "is not set up to run JenaDataSourceSetup before "
|
||||||
|
@ -58,11 +57,13 @@ public class UpdateUploadedFiles implements ServletContextListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
OntModel jenaOntModel = (OntModel) ctx
|
OntModel jenaOntModel = (OntModel) ctx
|
||||||
.getAttribute(JENA_ONT_MODEL_ATTRIBUTE_NAME);
|
.getAttribute(JenaBaseDao.ASSERTIONS_ONT_MODEL_ATTRIBUTE_NAME);
|
||||||
if (jenaOntModel == null) {
|
if (jenaOntModel == null) {
|
||||||
throw new IllegalStateException("Ontology model is null. "
|
throw new IllegalStateException("Ontology model is null. "
|
||||||
+ "The ServletContext does not contain an attribute "
|
+ "The ServletContext does not contain an attribute "
|
||||||
+ "for '" + JENA_ONT_MODEL_ATTRIBUTE_NAME + "'. "
|
+ "for '"
|
||||||
|
+ JenaBaseDao.ASSERTIONS_ONT_MODEL_ATTRIBUTE_NAME
|
||||||
|
+ "'. "
|
||||||
+ "Does the log contain a previous exception from "
|
+ "Does the log contain a previous exception from "
|
||||||
+ "JenaDataSourceSetup? Is it possible that web.xml "
|
+ "JenaDataSourceSetup? Is it possible that web.xml "
|
||||||
+ "is not set up to run JenaDataSourceSetup before "
|
+ "is not set up to run JenaDataSourceSetup before "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue