NIHVIVO-3513 fixes bug where model list wasn't showing after loading RDF in ingest tools

This commit is contained in:
brianjlowe 2011-12-14 22:45:39 +00:00
parent 6147a54dc3
commit 4b8f9c613d
2 changed files with 7 additions and 18 deletions

View file

@ -730,7 +730,7 @@ public class JenaIngestController extends BaseEditController {
}
}
private String getModelType(VitroRequest vreq, ModelMaker maker) {
protected String getModelType(VitroRequest vreq, ModelMaker maker) {
String modelType = vreq.getParameter("modelType");
maker = (maker instanceof VitroJenaSpecialModelMaker)
? ((VitroJenaSpecialModelMaker) maker).getInnerModelMaker()
@ -1230,7 +1230,7 @@ public class JenaIngestController extends BaseEditController {
return result;
}
private void showModelList(VitroRequest vreq, ModelMaker maker, String modelType) {
protected void showModelList(VitroRequest vreq, ModelMaker maker, String modelType) {
if(modelType.equals("rdb")){
vreq.setAttribute("modelType", "rdb");
vreq.setAttribute("infoLine", "RDB models");
@ -1238,6 +1238,7 @@ public class JenaIngestController extends BaseEditController {
vreq.setAttribute("modelType", "sdb");
vreq.setAttribute("infoLine", "SDB models");
}
vreq.setAttribute("modelNames", maker.listModels().toList());
vreq.setAttribute("bodyAttr", "onLoad=\"init()\"");
vreq.setAttribute("title","Available Models");
vreq.setAttribute("bodyJsp",LIST_MODELS_JSP);

View file

@ -41,7 +41,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.jena.event.BulkUpdateEvent;
import edu.cornell.mannlib.vitro.webapp.dao.jena.event.EditEvent;
import edu.cornell.mannlib.vitro.webapp.filestorage.uploadrequest.FileUploadServletRequest;
public class RDFUploadController extends BaseEditController {
public class RDFUploadController extends JenaIngestController {
private static int maxFileSizeInBytes = 1024 * 1024 * 2000; //2000mb
private static FileItem fileStream = null;
@ -214,11 +214,9 @@ public class RDFUploadController extends BaseEditController {
ModelMaker maker = getVitroJenaModelMaker(request);
if (docLoc!=null && modelName != null) {
doLoadRDFData(modelName,docLoc,filePath,languageStr,maker);
//request.setAttribute("title","Ingest Menu");
//request.setAttribute("bodyJsp",INGEST_MENU_JSP);
request.setAttribute("title","Available Models");
request.setAttribute("bodyJsp",LIST_MODELS_JSP);
doLoadRDFData(modelName, docLoc, filePath, languageStr, maker);
String modelType = getModelType(request, maker);
showModelList(request, maker, modelType);
} else {
request.setAttribute("title","Load RDF Data");
request.setAttribute("bodyJsp",LOAD_RDF_DATA_JSP);
@ -353,16 +351,6 @@ public class RDFUploadController extends BaseEditController {
return;
}
private ModelMaker getVitroJenaModelMaker(HttpServletRequest request) {
ModelMaker myVjmm = (ModelMaker) request.getSession().getAttribute(
"vitroJenaModelMaker");
myVjmm = (myVjmm == null)
? (ModelMaker) getServletContext().getAttribute(
"vitroJenaModelMaker")
: myVjmm;
return new VitroJenaSpecialModelMaker(myVjmm, request);
}
private OntModel getABoxModel(HttpSession session, ServletContext ctx) {
if (session != null
&& session.getAttribute("baseOntModelSelector")