VIVO-500 property deletion updates for faux props
This commit is contained in:
parent
bc0cf6be63
commit
5b6e86ab01
6 changed files with 22 additions and 7 deletions
|
@ -174,7 +174,7 @@ public class DeletePropertyController extends FreemarkerHttpServlet {
|
|||
//process object property
|
||||
private void processObjectProperty(VitroRequest vreq) {
|
||||
ObjectProperty prop = EditConfigurationUtils.getObjectProperty(vreq);
|
||||
|
||||
|
||||
//if this property is true, it means the object needs to be deleted along with statement
|
||||
if(prop.getStubObjectRelation())
|
||||
{
|
||||
|
|
|
@ -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()));
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue