handling editing in page management where one content type is deleted and another is added in its place (added code to force new uri for data getter variable for added content in editing situation)

This commit is contained in:
hjkhjk54 2012-08-30 20:59:48 +00:00
parent d7551ae44c
commit c0062ce189

View file

@ -255,13 +255,18 @@ public class ManagePagePreprocessor extends
if(editConfiguration.isParamUpdate()) {
//Although this is editing an existing page, new content might have been added which would not include
//existing data getter URIs, so important to check whether the key exists within the json object in the first place
String dataGetterURISubmissionName = pn.getDataGetterVarName(counter);
if(jsonObject.containsKey("URI")) {
String URIValue = jsonObject.getString("URI");
if(URIValue != null) {
log.debug("Existing URI for data getter found: " + URIValue);
String dataGetterURISubmissionName = pn.getDataGetterVarName(counter);
submission.addUriToForm(editConfiguration, dataGetterURISubmissionName, new String[]{URIValue});
}
} else {
//if the URI is not included in the json object, this is a NEW data getter
//and as such as we must ensure the URI is created
submission.addUriToForm(editConfiguration, dataGetterURISubmissionName, new String[]{EditConfigurationConstants.NEW_URI_SENTINEL});
}
}