NIHVIVO-143 Fix to previous commit: took isVitroNsProp value out of the EditConfiguration and put it in the request.
This commit is contained in:
parent
1de471536a
commit
014d9a3762
8 changed files with 75 additions and 57 deletions
|
@ -1,5 +1,7 @@
|
|||
<%-- $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="edu.cornell.mannlib.vedit.beans.LoginFormBean" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.DataProperty" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement" %>
|
||||
|
@ -23,7 +25,7 @@
|
|||
if (!VitroRequestPrep.isSelfEditing(request) && !LoginFormBean.loggedIn(request, LoginFormBean.NON_EDITOR)) {%>
|
||||
<c:redirect url="<%= Controllers.LOGIN %>" />
|
||||
<% }
|
||||
|
||||
|
||||
String subjectUri = request.getParameter("subjectUri");
|
||||
String predicateUri = request.getParameter("predicateUri");
|
||||
String datapropKeyStr = request.getParameter("datapropKey");
|
||||
|
@ -50,8 +52,14 @@
|
|||
request.setAttribute("subjectName",subject.getName());
|
||||
|
||||
String dataValue=null;
|
||||
// DataPropertyStatement dps=EditConfiguration.findDataPropertyStatementViaHashcode(subject,predicateUri,dataHash);
|
||||
DataPropertyStatement dps= RdfLiteralHash.getDataPropertyStmtByHash(subject,dataHash);
|
||||
// DataPropertyStatement dps=EditConfiguration.findDataPropertyStatementViaHashcode(subject,predicateUri,dataHash);
|
||||
//DataPropertyStatement dps= RdfLiteralHash.getDataPropertyStmtByHash(subject,dataHash);
|
||||
|
||||
Model model = (Model)application.getAttribute("jenaOntModel");
|
||||
String vitroNsProp = vreq.getParameter("vitroNsProp");
|
||||
boolean isVitroNsProp = vitroNsProp != null && vitroNsProp.equals("true") ? true : false;
|
||||
DataPropertyStatement dps = RdfLiteralHash.getPropertyStmtByHash(subject, dataHash, model, isVitroNsProp);
|
||||
|
||||
if( log.isDebugEnabled() ){
|
||||
log.debug("attempting to delete dataPropertyStatement: subjectURI <" + dps.getIndividualURI() +">");
|
||||
log.debug( "predicateURI <" + dps.getDatapropURI() + ">");
|
||||
|
|
|
@ -72,7 +72,6 @@
|
|||
"editKey" : "${editKey}",
|
||||
"datapropKey" : "<%= datapropKeyStr == null ? "" : datapropKeyStr %>",
|
||||
"urlPatternToReturnTo" : "/entity",
|
||||
"isVitroNsProp" : "true",
|
||||
|
||||
"subject" : ["subject", "${subjectUriJson}" ],
|
||||
"predicate" : ["predicate", "${predicateUriJson}" ],
|
||||
|
@ -127,6 +126,7 @@
|
|||
<c:set var="propertyLabel" value="${propertyName == 'label' ? 'name' : propertyName}" />
|
||||
<c:set var="submitLabel" value="Edit ${propertyLabel}" />
|
||||
<c:set var="title" scope="request" value="Edit the ${propertyLabel} of ${subject.name}:" />
|
||||
<c:set var="vitroNsProp" scope="request" value="true" />
|
||||
|
||||
<jsp:include page="${preForm}"/>
|
||||
|
||||
|
@ -136,5 +136,16 @@
|
|||
<p class="submit"><v:input type="submit" id="submit" value="${submitLabel}" cancel="${param.subjectUri}"/></p>
|
||||
</form>
|
||||
|
||||
<c:if test="${ (!empty param.datapropKey) && (empty param.deleteProhibited) }">
|
||||
<form class="deleteForm" action="editDatapropStmtRequestDispatch.jsp" method="post">
|
||||
<label for="delete"><h3>Delete this entry?</h3></label>
|
||||
<input type="hidden" name="subjectUri" value="${param.subjectUri}"/>
|
||||
<input type="hidden" name="predicateUri" value="${param.predicateUri}"/>
|
||||
<input type="hidden" name="datapropKey" value="${param.datapropKey}"/>
|
||||
<input type="hidden" name="cmd" value="delete"/>
|
||||
<v:input type="submit" id="delete" value="Delete" cancel="" />
|
||||
</form>
|
||||
</c:if>
|
||||
|
||||
<jsp:include page="${postForm}"/>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue