updates for page management as well as updates to new URI maker and individual dao jena to handle creation of new URI (old code was returning duplicate when maximum number of attempts was exhausted in NewURIMakerVitro b/c IndividualDaoJena kept returning the same URI since Random instance was set with system time seed and possibly the calls to the method were occurring close together in time and nextInt kept returning the same number).

This commit is contained in:
hjkhjk54 2012-06-21 20:44:42 +00:00
parent 98e5dc93f6
commit f6b2387a3e
9 changed files with 219 additions and 94 deletions

View file

@ -547,6 +547,11 @@ var pageManagementUtils = {
var dataGetterProcessor = pageManagementUtils.dataGetterProcessorMap[dataGetterType];
//the content type specific processor will create the json object to be returned
var jsonObject = dataGetterProcessor.processPageContentSection(pageContentSection);
//if data getter uri included, include that as well
if(pageContentSection.find("input[name='URI']").length > 0) {
var uriValue = pageContentSection.find("input[name='URI']").val();
jsonObject["URI"] = uriValue;
}
return jsonObject;
} else {
//ERROR handling
@ -618,6 +623,8 @@ var pageManagementUtils = {
var $newContentObj = pageManagementUtils.cloneContentAreaForEdit(contentType, contentTypeLabel, additionalLabelText);
//Populate the section with the values
dataGetterProcessorObject.populatePageContentSection(JSONContentObject, $newContentObj);
//Also include a hidden input with data getter URI
pageManagementUtils.includeDataGetterURI(JSONContentObject, $newContentObj);
} else {
//error condition
}
@ -627,6 +634,12 @@ var pageManagementUtils = {
}
},
includeDataGetterURI:function(JSONContentObject, $newContentObj) {
var uri = JSONContentObject["URI"];
if(uri != null) {
$("<input type='hidden' name='URI' value='" + uri + "'>").appendTo($newContentObj);
}
},
//Get the data getter processor
getDataGetterProcessorObject:function(pageContentSection) {
var dataGetterType = pageManagementUtils.processDataGetterUtils.selectDataGetterType(pageContentSection);