From 29169acc5ed7d8fe2d4420c683f49bec3f1dafe7 Mon Sep 17 00:00:00 2001 From: bjl23 Date: Fri, 4 Feb 2011 20:39:43 +0000 Subject: [PATCH] bugfix for restriction creation - writing to TBox model --- .../mannlib/vedit/controller/BaseEditController.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vedit/controller/BaseEditController.java b/webapp/src/edu/cornell/mannlib/vedit/controller/BaseEditController.java index be83a7eb5..f9681aca1 100644 --- a/webapp/src/edu/cornell/mannlib/vedit/controller/BaseEditController.java +++ b/webapp/src/edu/cornell/mannlib/vedit/controller/BaseEditController.java @@ -25,6 +25,7 @@ import edu.cornell.mannlib.vedit.util.FormUtils; import edu.cornell.mannlib.vitro.webapp.beans.Portal; import edu.cornell.mannlib.vitro.webapp.controller.Controllers; import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet; +import edu.cornell.mannlib.vitro.webapp.dao.jena.ModelContext; public class BaseEditController extends VitroHttpServlet { @@ -159,14 +160,13 @@ public class BaseEditController extends VitroHttpServlet { try { ontModel = (OntModel) request.getSession().getAttribute(MODEL_ATTR_NAME); - } catch (Exception e) {} + } catch (Exception e) { + // ignoring any problems here - we're not really expecting + // this attribute to be populated anyway + } if ( ontModel == null ) { - try { - ontModel = (OntModel) ctx.getAttribute(MODEL_ATTR_NAME); - } catch (Exception e) { - throw new RuntimeException("Could not find OntModel in context attribute '"+MODEL_ATTR_NAME+"'"); - } + ontModel = (OntModel) ModelContext.getBaseOntModelSelector(ctx).getTBoxModel(); } return ontModel;