NIHVIVO-143 Front end deletion of moniker through the "delete" link: fixed more bugs, so it finally works.

This commit is contained in:
rjy7 2010-03-19 21:37:09 +00:00
parent ea25ff4ffb
commit 6038b68c4a
3 changed files with 8 additions and 8 deletions

View file

@ -85,6 +85,7 @@
DataProperty dataproperty = wdf.getDataPropertyDao().getDataPropertyByURI( predicateUri );
if( dataproperty == null) {
// No dataproperty will be returned for a vitro ns prop, but we shouldn't throw an error.
// RY This is not necessarily true...
if (!isVitroNsProp) {
log.error("Could not find data property '"+predicateUri+"' in model");
throw new Error("editDatapropStmtRequest.jsp: Could not find DataProperty in model: " + predicateUri);

View file

@ -1,6 +1,9 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ page import="com.hp.hpl.jena.rdf.model.Model" %>
<%@ page import="com.hp.hpl.jena.rdf.model.Resource" %>
<%@ page import="com.hp.hpl.jena.rdf.model.Literal" %>
<%@ page import="com.hp.hpl.jena.rdf.model.Property" %>
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginFormBean" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.DataProperty" %>
@ -89,11 +92,11 @@
OntModel writeModel = (new StandardModelSelector()).getModel(request, application);
writeModel.enterCriticalSection(Lock.WRITE);
try{
writeModel.getBaseModel().notifyEvent(new EditEvent(editorUri,true));
writeModel.getBaseModel().notifyEvent(new EditEvent(editorUri,true));
writeModel.remove(
writeModel.getResource(subjectUri),
writeModel.getProperty(predicateUri),
writeModel.createLiteral(dps.getData()));
writeModel.createTypedLiteral(dps.getData(), dps.getDatatypeURI()));
}finally{
writeModel.leaveCriticalSection();
}

View file

@ -37,12 +37,12 @@
Individual subject = (Individual)vreq.getAttribute("subject");
if( subject == null ) {
throw new Error("In vitroNsEditLabelForm.jsp, could not find subject " + subjectUri);
throw new Error("In defaultVitroNsPropForm.jsp, could not find subject " + subjectUri);
}
Model model = (Model)application.getAttribute("jenaOntModel");
// RY ***** Get the rangeDatatypeUri - need to get it from the
// RY ***** Get the rangeDatatypeUri - need to get the existing value datatype. Or just hardcode?
//String rangeDatatypeUri = vreq.getWebappDaoFactory().getDataPropertyDao().getRequiredDatatypeURI(subject, prop);
//String rangeDatatypeUri = prop.getRangeDatatypeURI();
String rangeDatatypeUri = "http://www.w3.org/2001/XMLSchema#string";
@ -57,10 +57,7 @@
if (!rangeDatatypeUriJson.isEmpty()) {
validatorList.add("datatype:" + rangeDatatypeUriJson);
}
String validators = StringUtils.quotedList(validatorList, ",");
System.out.println("VALIDATORS: " + validators);
vreq.setAttribute("validators", StringUtils.quotedList(validatorList, ","));
%>
@ -132,7 +129,6 @@
<%
System.out.println(request.getAttribute("editjson"));
if( log.isDebugEnabled()) log.debug(request.getAttribute("editjson"));
EditConfiguration editConfig = EditConfiguration.getConfigFromSession(session,request);