updates to enable delete to work even if no statement information is being passed in the parameters

This commit is contained in:
hjkhjk54 2011-12-05 21:27:14 +00:00
parent 7d91949ebe
commit d1b17c75d1
2 changed files with 14 additions and 4 deletions

View file

@ -408,9 +408,7 @@ public class EditConfigurationTemplateModel extends BaseTemplateModel {
String subjectUri = EditConfigurationUtils.getSubjectUri(vreq); String subjectUri = EditConfigurationUtils.getSubjectUri(vreq);
String predicateUri = EditConfigurationUtils.getPredicateUri(vreq); String predicateUri = EditConfigurationUtils.getPredicateUri(vreq);
String objectUri = EditConfigurationUtils.getObjectUri(vreq); String objectUri = EditConfigurationUtils.getObjectUri(vreq);
//ObjectPropertyStatementTemplate Model should pass the object key as part of the delete url
String objectKey = vreq.getParameter("objectKey");
statementDisplay.put(objectKey, objectUri);
//Set data map //Set data map
Map params = vreq.getParameterMap(); Map params = vreq.getParameterMap();
for (Object key : params.keySet()) { for (Object key : params.keySet()) {
@ -422,6 +420,16 @@ public class EditConfigurationTemplateModel extends BaseTemplateModel {
} }
} }
//If no statement parameters being sent back, then just pass back null
if(statementDisplay.size() == 0) {
return null;
}
//ObjectPropertyStatementTemplate Model should pass the object key as part of the delete url
String objectKey = vreq.getParameter("objectKey");
statementDisplay.put(objectKey, objectUri);
//Using object property statement template model here //Using object property statement template model here
ObjectPropertyStatementTemplateModel osm = new ObjectPropertyStatementTemplateModel( ObjectPropertyStatementTemplateModel osm = new ObjectPropertyStatementTemplateModel(
subjectUri, subjectUri,

View file

@ -4,7 +4,9 @@
<#if editConfiguration.objectProperty = true> <#if editConfiguration.objectProperty = true>
<#assign toBeDeletedClass = "objProp" /> <#assign toBeDeletedClass = "objProp" />
<#if editConfiguration.objectStatementDisplay?has_content>
<#assign statement = editConfiguration.objectStatementDisplay /> <#assign statement = editConfiguration.objectStatementDisplay />
</#if>
<#else> <#else>
<#assign statement = editConfiguration.dataStatementDisplay /> <#assign statement = editConfiguration.dataStatementDisplay />
</#if> </#if>