resolves NIHVIVO-711 re: DAO factory methods on VitroHttpServlet
This commit is contained in:
parent
be6e85cf2e
commit
691feaee81
74 changed files with 290 additions and 278 deletions
|
@ -84,7 +84,7 @@ public class JSONServlet extends VitroHttpServlet {
|
||||||
if( log.isDebugEnabled() )
|
if( log.isDebugEnabled() )
|
||||||
log.debug(" attempting to get option list for field '" + field + "'");
|
log.debug(" attempting to get option list for field '" + field + "'");
|
||||||
|
|
||||||
Map<String,String> options = SelectListGenerator.getOptions(editConfig, field, getWebappDaoFactory());
|
Map<String,String> options = SelectListGenerator.getOptions(editConfig, field, (new VitroRequest(req)).getFullWebappDaoFactory());
|
||||||
resp.setContentType("application/json");
|
resp.setContentType("application/json");
|
||||||
ServletOutputStream out = resp.getOutputStream();
|
ServletOutputStream out = resp.getOutputStream();
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ public class JSONServlet extends VitroHttpServlet {
|
||||||
log.debug("in getEntitiesByVClass()");
|
log.debug("in getEntitiesByVClass()");
|
||||||
VitroRequest vreq = new VitroRequest(req);
|
VitroRequest vreq = new VitroRequest(req);
|
||||||
String vclassURI = vreq.getParameter("vclassURI");
|
String vclassURI = vreq.getParameter("vclassURI");
|
||||||
WebappDaoFactory daos = getWebappDaoFactory();
|
WebappDaoFactory daos = (new VitroRequest(req)).getFullWebappDaoFactory();
|
||||||
resp.setCharacterEncoding("UTF-8");
|
resp.setCharacterEncoding("UTF-8");
|
||||||
|
|
||||||
// ServletOutputStream doesn't support UTF-8
|
// ServletOutputStream doesn't support UTF-8
|
||||||
|
|
|
@ -105,8 +105,7 @@ public class MailUsersServlet extends VitroHttpServlet {
|
||||||
int recipientCount = 0;
|
int recipientCount = 0;
|
||||||
String deliveryfrom = null;
|
String deliveryfrom = null;
|
||||||
|
|
||||||
|
UserDao uDao = vreq.getFullWebappDaoFactory().getUserDao();
|
||||||
UserDao uDao = getWebappDaoFactory().getUserDao();
|
|
||||||
|
|
||||||
// get Individuals that the User mayEditAs
|
// get Individuals that the User mayEditAs
|
||||||
deliverToArray = uDao.getUserAccountEmails();
|
deliverToArray = uDao.getUserAccountEmails();
|
||||||
|
|
|
@ -325,7 +325,7 @@ public class SparqlQueryServlet extends BaseEditController {
|
||||||
/* @author ass92 */
|
/* @author ass92 */
|
||||||
|
|
||||||
|
|
||||||
OntologyDao daoObj = getWebappDaoFactory().getOntologyDao();
|
OntologyDao daoObj = vreq.getFullWebappDaoFactory().getOntologyDao();
|
||||||
List ontologiesObj = daoObj.getAllOntologies();
|
List ontologiesObj = daoObj.getAllOntologies();
|
||||||
ArrayList prefixList = new ArrayList();
|
ArrayList prefixList = new ArrayList();
|
||||||
|
|
||||||
|
|
|
@ -24,10 +24,6 @@ public class VitroHttpServlet extends HttpServlet
|
||||||
protected static DateFormat publicDateFormat = new SimpleDateFormat("M/dd/yyyy");
|
protected static DateFormat publicDateFormat = new SimpleDateFormat("M/dd/yyyy");
|
||||||
|
|
||||||
private static final Log log = LogFactory.getLog(VitroHttpServlet.class.getName());
|
private static final Log log = LogFactory.getLog(VitroHttpServlet.class.getName());
|
||||||
|
|
||||||
private WebappDaoFactory myWebappDaoFactory = null;
|
|
||||||
private WebappDaoFactory myAssertionsWebappDaoFactory = null;
|
|
||||||
private WebappDaoFactory myDeductionsWebappDaoFactory = null;
|
|
||||||
|
|
||||||
public final static String XHTML_MIMETYPE ="application/xhtml+xml";
|
public final static String XHTML_MIMETYPE ="application/xhtml+xml";
|
||||||
public final static String HTML_MIMETYPE ="text/html";
|
public final static String HTML_MIMETYPE ="text/html";
|
||||||
|
@ -49,21 +45,6 @@ public class VitroHttpServlet extends HttpServlet
|
||||||
|
|
||||||
protected final void setup(HttpServletRequest request) {
|
protected final void setup(HttpServletRequest request) {
|
||||||
|
|
||||||
if (request.getSession() != null) {
|
|
||||||
Object webappDaoFactoryAttr = request.getSession().getAttribute("webappDaoFactory");
|
|
||||||
if (webappDaoFactoryAttr != null && webappDaoFactoryAttr instanceof WebappDaoFactory) {
|
|
||||||
myWebappDaoFactory = (WebappDaoFactory) webappDaoFactoryAttr;
|
|
||||||
}
|
|
||||||
webappDaoFactoryAttr = request.getSession().getAttribute("assertionsWebappDaoFactory");
|
|
||||||
if (webappDaoFactoryAttr != null && webappDaoFactoryAttr instanceof WebappDaoFactory) {
|
|
||||||
myAssertionsWebappDaoFactory = (WebappDaoFactory) webappDaoFactoryAttr;
|
|
||||||
}
|
|
||||||
webappDaoFactoryAttr = request.getSession().getAttribute("deductionsWebappDaoFactory");
|
|
||||||
if (webappDaoFactoryAttr != null && webappDaoFactoryAttr instanceof WebappDaoFactory) {
|
|
||||||
myDeductionsWebappDaoFactory = (WebappDaoFactory) webappDaoFactoryAttr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//check to see if VitroRequestPrep filter was run
|
//check to see if VitroRequestPrep filter was run
|
||||||
if( request.getAttribute("appBean") == null ||
|
if( request.getAttribute("appBean") == null ||
|
||||||
request.getAttribute("webappDaoFactory") == null ){
|
request.getAttribute("webappDaoFactory") == null ){
|
||||||
|
@ -82,23 +63,4 @@ public class VitroHttpServlet extends HttpServlet
|
||||||
doGet( request,response );
|
doGet( request,response );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** gets WebappDaoFactory with no filtering */
|
|
||||||
public WebappDaoFactory getWebappDaoFactory(){
|
|
||||||
return (myWebappDaoFactory != null) ? myWebappDaoFactory :
|
|
||||||
(WebappDaoFactory) getServletContext().getAttribute("webappDaoFactory");
|
|
||||||
}
|
|
||||||
|
|
||||||
/** gets assertions-only WebappDaoFactory with no filtering */
|
|
||||||
public WebappDaoFactory getAssertionsWebappDaoFactory() {
|
|
||||||
return (myAssertionsWebappDaoFactory != null) ? myAssertionsWebappDaoFactory :
|
|
||||||
(WebappDaoFactory) getServletContext().getAttribute("assertionsWebappDaoFactory");
|
|
||||||
}
|
|
||||||
|
|
||||||
/** gets inferences-only WebappDaoFactory with no filtering */
|
|
||||||
public WebappDaoFactory getDeductionsWebappDaoFactory() {
|
|
||||||
return (myDeductionsWebappDaoFactory != null) ? myDeductionsWebappDaoFactory :
|
|
||||||
(WebappDaoFactory) getServletContext().getAttribute("deductionsWebappDaoFactory");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,13 +58,46 @@ public class VitroRequest implements HttpServletRequest {
|
||||||
this._req = _req;
|
this._req = _req;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WebappDaoFactory getWebappDaoFactory(){
|
|
||||||
return( WebappDaoFactory) getAttribute("webappDaoFactory");
|
|
||||||
}
|
|
||||||
public void setWebappDaoFactory( WebappDaoFactory wdf){
|
public void setWebappDaoFactory( WebappDaoFactory wdf){
|
||||||
setAttribute("webappDaoFactory",wdf);
|
setAttribute("webappDaoFactory",wdf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** gets WebappDaoFactory with appropriate filtering for the request */
|
||||||
|
public WebappDaoFactory getWebappDaoFactory(){
|
||||||
|
return (WebappDaoFactory) getAttribute("webappDaoFactory");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** gets assertions + inferences WebappDaoFactory with no filtering **/
|
||||||
|
public WebappDaoFactory getFullWebappDaoFactory() {
|
||||||
|
Object webappDaoFactoryAttr = _req.getSession().getAttribute("webappDaoFactory");
|
||||||
|
if (webappDaoFactoryAttr instanceof WebappDaoFactory) {
|
||||||
|
return (WebappDaoFactory) webappDaoFactoryAttr;
|
||||||
|
} else {
|
||||||
|
return (WebappDaoFactory) _req.getSession().getServletContext().getAttribute("webappDaoFactory");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** gets assertions-only WebappDaoFactory with no filtering */
|
||||||
|
public WebappDaoFactory getAssertionsWebappDaoFactory() {
|
||||||
|
Object webappDaoFactoryAttr = _req.getSession().getAttribute("assertionsWebappDaoFactory");
|
||||||
|
if (webappDaoFactoryAttr instanceof WebappDaoFactory) {
|
||||||
|
return (WebappDaoFactory) webappDaoFactoryAttr;
|
||||||
|
} else {
|
||||||
|
return (WebappDaoFactory) _req.getSession().getServletContext().getAttribute("assertionsWebappDaoFactory");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** gets inferences-only WebappDaoFactory with no filtering */
|
||||||
|
public WebappDaoFactory getDeductionsWebappDaoFactory() {
|
||||||
|
Object webappDaoFactoryAttr = _req.getSession().getAttribute("deductionsWebappDaoFactory");
|
||||||
|
if (webappDaoFactoryAttr instanceof WebappDaoFactory) {
|
||||||
|
return (WebappDaoFactory) webappDaoFactoryAttr;
|
||||||
|
} else {
|
||||||
|
return (WebappDaoFactory) _req.getSession().getServletContext().getAttribute("deductionsWebappDaoFactory");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public OntModel getJenaOntModel() {
|
public OntModel getJenaOntModel() {
|
||||||
OntModel jenaOntModel = (OntModel)_req.getSession().getAttribute( JenaBaseDao.JENA_ONT_MODEL_ATTRIBUTE_NAME );
|
OntModel jenaOntModel = (OntModel)_req.getSession().getAttribute( JenaBaseDao.JENA_ONT_MODEL_ATTRIBUTE_NAME );
|
||||||
if ( jenaOntModel == null ) {
|
if ( jenaOntModel == null ) {
|
||||||
|
|
|
@ -62,8 +62,8 @@ public class Classes2ClassesOperationController extends BaseEditController {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Classes2ClassesDao dao = getWebappDaoFactory().getClasses2ClassesDao();
|
Classes2ClassesDao dao = request.getFullWebappDaoFactory().getClasses2ClassesDao();
|
||||||
VClassDao vcDao = getWebappDaoFactory().getVClassDao();
|
VClassDao vcDao = request.getFullWebappDaoFactory().getVClassDao();
|
||||||
|
|
||||||
String modeStr = request.getParameter("opMode");
|
String modeStr = request.getParameter("opMode");
|
||||||
modeStr = (modeStr == null) ? "" : modeStr;
|
modeStr = (modeStr == null) ? "" : modeStr;
|
||||||
|
|
|
@ -48,8 +48,8 @@ public class Classes2ClassesRetryController extends BaseEditController {
|
||||||
action = epo.getAction();
|
action = epo.getAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
Classes2ClassesDao c2cDao = getWebappDaoFactory().getClasses2ClassesDao();
|
Classes2ClassesDao c2cDao = request.getFullWebappDaoFactory().getClasses2ClassesDao();
|
||||||
VClassDao vcDao = getWebappDaoFactory().getVClassDao();
|
VClassDao vcDao = request.getFullWebappDaoFactory().getVClassDao();
|
||||||
epo.setDataAccessObject(c2cDao);
|
epo.setDataAccessObject(c2cDao);
|
||||||
Classes2Classes objectForEditing = new Classes2Classes();
|
Classes2Classes objectForEditing = new Classes2Classes();
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class ClassgroupRetryController extends BaseEditController {
|
||||||
action = epo.getAction();
|
action = epo.getAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
VClassGroupDao cgDao = getWebappDaoFactory().getVClassGroupDao();
|
VClassGroupDao cgDao = request.getFullWebappDaoFactory().getVClassGroupDao();
|
||||||
|
|
||||||
epo.setDataAccessObject(cgDao);
|
epo.setDataAccessObject(cgDao);
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class CloneEntityServlet extends BaseEditController {
|
||||||
}
|
}
|
||||||
|
|
||||||
LoginFormBean loginBean = (LoginFormBean) request.getSession().getAttribute("loginHandler");
|
LoginFormBean loginBean = (LoginFormBean) request.getSession().getAttribute("loginHandler");
|
||||||
WebappDaoFactory myWebappDaoFactory = getWebappDaoFactory().getUserAwareDaoFactory(loginBean.getUserURI());
|
WebappDaoFactory myWebappDaoFactory = request.getFullWebappDaoFactory().getUserAwareDaoFactory(loginBean.getUserURI());
|
||||||
IndividualDao individualDao = myWebappDaoFactory.getIndividualDao();
|
IndividualDao individualDao = myWebappDaoFactory.getIndividualDao();
|
||||||
PropertyInstanceDao propertyInstanceDao = myWebappDaoFactory.getPropertyInstanceDao();
|
PropertyInstanceDao propertyInstanceDao = myWebappDaoFactory.getPropertyInstanceDao();
|
||||||
|
|
||||||
|
|
|
@ -49,13 +49,14 @@ public class DataPropertyStatementRetryController extends BaseEditController {
|
||||||
|
|
||||||
String action = "insert";
|
String action = "insert";
|
||||||
|
|
||||||
DataPropertyStatementDao dataPropertyStatementDao = getWebappDaoFactory().getDataPropertyStatementDao();
|
|
||||||
epo.setDataAccessObject(dataPropertyStatementDao);
|
|
||||||
DataPropertyDao dpDao = getWebappDaoFactory().getDataPropertyDao();
|
|
||||||
IndividualDao eDao = getWebappDaoFactory().getIndividualDao();
|
|
||||||
epo.setBeanClass(DataPropertyStatement.class);
|
|
||||||
|
|
||||||
VitroRequest vreq = new VitroRequest(request);
|
VitroRequest vreq = new VitroRequest(request);
|
||||||
|
|
||||||
|
DataPropertyStatementDao dataPropertyStatementDao =
|
||||||
|
vreq.getFullWebappDaoFactory().getDataPropertyStatementDao();
|
||||||
|
epo.setDataAccessObject(dataPropertyStatementDao);
|
||||||
|
DataPropertyDao dpDao = vreq.getFullWebappDaoFactory().getDataPropertyDao();
|
||||||
|
IndividualDao eDao = vreq.getFullWebappDaoFactory().getIndividualDao();
|
||||||
|
epo.setBeanClass(DataPropertyStatement.class);
|
||||||
|
|
||||||
DataPropertyStatement objectForEditing = null;
|
DataPropertyStatement objectForEditing = null;
|
||||||
if (!epo.getUseRecycledBean()){
|
if (!epo.getUseRecycledBean()){
|
||||||
|
|
|
@ -34,7 +34,10 @@ public class DatapropEditController extends BaseEditController {
|
||||||
|
|
||||||
private static final Log log = LogFactory.getLog(DatapropEditController.class.getName());
|
private static final Log log = LogFactory.getLog(DatapropEditController.class.getName());
|
||||||
|
|
||||||
public void doPost (HttpServletRequest request, HttpServletResponse response) {
|
public void doPost (HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|
||||||
|
VitroRequest vreq = new VitroRequest(request);
|
||||||
|
|
||||||
final int NUM_COLS=15;
|
final int NUM_COLS=15;
|
||||||
|
|
||||||
if (!checkLoginStatus(request,response,(String)request.getAttribute("fetchURI")))
|
if (!checkLoginStatus(request,response,(String)request.getAttribute("fetchURI")))
|
||||||
|
@ -48,9 +51,9 @@ public class DatapropEditController extends BaseEditController {
|
||||||
|
|
||||||
String datapropURI = request.getParameter("uri");
|
String datapropURI = request.getParameter("uri");
|
||||||
|
|
||||||
DataPropertyDao dpDao = getWebappDaoFactory().getDataPropertyDao();
|
DataPropertyDao dpDao = vreq.getFullWebappDaoFactory().getDataPropertyDao();
|
||||||
DataProperty dp = dpDao.getDataPropertyByURI(datapropURI);
|
DataProperty dp = dpDao.getDataPropertyByURI(datapropURI);
|
||||||
PropertyGroupDao pgDao = getWebappDaoFactory().getPropertyGroupDao();
|
PropertyGroupDao pgDao = vreq.getFullWebappDaoFactory().getPropertyGroupDao();
|
||||||
|
|
||||||
ArrayList results = new ArrayList();
|
ArrayList results = new ArrayList();
|
||||||
results.add("Data Property");
|
results.add("Data Property");
|
||||||
|
@ -76,7 +79,7 @@ public class DatapropEditController extends BaseEditController {
|
||||||
results.add(dp.getLocalNameWithPrefix());
|
results.add(dp.getLocalNameWithPrefix());
|
||||||
String ontologyName = null;
|
String ontologyName = null;
|
||||||
if (dp.getNamespace() != null) {
|
if (dp.getNamespace() != null) {
|
||||||
Ontology ont = getWebappDaoFactory().getOntologyDao().getOntologyByURI(dp.getNamespace());
|
Ontology ont = vreq.getFullWebappDaoFactory().getOntologyDao().getOntologyByURI(dp.getNamespace());
|
||||||
if ( (ont != null) && (ont.getName() != null) ) {
|
if ( (ont != null) && (ont.getName() != null) ) {
|
||||||
ontologyName = ont.getName();
|
ontologyName = ont.getName();
|
||||||
}
|
}
|
||||||
|
@ -134,9 +137,9 @@ public class DatapropEditController extends BaseEditController {
|
||||||
foo.setOptionLists(OptionMap);
|
foo.setOptionLists(OptionMap);
|
||||||
epo.setFormObject(foo);
|
epo.setFormObject(foo);
|
||||||
|
|
||||||
DataPropertyDao assertionsDpDao = (getAssertionsWebappDaoFactory() != null)
|
DataPropertyDao assertionsDpDao = (vreq.getAssertionsWebappDaoFactory() != null)
|
||||||
? getAssertionsWebappDaoFactory().getDataPropertyDao()
|
? vreq.getAssertionsWebappDaoFactory().getDataPropertyDao()
|
||||||
: getWebappDaoFactory().getDataPropertyDao();
|
: vreq.getFullWebappDaoFactory().getDataPropertyDao();
|
||||||
|
|
||||||
List superURIs = assertionsDpDao.getSuperPropertyURIs(dp.getURI(),false);
|
List superURIs = assertionsDpDao.getSuperPropertyURIs(dp.getURI(),false);
|
||||||
List superProperties = new ArrayList();
|
List superProperties = new ArrayList();
|
||||||
|
|
|
@ -57,13 +57,15 @@ public class DatapropRetryController extends BaseEditController {
|
||||||
|
|
||||||
//create an EditProcessObject for this and put it in the session
|
//create an EditProcessObject for this and put it in the session
|
||||||
EditProcessObject epo = super.createEpo(request);
|
EditProcessObject epo = super.createEpo(request);
|
||||||
epo.setBeanClass(DataProperty.class);
|
epo.setBeanClass(DataProperty.class);
|
||||||
|
|
||||||
|
VitroRequest vreq = new VitroRequest(request);
|
||||||
|
|
||||||
DatatypeDao dDao = getWebappDaoFactory().getDatatypeDao();
|
DatatypeDao dDao = vreq.getFullWebappDaoFactory().getDatatypeDao();
|
||||||
DataPropertyDao dpDao = getWebappDaoFactory().getDataPropertyDao();
|
DataPropertyDao dpDao = vreq.getFullWebappDaoFactory().getDataPropertyDao();
|
||||||
epo.setDataAccessObject(dpDao);
|
epo.setDataAccessObject(dpDao);
|
||||||
OntologyDao ontDao = getWebappDaoFactory().getOntologyDao();
|
OntologyDao ontDao = vreq.getFullWebappDaoFactory().getOntologyDao();
|
||||||
VClassDao vclassDao = getWebappDaoFactory().getVClassDao();
|
VClassDao vclassDao = vreq.getFullWebappDaoFactory().getVClassDao();
|
||||||
|
|
||||||
DataProperty objectForEditing = null;
|
DataProperty objectForEditing = null;
|
||||||
String action = null;
|
String action = null;
|
||||||
|
@ -120,7 +122,6 @@ public class DatapropRetryController extends BaseEditController {
|
||||||
log.error("DatapropRetryController could not find the getDataPropertyByURI method in the facade");
|
log.error("DatapropRetryController could not find the getDataPropertyByURI method in the facade");
|
||||||
}
|
}
|
||||||
|
|
||||||
VitroRequest vreq = new VitroRequest(request);
|
|
||||||
Portal currPortal = vreq.getPortal();
|
Portal currPortal = vreq.getPortal();
|
||||||
int currPortalId = 1;
|
int currPortalId = 1;
|
||||||
if (currPortal != null) {
|
if (currPortal != null) {
|
||||||
|
@ -146,10 +147,10 @@ public class DatapropRetryController extends BaseEditController {
|
||||||
|
|
||||||
HashMap optionMap = new HashMap();
|
HashMap optionMap = new HashMap();
|
||||||
List namespaceList = FormUtils.makeOptionListFromBeans(ontDao.getAllOntologies(),"URI","Name", ((objectForEditing.getNamespace()==null) ? "" : objectForEditing.getNamespace()), null, (objectForEditing.getNamespace()!=null));
|
List namespaceList = FormUtils.makeOptionListFromBeans(ontDao.getAllOntologies(),"URI","Name", ((objectForEditing.getNamespace()==null) ? "" : objectForEditing.getNamespace()), null, (objectForEditing.getNamespace()!=null));
|
||||||
namespaceList.add(new Option(getWebappDaoFactory().getDefaultNamespace(),"default"));
|
namespaceList.add(new Option(vreq.getFullWebappDaoFactory().getDefaultNamespace(),"default"));
|
||||||
optionMap.put("Namespace", namespaceList);
|
optionMap.put("Namespace", namespaceList);
|
||||||
|
|
||||||
List<Option> domainOptionList = FormUtils.makeVClassOptionList(getWebappDaoFactory(), objectForEditing.getDomainClassURI());
|
List<Option> domainOptionList = FormUtils.makeVClassOptionList(vreq.getFullWebappDaoFactory(), objectForEditing.getDomainClassURI());
|
||||||
domainOptionList.add(0, new Option("","(none specified)"));
|
domainOptionList.add(0, new Option("","(none specified)"));
|
||||||
optionMap.put("DomainClassURI", domainOptionList);
|
optionMap.put("DomainClassURI", domainOptionList);
|
||||||
|
|
||||||
|
@ -158,7 +159,7 @@ public class DatapropRetryController extends BaseEditController {
|
||||||
datatypeOptionList.add(0,new Option(null,"untyped (use if language tags desired)"));
|
datatypeOptionList.add(0,new Option(null,"untyped (use if language tags desired)"));
|
||||||
optionMap.put("RangeDatatypeURI", datatypeOptionList);
|
optionMap.put("RangeDatatypeURI", datatypeOptionList);
|
||||||
|
|
||||||
List groupOptList = FormUtils.makeOptionListFromBeans(getWebappDaoFactory().getPropertyGroupDao().getPublicGroups(true),"URI","Name", ((objectForEditing.getGroupURI()==null) ? "" : objectForEditing.getGroupURI()), null, (objectForEditing.getGroupURI()!=null));
|
List groupOptList = FormUtils.makeOptionListFromBeans(vreq.getFullWebappDaoFactory().getPropertyGroupDao().getPublicGroups(true),"URI","Name", ((objectForEditing.getGroupURI()==null) ? "" : objectForEditing.getGroupURI()), null, (objectForEditing.getGroupURI()!=null));
|
||||||
groupOptList.add(0,new Option("","none"));
|
groupOptList.add(0,new Option("","none"));
|
||||||
optionMap.put("GroupURI", groupOptList);
|
optionMap.put("GroupURI", groupOptList);
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class DatatypeRetryController extends BaseEditController {
|
||||||
//create an EditProcessObject for this and put it in the session
|
//create an EditProcessObject for this and put it in the session
|
||||||
EditProcessObject epo = super.createEpo(request);
|
EditProcessObject epo = super.createEpo(request);
|
||||||
|
|
||||||
DatatypeDao dDao = getWebappDaoFactory().getDatatypeDao();
|
DatatypeDao dDao = request.getFullWebappDaoFactory().getDatatypeDao();
|
||||||
epo.setDataAccessObject(dDao);
|
epo.setDataAccessObject(dDao);
|
||||||
Datatype objectForEditing = null;
|
Datatype objectForEditing = null;
|
||||||
String action = "";
|
String action = "";
|
||||||
|
|
|
@ -70,12 +70,12 @@ public class EntityEditController extends BaseEditController {
|
||||||
Portal portal = vreq.getPortal();
|
Portal portal = vreq.getPortal();
|
||||||
ApplicationBean application = vreq.getAppBean();
|
ApplicationBean application = vreq.getAppBean();
|
||||||
|
|
||||||
Individual ent = getAssertionsWebappDaoFactory().getIndividualDao().getIndividualByURI(entURI);
|
Individual ent = vreq.getAssertionsWebappDaoFactory().getIndividualDao().getIndividualByURI(entURI);
|
||||||
if (ent == null) {
|
if (ent == null) {
|
||||||
ent = new IndividualImpl(entURI);
|
ent = new IndividualImpl(entURI);
|
||||||
}
|
}
|
||||||
|
|
||||||
Individual inferredEnt = getWebappDaoFactory().getIndividualDao().getIndividualByURI(entURI);
|
Individual inferredEnt = vreq.getFullWebappDaoFactory().getIndividualDao().getIndividualByURI(entURI);
|
||||||
if (inferredEnt == null) {
|
if (inferredEnt == null) {
|
||||||
inferredEnt = new IndividualImpl(entURI);
|
inferredEnt = new IndividualImpl(entURI);
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ public class EntityEditController extends BaseEditController {
|
||||||
results.add("sunset");
|
results.add("sunset");
|
||||||
colCount = colCount + 3;
|
colCount = colCount + 3;
|
||||||
}
|
}
|
||||||
if (getWebappDaoFactory().getApplicationDao().isFlag2Active()) {
|
if (vreq.getFullWebappDaoFactory().getApplicationDao().isFlag2Active()) {
|
||||||
results.add("Flag 2 values");
|
results.add("Flag 2 values");
|
||||||
colCount++;
|
colCount++;
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ public class EntityEditController extends BaseEditController {
|
||||||
String rSunset = (ent.getSunset()==null) ? "" : publicDateFormat.format(ent.getSunset());
|
String rSunset = (ent.getSunset()==null) ? "" : publicDateFormat.format(ent.getSunset());
|
||||||
results.add(rSunset);
|
results.add(rSunset);
|
||||||
}
|
}
|
||||||
if (getWebappDaoFactory().getApplicationDao().isFlag2Active()) {
|
if (vreq.getFullWebappDaoFactory().getApplicationDao().isFlag2Active()) {
|
||||||
String rFlag2Set = (ent.getFlag2Set()==null) ? "" : ent.getFlag2Set();
|
String rFlag2Set = (ent.getFlag2Set()==null) ? "" : ent.getFlag2Set();
|
||||||
results.add(rFlag2Set);
|
results.add(rFlag2Set);
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ public class EntityEditController extends BaseEditController {
|
||||||
FormObject foo = new FormObject();
|
FormObject foo = new FormObject();
|
||||||
HashMap OptionMap = new HashMap();
|
HashMap OptionMap = new HashMap();
|
||||||
|
|
||||||
Collection<DataPropertyStatement> curationNotes = vreq.getWebappDaoFactory().getDataPropertyStatementDao().getDataPropertyStatementsForIndividualByDataPropertyURI(ent, VitroVocabulary.CURATOR_NOTE);
|
Collection<DataPropertyStatement> curationNotes = vreq.getFullWebappDaoFactory().getDataPropertyStatementDao().getDataPropertyStatementsForIndividualByDataPropertyURI(ent, VitroVocabulary.CURATOR_NOTE);
|
||||||
List curationNoteStrs = new LinkedList();
|
List curationNoteStrs = new LinkedList();
|
||||||
Iterator<DataPropertyStatement> cnIt = curationNotes.iterator();
|
Iterator<DataPropertyStatement> cnIt = curationNotes.iterator();
|
||||||
while (cnIt.hasNext()) {
|
while (cnIt.hasNext()) {
|
||||||
|
@ -196,20 +196,20 @@ public class EntityEditController extends BaseEditController {
|
||||||
OptionMap.put("ExtraURL", FormUtils.makeOptionListFromBeans(ent.getLinksList(), "URI", "Anchor", null, null, false));
|
OptionMap.put("ExtraURL", FormUtils.makeOptionListFromBeans(ent.getLinksList(), "URI", "Anchor", null, null, false));
|
||||||
} catch (Exception e) {e.printStackTrace();}
|
} catch (Exception e) {e.printStackTrace();}
|
||||||
|
|
||||||
List classGroups = vreq.getWebappDaoFactory().getVClassGroupDao().getPublicGroupsWithVClasses(true,true,false); // order by displayRank, include uninstantiated classes, don't count the individuals
|
List classGroups = vreq.getFullWebappDaoFactory().getVClassGroupDao().getPublicGroupsWithVClasses(true,true,false); // order by displayRank, include uninstantiated classes, don't count the individuals
|
||||||
Iterator classGroupIt = classGroups.iterator();
|
Iterator classGroupIt = classGroups.iterator();
|
||||||
ListOrderedMap optGroupMap = new ListOrderedMap();
|
ListOrderedMap optGroupMap = new ListOrderedMap();
|
||||||
while (classGroupIt.hasNext()) {
|
while (classGroupIt.hasNext()) {
|
||||||
VClassGroup group = (VClassGroup)classGroupIt.next();
|
VClassGroup group = (VClassGroup)classGroupIt.next();
|
||||||
List classes = group.getVitroClassList();
|
List classes = group.getVitroClassList();
|
||||||
optGroupMap.put(group.getPublicName(),FormUtils.makeOptionListFromBeans(classes,"URI","PickListName",ent.getVClassURI(),null,false));
|
optGroupMap.put(group.getPublicName(),FormUtils.makeOptionListFromBeans(classes,"URI","PickListName",ent.getVClassURI(),null,false));
|
||||||
//mixes group names with classes:optGroupMap.put(group.getPublicName(),FormUtils.makeVClassOptionList(getWebappDaoFactory(),ent.getVClassURI()));
|
//mixes group names with classes:optGroupMap.put(group.getPublicName(),FormUtils.makeVClassOptionList(getFullWebappDaoFactory(),ent.getVClassURI()));
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
OptionMap.put("VClassURI", optGroupMap);
|
OptionMap.put("VClassURI", optGroupMap);
|
||||||
} catch (Exception e) {e.printStackTrace();}
|
} catch (Exception e) {e.printStackTrace();}
|
||||||
|
|
||||||
PropertyInstanceDao piDao = vreq.getWebappDaoFactory().getPropertyInstanceDao();
|
PropertyInstanceDao piDao = vreq.getFullWebappDaoFactory().getPropertyInstanceDao();
|
||||||
// existing property statements
|
// existing property statements
|
||||||
try {
|
try {
|
||||||
List epiOptionList = new LinkedList();
|
List epiOptionList = new LinkedList();
|
||||||
|
@ -237,17 +237,17 @@ public class EntityEditController extends BaseEditController {
|
||||||
foo.setOptionLists(OptionMap);
|
foo.setOptionLists(OptionMap);
|
||||||
|
|
||||||
// make the flag checkbox lists
|
// make the flag checkbox lists
|
||||||
Boolean singlePortal = new Boolean(vreq.getWebappDaoFactory().getPortalDao().isSinglePortal());
|
Boolean singlePortal = new Boolean(vreq.getFullWebappDaoFactory().getPortalDao().isSinglePortal());
|
||||||
request.setAttribute("singlePortal", singlePortal);
|
request.setAttribute("singlePortal", singlePortal);
|
||||||
|
|
||||||
EditProcessObject flagEpo = super.createEpo(request);
|
EditProcessObject flagEpo = super.createEpo(request);
|
||||||
flagEpo.setOriginalBean(ent);
|
flagEpo.setOriginalBean(ent);
|
||||||
flagEpo.setDataAccessObject(getWebappDaoFactory().getIndividualDao());
|
flagEpo.setDataAccessObject(vreq.getFullWebappDaoFactory().getIndividualDao());
|
||||||
request.setAttribute("_flagEpoKey",flagEpo.getKey());
|
request.setAttribute("_flagEpoKey",flagEpo.getKey());
|
||||||
|
|
||||||
if (getWebappDaoFactory().getApplicationDao().isFlag1Active()) {
|
if (vreq.getFullWebappDaoFactory().getApplicationDao().isFlag1Active()) {
|
||||||
request.setAttribute("isFlag1Active",true);
|
request.setAttribute("isFlag1Active",true);
|
||||||
PortalDao pDao = getWebappDaoFactory().getPortalDao();
|
PortalDao pDao = vreq.getFullWebappDaoFactory().getPortalDao();
|
||||||
HashSet indPortalSet = new HashSet();
|
HashSet indPortalSet = new HashSet();
|
||||||
if (ent.getFlag1Set() != null) {
|
if (ent.getFlag1Set() != null) {
|
||||||
String[] indPortal = ent.getFlag1Set().split(",");
|
String[] indPortal = ent.getFlag1Set().split(",");
|
||||||
|
@ -278,7 +278,7 @@ public class EntityEditController extends BaseEditController {
|
||||||
request.setAttribute("isFlag1Active",false);
|
request.setAttribute("isFlag1Active",false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getWebappDaoFactory().getApplicationDao().isFlag2Active()) {
|
if (vreq.getFullWebappDaoFactory().getApplicationDao().isFlag2Active()) {
|
||||||
try {
|
try {
|
||||||
request.setAttribute("isFlag2Active",true);
|
request.setAttribute("isFlag2Active",true);
|
||||||
List<Checkbox> flag2CheckboxList = new ArrayList<Checkbox>();
|
List<Checkbox> flag2CheckboxList = new ArrayList<Checkbox>();
|
||||||
|
@ -288,7 +288,7 @@ public class EntityEditController extends BaseEditController {
|
||||||
flag2ValueSet.add(flag2Values[ii]);
|
flag2ValueSet.add(flag2Values[ii]);
|
||||||
}
|
}
|
||||||
List<String> keyList = new ArrayList<String>();
|
List<String> keyList = new ArrayList<String>();
|
||||||
keyList.addAll(((WebappDaoFactoryJena)getWebappDaoFactory()).getFlag2ValueMap().keySet());
|
keyList.addAll(((WebappDaoFactoryJena) vreq.getFullWebappDaoFactory()).getFlag2ValueMap().keySet());
|
||||||
Collections.sort(keyList);
|
Collections.sort(keyList);
|
||||||
for (Iterator<String> i = keyList.iterator(); i.hasNext(); ) {
|
for (Iterator<String> i = keyList.iterator(); i.hasNext(); ) {
|
||||||
String value = i.next();
|
String value = i.next();
|
||||||
|
@ -309,8 +309,8 @@ public class EntityEditController extends BaseEditController {
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Option> existingKeywordRelations = new LinkedList();
|
List<Option> existingKeywordRelations = new LinkedList();
|
||||||
KeywordIndividualRelationDao kirDao = getWebappDaoFactory().getKeys2EntsDao();
|
KeywordIndividualRelationDao kirDao = vreq.getFullWebappDaoFactory().getKeys2EntsDao();
|
||||||
KeywordDao kDao = getWebappDaoFactory().getKeywordDao();
|
KeywordDao kDao = vreq.getFullWebappDaoFactory().getKeywordDao();
|
||||||
List kirs = kirDao.getKeywordIndividualRelationsByIndividualURI(ent.getURI());
|
List kirs = kirDao.getKeywordIndividualRelationsByIndividualURI(ent.getURI());
|
||||||
if (kirs != null) {
|
if (kirs != null) {
|
||||||
Iterator kirIt = kirs.iterator();
|
Iterator kirIt = kirs.iterator();
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class EntityRetryController extends BaseEditController {
|
||||||
action = epo.getAction();
|
action = epo.getAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebappDaoFactory wadf = (getAssertionsWebappDaoFactory()!=null) ? getAssertionsWebappDaoFactory() : getWebappDaoFactory();
|
WebappDaoFactory wadf = (vreq.getAssertionsWebappDaoFactory()!=null) ? vreq.getAssertionsWebappDaoFactory() : vreq.getFullWebappDaoFactory();
|
||||||
|
|
||||||
LoginFormBean loginBean = (LoginFormBean) request.getSession().getAttribute("loginHandler");
|
LoginFormBean loginBean = (LoginFormBean) request.getSession().getAttribute("loginHandler");
|
||||||
WebappDaoFactory myWebappDaoFactory = wadf.getUserAwareDaoFactory(loginBean.getUserURI());
|
WebappDaoFactory myWebappDaoFactory = wadf.getUserAwareDaoFactory(loginBean.getUserURI());
|
||||||
|
@ -202,7 +202,7 @@ public class EntityRetryController extends BaseEditController {
|
||||||
vclasses = new ArrayList<VClass>();
|
vclasses = new ArrayList<VClass>();
|
||||||
if (individualForEditing.getVClassURI() != null) {
|
if (individualForEditing.getVClassURI() != null) {
|
||||||
try {
|
try {
|
||||||
VClass cls = getWebappDaoFactory().getVClassDao().getVClassByURI(individualForEditing.getVClassURI());
|
VClass cls = vreq.getFullWebappDaoFactory().getVClassDao().getVClassByURI(individualForEditing.getVClassURI());
|
||||||
if (cls != null) {
|
if (cls != null) {
|
||||||
vclasses.add(cls);
|
vclasses.add(cls);
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,12 +53,12 @@ public class ExternalIdRetryController extends BaseEditController {
|
||||||
|
|
||||||
String action = "insert";
|
String action = "insert";
|
||||||
|
|
||||||
DataPropertyDao dpDao = getWebappDaoFactory().getDataPropertyDao();
|
DataPropertyDao dpDao = vreq.getFullWebappDaoFactory().getDataPropertyDao();
|
||||||
DataPropertyStatementDao edDao = getWebappDaoFactory().getDataPropertyStatementDao();
|
DataPropertyStatementDao edDao = vreq.getFullWebappDaoFactory().getDataPropertyStatementDao();
|
||||||
epo.setDataAccessObject(edDao);
|
epo.setDataAccessObject(edDao);
|
||||||
epo.setBeanClass(DataPropertyStatement.class);
|
epo.setBeanClass(DataPropertyStatement.class);
|
||||||
|
|
||||||
IndividualDao eDao = getWebappDaoFactory().getIndividualDao();
|
IndividualDao eDao = vreq.getFullWebappDaoFactory().getIndividualDao();
|
||||||
|
|
||||||
DataPropertyStatement eidForEditing = null;
|
DataPropertyStatement eidForEditing = null;
|
||||||
if (!epo.getUseRecycledBean()){
|
if (!epo.getUseRecycledBean()){
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class IndividualTypeOperationController extends BaseEditController {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
IndividualDao dao = getWebappDaoFactory().getIndividualDao();
|
IndividualDao dao = request.getFullWebappDaoFactory().getIndividualDao();
|
||||||
|
|
||||||
if (request.getParameter("_cancel") == null) {
|
if (request.getParameter("_cancel") == null) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -30,6 +30,7 @@ import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.IndividualImpl;
|
import edu.cornell.mannlib.vitro.webapp.beans.IndividualImpl;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.VClassDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.VClassDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||||
|
@ -52,8 +53,10 @@ public class IndividualTypeRetryController extends BaseEditController {
|
||||||
//create an EditProcessObject for this and put it in the session
|
//create an EditProcessObject for this and put it in the session
|
||||||
EditProcessObject epo = super.createEpo(request);
|
EditProcessObject epo = super.createEpo(request);
|
||||||
|
|
||||||
|
VitroRequest vreq = new VitroRequest(request);
|
||||||
|
|
||||||
WebappDaoFactory t;
|
WebappDaoFactory t;
|
||||||
WebappDaoFactory wadf = ((t = getAssertionsWebappDaoFactory()) != null) ? t : getWebappDaoFactory();
|
WebappDaoFactory wadf = ((t = vreq.getAssertionsWebappDaoFactory()) != null) ? t : vreq.getFullWebappDaoFactory();
|
||||||
IndividualDao iDao = wadf.getIndividualDao();
|
IndividualDao iDao = wadf.getIndividualDao();
|
||||||
VClassDao vcDao = wadf.getVClassDao();
|
VClassDao vcDao = wadf.getVClassDao();
|
||||||
|
|
||||||
|
|
|
@ -58,10 +58,10 @@ public class Keys2EntsRetryController extends BaseEditController {
|
||||||
isDashboardForm=true;
|
isDashboardForm=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
KeywordIndividualRelationDao k2eDao = getWebappDaoFactory().getKeys2EntsDao();
|
KeywordIndividualRelationDao k2eDao = request.getFullWebappDaoFactory().getKeys2EntsDao();
|
||||||
epo.setDataAccessObject(k2eDao);
|
epo.setDataAccessObject(k2eDao);
|
||||||
KeywordDao kDao = getWebappDaoFactory().getKeywordDao();
|
KeywordDao kDao = request.getFullWebappDaoFactory().getKeywordDao();
|
||||||
IndividualDao eDao = getWebappDaoFactory().getIndividualDao();
|
IndividualDao eDao = request.getFullWebappDaoFactory().getIndividualDao();
|
||||||
|
|
||||||
KeywordIndividualRelation objectForEditing = new KeywordIndividualRelation();
|
KeywordIndividualRelation objectForEditing = new KeywordIndividualRelation();
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ public class Keys2EntsRetryController extends BaseEditController {
|
||||||
|
|
||||||
if (isDashboardForm && action.equals("delete")) {
|
if (isDashboardForm && action.equals("delete")) {
|
||||||
List<Option> existingKeywordRelations = new LinkedList();
|
List<Option> existingKeywordRelations = new LinkedList();
|
||||||
KeywordIndividualRelationDao kirDao = getWebappDaoFactory().getKeys2EntsDao();
|
KeywordIndividualRelationDao kirDao = request.getFullWebappDaoFactory().getKeys2EntsDao();
|
||||||
List kirs = kirDao.getKeywordIndividualRelationsByIndividualURI(ent.getURI());
|
List kirs = kirDao.getKeywordIndividualRelationsByIndividualURI(ent.getURI());
|
||||||
if (kirs != null) {
|
if (kirs != null) {
|
||||||
Iterator kirIt = kirs.iterator();
|
Iterator kirIt = kirs.iterator();
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class KeywordEditController extends BaseEditController {
|
||||||
String theKeywordId = linkwhereId.substring(15,linkwhereId.length()-1);
|
String theKeywordId = linkwhereId.substring(15,linkwhereId.length()-1);
|
||||||
int kwId = Integer.decode(theKeywordId);
|
int kwId = Integer.decode(theKeywordId);
|
||||||
|
|
||||||
Keyword k = vreq.getWebappDaoFactory().getKeywordDao().getKeywordById(kwId);
|
Keyword k = vreq.getFullWebappDaoFactory().getKeywordDao().getKeywordById(kwId);
|
||||||
|
|
||||||
EditProcessObject epo = super.createEpo(request);
|
EditProcessObject epo = super.createEpo(request);
|
||||||
FormObject foo = new FormObject();
|
FormObject foo = new FormObject();
|
||||||
|
|
|
@ -55,9 +55,9 @@ public class KeywordRetryController extends BaseEditController {
|
||||||
epo.setBeanClass(Keyword.class);
|
epo.setBeanClass(Keyword.class);
|
||||||
epo.setBeanMask(testMask);
|
epo.setBeanMask(testMask);
|
||||||
|
|
||||||
KeywordDao kDao = getWebappDaoFactory().getKeywordDao();
|
KeywordDao kDao = request.getFullWebappDaoFactory().getKeywordDao();
|
||||||
epo.setDataAccessObject(kDao);
|
epo.setDataAccessObject(kDao);
|
||||||
epo.getAdditionalDaoMap().put("KeywordIndividualRelationDao", getWebappDaoFactory().getKeys2EntsDao());
|
epo.getAdditionalDaoMap().put("KeywordIndividualRelationDao", request.getFullWebappDaoFactory().getKeys2EntsDao());
|
||||||
|
|
||||||
String action="insert";
|
String action="insert";
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,9 @@ public class LinkRetryController extends BaseEditController {
|
||||||
|
|
||||||
String action = "insert";
|
String action = "insert";
|
||||||
|
|
||||||
WebappDaoFactory wadf = (getAssertionsWebappDaoFactory() != null) ? getAssertionsWebappDaoFactory() : getWebappDaoFactory();
|
WebappDaoFactory wadf = (request.getAssertionsWebappDaoFactory() != null)
|
||||||
|
? request.getAssertionsWebappDaoFactory()
|
||||||
|
: request.getFullWebappDaoFactory();
|
||||||
|
|
||||||
LinksDao lDao = wadf.getLinksDao();
|
LinksDao lDao = wadf.getLinksDao();
|
||||||
epo.setDataAccessObject(lDao);
|
epo.setDataAccessObject(lDao);
|
||||||
|
|
|
@ -35,6 +35,7 @@ import com.hp.hpl.jena.shared.Lock;
|
||||||
import edu.cornell.mannlib.vedit.beans.LoginFormBean;
|
import edu.cornell.mannlib.vedit.beans.LoginFormBean;
|
||||||
import edu.cornell.mannlib.vitro.webapp.ConfigurationProperties;
|
import edu.cornell.mannlib.vitro.webapp.ConfigurationProperties;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet;
|
import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.UserDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.UserDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.event.EditEvent;
|
import edu.cornell.mannlib.vitro.webapp.dao.jena.event.EditEvent;
|
||||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration;
|
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration;
|
||||||
|
@ -307,7 +308,7 @@ public class N3MultiPartUpload extends VitroHttpServlet {
|
||||||
//This is before the redirect occurs from postEditCleanUp
|
//This is before the redirect occurs from postEditCleanUp
|
||||||
//Send out email confirmation here
|
//Send out email confirmation here
|
||||||
try {
|
try {
|
||||||
sendUserEmail(session, uploadFileName);
|
sendUserEmail(request, session, uploadFileName);
|
||||||
} catch(Exception ex) {
|
} catch(Exception ex) {
|
||||||
System.out.println("Problem with retrieving and/or sending email");
|
System.out.println("Problem with retrieving and/or sending email");
|
||||||
}
|
}
|
||||||
|
@ -506,12 +507,12 @@ public class N3MultiPartUpload extends VitroHttpServlet {
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendUserEmail(HttpSession session, String uploadFileName) {
|
public void sendUserEmail(HttpServletRequest request, HttpSession session, String uploadFileName) {
|
||||||
LoginFormBean loginBean = (LoginFormBean) session.getAttribute("loginHandler");
|
LoginFormBean loginBean = (LoginFormBean) session.getAttribute("loginHandler");
|
||||||
String userURI = loginBean.getUserURI();
|
String userURI = loginBean.getUserURI();
|
||||||
try{
|
try{
|
||||||
System.out.println("User URI is " + userURI);
|
System.out.println("User URI is " + userURI);
|
||||||
UserDao uDao = getWebappDaoFactory().getUserDao();
|
UserDao uDao = (new VitroRequest(request)).getFullWebappDaoFactory().getUserDao();
|
||||||
String email = uDao.getUserEmailAddress(userURI);
|
String email = uDao.getUserEmailAddress(userURI);
|
||||||
String deliveryFrom = "hjk54@cornell.edu";//TO DO: replace with email address to be used
|
String deliveryFrom = "hjk54@cornell.edu";//TO DO: replace with email address to be used
|
||||||
//Now send message
|
//Now send message
|
||||||
|
|
|
@ -49,9 +49,9 @@ public class NamespaceRetryController extends BaseEditController {
|
||||||
epo.setBeanMask(testMask);
|
epo.setBeanMask(testMask);
|
||||||
|
|
||||||
String action = "insert";
|
String action = "insert";
|
||||||
if (getWebappDaoFactory() == null)
|
if (request.getFullWebappDaoFactory() == null)
|
||||||
log.error("null CoreDaoFactory");
|
log.error("null CoreDaoFactory");
|
||||||
NamespaceDao namespaceDao = getWebappDaoFactory().getNamespaceDao();
|
NamespaceDao namespaceDao = request.getFullWebappDaoFactory().getNamespaceDao();
|
||||||
//VitroFacade facade = getFacade();
|
//VitroFacade facade = getFacade();
|
||||||
//epo.setFacade(facade);
|
//epo.setFacade(facade);
|
||||||
|
|
||||||
|
|
|
@ -64,11 +64,11 @@ public class ObjectPropertyStatementRetryController extends BaseEditController {
|
||||||
|
|
||||||
String action = "insert";
|
String action = "insert";
|
||||||
|
|
||||||
PropertyInstanceDao piDao = getWebappDaoFactory().getPropertyInstanceDao();
|
PropertyInstanceDao piDao = vreq.getFullWebappDaoFactory().getPropertyInstanceDao();
|
||||||
epo.setDataAccessObject(piDao);
|
epo.setDataAccessObject(piDao);
|
||||||
ObjectPropertyDao pDao = getWebappDaoFactory().getObjectPropertyDao();
|
ObjectPropertyDao pDao = vreq.getFullWebappDaoFactory().getObjectPropertyDao();
|
||||||
IndividualDao eDao = getWebappDaoFactory().getIndividualDao();
|
IndividualDao eDao = vreq.getFullWebappDaoFactory().getIndividualDao();
|
||||||
VClassDao vcDao = getWebappDaoFactory().getVClassDao();
|
VClassDao vcDao = vreq.getFullWebappDaoFactory().getVClassDao();
|
||||||
|
|
||||||
PropertyInstance objectForEditing = null;
|
PropertyInstance objectForEditing = null;
|
||||||
if (!epo.getUseRecycledBean()){
|
if (!epo.getUseRecycledBean()){
|
||||||
|
|
|
@ -42,13 +42,13 @@ public class OntologyEditController extends BaseEditController {
|
||||||
EditProcessObject epo = super.createEpo(request);
|
EditProcessObject epo = super.createEpo(request);
|
||||||
request.setAttribute("epoKey", epo.getKey());
|
request.setAttribute("epoKey", epo.getKey());
|
||||||
|
|
||||||
OntologyDao oDao=getWebappDaoFactory().getOntologyDao();
|
OntologyDao oDao = request.getFullWebappDaoFactory().getOntologyDao();
|
||||||
Ontology o=null;
|
Ontology o = null;
|
||||||
if (request.getParameter("uri")==null){
|
if (request.getParameter("uri")==null){
|
||||||
log.error("doPost() expects non-null uri parameter");
|
log.error("doPost() expects non-null uri parameter");
|
||||||
} else {
|
} else {
|
||||||
o = (Ontology)oDao.getOntologyByURI(request.getParameter("uri"));
|
o = (Ontology)oDao.getOntologyByURI(request.getParameter("uri"));
|
||||||
if (o==null){
|
if (o == null){
|
||||||
if (!VitroVocabulary.vitroURI.equals(request.getParameter("uri"))) {
|
if (!VitroVocabulary.vitroURI.equals(request.getParameter("uri"))) {
|
||||||
log.debug("doPost(): no ontology object found for the namespace "+request.getParameter("uri"));
|
log.debug("doPost(): no ontology object found for the namespace "+request.getParameter("uri"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,9 +55,9 @@ public class OntologyRetryController extends BaseEditController {
|
||||||
|
|
||||||
String action = "insert";
|
String action = "insert";
|
||||||
|
|
||||||
OntologyDao oDao = getWebappDaoFactory().getOntologyDao();
|
OntologyDao oDao = request.getFullWebappDaoFactory().getOntologyDao();
|
||||||
epo.setDataAccessObject(oDao);
|
epo.setDataAccessObject(oDao);
|
||||||
NamespaceDao nDao = getWebappDaoFactory().getNamespaceDao();
|
NamespaceDao nDao = request.getFullWebappDaoFactory().getNamespaceDao();
|
||||||
|
|
||||||
Ontology ontologyForEditing = null;
|
Ontology ontologyForEditing = null;
|
||||||
if (!epo.getUseRecycledBean()){
|
if (!epo.getUseRecycledBean()){
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class PortalEditController extends BaseEditController {
|
||||||
int portalId = Integer.decode(thePortalId);
|
int portalId = Integer.decode(thePortalId);
|
||||||
|
|
||||||
VitroRequest vreq = (new VitroRequest(request));
|
VitroRequest vreq = (new VitroRequest(request));
|
||||||
Portal p = vreq.getWebappDaoFactory().getPortalDao().getPortal(portalId);
|
Portal p = vreq.getFullWebappDaoFactory().getPortalDao().getPortal(portalId);
|
||||||
|
|
||||||
EditProcessObject epo = super.createEpo(request);
|
EditProcessObject epo = super.createEpo(request);
|
||||||
FormObject foo = new FormObject();
|
FormObject foo = new FormObject();
|
||||||
|
|
|
@ -55,9 +55,9 @@ public class PortalRetryController extends BaseEditController {
|
||||||
|
|
||||||
String action = "insert";
|
String action = "insert";
|
||||||
|
|
||||||
PortalDao pDao = getWebappDaoFactory().getPortalDao();
|
PortalDao pDao = request.getFullWebappDaoFactory().getPortalDao();
|
||||||
epo.setDataAccessObject(pDao);
|
epo.setDataAccessObject(pDao);
|
||||||
TabDao tDao = getWebappDaoFactory().getTabDao();
|
TabDao tDao = request.getFullWebappDaoFactory().getTabDao();
|
||||||
|
|
||||||
boolean creatingNewPortal = false;
|
boolean creatingNewPortal = false;
|
||||||
Portal portalForEditing = null;
|
Portal portalForEditing = null;
|
||||||
|
@ -96,7 +96,8 @@ public class PortalRetryController extends BaseEditController {
|
||||||
//set up any listeners
|
//set up any listeners
|
||||||
List changeListenerList = new ArrayList();
|
List changeListenerList = new ArrayList();
|
||||||
epo.setChangeListenerList(changeListenerList);
|
epo.setChangeListenerList(changeListenerList);
|
||||||
changeListenerList.add(new PortalPrefixUpdater(getServletContext(),getWebappDaoFactory().getPortalDao()));
|
changeListenerList.add(new PortalPrefixUpdater(getServletContext(),
|
||||||
|
request.getFullWebappDaoFactory().getPortalDao()));
|
||||||
|
|
||||||
epo.setPostDeletePageForwarder(new PortalDeletionPageForwarder(getServletContext(),pDao));
|
epo.setPostDeletePageForwarder(new PortalDeletionPageForwarder(getServletContext(),pDao));
|
||||||
|
|
||||||
|
@ -139,7 +140,7 @@ public class PortalRetryController extends BaseEditController {
|
||||||
|
|
||||||
String html = FormUtils.htmlFormFromBean(portalForEditing,action,foo,epo.getBadValueMap());
|
String html = FormUtils.htmlFormFromBean(portalForEditing,action,foo,epo.getBadValueMap());
|
||||||
|
|
||||||
Boolean singlePortal = new Boolean(request.getWebappDaoFactory().getPortalDao().isSinglePortal());
|
Boolean singlePortal = new Boolean(request.getFullWebappDaoFactory().getPortalDao().isSinglePortal());
|
||||||
request.setAttribute("singlePortal", singlePortal);
|
request.setAttribute("singlePortal", singlePortal);
|
||||||
request.setAttribute("creatingNewPortal", new Boolean(creatingNewPortal));
|
request.setAttribute("creatingNewPortal", new Boolean(creatingNewPortal));
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class PrimitiveDelete extends PrimitiveRdfEdit {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
|
WebappDaoFactory wdf = vreq.getFullWebappDaoFactory();
|
||||||
IndividualDao idao = wdf.getIndividualDao();
|
IndividualDao idao = wdf.getIndividualDao();
|
||||||
int result = idao.deleteIndividual(uriToDelete);
|
int result = idao.deleteIndividual(uriToDelete);
|
||||||
if (result == 1) {
|
if (result == 1) {
|
||||||
|
|
|
@ -131,7 +131,7 @@ public class Properties2PropertiesOperationController extends
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doEdit(String modeStr, boolean operation, VitroRequest request) {
|
private void doEdit(String modeStr, boolean operation, VitroRequest request) {
|
||||||
PropertyDao opDao = getWebappDaoFactory().getObjectPropertyDao();
|
PropertyDao opDao = request.getFullWebappDaoFactory().getObjectPropertyDao();
|
||||||
|
|
||||||
if (operation == REMOVE) {
|
if (operation == REMOVE) {
|
||||||
String[] subpropertyURIstrs = request.getParameterValues("SubpropertyURI");
|
String[] subpropertyURIstrs = request.getParameterValues("SubpropertyURI");
|
||||||
|
|
|
@ -53,8 +53,8 @@ public class Properties2PropertiesRetryController extends BaseEditController {
|
||||||
action = epo.getAction();
|
action = epo.getAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
ObjectPropertyDao opDao = getWebappDaoFactory().getObjectPropertyDao();
|
ObjectPropertyDao opDao = request.getFullWebappDaoFactory().getObjectPropertyDao();
|
||||||
DataPropertyDao dpDao = getWebappDaoFactory().getDataPropertyDao();
|
DataPropertyDao dpDao = request.getFullWebappDaoFactory().getDataPropertyDao();
|
||||||
epo.setDataAccessObject(opDao);
|
epo.setDataAccessObject(opDao);
|
||||||
|
|
||||||
List propList = ("data".equals(request.getParameter("propertyType")))
|
List propList = ("data".equals(request.getParameter("propertyType")))
|
||||||
|
|
|
@ -47,11 +47,12 @@ public class PropertyEditController extends BaseEditController {
|
||||||
log.error("PropertyEditController caught exception calling doGet()");
|
log.error("PropertyEditController caught exception calling doGet()");
|
||||||
}
|
}
|
||||||
|
|
||||||
Portal portal = (new VitroRequest(request)).getPortal();
|
VitroRequest vreq = new VitroRequest(request);
|
||||||
|
Portal portal = vreq.getPortal();
|
||||||
|
|
||||||
ObjectPropertyDao propDao = getWebappDaoFactory().getObjectPropertyDao();
|
ObjectPropertyDao propDao = vreq.getFullWebappDaoFactory().getObjectPropertyDao();
|
||||||
VClassDao vcDao = getWebappDaoFactory().getVClassDao();
|
VClassDao vcDao = vreq.getFullWebappDaoFactory().getVClassDao();
|
||||||
PropertyGroupDao pgDao = getWebappDaoFactory().getPropertyGroupDao();
|
PropertyGroupDao pgDao = vreq.getFullWebappDaoFactory().getPropertyGroupDao();
|
||||||
ObjectProperty p = (ObjectProperty)propDao.getObjectPropertyByURI(request.getParameter("uri"));
|
ObjectProperty p = (ObjectProperty)propDao.getObjectPropertyByURI(request.getParameter("uri"));
|
||||||
request.setAttribute("property",p);
|
request.setAttribute("property",p);
|
||||||
|
|
||||||
|
@ -166,10 +167,10 @@ public class PropertyEditController extends BaseEditController {
|
||||||
// superproperties and subproperties
|
// superproperties and subproperties
|
||||||
|
|
||||||
ObjectPropertyDao opDao;
|
ObjectPropertyDao opDao;
|
||||||
if (getAssertionsWebappDaoFactory() != null) {
|
if (vreq.getAssertionsWebappDaoFactory() != null) {
|
||||||
opDao = getAssertionsWebappDaoFactory().getObjectPropertyDao();
|
opDao = vreq.getAssertionsWebappDaoFactory().getObjectPropertyDao();
|
||||||
} else {
|
} else {
|
||||||
opDao = getWebappDaoFactory().getObjectPropertyDao();
|
opDao = vreq.getFullWebappDaoFactory().getObjectPropertyDao();
|
||||||
}
|
}
|
||||||
List superURIs = opDao.getSuperPropertyURIs(p.getURI(),false);
|
List superURIs = opDao.getSuperPropertyURIs(p.getURI(),false);
|
||||||
List superProperties = new ArrayList();
|
List superProperties = new ArrayList();
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class PropertyGroupRetryController extends BaseEditController {
|
||||||
action = epo.getAction();
|
action = epo.getAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
PropertyGroupDao pgDao = getWebappDaoFactory().getPropertyGroupDao();
|
PropertyGroupDao pgDao = request.getFullWebappDaoFactory().getPropertyGroupDao();
|
||||||
|
|
||||||
epo.setDataAccessObject(pgDao);
|
epo.setDataAccessObject(pgDao);
|
||||||
|
|
||||||
|
|
|
@ -72,11 +72,11 @@ public class PropertyRetryController extends BaseEditController {
|
||||||
action = epo.getAction();
|
action = epo.getAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
ObjectPropertyDao propDao = getWebappDaoFactory().getObjectPropertyDao();
|
ObjectPropertyDao propDao = request.getFullWebappDaoFactory().getObjectPropertyDao();
|
||||||
epo.setDataAccessObject(propDao);
|
epo.setDataAccessObject(propDao);
|
||||||
OntologyDao ontDao = getWebappDaoFactory().getOntologyDao();
|
OntologyDao ontDao = request.getFullWebappDaoFactory().getOntologyDao();
|
||||||
VClassDao vclassDao = getWebappDaoFactory().getVClassDao();
|
VClassDao vclassDao = request.getFullWebappDaoFactory().getVClassDao();
|
||||||
DataPropertyDao dpDao = getWebappDaoFactory().getDataPropertyDao();
|
DataPropertyDao dpDao = request.getFullWebappDaoFactory().getDataPropertyDao();
|
||||||
|
|
||||||
ObjectProperty propertyForEditing = null;
|
ObjectProperty propertyForEditing = null;
|
||||||
if (!epo.getUseRecycledBean()){
|
if (!epo.getUseRecycledBean()){
|
||||||
|
@ -151,10 +151,10 @@ public class PropertyRetryController extends BaseEditController {
|
||||||
HashMap<String, List<Option>> optionMap = new HashMap<String, List<Option>>();
|
HashMap<String, List<Option>> optionMap = new HashMap<String, List<Option>>();
|
||||||
try {
|
try {
|
||||||
List<Option> namespaceIdList = FormUtils.makeOptionListFromBeans(ontDao.getAllOntologies(),"URI","Name", ((propertyForEditing.getNamespace()==null) ? "" : propertyForEditing.getNamespace()), null, (propertyForEditing.getNamespace()!=null));
|
List<Option> namespaceIdList = FormUtils.makeOptionListFromBeans(ontDao.getAllOntologies(),"URI","Name", ((propertyForEditing.getNamespace()==null) ? "" : propertyForEditing.getNamespace()), null, (propertyForEditing.getNamespace()!=null));
|
||||||
namespaceIdList.add(new Option(getWebappDaoFactory().getDefaultNamespace(),"default"));
|
namespaceIdList.add(new Option(request.getFullWebappDaoFactory().getDefaultNamespace(),"default"));
|
||||||
optionMap.put("Namespace", namespaceIdList);
|
optionMap.put("Namespace", namespaceIdList);
|
||||||
List<Option> namespaceIdInverseList = FormUtils.makeOptionListFromBeans(ontDao.getAllOntologies(),"URI","Name", ((propertyForEditing.getNamespaceInverse()==null) ? "" : propertyForEditing.getNamespaceInverse()), null, (propertyForEditing.getNamespaceInverse()!=null));
|
List<Option> namespaceIdInverseList = FormUtils.makeOptionListFromBeans(ontDao.getAllOntologies(),"URI","Name", ((propertyForEditing.getNamespaceInverse()==null) ? "" : propertyForEditing.getNamespaceInverse()), null, (propertyForEditing.getNamespaceInverse()!=null));
|
||||||
namespaceIdInverseList.add(new Option(getWebappDaoFactory().getDefaultNamespace(),"default"));
|
namespaceIdInverseList.add(new Option(request.getFullWebappDaoFactory().getDefaultNamespace(),"default"));
|
||||||
optionMap.put("NamespaceInverse", namespaceIdInverseList);
|
optionMap.put("NamespaceInverse", namespaceIdInverseList);
|
||||||
List<ObjectProperty> objPropList = propDao.getAllObjectProperties();
|
List<ObjectProperty> objPropList = propDao.getAllObjectProperties();
|
||||||
Collections.sort(objPropList);
|
Collections.sort(objPropList);
|
||||||
|
@ -166,10 +166,10 @@ public class PropertyRetryController extends BaseEditController {
|
||||||
List<Option> objectIndividualSortPropertyList = FormUtils.makeOptionListFromBeans(dpList,"URI","Name",propertyForEditing.getObjectIndividualSortPropertyURI(),null);
|
List<Option> objectIndividualSortPropertyList = FormUtils.makeOptionListFromBeans(dpList,"URI","Name",propertyForEditing.getObjectIndividualSortPropertyURI(),null);
|
||||||
objectIndividualSortPropertyList.add(0,new Option("","- select data property -"));
|
objectIndividualSortPropertyList.add(0,new Option("","- select data property -"));
|
||||||
optionMap.put("ObjectIndividualSortPropertyURI",objectIndividualSortPropertyList);
|
optionMap.put("ObjectIndividualSortPropertyURI",objectIndividualSortPropertyList);
|
||||||
List<Option> domainOptionList = FormUtils.makeVClassOptionList(getWebappDaoFactory(), propertyForEditing.getDomainVClassURI());
|
List<Option> domainOptionList = FormUtils.makeVClassOptionList(request.getFullWebappDaoFactory(), propertyForEditing.getDomainVClassURI());
|
||||||
domainOptionList.add(0, new Option("","(none specified)"));
|
domainOptionList.add(0, new Option("","(none specified)"));
|
||||||
optionMap.put("DomainVClassURI", domainOptionList);
|
optionMap.put("DomainVClassURI", domainOptionList);
|
||||||
List<Option> rangeOptionList = FormUtils.makeVClassOptionList(getWebappDaoFactory(), propertyForEditing.getRangeVClassURI());
|
List<Option> rangeOptionList = FormUtils.makeVClassOptionList(request.getFullWebappDaoFactory(), propertyForEditing.getRangeVClassURI());
|
||||||
rangeOptionList.add(0, new Option("","(none specified)"));
|
rangeOptionList.add(0, new Option("","(none specified)"));
|
||||||
optionMap.put("RangeVClassURI", rangeOptionList);
|
optionMap.put("RangeVClassURI", rangeOptionList);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -179,7 +179,7 @@ public class PropertyRetryController extends BaseEditController {
|
||||||
optionMap.put("HiddenFromDisplayBelowRoleLevelUsingRoleUri",RoleLevelOptionsSetup.getDisplayOptionsList(propertyForEditing));
|
optionMap.put("HiddenFromDisplayBelowRoleLevelUsingRoleUri",RoleLevelOptionsSetup.getDisplayOptionsList(propertyForEditing));
|
||||||
optionMap.put("ProhibitedFromUpdateBelowRoleLevelUsingRoleUri",RoleLevelOptionsSetup.getUpdateOptionsList(propertyForEditing));
|
optionMap.put("ProhibitedFromUpdateBelowRoleLevelUsingRoleUri",RoleLevelOptionsSetup.getUpdateOptionsList(propertyForEditing));
|
||||||
|
|
||||||
List groupOptList = FormUtils.makeOptionListFromBeans(getWebappDaoFactory().getPropertyGroupDao().getPublicGroups(true),"URI","Name", ((propertyForEditing.getGroupURI()==null) ? "" : propertyForEditing.getGroupURI()), null, (propertyForEditing.getGroupURI()!=null));
|
List groupOptList = FormUtils.makeOptionListFromBeans(request.getFullWebappDaoFactory().getPropertyGroupDao().getPublicGroups(true),"URI","Name", ((propertyForEditing.getGroupURI()==null) ? "" : propertyForEditing.getGroupURI()), null, (propertyForEditing.getGroupURI()!=null));
|
||||||
groupOptList.add(0,new Option("","none"));
|
groupOptList.add(0,new Option("","none"));
|
||||||
optionMap.put("GroupURI", groupOptList);
|
optionMap.put("GroupURI", groupOptList);
|
||||||
|
|
||||||
|
|
|
@ -211,7 +211,7 @@ public class RefactorOperationController extends BaseEditController {
|
||||||
// validateURI
|
// validateURI
|
||||||
String errorMsg = null;
|
String errorMsg = null;
|
||||||
try {
|
try {
|
||||||
getWebappDaoFactory().checkURI(newURIStr);
|
request.getFullWebappDaoFactory().checkURI(newURIStr);
|
||||||
} catch (InvalidPropertyURIException ipue) {
|
} catch (InvalidPropertyURIException ipue) {
|
||||||
// TODO We don't know if we're editing a property's URI or not here!
|
// TODO We don't know if we're editing a property's URI or not here!
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,18 +49,18 @@ public class RefactorRetryController extends BaseEditController {
|
||||||
epo.setFormObject(foo);
|
epo.setFormObject(foo);
|
||||||
HashMap<String,List<Option>> optMap = new HashMap<String,List<Option>>();
|
HashMap<String,List<Option>> optMap = new HashMap<String,List<Option>>();
|
||||||
foo.setOptionLists(optMap);
|
foo.setOptionLists(optMap);
|
||||||
List<Option> subjectClassOpts = FormUtils.makeOptionListFromBeans(getWebappDaoFactory().getVClassDao().getAllVclasses(),"URI","Name", null, null);
|
List<Option> subjectClassOpts = FormUtils.makeOptionListFromBeans(request.getFullWebappDaoFactory().getVClassDao().getAllVclasses(),"URI","Name", null, null);
|
||||||
subjectClassOpts.add(0,new Option("","? wildcard",true));
|
subjectClassOpts.add(0,new Option("","? wildcard",true));
|
||||||
optMap.put("SubjectClassURI", subjectClassOpts);
|
optMap.put("SubjectClassURI", subjectClassOpts);
|
||||||
optMap.put("ObjectClassURI", subjectClassOpts);
|
optMap.put("ObjectClassURI", subjectClassOpts);
|
||||||
|
|
||||||
List newPropertyOpts;
|
List newPropertyOpts;
|
||||||
if (epo.getAttribute("propertyType").equals("ObjectProperty")) {
|
if (epo.getAttribute("propertyType").equals("ObjectProperty")) {
|
||||||
List<ObjectProperty> opList = getWebappDaoFactory().getObjectPropertyDao().getAllObjectProperties();
|
List<ObjectProperty> opList = request.getFullWebappDaoFactory().getObjectPropertyDao().getAllObjectProperties();
|
||||||
Collections.sort(opList);
|
Collections.sort(opList);
|
||||||
newPropertyOpts = FormUtils.makeOptionListFromBeans(opList,"URI","LocalNameWithPrefix", null, null);
|
newPropertyOpts = FormUtils.makeOptionListFromBeans(opList,"URI","LocalNameWithPrefix", null, null);
|
||||||
} else {
|
} else {
|
||||||
List<DataProperty> dpList = getWebappDaoFactory().getDataPropertyDao().getAllDataProperties();
|
List<DataProperty> dpList = request.getFullWebappDaoFactory().getDataPropertyDao().getAllDataProperties();
|
||||||
Collections.sort(dpList);
|
Collections.sort(dpList);
|
||||||
newPropertyOpts = FormUtils.makeOptionListFromBeans(dpList,"URI","Name", null, null);
|
newPropertyOpts = FormUtils.makeOptionListFromBeans(dpList,"URI","Name", null, null);
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ public class RefactorRetryController extends BaseEditController {
|
||||||
epo.setFormObject(foo);
|
epo.setFormObject(foo);
|
||||||
HashMap<String,List<Option>> optMap = new HashMap<String,List<Option>>();
|
HashMap<String,List<Option>> optMap = new HashMap<String,List<Option>>();
|
||||||
foo.setOptionLists(optMap);
|
foo.setOptionLists(optMap);
|
||||||
List<Option> newClassURIopts = FormUtils.makeOptionListFromBeans(getWebappDaoFactory().getVClassDao().getAllVclasses(),"URI","LocalNameWithPrefix", null, null);
|
List<Option> newClassURIopts = FormUtils.makeOptionListFromBeans(request.getFullWebappDaoFactory().getVClassDao().getAllVclasses(),"URI","LocalNameWithPrefix", null, null);
|
||||||
newClassURIopts.add(new Option ("","move to trash"));
|
newClassURIopts.add(new Option ("","move to trash"));
|
||||||
optMap.put("NewVClassURI", newClassURIopts);
|
optMap.put("NewVClassURI", newClassURIopts);
|
||||||
request.setAttribute("editAction","refactorOp");
|
request.setAttribute("editAction","refactorOp");
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class RestrictionOperationController extends BaseEditController {
|
||||||
ontModel.enterCriticalSection(Lock.WRITE);
|
ontModel.enterCriticalSection(Lock.WRITE);
|
||||||
try {
|
try {
|
||||||
|
|
||||||
ontModel.getBaseModel().notifyEvent(new EditEvent(getWebappDaoFactory().getUserURI(),true));
|
ontModel.getBaseModel().notifyEvent(new EditEvent(request.getFullWebappDaoFactory().getUserURI(),true));
|
||||||
|
|
||||||
if ( request.getParameter("_action") != null && request.getParameter("_action").equals("delete") ) {
|
if ( request.getParameter("_action") != null && request.getParameter("_action").equals("delete") ) {
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ public class RestrictionOperationController extends BaseEditController {
|
||||||
}
|
}
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
ontModel.getBaseModel().notifyEvent(new EditEvent(getWebappDaoFactory().getUserURI(),false));
|
ontModel.getBaseModel().notifyEvent(new EditEvent(request.getFullWebappDaoFactory().getUserURI(),false));
|
||||||
ontModel.leaveCriticalSection();
|
ontModel.leaveCriticalSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,8 +66,8 @@ public class RestrictionRetryController extends BaseEditController {
|
||||||
boolean propertyType = ("data".equals(request.getParameter("propertyType"))) ? DATA : OBJECT ;
|
boolean propertyType = ("data".equals(request.getParameter("propertyType"))) ? DATA : OBJECT ;
|
||||||
|
|
||||||
List<Property> pList = (propertyType == OBJECT)
|
List<Property> pList = (propertyType == OBJECT)
|
||||||
? getWebappDaoFactory().getObjectPropertyDao().getAllObjectProperties()
|
? request.getFullWebappDaoFactory().getObjectPropertyDao().getAllObjectProperties()
|
||||||
: getWebappDaoFactory().getDataPropertyDao().getAllDataProperties();
|
: request.getFullWebappDaoFactory().getDataPropertyDao().getAllDataProperties();
|
||||||
List<Option> onPropertyList = new LinkedList<Option>();
|
List<Option> onPropertyList = new LinkedList<Option>();
|
||||||
Collections.sort(pList, new PropSorter());
|
Collections.sort(pList, new PropSorter());
|
||||||
for (Iterator<Property> i = pList.iterator(); i.hasNext(); ) {
|
for (Iterator<Property> i = pList.iterator(); i.hasNext(); ) {
|
||||||
|
@ -81,14 +81,14 @@ public class RestrictionRetryController extends BaseEditController {
|
||||||
if (restrictionTypeStr.equals("someValuesFrom")) {
|
if (restrictionTypeStr.equals("someValuesFrom")) {
|
||||||
request.setAttribute("specificRestrictionForm","someValuesFromRestriction_retry.jsp");
|
request.setAttribute("specificRestrictionForm","someValuesFromRestriction_retry.jsp");
|
||||||
List<Option> optionList = (propertyType == OBJECT)
|
List<Option> optionList = (propertyType == OBJECT)
|
||||||
? getValueClassOptionList()
|
? getValueClassOptionList(request)
|
||||||
: getValueDatatypeOptionList() ;
|
: getValueDatatypeOptionList(request) ;
|
||||||
epo.getFormObject().getOptionLists().put("ValueClass",optionList);
|
epo.getFormObject().getOptionLists().put("ValueClass",optionList);
|
||||||
} else if (restrictionTypeStr.equals("allValuesFrom")) {
|
} else if (restrictionTypeStr.equals("allValuesFrom")) {
|
||||||
request.setAttribute("specificRestrictionForm","allValuesFromRestriction_retry.jsp");
|
request.setAttribute("specificRestrictionForm","allValuesFromRestriction_retry.jsp");
|
||||||
List<Option> optionList = (propertyType == OBJECT)
|
List<Option> optionList = (propertyType == OBJECT)
|
||||||
? getValueClassOptionList()
|
? getValueClassOptionList(request)
|
||||||
: getValueDatatypeOptionList() ;
|
: getValueDatatypeOptionList(request) ;
|
||||||
epo.getFormObject().getOptionLists().put("ValueClass",optionList);
|
epo.getFormObject().getOptionLists().put("ValueClass",optionList);
|
||||||
} else if (restrictionTypeStr.equals("hasValue")) {
|
} else if (restrictionTypeStr.equals("hasValue")) {
|
||||||
request.setAttribute("specificRestrictionForm", "hasValueRestriction_retry.jsp");
|
request.setAttribute("specificRestrictionForm", "hasValueRestriction_retry.jsp");
|
||||||
|
@ -123,9 +123,9 @@ public class RestrictionRetryController extends BaseEditController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Option> getValueClassOptionList() {
|
private List<Option> getValueClassOptionList(VitroRequest request) {
|
||||||
List<Option> valueClassOptionList = new LinkedList<Option>();
|
List<Option> valueClassOptionList = new LinkedList<Option>();
|
||||||
VClassDao vcDao = getWebappDaoFactory().getVClassDao();
|
VClassDao vcDao = request.getFullWebappDaoFactory().getVClassDao();
|
||||||
for (Iterator i = vcDao.getAllVclasses().iterator(); i.hasNext(); ) {
|
for (Iterator i = vcDao.getAllVclasses().iterator(); i.hasNext(); ) {
|
||||||
VClass vc = (VClass) i.next();
|
VClass vc = (VClass) i.next();
|
||||||
valueClassOptionList.add(new Option(vc.getURI(), vc.getLocalNameWithPrefix()));
|
valueClassOptionList.add(new Option(vc.getURI(), vc.getLocalNameWithPrefix()));
|
||||||
|
@ -133,9 +133,9 @@ public class RestrictionRetryController extends BaseEditController {
|
||||||
return valueClassOptionList;
|
return valueClassOptionList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Option> getValueDatatypeOptionList() {
|
private List<Option> getValueDatatypeOptionList(VitroRequest request) {
|
||||||
List<Option> valueDatatypeOptionList = new LinkedList<Option>();
|
List<Option> valueDatatypeOptionList = new LinkedList<Option>();
|
||||||
DatatypeDao dtDao = getWebappDaoFactory().getDatatypeDao();
|
DatatypeDao dtDao = request.getFullWebappDaoFactory().getDatatypeDao();
|
||||||
for (Iterator i = dtDao.getAllDatatypes().iterator(); i.hasNext(); ) {
|
for (Iterator i = dtDao.getAllDatatypes().iterator(); i.hasNext(); ) {
|
||||||
Datatype dt = (Datatype) i.next();
|
Datatype dt = (Datatype) i.next();
|
||||||
valueDatatypeOptionList.add(new Option(dt.getUri(), dt.getName()));
|
valueDatatypeOptionList.add(new Option(dt.getUri(), dt.getName()));
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class SiteAdminController extends BaseEditController {
|
||||||
FormObject foo = new FormObject();
|
FormObject foo = new FormObject();
|
||||||
HashMap optionMap = new HashMap();
|
HashMap optionMap = new HashMap();
|
||||||
|
|
||||||
List classGroups = vreq.getWebappDaoFactory().getVClassGroupDao().getPublicGroupsWithVClasses(true,true,false); // order by displayRank, include uninstantiated classes, don't get the counts of individuals
|
List classGroups = vreq.getFullWebappDaoFactory().getVClassGroupDao().getPublicGroupsWithVClasses(true,true,false); // order by displayRank, include uninstantiated classes, don't get the counts of individuals
|
||||||
|
|
||||||
Iterator classGroupIt = classGroups.iterator();
|
Iterator classGroupIt = classGroups.iterator();
|
||||||
ListOrderedMap optGroupMap = new ListOrderedMap();
|
ListOrderedMap optGroupMap = new ListOrderedMap();
|
||||||
|
@ -53,9 +53,9 @@ public class SiteAdminController extends BaseEditController {
|
||||||
foo.setOptionLists(optionMap);
|
foo.setOptionLists(optionMap);
|
||||||
epo.setFormObject(foo);
|
epo.setFormObject(foo);
|
||||||
|
|
||||||
if ( (200 <= getWebappDaoFactory().getLanguageProfile()) && (getWebappDaoFactory().getLanguageProfile() < 300) ) {
|
if ( (200 <= vreq.getFullWebappDaoFactory().getLanguageProfile()) && (vreq.getFullWebappDaoFactory().getLanguageProfile() < 300) ) {
|
||||||
request.setAttribute("languageModeStr", "OWL Mode" );
|
request.setAttribute("languageModeStr", "OWL Mode" );
|
||||||
} else if ( 100 == getWebappDaoFactory().getLanguageProfile() ) {
|
} else if ( 100 == vreq.getFullWebappDaoFactory().getLanguageProfile() ) {
|
||||||
request.setAttribute("languageModeStr", "RDF Schema Mode" );
|
request.setAttribute("languageModeStr", "RDF Schema Mode" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ public class SiteAdminController extends BaseEditController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
request.setAttribute("singlePortal",new Boolean(vreq.getWebappDaoFactory().getPortalDao().isSinglePortal()));
|
request.setAttribute("singlePortal",new Boolean(vreq.getFullWebappDaoFactory().getPortalDao().isSinglePortal()));
|
||||||
|
|
||||||
RequestDispatcher rd = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
RequestDispatcher rd = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
||||||
request.setAttribute("bodyJsp","/siteAdmin/siteAdminMain.jsp");
|
request.setAttribute("bodyJsp","/siteAdmin/siteAdminMain.jsp");
|
||||||
|
|
|
@ -55,11 +55,11 @@ public class TabEditController extends BaseEditController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TabDao tDao = getWebappDaoFactory().getTabDao();
|
TabDao tDao = vreq.getFullWebappDaoFactory().getTabDao();
|
||||||
VClassDao vcDao = getWebappDaoFactory().getVClassDao();
|
VClassDao vcDao = vreq.getFullWebappDaoFactory().getVClassDao();
|
||||||
VClassGroupDao vcgDao = getWebappDaoFactory().getVClassGroupDao();
|
VClassGroupDao vcgDao = vreq.getFullWebappDaoFactory().getVClassGroupDao();
|
||||||
IndividualDao eDao = getWebappDaoFactory().getIndividualDao();
|
IndividualDao eDao = vreq.getFullWebappDaoFactory().getIndividualDao();
|
||||||
Tab t = vreq.getWebappDaoFactory().getTabDao().getTab(tabId);
|
Tab t = vreq.getFullWebappDaoFactory().getTabDao().getTab(tabId);
|
||||||
|
|
||||||
request.setAttribute("tabId",tabId);
|
request.setAttribute("tabId",tabId);
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ public class TabEditController extends BaseEditController {
|
||||||
}
|
}
|
||||||
request.setAttribute("affilTypes",types);
|
request.setAttribute("affilTypes",types);
|
||||||
|
|
||||||
TabIndividualRelationDao tirDao = getWebappDaoFactory().getTabs2EntsDao();
|
TabIndividualRelationDao tirDao = vreq.getFullWebappDaoFactory().getTabs2EntsDao();
|
||||||
List<TabIndividualRelation> tirs = tirDao.getTabIndividualRelationsByTabURI(((WebappDaoFactory)request.getSession().getServletContext().getAttribute("webappDaoFactory")).getDefaultNamespace()+"tab"+tabId);
|
List<TabIndividualRelation> tirs = tirDao.getTabIndividualRelationsByTabURI(((WebappDaoFactory)request.getSession().getServletContext().getAttribute("webappDaoFactory")).getDefaultNamespace()+"tab"+tabId);
|
||||||
List checkboxList = new ArrayList();
|
List checkboxList = new ArrayList();
|
||||||
Iterator<TabIndividualRelation> tirsIt = tirs.iterator();
|
Iterator<TabIndividualRelation> tirsIt = tirs.iterator();
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class TabHierarchyOperationController extends BaseEditController {
|
||||||
|
|
||||||
VitroRequest request = new VitroRequest(req);
|
VitroRequest request = new VitroRequest(req);
|
||||||
String defaultLandingPage = getDefaultLandingPage(request);
|
String defaultLandingPage = getDefaultLandingPage(request);
|
||||||
TabDao tDao = getWebappDaoFactory().getTabDao();
|
TabDao tDao = request.getFullWebappDaoFactory().getTabDao();
|
||||||
|
|
||||||
if (request.getParameter("_cancel") == null) {
|
if (request.getParameter("_cancel") == null) {
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class TabIndividualRelationOperationController extends
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TabIndividualRelationDao dao = getWebappDaoFactory().getTabs2EntsDao();
|
TabIndividualRelationDao dao = request.getFullWebappDaoFactory().getTabs2EntsDao();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (request.getParameter("operation").equals("remove")) {
|
if (request.getParameter("operation").equals("remove")) {
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class TabRetryController extends BaseEditController {
|
||||||
|
|
||||||
String action = "insert";
|
String action = "insert";
|
||||||
|
|
||||||
TabDao tDao = getWebappDaoFactory().getTabDao();
|
TabDao tDao = request.getFullWebappDaoFactory().getTabDao();
|
||||||
epo.setDataAccessObject(tDao);
|
epo.setDataAccessObject(tDao);
|
||||||
|
|
||||||
//set portal flag to current portal
|
//set portal flag to current portal
|
||||||
|
|
|
@ -60,10 +60,10 @@ public class Tabs2EntsRetryController extends BaseEditController {
|
||||||
|
|
||||||
String action = "insert";
|
String action = "insert";
|
||||||
|
|
||||||
TabIndividualRelationDao t2eDao = getWebappDaoFactory().getTabs2EntsDao();
|
TabIndividualRelationDao t2eDao = request.getFullWebappDaoFactory().getTabs2EntsDao();
|
||||||
epo.setDataAccessObject(t2eDao);
|
epo.setDataAccessObject(t2eDao);
|
||||||
TabDao tDao = getWebappDaoFactory().getTabDao();
|
TabDao tDao = request.getFullWebappDaoFactory().getTabDao();
|
||||||
IndividualDao eDao = getWebappDaoFactory().getIndividualDao();
|
IndividualDao eDao = request.getFullWebappDaoFactory().getIndividualDao();
|
||||||
|
|
||||||
TabIndividualRelation objectForEditing = null;
|
TabIndividualRelation objectForEditing = null;
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class Tabs2TabsRetryController extends BaseEditController {
|
||||||
|
|
||||||
String action = "insert";
|
String action = "insert";
|
||||||
|
|
||||||
TabDao tDao = getWebappDaoFactory().getTabDao();
|
TabDao tDao = request.getFullWebappDaoFactory().getTabDao();
|
||||||
|
|
||||||
Tab child = null;
|
Tab child = null;
|
||||||
Tab parent = null;
|
Tab parent = null;
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class Tabs2TypesOperationController extends BaseEditController {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TabVClassRelationDao dao = getWebappDaoFactory().getTabs2TypesDao();
|
TabVClassRelationDao dao = request.getFullWebappDaoFactory().getTabs2TypesDao();
|
||||||
|
|
||||||
if (request.getParameter("_cancel") == null) {
|
if (request.getParameter("_cancel") == null) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -59,10 +59,10 @@ public class Tabs2TypesRetryController extends BaseEditController {
|
||||||
|
|
||||||
String action = "insert";
|
String action = "insert";
|
||||||
|
|
||||||
TabVClassRelationDao t2tDao = getWebappDaoFactory().getTabs2TypesDao();
|
TabVClassRelationDao t2tDao = request.getFullWebappDaoFactory().getTabs2TypesDao();
|
||||||
epo.setDataAccessObject(t2tDao);
|
epo.setDataAccessObject(t2tDao);
|
||||||
TabDao tDao = getWebappDaoFactory().getTabDao();
|
TabDao tDao = request.getFullWebappDaoFactory().getTabDao();
|
||||||
VClassGroupDao cgDao = getWebappDaoFactory().getVClassGroupDao();
|
VClassGroupDao cgDao = request.getFullWebappDaoFactory().getVClassGroupDao();
|
||||||
|
|
||||||
TabVClassRelation objectForEditing = null;
|
TabVClassRelation objectForEditing = null;
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class UserEditController extends BaseEditController {
|
||||||
VitroRequest vreq = new VitroRequest(request);
|
VitroRequest vreq = new VitroRequest(request);
|
||||||
Portal portal = vreq.getPortal();
|
Portal portal = vreq.getPortal();
|
||||||
|
|
||||||
UserDao uDao = getWebappDaoFactory().getUserDao();
|
UserDao uDao = vreq.getFullWebappDaoFactory().getUserDao();
|
||||||
|
|
||||||
String userURIStr = request.getParameter("uri");
|
String userURIStr = request.getParameter("uri");
|
||||||
User u = null;
|
User u = null;
|
||||||
|
@ -97,7 +97,7 @@ public class UserEditController extends BaseEditController {
|
||||||
List<ObjectPropertyStatement> mayEditAsStmts =
|
List<ObjectPropertyStatement> mayEditAsStmts =
|
||||||
new ArrayList<ObjectPropertyStatement>(mayEditAsUris.size());
|
new ArrayList<ObjectPropertyStatement>(mayEditAsUris.size());
|
||||||
for(String objURI: mayEditAsUris){
|
for(String objURI: mayEditAsUris){
|
||||||
Individual editAs = getWebappDaoFactory().getIndividualDao().getIndividualByURI(objURI);
|
Individual editAs = vreq.getFullWebappDaoFactory().getIndividualDao().getIndividualByURI(objURI);
|
||||||
ObjectPropertyStatement stmt = new ObjectPropertyStatementImpl();
|
ObjectPropertyStatement stmt = new ObjectPropertyStatementImpl();
|
||||||
stmt.setSubjectURI(u.getURI());
|
stmt.setSubjectURI(u.getURI());
|
||||||
stmt.setPropertyURI(VitroVocabulary.MAY_EDIT_AS);
|
stmt.setPropertyURI(VitroVocabulary.MAY_EDIT_AS);
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class UserRetryController extends BaseEditController {
|
||||||
|
|
||||||
//create an EditProcessObject for this and put it in the session
|
//create an EditProcessObject for this and put it in the session
|
||||||
EditProcessObject epo = super.createEpo(request);
|
EditProcessObject epo = super.createEpo(request);
|
||||||
epo.setDataAccessObject(getWebappDaoFactory().getVClassDao());
|
epo.setDataAccessObject(vreq.getFullWebappDaoFactory().getVClassDao());
|
||||||
|
|
||||||
String action = null;
|
String action = null;
|
||||||
if (epo.getAction() == null) {
|
if (epo.getAction() == null) {
|
||||||
|
@ -62,7 +62,7 @@ public class UserRetryController extends BaseEditController {
|
||||||
action = epo.getAction();
|
action = epo.getAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
UserDao uDao = getWebappDaoFactory().getUserDao();
|
UserDao uDao = vreq.getFullWebappDaoFactory().getUserDao();
|
||||||
epo.setDataAccessObject(uDao);
|
epo.setDataAccessObject(uDao);
|
||||||
|
|
||||||
User userForEditing = null;
|
User userForEditing = null;
|
||||||
|
|
|
@ -53,11 +53,12 @@ public class VclassEditController extends BaseEditController {
|
||||||
EditProcessObject epo = super.createEpo(request, FORCE_NEW);
|
EditProcessObject epo = super.createEpo(request, FORCE_NEW);
|
||||||
request.setAttribute("epoKey", epo.getKey());
|
request.setAttribute("epoKey", epo.getKey());
|
||||||
|
|
||||||
VClassDao vcwDao = getWebappDaoFactory().getVClassDao();
|
VClassDao vcwDao = request.getFullWebappDaoFactory().getVClassDao();
|
||||||
VClass vcl = (VClass)vcwDao.getVClassByURI(request.getParameter("uri"));
|
VClass vcl = (VClass)vcwDao.getVClassByURI(request.getParameter("uri"));
|
||||||
|
|
||||||
if (vcl == null) {
|
if (vcl == null) {
|
||||||
if (VitroModelProperties.isRDFS(getWebappDaoFactory().getLanguageProfile()) && ( (RDF.getURI()+"Resource").equals(request.getParameter("uri")))) {
|
if (VitroModelProperties.isRDFS(request.getFullWebappDaoFactory().getLanguageProfile())
|
||||||
|
&& ( (RDF.getURI()+"Resource").equals(request.getParameter("uri")))) {
|
||||||
vcl = new VClass(RDF.getURI()+"Resource");
|
vcl = new VClass(RDF.getURI()+"Resource");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,7 +85,7 @@ public class VclassEditController extends BaseEditController {
|
||||||
String example = (vcl.getExample()==null) ? "" : vcl.getExample();
|
String example = (vcl.getExample()==null) ? "" : vcl.getExample();
|
||||||
String description = (vcl.getDescription()==null) ? "" : vcl.getDescription();
|
String description = (vcl.getDescription()==null) ? "" : vcl.getDescription();
|
||||||
|
|
||||||
WebappDaoFactory wadf = getWebappDaoFactory();
|
WebappDaoFactory wadf = request.getFullWebappDaoFactory();
|
||||||
|
|
||||||
String groupURI = vcl.getGroupURI();
|
String groupURI = vcl.getGroupURI();
|
||||||
String groupName = "none";
|
String groupName = "none";
|
||||||
|
@ -98,7 +99,7 @@ public class VclassEditController extends BaseEditController {
|
||||||
|
|
||||||
boolean foundComment = false;
|
boolean foundComment = false;
|
||||||
StringBuffer commSb = null;
|
StringBuffer commSb = null;
|
||||||
for (Iterator<String> commIt = getWebappDaoFactory().getCommentsForResource(vcl.getURI()).iterator(); commIt.hasNext();) {
|
for (Iterator<String> commIt = request.getFullWebappDaoFactory().getCommentsForResource(vcl.getURI()).iterator(); commIt.hasNext();) {
|
||||||
if (commSb==null) {
|
if (commSb==null) {
|
||||||
commSb = new StringBuffer();
|
commSb = new StringBuffer();
|
||||||
foundComment=true;
|
foundComment=true;
|
||||||
|
@ -145,10 +146,10 @@ public class VclassEditController extends BaseEditController {
|
||||||
|
|
||||||
// if supported, we want to show only the asserted superclasses and subclasses. Don't want to see anonymous classes, restrictions, etc.
|
// if supported, we want to show only the asserted superclasses and subclasses. Don't want to see anonymous classes, restrictions, etc.
|
||||||
VClassDao vcDao;
|
VClassDao vcDao;
|
||||||
if (getAssertionsWebappDaoFactory() != null) {
|
if (request.getAssertionsWebappDaoFactory() != null) {
|
||||||
vcDao = getAssertionsWebappDaoFactory().getVClassDao();
|
vcDao = request.getAssertionsWebappDaoFactory().getVClassDao();
|
||||||
} else {
|
} else {
|
||||||
vcDao = getWebappDaoFactory().getVClassDao();
|
vcDao = request.getFullWebappDaoFactory().getVClassDao();
|
||||||
}
|
}
|
||||||
List superURIs = vcDao.getSuperClassURIs(vcl.getURI(),false);
|
List superURIs = vcDao.getSuperClassURIs(vcl.getURI(),false);
|
||||||
List superVClasses = new ArrayList();
|
List superVClasses = new ArrayList();
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class VclassRetryController extends BaseEditController {
|
||||||
|
|
||||||
//create an EditProcessObject for this and put it in the session
|
//create an EditProcessObject for this and put it in the session
|
||||||
EditProcessObject epo = super.createEpo(request);
|
EditProcessObject epo = super.createEpo(request);
|
||||||
epo.setDataAccessObject(getWebappDaoFactory().getVClassDao());
|
epo.setDataAccessObject(request.getFullWebappDaoFactory().getVClassDao());
|
||||||
|
|
||||||
/*for testing*/
|
/*for testing*/
|
||||||
VClass testMask = new VClass();
|
VClass testMask = new VClass();
|
||||||
|
@ -72,10 +72,10 @@ public class VclassRetryController extends BaseEditController {
|
||||||
action = epo.getAction();
|
action = epo.getAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
VClassDao vcwDao = getWebappDaoFactory().getVClassDao();
|
VClassDao vcwDao = request.getFullWebappDaoFactory().getVClassDao();
|
||||||
epo.setDataAccessObject(vcwDao);
|
epo.setDataAccessObject(vcwDao);
|
||||||
VClassGroupDao cgDao = getWebappDaoFactory().getVClassGroupDao();
|
VClassGroupDao cgDao = request.getFullWebappDaoFactory().getVClassGroupDao();
|
||||||
OntologyDao oDao = getWebappDaoFactory().getOntologyDao();
|
OntologyDao oDao = request.getFullWebappDaoFactory().getOntologyDao();
|
||||||
|
|
||||||
VClass vclassForEditing = null;
|
VClass vclassForEditing = null;
|
||||||
if (!epo.getUseRecycledBean()){
|
if (!epo.getUseRecycledBean()){
|
||||||
|
@ -118,7 +118,7 @@ public class VclassRetryController extends BaseEditController {
|
||||||
//set up any listeners
|
//set up any listeners
|
||||||
List changeListenerList = new LinkedList();
|
List changeListenerList = new LinkedList();
|
||||||
if (request.getParameter("superclassUri") != null) {
|
if (request.getParameter("superclassUri") != null) {
|
||||||
changeListenerList.add(new SubclassListener(request.getParameter("superclassUri"),getWebappDaoFactory()));
|
changeListenerList.add(new SubclassListener(request.getParameter("superclassUri"), request.getFullWebappDaoFactory()));
|
||||||
}
|
}
|
||||||
epo.setChangeListenerList(changeListenerList);
|
epo.setChangeListenerList(changeListenerList);
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ public class VclassRetryController extends BaseEditController {
|
||||||
|
|
||||||
HashMap<String,List> optionMap = new HashMap<String,List>();
|
HashMap<String,List> optionMap = new HashMap<String,List>();
|
||||||
try {
|
try {
|
||||||
VClassGroupDao vcgDao = getWebappDaoFactory().getVClassGroupDao();
|
VClassGroupDao vcgDao = request.getFullWebappDaoFactory().getVClassGroupDao();
|
||||||
List classGroupOptionList = FormUtils.makeOptionListFromBeans(vcgDao.getPublicGroupsWithVClasses(),"URI","PublicName",vclassForEditing.getGroupURI(),null,(vclassForEditing.getGroupURI()!=null && !(vclassForEditing.getGroupURI().equals(""))));
|
List classGroupOptionList = FormUtils.makeOptionListFromBeans(vcgDao.getPublicGroupsWithVClasses(),"URI","PublicName",vclassForEditing.getGroupURI(),null,(vclassForEditing.getGroupURI()!=null && !(vclassForEditing.getGroupURI().equals(""))));
|
||||||
classGroupOptionList.add(new Option("", "none", ("update".equals(action) && (vclassForEditing.getGroupURI()==null || vclassForEditing.getGroupURI().equals("")))));
|
classGroupOptionList.add(new Option("", "none", ("update".equals(action) && (vclassForEditing.getGroupURI()==null || vclassForEditing.getGroupURI().equals("")))));
|
||||||
optionMap.put("GroupURI", classGroupOptionList);
|
optionMap.put("GroupURI", classGroupOptionList);
|
||||||
|
@ -156,7 +156,7 @@ public class VclassRetryController extends BaseEditController {
|
||||||
List namespaceIdList = (action.equals("insert"))
|
List namespaceIdList = (action.equals("insert"))
|
||||||
? FormUtils.makeOptionListFromBeans(oDao.getAllOntologies(),"URI","Name", ((vclassForEditing.getNamespace()==null) ? "" : vclassForEditing.getNamespace()), null, false)
|
? FormUtils.makeOptionListFromBeans(oDao.getAllOntologies(),"URI","Name", ((vclassForEditing.getNamespace()==null) ? "" : vclassForEditing.getNamespace()), null, false)
|
||||||
: FormUtils.makeOptionListFromBeans(oDao.getAllOntologies(),"URI","Name", ((vclassForEditing.getNamespace()==null) ? "" : vclassForEditing.getNamespace()), null, true);
|
: FormUtils.makeOptionListFromBeans(oDao.getAllOntologies(),"URI","Name", ((vclassForEditing.getNamespace()==null) ? "" : vclassForEditing.getNamespace()), null, true);
|
||||||
namespaceIdList.add(new Option(getWebappDaoFactory().getDefaultNamespace(),"default"));
|
namespaceIdList.add(new Option(request.getFullWebappDaoFactory().getDefaultNamespace(),"default"));
|
||||||
optionMap.put("Namespace", namespaceIdList);
|
optionMap.put("Namespace", namespaceIdList);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(this.getClass().getName() + "unable to create Namespace option list");
|
log.error(this.getClass().getName() + "unable to create Namespace option list");
|
||||||
|
|
|
@ -30,11 +30,13 @@ public class AllClassGroupsListingController extends BaseEditController {
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
}
|
}
|
||||||
Portal portal = (new VitroRequest(request)).getPortal();
|
|
||||||
|
VitroRequest vreq = new VitroRequest(request);
|
||||||
|
Portal portal = vreq.getPortal();
|
||||||
|
|
||||||
//need to figure out how to structure the results object to put the classes underneath
|
//need to figure out how to structure the results object to put the classes underneath
|
||||||
|
|
||||||
VClassGroupDao dao = getWebappDaoFactory().getVClassGroupDao();
|
VClassGroupDao dao = vreq.getFullWebappDaoFactory().getVClassGroupDao();
|
||||||
|
|
||||||
List groups = dao.getPublicGroupsWithVClasses(); // uses an unfiltered dao so will see all classes
|
List groups = dao.getPublicGroupsWithVClasses(); // uses an unfiltered dao so will see all classes
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class AllTabsForPortalListingController extends BaseEditController {
|
||||||
types.put(26,"primary tab content");
|
types.put(26,"primary tab content");
|
||||||
types.put(28,"primary tab");
|
types.put(28,"primary tab");
|
||||||
|
|
||||||
TabDao dao = getWebappDaoFactory().getTabDao();
|
TabDao dao = vrequest.getFullWebappDaoFactory().getTabDao();
|
||||||
List tabs = dao.getTabsForPortal(portal.getPortalId());
|
List tabs = dao.getTabsForPortal(portal.getPortalId());
|
||||||
Collections.sort(tabs, new TabComparator());
|
Collections.sort(tabs, new TabComparator());
|
||||||
|
|
||||||
|
|
|
@ -63,10 +63,10 @@ public class ClassHierarchyListingController extends BaseEditController {
|
||||||
|
|
||||||
boolean inferred = (vrequest.getParameter("inferred") != null);
|
boolean inferred = (vrequest.getParameter("inferred") != null);
|
||||||
|
|
||||||
if (getAssertionsWebappDaoFactory() != null && !inferred) {
|
if (vrequest.getAssertionsWebappDaoFactory() != null && !inferred) {
|
||||||
vcDao = getAssertionsWebappDaoFactory().getVClassDao();
|
vcDao = vrequest.getAssertionsWebappDaoFactory().getVClassDao();
|
||||||
} else {
|
} else {
|
||||||
vcDao = getWebappDaoFactory().getVClassDao();
|
vcDao = vrequest.getFullWebappDaoFactory().getVClassDao();
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList results = new ArrayList();
|
ArrayList results = new ArrayList();
|
||||||
|
@ -94,7 +94,7 @@ public class ClassHierarchyListingController extends BaseEditController {
|
||||||
/* TODO: this needs more thinking */
|
/* TODO: this needs more thinking */
|
||||||
if (false) { // (getWebappDaoFactory() instanceof WebappDaoFactoryJena) {
|
if (false) { // (getWebappDaoFactory() instanceof WebappDaoFactoryJena) {
|
||||||
String topConceptURI = null;
|
String topConceptURI = null;
|
||||||
int langProfile = ((WebappDaoFactoryJena)getWebappDaoFactory()).getLanguageProfile();
|
int langProfile = ((WebappDaoFactoryJena) vrequest.getFullWebappDaoFactory()).getLanguageProfile();
|
||||||
if (langProfile==WebappDaoFactoryJena.OWL_CONST) {
|
if (langProfile==WebappDaoFactoryJena.OWL_CONST) {
|
||||||
topConceptURI = OWL.Thing.getURI();
|
topConceptURI = OWL.Thing.getURI();
|
||||||
} else if (langProfile==WebappDaoFactoryJena.RDFS_CONST) {
|
} else if (langProfile==WebappDaoFactoryJena.RDFS_CONST) {
|
||||||
|
@ -115,9 +115,9 @@ public class ClassHierarchyListingController extends BaseEditController {
|
||||||
// DEBUGGING
|
// DEBUGGING
|
||||||
if (roots == null) {
|
if (roots == null) {
|
||||||
roots = new LinkedList<VClass>();
|
roots = new LinkedList<VClass>();
|
||||||
if (VitroModelProperties.isOWL(getWebappDaoFactory().getLanguageProfile())) {
|
if (VitroModelProperties.isOWL(vrequest.getFullWebappDaoFactory().getLanguageProfile())) {
|
||||||
roots.add(vcDao.getVClassByURI(OWL.Thing.getURI()));
|
roots.add(vcDao.getVClassByURI(OWL.Thing.getURI()));
|
||||||
} else if (VitroModelProperties.isRDFS(getWebappDaoFactory().getLanguageProfile())) {
|
} else if (VitroModelProperties.isRDFS(vrequest.getFullWebappDaoFactory().getLanguageProfile())) {
|
||||||
roots.add(new VClass(RDF.getURI()+"Resource"));
|
roots.add(new VClass(RDF.getURI()+"Resource"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,13 +128,13 @@ public class ClassHierarchyListingController extends BaseEditController {
|
||||||
if (!rootIt.hasNext()) {
|
if (!rootIt.hasNext()) {
|
||||||
VClass vcw = new VClass();
|
VClass vcw = new VClass();
|
||||||
vcw.setName("<strong>No classes found.</strong>");
|
vcw.setName("<strong>No classes found.</strong>");
|
||||||
results.addAll(addVClassDataToResultsList(vcw,0,ontologyUri));
|
results.addAll(addVClassDataToResultsList(vrequest.getFullWebappDaoFactory(), vcw,0,ontologyUri));
|
||||||
} else {
|
} else {
|
||||||
while (rootIt.hasNext()) {
|
while (rootIt.hasNext()) {
|
||||||
VClass root = (VClass) rootIt.next();
|
VClass root = (VClass) rootIt.next();
|
||||||
if (root != null) {
|
if (root != null) {
|
||||||
ArrayList childResults = new ArrayList();
|
ArrayList childResults = new ArrayList();
|
||||||
addChildren(root, childResults, 0, ontologyUri);
|
addChildren(vrequest.getFullWebappDaoFactory(), root, childResults, 0, ontologyUri);
|
||||||
results.addAll(childResults);
|
results.addAll(childResults);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -201,8 +201,8 @@ public class ClassHierarchyListingController extends BaseEditController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addChildren(VClass parent, ArrayList list, int position, String ontologyUri) {
|
private void addChildren(WebappDaoFactory wadf, VClass parent, ArrayList list, int position, String ontologyUri) {
|
||||||
List rowElts = addVClassDataToResultsList(parent, position, ontologyUri);
|
List rowElts = addVClassDataToResultsList(wadf, parent, position, ontologyUri);
|
||||||
int childShift = (rowElts.size() > 0) ? 1 : 0; // if addVClassDataToResultsList filtered out the result, don't shift the children over
|
int childShift = (rowElts.size() > 0) ? 1 : 0; // if addVClassDataToResultsList filtered out the result, don't shift the children over
|
||||||
list.addAll(rowElts);
|
list.addAll(rowElts);
|
||||||
List childURIstrs = vcDao.getSubClassURIs(parent.getURI());
|
List childURIstrs = vcDao.getSubClassURIs(parent.getURI());
|
||||||
|
@ -222,13 +222,13 @@ public class ClassHierarchyListingController extends BaseEditController {
|
||||||
Iterator childClassIt = childClasses.iterator();
|
Iterator childClassIt = childClasses.iterator();
|
||||||
while (childClassIt.hasNext()) {
|
while (childClassIt.hasNext()) {
|
||||||
VClass child = (VClass) childClassIt.next();
|
VClass child = (VClass) childClassIt.next();
|
||||||
addChildren(child, list, position + childShift, ontologyUri);
|
addChildren(wadf, child, list, position + childShift, ontologyUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List addVClassDataToResultsList(VClass vcw, int position, String ontologyUri) {
|
private List addVClassDataToResultsList(WebappDaoFactory wadf, VClass vcw, int position, String ontologyUri) {
|
||||||
List results = new ArrayList();
|
List results = new ArrayList();
|
||||||
if (ontologyUri == null || ( (vcw.getNamespace()!=null) && (vcw.getNamespace().equals(ontologyUri)) ) ) {
|
if (ontologyUri == null || ( (vcw.getNamespace()!=null) && (vcw.getNamespace().equals(ontologyUri)) ) ) {
|
||||||
for (int i=0; i<position; i++) {
|
for (int i=0; i<position; i++) {
|
||||||
|
@ -247,7 +247,6 @@ public class ClassHierarchyListingController extends BaseEditController {
|
||||||
numCols = addColToResults(((vcw.getExample() == null) ? "" : vcw.getExample()), results, numCols); // column 4
|
numCols = addColToResults(((vcw.getExample() == null) ? "" : vcw.getExample()), results, numCols); // column 4
|
||||||
|
|
||||||
// Get group name if it exists
|
// Get group name if it exists
|
||||||
WebappDaoFactory wadf = getWebappDaoFactory();
|
|
||||||
VClassGroupDao groupDao= wadf.getVClassGroupDao();
|
VClassGroupDao groupDao= wadf.getVClassGroupDao();
|
||||||
String groupURI = vcw.getGroupURI();
|
String groupURI = vcw.getGroupURI();
|
||||||
String groupName = null;
|
String groupName = null;
|
||||||
|
|
|
@ -60,10 +60,10 @@ public class DataPropertyHierarchyListingController extends BaseEditController {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
dpDao = getWebappDaoFactory().getDataPropertyDao();
|
dpDao = vrequest.getFullWebappDaoFactory().getDataPropertyDao();
|
||||||
vcDao = getWebappDaoFactory().getVClassDao();
|
vcDao = vrequest.getFullWebappDaoFactory().getVClassDao();
|
||||||
pgDao = getWebappDaoFactory().getPropertyGroupDao();
|
pgDao = vrequest.getFullWebappDaoFactory().getPropertyGroupDao();
|
||||||
dDao = getWebappDaoFactory().getDatatypeDao();
|
dDao = vrequest.getFullWebappDaoFactory().getDatatypeDao();
|
||||||
|
|
||||||
ArrayList results = new ArrayList();
|
ArrayList results = new ArrayList();
|
||||||
results.add("XX"); // column 1
|
results.add("XX"); // column 1
|
||||||
|
|
|
@ -77,9 +77,9 @@ public class DataPropertyStatementListingController extends BaseEditController {
|
||||||
results.add("property");
|
results.add("property");
|
||||||
results.add("object");
|
results.add("object");
|
||||||
|
|
||||||
DataPropertyStatementDao dpsDao = getWebappDaoFactory().getDataPropertyStatementDao();
|
DataPropertyStatementDao dpsDao = vrequest.getFullWebappDaoFactory().getDataPropertyStatementDao();
|
||||||
DataPropertyDao dpDao = getWebappDaoFactory().getDataPropertyDao();
|
DataPropertyDao dpDao = vrequest.getFullWebappDaoFactory().getDataPropertyDao();
|
||||||
IndividualDao iDao = getWebappDaoFactory().getIndividualDao();
|
IndividualDao iDao = vrequest.getFullWebappDaoFactory().getIndividualDao();
|
||||||
|
|
||||||
String propURIStr = request.getParameter("propertyURI");
|
String propURIStr = request.getParameter("propertyURI");
|
||||||
|
|
||||||
|
|
|
@ -52,10 +52,10 @@ public class DatatypePropertiesListingController extends BaseEditController {
|
||||||
|
|
||||||
String ontologyUri = request.getParameter("ontologyUri");
|
String ontologyUri = request.getParameter("ontologyUri");
|
||||||
|
|
||||||
DataPropertyDao dao = getWebappDaoFactory().getDataPropertyDao();
|
DataPropertyDao dao = vrequest.getFullWebappDaoFactory().getDataPropertyDao();
|
||||||
VClassDao vcDao = getWebappDaoFactory().getVClassDao();
|
VClassDao vcDao = vrequest.getFullWebappDaoFactory().getVClassDao();
|
||||||
DatatypeDao dDao = getWebappDaoFactory().getDatatypeDao();
|
DatatypeDao dDao = vrequest.getFullWebappDaoFactory().getDatatypeDao();
|
||||||
PropertyGroupDao pgDao = getWebappDaoFactory().getPropertyGroupDao();
|
PropertyGroupDao pgDao = vrequest.getFullWebappDaoFactory().getPropertyGroupDao();
|
||||||
|
|
||||||
List props = new ArrayList();
|
List props = new ArrayList();
|
||||||
|
|
||||||
|
|
|
@ -47,10 +47,10 @@ public class IndividualsListingController extends BaseEditController {
|
||||||
WebappDaoFactory wadf = null;
|
WebappDaoFactory wadf = null;
|
||||||
|
|
||||||
if (assertedOnlyStr != null && assertedOnlyStr.equalsIgnoreCase("true")) {
|
if (assertedOnlyStr != null && assertedOnlyStr.equalsIgnoreCase("true")) {
|
||||||
wadf = getAssertionsWebappDaoFactory();
|
wadf = vrequest.getAssertionsWebappDaoFactory();
|
||||||
}
|
}
|
||||||
if (wadf == null) {
|
if (wadf == null) {
|
||||||
wadf = getWebappDaoFactory();
|
wadf = vrequest.getFullWebappDaoFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
IndividualDao dao = wadf.getIndividualDao();
|
IndividualDao dao = wadf.getIndividualDao();
|
||||||
|
|
|
@ -59,9 +59,9 @@ public class ObjectPropertyHierarchyListingController extends BaseEditController
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
opDao = getWebappDaoFactory().getObjectPropertyDao();
|
opDao = vrequest.getFullWebappDaoFactory().getObjectPropertyDao();
|
||||||
vcDao = getWebappDaoFactory().getVClassDao();
|
vcDao = vrequest.getFullWebappDaoFactory().getVClassDao();
|
||||||
pgDao = getWebappDaoFactory().getPropertyGroupDao();
|
pgDao = vrequest.getFullWebappDaoFactory().getPropertyGroupDao();
|
||||||
|
|
||||||
ArrayList results = new ArrayList();
|
ArrayList results = new ArrayList();
|
||||||
results.add("XX"); // column 1
|
results.add("XX"); // column 1
|
||||||
|
|
|
@ -98,19 +98,19 @@ public class ObjectPropertyStatementListingController extends
|
||||||
|
|
||||||
ObjectPropertyStatementDao opsDao = null;
|
ObjectPropertyStatementDao opsDao = null;
|
||||||
if (assertedStatementsOnly){ // get only asserted, not inferred, object property statements
|
if (assertedStatementsOnly){ // get only asserted, not inferred, object property statements
|
||||||
opsDao = getAssertionsWebappDaoFactory().getObjectPropertyStatementDao();
|
opsDao = vrequest.getAssertionsWebappDaoFactory().getObjectPropertyStatementDao();
|
||||||
} else {
|
} else {
|
||||||
opsDao = getWebappDaoFactory().getObjectPropertyStatementDao();
|
opsDao = vrequest.getFullWebappDaoFactory().getObjectPropertyStatementDao();
|
||||||
}
|
}
|
||||||
|
|
||||||
// get all object properties -- no concept of asserted vs. inferred object properties
|
// get all object properties -- no concept of asserted vs. inferred object properties
|
||||||
ObjectPropertyDao opDao = getWebappDaoFactory().getObjectPropertyDao();
|
ObjectPropertyDao opDao = vrequest.getFullWebappDaoFactory().getObjectPropertyDao();
|
||||||
|
|
||||||
IndividualDao iDao = null;
|
IndividualDao iDao = null;
|
||||||
if (showVClasses) {
|
if (showVClasses) {
|
||||||
iDao = getAssertionsWebappDaoFactory().getIndividualDao();
|
iDao = vrequest.getAssertionsWebappDaoFactory().getIndividualDao();
|
||||||
} else {
|
} else {
|
||||||
iDao = getWebappDaoFactory().getIndividualDao();
|
iDao = vrequest.getFullWebappDaoFactory().getIndividualDao();
|
||||||
}
|
}
|
||||||
|
|
||||||
String propURIStr = request.getParameter("propertyURI");
|
String propURIStr = request.getParameter("propertyURI");
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class OntologiesListingController extends BaseEditController {
|
||||||
|
|
||||||
String noResultsMsgStr = "No ontologies found";
|
String noResultsMsgStr = "No ontologies found";
|
||||||
|
|
||||||
OntologyDao dao = getWebappDaoFactory().getOntologyDao();
|
OntologyDao dao = vrequest.getFullWebappDaoFactory().getOntologyDao();
|
||||||
|
|
||||||
List onts = dao.getAllOntologies();
|
List onts = dao.getAllOntologies();
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class PortalsListingController extends BaseEditController {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
PortalDao dao = getWebappDaoFactory().getPortalDao();
|
PortalDao dao = vrequest.getFullWebappDaoFactory().getPortalDao();
|
||||||
|
|
||||||
Collection portals = dao.getAllPortals();
|
Collection portals = dao.getAllPortals();
|
||||||
|
|
||||||
|
|
|
@ -36,11 +36,13 @@ public class PropertyGroupsListingController extends BaseEditController {
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
}
|
}
|
||||||
Portal portal = (new VitroRequest(request)).getPortal();
|
|
||||||
|
VitroRequest vrequest = new VitroRequest(request);
|
||||||
|
Portal portal = vrequest.getPortal();
|
||||||
|
|
||||||
//need to figure out how to structure the results object to put the classes underneath
|
//need to figure out how to structure the results object to put the classes underneath
|
||||||
|
|
||||||
PropertyGroupDao dao = getWebappDaoFactory().getPropertyGroupDao();
|
PropertyGroupDao dao = vrequest.getFullWebappDaoFactory().getPropertyGroupDao();
|
||||||
|
|
||||||
List groups = dao.getPublicGroups(true);
|
List groups = dao.getPublicGroups(true);
|
||||||
|
|
||||||
|
|
|
@ -59,10 +59,10 @@ public class PropertyWebappsListingController extends BaseEditController {
|
||||||
|
|
||||||
String ontologyUri = request.getParameter("ontologyUri");
|
String ontologyUri = request.getParameter("ontologyUri");
|
||||||
|
|
||||||
ObjectPropertyDao dao = getWebappDaoFactory().getObjectPropertyDao();
|
ObjectPropertyDao dao = vrequest.getFullWebappDaoFactory().getObjectPropertyDao();
|
||||||
PropertyInstanceDao piDao = getWebappDaoFactory().getPropertyInstanceDao();
|
PropertyInstanceDao piDao = vrequest.getFullWebappDaoFactory().getPropertyInstanceDao();
|
||||||
VClassDao vcDao = getWebappDaoFactory().getVClassDao();
|
VClassDao vcDao = vrequest.getFullWebappDaoFactory().getVClassDao();
|
||||||
PropertyGroupDao pgDao = getWebappDaoFactory().getPropertyGroupDao();
|
PropertyGroupDao pgDao = vrequest.getFullWebappDaoFactory().getPropertyGroupDao();
|
||||||
|
|
||||||
List props = new ArrayList();
|
List props = new ArrayList();
|
||||||
if (request.getParameter("propsForClass") != null) {
|
if (request.getParameter("propsForClass") != null) {
|
||||||
|
@ -86,7 +86,7 @@ public class PropertyWebappsListingController extends BaseEditController {
|
||||||
: dao.getAllObjectProperties();
|
: dao.getAllObjectProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
OntologyDao oDao=getWebappDaoFactory().getOntologyDao();
|
OntologyDao oDao = vrequest.getFullWebappDaoFactory().getOntologyDao();
|
||||||
HashMap<String,String> ontologyHash = new HashMap<String,String>();
|
HashMap<String,String> ontologyHash = new HashMap<String,String>();
|
||||||
|
|
||||||
Iterator propIt = props.iterator();
|
Iterator propIt = props.iterator();
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class UsersListingController extends BaseEditController {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
UserDao dao = getWebappDaoFactory().getUserDao();
|
UserDao dao = vrequest.getFullWebappDaoFactory().getUserDao();
|
||||||
|
|
||||||
List<User> users = dao.getAllUsers();
|
List<User> users = dao.getAllUsers();
|
||||||
Collections.sort(users);
|
Collections.sort(users);
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class VClassWebappWithInstancesListingController extends BaseEditControll
|
||||||
|
|
||||||
if(uriStr != null) {
|
if(uriStr != null) {
|
||||||
|
|
||||||
VClassDao dao = getWebappDaoFactory().getVClassDao();
|
VClassDao dao = vrequest.getFullWebappDaoFactory().getVClassDao();
|
||||||
|
|
||||||
results.add("XX");
|
results.add("XX");
|
||||||
results.add("name");
|
results.add("name");
|
||||||
|
@ -72,7 +72,7 @@ public class VClassWebappWithInstancesListingController extends BaseEditControll
|
||||||
results.add(lastModifiedStr);
|
results.add(lastModifiedStr);
|
||||||
results.add("XX");
|
results.add("XX");
|
||||||
|
|
||||||
IndividualDao ewDao = getWebappDaoFactory().getIndividualDao();
|
IndividualDao ewDao = vrequest.getFullWebappDaoFactory().getIndividualDao();
|
||||||
|
|
||||||
List ents = ewDao.getIndividualsByVClassURI(vcw.getURI(), -2, -2);
|
List ents = ewDao.getIndividualsByVClassURI(vcw.getURI(), -2, -2);
|
||||||
if (ents != null && ents.size()>0) {
|
if (ents != null && ents.size()>0) {
|
||||||
|
|
|
@ -49,10 +49,10 @@ public class VClassWebappsListingController extends BaseEditController {
|
||||||
List<VClass> classes = null;
|
List<VClass> classes = null;
|
||||||
|
|
||||||
if (request.getParameter("showPropertyRestrictions") != null) {
|
if (request.getParameter("showPropertyRestrictions") != null) {
|
||||||
PropertyDao pdao = getWebappDaoFactory().getObjectPropertyDao();
|
PropertyDao pdao = vrequest.getFullWebappDaoFactory().getObjectPropertyDao();
|
||||||
classes = pdao.getClassesWithRestrictionOnProperty(request.getParameter("propertyURI"));
|
classes = pdao.getClassesWithRestrictionOnProperty(request.getParameter("propertyURI"));
|
||||||
} else {
|
} else {
|
||||||
VClassDao vcdao = getWebappDaoFactory().getVClassDao();
|
VClassDao vcdao = vrequest.getFullWebappDaoFactory().getVClassDao();
|
||||||
|
|
||||||
if (request.getParameter("iffRoot") != null) {
|
if (request.getParameter("iffRoot") != null) {
|
||||||
classes = vcdao.getRootClasses();
|
classes = vcdao.getRootClasses();
|
||||||
|
@ -94,12 +94,12 @@ public class VClassWebappsListingController extends BaseEditController {
|
||||||
String shortDef = (cls.getShortDef()==null) ? "" : cls.getShortDef();
|
String shortDef = (cls.getShortDef()==null) ? "" : cls.getShortDef();
|
||||||
String example = (cls.getExample()==null) ? "" : cls.getExample();
|
String example = (cls.getExample()==null) ? "" : cls.getExample();
|
||||||
StringBuffer commSb = new StringBuffer();
|
StringBuffer commSb = new StringBuffer();
|
||||||
for (Iterator<String> commIt = getWebappDaoFactory().getCommentsForResource(cls.getURI()).iterator(); commIt.hasNext();) {
|
for (Iterator<String> commIt = vrequest.getFullWebappDaoFactory().getCommentsForResource(cls.getURI()).iterator(); commIt.hasNext();) {
|
||||||
commSb.append(commIt.next()).append(" ");
|
commSb.append(commIt.next()).append(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
// get group name
|
// get group name
|
||||||
WebappDaoFactory wadf = getWebappDaoFactory();
|
WebappDaoFactory wadf = vrequest.getFullWebappDaoFactory();
|
||||||
VClassGroupDao groupDao= wadf.getVClassGroupDao();
|
VClassGroupDao groupDao= wadf.getVClassGroupDao();
|
||||||
String groupURI = cls.getGroupURI();
|
String groupURI = cls.getGroupURI();
|
||||||
String groupName = "";
|
String groupName = "";
|
||||||
|
|
|
@ -62,8 +62,9 @@ public class RestrictionsListingController extends BaseEditController {
|
||||||
|
|
||||||
OntModel ontModel = (OntModel) getServletContext().getAttribute("jenaOntModel");
|
OntModel ontModel = (OntModel) getServletContext().getAttribute("jenaOntModel");
|
||||||
|
|
||||||
ObjectPropertyDao opDao = getWebappDaoFactory().getObjectPropertyDao();
|
ObjectPropertyDao opDao = vrequest.getFullWebappDaoFactory().getObjectPropertyDao();
|
||||||
IndividualDao iDao = getWebappDaoFactory().getIndividualDao();
|
VClassDao vcDao = vrequest.getFullWebappDaoFactory().getVClassDao();
|
||||||
|
IndividualDao iDao = vrequest.getFullWebappDaoFactory().getIndividualDao();
|
||||||
|
|
||||||
ArrayList results = new ArrayList();
|
ArrayList results = new ArrayList();
|
||||||
request.setAttribute("results",results);
|
request.setAttribute("results",results);
|
||||||
|
@ -84,7 +85,7 @@ public class RestrictionsListingController extends BaseEditController {
|
||||||
try {
|
try {
|
||||||
for (Iterator i = superClassIt; i.hasNext(); ) {
|
for (Iterator i = superClassIt; i.hasNext(); ) {
|
||||||
OntClass superClass = (OntClass) i.next();
|
OntClass superClass = (OntClass) i.next();
|
||||||
tryRestriction(superClass, opDao, iDao, results, vClassURI);
|
tryRestriction(superClass, vcDao, opDao, iDao, results, vClassURI);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
superClassIt.close();
|
superClassIt.close();
|
||||||
|
@ -93,7 +94,7 @@ public class RestrictionsListingController extends BaseEditController {
|
||||||
try {
|
try {
|
||||||
for (Iterator i = equivClassIt; i.hasNext(); ) {
|
for (Iterator i = equivClassIt; i.hasNext(); ) {
|
||||||
OntClass superClass = (OntClass) i.next();
|
OntClass superClass = (OntClass) i.next();
|
||||||
tryRestriction(superClass, opDao, iDao, results, vClassURI);
|
tryRestriction(superClass, vcDao, opDao, iDao, results, vClassURI);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
equivClassIt.close();
|
equivClassIt.close();
|
||||||
|
@ -126,7 +127,7 @@ public class RestrictionsListingController extends BaseEditController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void tryRestriction(OntClass theClass, ObjectPropertyDao opDao, IndividualDao iDao, ArrayList results, String vClassURI) {
|
private void tryRestriction(OntClass theClass, VClassDao vcDao, ObjectPropertyDao opDao, IndividualDao iDao, ArrayList results, String vClassURI) {
|
||||||
if (theClass.isRestriction()) {
|
if (theClass.isRestriction()) {
|
||||||
Restriction rest = (Restriction) theClass.as(Restriction.class);
|
Restriction rest = (Restriction) theClass.as(Restriction.class);
|
||||||
try {
|
try {
|
||||||
|
@ -138,12 +139,12 @@ public class RestrictionsListingController extends BaseEditController {
|
||||||
results.add("all values from");
|
results.add("all values from");
|
||||||
AllValuesFromRestriction avfrest = (AllValuesFromRestriction) rest.as(AllValuesFromRestriction.class);
|
AllValuesFromRestriction avfrest = (AllValuesFromRestriction) rest.as(AllValuesFromRestriction.class);
|
||||||
Resource allValuesFrom = avfrest.getAllValuesFrom();
|
Resource allValuesFrom = avfrest.getAllValuesFrom();
|
||||||
results.add(printAsClass(allValuesFrom));
|
results.add(printAsClass(vcDao, allValuesFrom));
|
||||||
} else if (rest.isSomeValuesFromRestriction()) {
|
} else if (rest.isSomeValuesFromRestriction()) {
|
||||||
results.add("some values from");
|
results.add("some values from");
|
||||||
SomeValuesFromRestriction svfrest = (SomeValuesFromRestriction) rest.as(SomeValuesFromRestriction.class);
|
SomeValuesFromRestriction svfrest = (SomeValuesFromRestriction) rest.as(SomeValuesFromRestriction.class);
|
||||||
Resource someValuesFrom = svfrest.getSomeValuesFrom();
|
Resource someValuesFrom = svfrest.getSomeValuesFrom();
|
||||||
results.add(printAsClass(someValuesFrom));
|
results.add(printAsClass(vcDao, someValuesFrom));
|
||||||
} else if (rest.isHasValueRestriction()) {
|
} else if (rest.isHasValueRestriction()) {
|
||||||
results.add("has value");
|
results.add("has value");
|
||||||
HasValueRestriction hvrest = (HasValueRestriction) rest.as(HasValueRestriction.class);
|
HasValueRestriction hvrest = (HasValueRestriction) rest.as(HasValueRestriction.class);
|
||||||
|
@ -191,9 +192,8 @@ public class RestrictionsListingController extends BaseEditController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String printAsClass(Resource res) {
|
private String printAsClass(VClassDao vcDao, Resource res) {
|
||||||
String UNKNOWN = "???";
|
String UNKNOWN = "???";
|
||||||
VClassDao vcDao = getWebappDaoFactory().getVClassDao();
|
|
||||||
try {
|
try {
|
||||||
VClass vClass = vcDao.getVClassByURI(res.getURI());
|
VClass vClass = vcDao.getVClassByURI(res.getURI());
|
||||||
return (vClass.getName() != null) ? vClass.getName() : UNKNOWN ;
|
return (vClass.getName() != null) ? vClass.getName() : UNKNOWN ;
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class StatementChangeListingController extends BaseEditController {
|
||||||
OntModel ontModel = (OntModel) getServletContext().getAttribute("jenaOntModel");
|
OntModel ontModel = (OntModel) getServletContext().getAttribute("jenaOntModel");
|
||||||
Model auditModel = (Model) request.getSession().getServletContext().getAttribute("jenaAuditModel");
|
Model auditModel = (Model) request.getSession().getServletContext().getAttribute("jenaAuditModel");
|
||||||
|
|
||||||
UserDao dao = getWebappDaoFactory().getUserDao();
|
UserDao dao = vrequest.getFullWebappDaoFactory().getUserDao();
|
||||||
|
|
||||||
User user = dao.getUserByURI(userURI);
|
User user = dao.getUserByURI(userURI);
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,7 @@ public class ImageUploadController extends FreeMarkerHttpServlet {
|
||||||
*/
|
*/
|
||||||
private ResponseValues doUploadImage(VitroRequest vreq, Individual entity) {
|
private ResponseValues doUploadImage(VitroRequest vreq, Individual entity) {
|
||||||
ImageUploadHelper helper = new ImageUploadHelper(fileStorage,
|
ImageUploadHelper helper = new ImageUploadHelper(fileStorage,
|
||||||
getWebappDaoFactory());
|
vreq.getFullWebappDaoFactory());
|
||||||
|
|
||||||
// Did they provide a file to upload? If not, show an error.
|
// Did they provide a file to upload? If not, show an error.
|
||||||
FileItem fileItem;
|
FileItem fileItem;
|
||||||
|
@ -312,7 +312,7 @@ public class ImageUploadController extends FreeMarkerHttpServlet {
|
||||||
|
|
||||||
// The entity Individual is stale - get another one;
|
// The entity Individual is stale - get another one;
|
||||||
String entityUri = entity.getURI();
|
String entityUri = entity.getURI();
|
||||||
entity = getWebappDaoFactory().getIndividualDao().getIndividualByURI(
|
entity = vreq.getFullWebappDaoFactory().getIndividualDao().getIndividualByURI(
|
||||||
entityUri);
|
entityUri);
|
||||||
|
|
||||||
// Go to the cropping page.
|
// Go to the cropping page.
|
||||||
|
@ -327,7 +327,7 @@ public class ImageUploadController extends FreeMarkerHttpServlet {
|
||||||
private ResponseValues doCreateThumbnail(VitroRequest vreq,
|
private ResponseValues doCreateThumbnail(VitroRequest vreq,
|
||||||
Individual entity) {
|
Individual entity) {
|
||||||
ImageUploadHelper helper = new ImageUploadHelper(fileStorage,
|
ImageUploadHelper helper = new ImageUploadHelper(fileStorage,
|
||||||
getWebappDaoFactory());
|
vreq.getFullWebappDaoFactory());
|
||||||
|
|
||||||
validateMainImage(entity);
|
validateMainImage(entity);
|
||||||
CropRectangle crop = validateCropCoordinates(vreq);
|
CropRectangle crop = validateCropCoordinates(vreq);
|
||||||
|
@ -343,7 +343,7 @@ public class ImageUploadController extends FreeMarkerHttpServlet {
|
||||||
*/
|
*/
|
||||||
private ResponseValues doDeleteImage(VitroRequest vreq, Individual entity) {
|
private ResponseValues doDeleteImage(VitroRequest vreq, Individual entity) {
|
||||||
ImageUploadHelper helper = new ImageUploadHelper(fileStorage,
|
ImageUploadHelper helper = new ImageUploadHelper(fileStorage,
|
||||||
getWebappDaoFactory());
|
vreq.getFullWebappDaoFactory());
|
||||||
|
|
||||||
helper.removeExistingImage(entity);
|
helper.removeExistingImage(entity);
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ public class ImageUploadController extends FreeMarkerHttpServlet {
|
||||||
throw new UserMistakeException("No entity URI was provided");
|
throw new UserMistakeException("No entity URI was provided");
|
||||||
}
|
}
|
||||||
|
|
||||||
Individual entity = getWebappDaoFactory().getIndividualDao()
|
Individual entity = vreq.getFullWebappDaoFactory().getIndividualDao()
|
||||||
.getIndividualByURI(entityUri);
|
.getIndividualByURI(entityUri);
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
throw new UserMistakeException(
|
throw new UserMistakeException(
|
||||||
|
|
|
@ -336,7 +336,7 @@ public class JenaIngestController extends BaseEditController {
|
||||||
jenaOntModel.leaveCriticalSection();
|
jenaOntModel.leaveCriticalSection();
|
||||||
}
|
}
|
||||||
/*ass92*/
|
/*ass92*/
|
||||||
OntologyDao daoObj = getWebappDaoFactory().getOntologyDao();
|
OntologyDao daoObj = vreq.getFullWebappDaoFactory().getOntologyDao();
|
||||||
List ontologiesObj = daoObj.getAllOntologies();
|
List ontologiesObj = daoObj.getAllOntologies();
|
||||||
ArrayList prefixList = new ArrayList();
|
ArrayList prefixList = new ArrayList();
|
||||||
|
|
||||||
|
@ -427,7 +427,7 @@ public class JenaIngestController extends BaseEditController {
|
||||||
else {
|
else {
|
||||||
namespaceList.add("no resources present");
|
namespaceList.add("no resources present");
|
||||||
}
|
}
|
||||||
String defaultNamespace = getWebappDaoFactory().getDefaultNamespace();
|
String defaultNamespace = vreq.getFullWebappDaoFactory().getDefaultNamespace();
|
||||||
request.setAttribute("modelName", modelName);
|
request.setAttribute("modelName", modelName);
|
||||||
request.setAttribute("defaultNamespace", defaultNamespace);
|
request.setAttribute("defaultNamespace", defaultNamespace);
|
||||||
request.setAttribute("namespaceList", namespaceList);
|
request.setAttribute("namespaceList", namespaceList);
|
||||||
|
@ -931,7 +931,7 @@ public class JenaIngestController extends BaseEditController {
|
||||||
String newNamespace,String dNamespace,ModelMaker maker,VitroRequest vreq){
|
String newNamespace,String dNamespace,ModelMaker maker,VitroRequest vreq){
|
||||||
|
|
||||||
|
|
||||||
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
|
WebappDaoFactory wdf = vreq.getFullWebappDaoFactory();
|
||||||
Model m = maker.getModel(oldModel);
|
Model m = maker.getModel(oldModel);
|
||||||
Model saveModel = maker.getModel(newModel);
|
Model saveModel = maker.getModel(newModel);
|
||||||
ResIterator rsItr = m.listResourcesWithProperty((Property)null);
|
ResIterator rsItr = m.listResourcesWithProperty((Property)null);
|
||||||
|
|
|
@ -30,6 +30,7 @@ import edu.cornell.mannlib.vedit.controller.BaseEditController;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Portal;
|
import edu.cornell.mannlib.vitro.webapp.beans.Portal;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.JenaModelUtils;
|
import edu.cornell.mannlib.vitro.webapp.dao.jena.JenaModelUtils;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.VitroJenaSpecialModelMaker;
|
import edu.cornell.mannlib.vitro.webapp.dao.jena.VitroJenaSpecialModelMaker;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.event.EditEvent;
|
import edu.cornell.mannlib.vitro.webapp.dao.jena.event.EditEvent;
|
||||||
|
@ -96,7 +97,7 @@ public class RDFUploadController extends BaseEditController {
|
||||||
portalArray[0] = currentPortal.getPortalId();
|
portalArray[0] = currentPortal.getPortalId();
|
||||||
} else if (individualCheckIn.equals("all")) {
|
} else if (individualCheckIn.equals("all")) {
|
||||||
try {
|
try {
|
||||||
Collection<Portal> portalCollection = getWebappDaoFactory().getPortalDao().getAllPortals();
|
Collection<Portal> portalCollection = request.getFullWebappDaoFactory().getPortalDao().getAllPortals();
|
||||||
portalArray = new int[portalCollection.size()];
|
portalArray = new int[portalCollection.size()];
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (Iterator<Portal> pit = portalCollection.iterator(); pit.hasNext(); ) {
|
for (Iterator<Portal> pit = portalCollection.iterator(); pit.hasNext(); ) {
|
||||||
|
@ -161,7 +162,7 @@ public class RDFUploadController extends BaseEditController {
|
||||||
memModel = (OntModel) getServletContext().getAttribute("baseOntModel");
|
memModel = (OntModel) getServletContext().getAttribute("baseOntModel");
|
||||||
}
|
}
|
||||||
if (memModel != null) {
|
if (memModel != null) {
|
||||||
stmtCount = operateOnModel(memModel,tempModel,remove,makeClassgroups,portalArray,loginBean.getUserURI());
|
stmtCount = operateOnModel(request.getFullWebappDaoFactory(), memModel,tempModel,remove,makeClassgroups,portalArray,loginBean.getUserURI());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,14 +214,14 @@ public class RDFUploadController extends BaseEditController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private long operateOnModel(OntModel mainModel, Model changesModel, boolean remove, boolean makeClassgroups, int[] portal, String userURI) {
|
private long operateOnModel(WebappDaoFactory webappDaoFactory, OntModel mainModel, Model changesModel, boolean remove, boolean makeClassgroups, int[] portal, String userURI) {
|
||||||
mainModel.enterCriticalSection(Lock.WRITE);
|
mainModel.enterCriticalSection(Lock.WRITE);
|
||||||
try {
|
try {
|
||||||
mainModel.getBaseModel().notifyEvent(new EditEvent(userURI,true));
|
mainModel.getBaseModel().notifyEvent(new EditEvent(userURI,true));
|
||||||
try {
|
try {
|
||||||
if (makeClassgroups) {
|
if (makeClassgroups) {
|
||||||
Model classgroupModel =
|
Model classgroupModel =
|
||||||
JenaModelUtils.makeClassGroupsFromRootClasses(getWebappDaoFactory(), changesModel, changesModel);
|
JenaModelUtils.makeClassGroupsFromRootClasses(webappDaoFactory, changesModel, changesModel);
|
||||||
mainModel.add(classgroupModel);
|
mainModel.add(classgroupModel);
|
||||||
}
|
}
|
||||||
if (portal != null && portal.length>0) {
|
if (portal != null && portal.length>0) {
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class FileServingServlet extends VitroHttpServlet {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the MIME type.
|
// Get the MIME type.
|
||||||
String mimeType = new FileModelHelper(getWebappDaoFactory())
|
String mimeType = new FileModelHelper(request.getFullWebappDaoFactory())
|
||||||
.getMimeTypeForBytestream(uri);
|
.getMimeTypeForBytestream(uri);
|
||||||
|
|
||||||
// Open the actual byte stream.
|
// Open the actual byte stream.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue