VIVO-500 property deletion updates for faux props

This commit is contained in:
brianjlowe 2013-11-06 17:29:19 -05:00
parent bc0cf6be63
commit 5b6e86ab01
6 changed files with 22 additions and 7 deletions

View file

@ -62,7 +62,6 @@ public class PropertyInstanceDaoJena extends PropertyDaoJena implements
baseModel.notifyEvent(new IndividualUpdateEvent(userUri,true,subjectURI));
try {
ontModel.remove(subjRes,pred,objRes);
updatePropertyDateTimeValue(subjRes,MODTIME,Calendar.getInstance().getTime(),ontModel);
} finally {
baseModel.notifyEvent(new IndividualUpdateEvent(userUri,false,subjectURI));
}
@ -78,7 +77,6 @@ public class PropertyInstanceDaoJena extends PropertyDaoJena implements
baseModel.notifyEvent(new IndividualUpdateEvent(userUri,true,objectURI));
try {
ontModel.remove(objRes,invPred,subjRes);
updatePropertyDateTimeValue(objRes,MODTIME,Calendar.getInstance().getTime(),ontModel);
} finally {
baseModel.notifyEvent(new IndividualUpdateEvent(userUri,false,subjectURI));
}
@ -215,7 +213,6 @@ public class PropertyInstanceDaoJena extends PropertyDaoJena implements
getOntModel().getBaseModel().notifyEvent(new IndividualUpdateEvent(getWebappDaoFactory().getUserURI(),true,prop.getSubjectEntURI()));
try {
ontModel.add(subjRes,pred,objRes);
updatePropertyDateTimeValue(subjRes,MODTIME,Calendar.getInstance().getTime(),getOntModel());
} finally {
getOntModel().getBaseModel().notifyEvent(new IndividualUpdateEvent(getWebappDaoFactory().getUserURI(),false,prop.getSubjectEntURI()));
}
@ -224,7 +221,6 @@ public class PropertyInstanceDaoJena extends PropertyDaoJena implements
getOntModel().getBaseModel().notifyEvent(new IndividualUpdateEvent(getWebappDaoFactory().getUserURI(),true,prop.getObjectEntURI()));
try {
ontModel.add(objRes,invPred,subjRes);
updatePropertyDateTimeValue(objRes,MODTIME,Calendar.getInstance().getTime(),getOntModel());
} finally {
getOntModel().getBaseModel().notifyEvent(new IndividualUpdateEvent(getWebappDaoFactory().getUserURI(),false,prop.getSubjectEntURI()));
}

View file

@ -367,6 +367,14 @@ public class EditConfigurationTemplateModel extends BaseTemplateModel {
return editConfig.getObject();
}
public String getDomainUri() {
return EditConfigurationUtils.getDomainUri(vreq);
}
public String getRangeUri() {
return EditConfigurationUtils.getRangeUri(vreq);
}
//data literal
//Thus would depend on the literals on the form

View file

@ -47,11 +47,11 @@ public class ObjectPropertyStatementTemplateModel extends PropertyStatementTempl
ops.setProperty(predicate);
// Do delete url first, since it is used in building edit url
this.deleteUrl = makeDeleteUrl();
this.deleteUrl = makeDeleteUrl(ops);
this.editUrl = makeEditUrl(ops);
}
private String makeDeleteUrl() {
private String makeDeleteUrl(ObjectPropertyStatement ops) {
// Is the delete link suppressed for this property?
if (property.isDeleteLinkSuppressed()) {
return "";
@ -87,6 +87,13 @@ public class ObjectPropertyStatementTemplateModel extends PropertyStatementTempl
}
}
if (ops.getProperty()!= null && ops.getProperty().getDomainVClassURI() != null) {
params.put("domainUri", ops.getProperty().getDomainVClassURI());
}
if (ops.getProperty()!= null && ops.getProperty().getRangeVClassURI() != null) {
params.put("rangeUri", ops.getProperty().getRangeVClassURI());
}
params.put("templateName", templateName);
params.putAll(UrlBuilder.getModelParams(vreq));

View file

@ -30,6 +30,8 @@
<input type="hidden" name="subjectUri" value="${editConfiguration.subjectUri}" role="input" />
<input type="hidden" name="predicateUri" value="${editConfiguration.predicateUri}" role="input" />
<input type="hidden" name="domainUri" value="${editConfiguration.domainUri}" role="input" />
<input type="hidden" name="rangeUri" value="${editConfiguration.rangeUri}" role="input" />
<#if editConfiguration.dataProperty = true>
<input type="hidden" name="datapropKey" value="${editConfiguration.datapropKey}" role="input" />

View file

@ -7,6 +7,8 @@
<input type="hidden" name="subjectUri" value="${editConfiguration.subjectUri}"/>
<input type="hidden" name="predicateUri" value="${editConfiguration.predicateUri}"/>
<input type="hidden" name="domainUri" value="${editConfiguration.domainUri}"/>
<input type="hidden" name="rangeUri" value="${editConfiguration.rangeUri}"/>
<input type="hidden" name="cmd" value="delete"/>
<input type="hidden" name="editKey" value="${editConfiguration.editKey}"/>
<#if editConfiguration.dataProperty = true>