diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dwr/PropertyDWR.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dwr/PropertyDWR.java index 0a854e6ea..6e46c700c 100755 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dwr/PropertyDWR.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dwr/PropertyDWR.java @@ -36,16 +36,6 @@ public class PropertyDWR { public PropertyDWR(){ } - private WebappDaoFactory getUnfilteredWebappDaoFactory(VitroRequest vreq) { - try { - return (WebappDaoFactory) vreq.getSession().getServletContext().getAttribute("webappDaoFactory"); - } catch (ClassCastException e) { - log.warn("Could not find unfiltered WebappDaoFactory in getServletContext().getAttribute(\"webappDaoFactory\"). " + - "Using vreq.getWebappDaoFactory() instead."); - return vreq.getWebappDaoFactory(); - } - } - public Object test(){ WebContext ctx = WebContextFactory.get(); HttpServletRequest req = ctx.getHttpServletRequest(); @@ -65,7 +55,7 @@ public class PropertyDWR { WebContext ctx = WebContextFactory.get(); HttpServletRequest req = ctx.getHttpServletRequest(); VitroRequest vreq = new VitroRequest(req); - WebappDaoFactory wdf = vreq.getWebappDaoFactory(); + WebappDaoFactory wdf = vreq.getFullWebappDaoFactory(); Collection c = wdf.getPropertyInstanceDao().getAllPropInstByVClass(classURI); @@ -76,7 +66,7 @@ public class PropertyDWR { WebContext ctx = WebContextFactory.get(); HttpServletRequest req = ctx.getHttpServletRequest(); VitroRequest vreq = new VitroRequest(req); - WebappDaoFactory wdf = vreq.getWebappDaoFactory(); + WebappDaoFactory wdf = vreq.getFullWebappDaoFactory(); Collection c = wdf.getPropertyInstanceDao().getAllPossiblePropInstForIndividual(individualURI); @@ -87,7 +77,7 @@ public class PropertyDWR { WebContext ctx = WebContextFactory.get(); HttpServletRequest req = ctx.getHttpServletRequest(); VitroRequest vreq = new VitroRequest(req); - WebappDaoFactory wdf = vreq.getWebappDaoFactory(); + WebappDaoFactory wdf = vreq.getFullWebappDaoFactory(); return wdf.getPropertyInstanceDao().getProperty(subjectURI, predicateURI, objectURI); } @@ -121,16 +111,14 @@ public class PropertyDWR { WebContext ctx = WebContextFactory.get(); HttpServletRequest req = ctx.getHttpServletRequest(); VitroRequest vreq = new VitroRequest(req); - - return getUnfilteredWebappDaoFactory(vreq).getPropertyInstanceDao().insertProp(prop); + return vreq.getFullWebappDaoFactory().getPropertyInstanceDao().insertProp(prop); } public int deleteProp(String subjectUri, String predicateUri, String objectUri){ WebContext ctx = WebContextFactory.get(); HttpServletRequest req = ctx.getHttpServletRequest(); VitroRequest vreq = new VitroRequest(req); - - getUnfilteredWebappDaoFactory(vreq).getPropertyInstanceDao().deleteObjectPropertyStatement(subjectUri, predicateUri, objectUri); + vreq.getFullWebappDaoFactory().getPropertyInstanceDao().deleteObjectPropertyStatement(subjectUri, predicateUri, objectUri); return 0; } @@ -154,7 +142,7 @@ public class PropertyDWR { WebContext ctx = WebContextFactory.get(); HttpServletRequest req = ctx.getHttpServletRequest(); VitroRequest vreq = new VitroRequest(req); - WebappDaoFactory wdf = vreq.getWebappDaoFactory(); + WebappDaoFactory wdf = vreq.getFullWebappDaoFactory(); return wdf.getPropertyInstanceDao().getExistingProperties(entityURI, null); }