NIHVIVO-143 Front end deletion of moniker through the "edit" link
This commit is contained in:
parent
9ae82a7fb3
commit
1273717a14
5 changed files with 17 additions and 16 deletions
|
@ -100,7 +100,7 @@ public class RdfLiteralHash {
|
||||||
|
|
||||||
List<DataPropertyStatement> statements = ind.getDataPropertyStatements();
|
List<DataPropertyStatement> statements = ind.getDataPropertyStatements();
|
||||||
if( statements == null ) return null;
|
if( statements == null ) return null;
|
||||||
for( DataPropertyStatement dps : statements){
|
for( DataPropertyStatement dps : statements){
|
||||||
if( doesStmtMatchHash(dps, hash) )
|
if( doesStmtMatchHash(dps, hash) )
|
||||||
return dps;
|
return dps;
|
||||||
}
|
}
|
||||||
|
@ -131,8 +131,7 @@ public class RdfLiteralHash {
|
||||||
dps.setLanguage(lang);
|
dps.setLanguage(lang);
|
||||||
dps.setData(value);
|
dps.setData(value);
|
||||||
dps.setDatapropURI(stmt.getPredicate().toString());
|
dps.setDatapropURI(stmt.getPredicate().toString());
|
||||||
dps.setIndividualURI(ind.getURI());
|
dps.setIndividualURI(ind.getURI());
|
||||||
|
|
||||||
if (doesStmtMatchHash(dps, hash)) {
|
if (doesStmtMatchHash(dps, hash)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,7 @@ public class PropertyEditLinks extends TagSupport{
|
||||||
DataProperty prop = (DataProperty)item; // a DataProperty populated for this subject individual
|
DataProperty prop = (DataProperty)item; // a DataProperty populated for this subject individual
|
||||||
links = doDataProp( prop, entity, themeDir,policyToAccess(ids, policy, entity.getURI(), prop), contextPath ) ;
|
links = doDataProp( prop, entity, themeDir,policyToAccess(ids, policy, entity.getURI(), prop), contextPath ) ;
|
||||||
} else if (item instanceof String && data != null) {
|
} else if (item instanceof String && data != null) {
|
||||||
DataPropertyStatement dps = (DataPropertyStatement) new DataPropertyStatementImpl(entity.getURI(), (String)item, data);
|
DataPropertyStatement dps = (DataPropertyStatement) new DataPropertyStatementImpl(entity.getURI(), (String)item, data);
|
||||||
links = doVitroNamespaceProp( dps, themeDir, policyToAccess(ids, policy, dps), contextPath );
|
links = doVitroNamespaceProp( dps, themeDir, policyToAccess(ids, policy, dps), contextPath );
|
||||||
} else {
|
} else {
|
||||||
log.error("PropertyEditLinks cannot make links for an object of type "+item.getClass().getName());
|
log.error("PropertyEditLinks cannot make links for an object of type "+item.getClass().getName());
|
||||||
|
|
|
@ -17,8 +17,6 @@
|
||||||
<%@ page import="org.apache.commons.logging.Log" %>
|
<%@ page import="org.apache.commons.logging.Log" %>
|
||||||
<%@ page import="org.apache.commons.logging.LogFactory" %>
|
<%@ page import="org.apache.commons.logging.LogFactory" %>
|
||||||
|
|
||||||
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
|
|
||||||
|
|
||||||
<%
|
<%
|
||||||
//org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.editDatapropStmtRequestDispatch.jsp");
|
//org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.editDatapropStmtRequestDispatch.jsp");
|
||||||
final Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.editDatapropStmtRequestDispatch.jsp");
|
final Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.editDatapropStmtRequestDispatch.jsp");
|
||||||
|
@ -56,8 +54,9 @@
|
||||||
String predicateUri = vreq.getParameter("predicateUri");
|
String predicateUri = vreq.getParameter("predicateUri");
|
||||||
String formParam = vreq.getParameter("editForm");
|
String formParam = vreq.getParameter("editForm");
|
||||||
String command = vreq.getParameter("cmd");
|
String command = vreq.getParameter("cmd");
|
||||||
|
|
||||||
String vitroNsProp = vreq.getParameter("vitroNsProp");
|
String vitroNsProp = vreq.getParameter("vitroNsProp");
|
||||||
boolean isVitroNsProp = vitroNsProp != null && vitroNsProp.equals("true") ? true : false;
|
boolean isVitroNsProp = (vitroNsProp != null && vitroNsProp.equals("true")) ? true : false;
|
||||||
|
|
||||||
if( subjectUri == null || subjectUri.trim().length() == 0 ) {
|
if( subjectUri == null || subjectUri.trim().length() == 0 ) {
|
||||||
log.error("required subjectUri parameter missing");
|
log.error("required subjectUri parameter missing");
|
||||||
|
@ -74,7 +73,7 @@
|
||||||
vreq.setAttribute("subjectUriJson", MiscWebUtils.escape(subjectUri));
|
vreq.setAttribute("subjectUriJson", MiscWebUtils.escape(subjectUri));
|
||||||
vreq.setAttribute("predicateUri", predicateUri);
|
vreq.setAttribute("predicateUri", predicateUri);
|
||||||
vreq.setAttribute("predicateUriJson", MiscWebUtils.escape(predicateUri));
|
vreq.setAttribute("predicateUriJson", MiscWebUtils.escape(predicateUri));
|
||||||
vreq.setAttribute("vitroNsProp", vitroNsProp);
|
//vreq.setAttribute("vitroNsProp", vitroNsProp);
|
||||||
|
|
||||||
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
|
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
|
||||||
|
|
||||||
|
|
|
@ -51,13 +51,13 @@
|
||||||
if( subject == null ) throw new Error("could not find subject " + subjectUri);
|
if( subject == null ) throw new Error("could not find subject " + subjectUri);
|
||||||
request.setAttribute("subjectName",subject.getName());
|
request.setAttribute("subjectName",subject.getName());
|
||||||
|
|
||||||
String dataValue=null;
|
|
||||||
// DataPropertyStatement dps=EditConfiguration.findDataPropertyStatementViaHashcode(subject,predicateUri,dataHash);
|
|
||||||
//DataPropertyStatement dps= RdfLiteralHash.getDataPropertyStmtByHash(subject,dataHash);
|
|
||||||
|
|
||||||
Model model = (Model)application.getAttribute("jenaOntModel");
|
|
||||||
String vitroNsProp = vreq.getParameter("vitroNsProp");
|
String vitroNsProp = vreq.getParameter("vitroNsProp");
|
||||||
boolean isVitroNsProp = vitroNsProp != null && vitroNsProp.equals("true") ? true : false;
|
boolean isVitroNsProp = vitroNsProp != null && vitroNsProp.equals("true") ? true : false;
|
||||||
|
|
||||||
|
String dataValue=null;
|
||||||
|
|
||||||
|
Model model = (Model)application.getAttribute("jenaOntModel");
|
||||||
|
|
||||||
DataPropertyStatement dps = RdfLiteralHash.getPropertyStmtByHash(subject, dataHash, model, isVitroNsProp);
|
DataPropertyStatement dps = RdfLiteralHash.getPropertyStmtByHash(subject, dataHash, model, isVitroNsProp);
|
||||||
|
|
||||||
if( log.isDebugEnabled() ){
|
if( log.isDebugEnabled() ){
|
||||||
|
@ -99,6 +99,7 @@
|
||||||
<input type="hidden" name="datapropKey" value="${param.datapropKey}"/>
|
<input type="hidden" name="datapropKey" value="${param.datapropKey}"/>
|
||||||
<input type="hidden" name="y" value="1"/>
|
<input type="hidden" name="y" value="1"/>
|
||||||
<input type="hidden" name="cmd" value="delete"/>
|
<input type="hidden" name="cmd" value="delete"/>
|
||||||
|
<input type="hidden" name="vitroNsProp" value="<%= vitroNsProp %>" />
|
||||||
<v:input type="submit" id="submit" value="Delete" cancel="${param.subjectUri}" />
|
<v:input type="submit" id="submit" value="Delete" cancel="${param.subjectUri}" />
|
||||||
</form>
|
</form>
|
||||||
<jsp:include page="${postForm}"/>
|
<jsp:include page="${postForm}"/>
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory"%>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory"%>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest"%>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest"%>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement" %>
|
||||||
|
<%@page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils"%>
|
||||||
|
|
||||||
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
|
||||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
|
||||||
|
@ -55,8 +56,7 @@
|
||||||
?subject <${predicate}> ?${propertyName} .
|
?subject <${predicate}> ?${propertyName} .
|
||||||
</v:jsonset>
|
</v:jsonset>
|
||||||
|
|
||||||
<%-- RY This will be the default, but base it on propertyName --%>
|
|
||||||
<c:set var="rangeDatatypeUri" value="http://www.w3.org/2001/XMLSchema#string" />
|
|
||||||
|
|
||||||
<%-- RY Add other validation cases here. --%>
|
<%-- RY Add other validation cases here. --%>
|
||||||
<c:choose>
|
<c:choose>
|
||||||
|
@ -97,7 +97,7 @@
|
||||||
"literalOptions" : [ ],
|
"literalOptions" : [ ],
|
||||||
"predicateUri" : "",
|
"predicateUri" : "",
|
||||||
"objectClassUri" : "",
|
"objectClassUri" : "",
|
||||||
"rangeDatatypeUri" : "${rangeDatatypeUri}",
|
"rangeDatatypeUri" : "",
|
||||||
"rangeLang" : "",
|
"rangeLang" : "",
|
||||||
"assertions" : [ "${dataAssertion}" ]
|
"assertions" : [ "${dataAssertion}" ]
|
||||||
}
|
}
|
||||||
|
@ -133,6 +133,7 @@
|
||||||
<h2>${title}</h2>
|
<h2>${title}</h2>
|
||||||
<form action="<c:url value="/edit/processDatapropRdfForm.jsp"/>" >
|
<form action="<c:url value="/edit/processDatapropRdfForm.jsp"/>" >
|
||||||
<v:input type="text" id="${propertyName}" size="30" />
|
<v:input type="text" id="${propertyName}" size="30" />
|
||||||
|
<input type="hidden" name="vitroNsProp" value="true" />
|
||||||
<p class="submit"><v:input type="submit" id="submit" value="${submitLabel}" cancel="${param.subjectUri}"/></p>
|
<p class="submit"><v:input type="submit" id="submit" value="${submitLabel}" cancel="${param.subjectUri}"/></p>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
@ -143,6 +144,7 @@
|
||||||
<input type="hidden" name="predicateUri" value="${param.predicateUri}"/>
|
<input type="hidden" name="predicateUri" value="${param.predicateUri}"/>
|
||||||
<input type="hidden" name="datapropKey" value="${param.datapropKey}"/>
|
<input type="hidden" name="datapropKey" value="${param.datapropKey}"/>
|
||||||
<input type="hidden" name="cmd" value="delete"/>
|
<input type="hidden" name="cmd" value="delete"/>
|
||||||
|
<input type="hidden" name="vitroNsProp" value="true" />
|
||||||
<v:input type="submit" id="delete" value="Delete" cancel="" />
|
<v:input type="submit" id="delete" value="Delete" cancel="" />
|
||||||
</form>
|
</form>
|
||||||
</c:if>
|
</c:if>
|
||||||
|
|
Loading…
Add table
Reference in a new issue