Revision 58375
Added by Michele Artini about 4 years ago
repoControllers.js | ||
---|---|---|
103 | 103 |
$scope.currentRepoApi = {}; |
104 | 104 |
$scope.currentSets = []; |
105 | 105 |
$scope.selectedSets = []; |
106 |
|
|
107 |
$scope.newSyncApi = {}; |
|
106 | 108 |
|
107 | 109 |
$scope.loadApi = function() { |
108 | 110 |
$scope.showSpinner(); |
... | ... | |
389 | 391 |
} |
390 | 392 |
); |
391 | 393 |
} |
394 |
|
|
395 |
$scope.showCreateRemoteSyncApi = function(mongoUrl, mongoDB, mdId, apiSuffix) { |
|
396 |
|
|
397 |
var path = "//*[local-name()='header']/*[local-name()='identifier']"; |
|
398 |
angular.forEach($scope.currentRepoApi.otherParams, function(p) { |
|
399 |
if (p.id=='metadata_identifier_path') { |
|
400 |
path = p.value; |
|
401 |
} |
|
402 |
}); |
|
403 |
|
|
404 |
var compliance = "UNKNOWN"; |
|
405 |
angular.forEach($scope.currentRepoApi.commonParams, function(p) { |
|
406 |
if (p.id=='compliance') { |
|
407 |
compliance = p.value; |
|
408 |
} |
|
409 |
}); |
|
410 |
|
|
411 |
$scope.newSyncApi = { |
|
412 |
'dsId' : $routeParams.repoId, |
|
413 |
'apiId' : 'api_________::' + $routeParams.repoId + "::" + apiSuffix, |
|
414 |
'compatibility' : compliance, |
|
415 |
'contentdescription' : 'metadata', |
|
416 |
'protocol' : 'remoteMdstore', |
|
417 |
'baseurl' : mongoUrl, |
|
418 |
'apiParams' : { |
|
419 |
'remote_database' : mongoDB, |
|
420 |
'remote_mdstore_id' : mdId |
|
421 |
}, |
|
422 |
'metadataIdentifierPath' : path |
|
423 |
}; |
|
424 |
|
|
425 |
$('#remoteSyncApiModal').modal('show'); |
|
426 |
|
|
427 |
} |
|
392 | 428 |
|
393 | 429 |
$scope.loadApi(); |
394 | 430 |
} |
Also available in: Unified diff
remoteMdstore API creation in other infrastructure (partial implementation)