Revision 57670
Added by Michele Artini over 4 years ago
organizations.js | ||
---|---|---|
11 | 11 |
.when('/byType/:page/:size/:type*', { templateUrl: 'resources/html/list.html', controller: 'byTypeCtrl' }) |
12 | 12 |
.when('/metadata/:msg/:id', { templateUrl: 'resources/html/edit.html', controller: 'showMetadataCtrl' }) |
13 | 13 |
.when('/relations/:id', { templateUrl: 'resources/html/relations.html', controller: 'showRelationsCtrl' }) |
14 |
.when('/similarities/:id', { templateUrl: 'resources/html/similarities.html', controller: 'showSimilaritiesCtrl' }) |
|
15 |
.when('/warnings', { templateUrl: 'resources/html/warnings.html', controller: 'showWarningsCtrl' }) |
|
14 |
.when('/enrichments/:id', { templateUrl: 'resources/html/enrichments.html', controller: 'showEnrichmentsCtrl' }) |
|
15 |
.when('/conflicts/:id', { templateUrl: 'resources/html/conflicts.html', controller: 'showConflictsCtrl' }) |
|
16 |
.when('/allConflicts', { templateUrl: 'resources/html/allConflicts.html', controller: 'showAllConflictsCtrl' }) |
|
16 | 17 |
.when('/users', { templateUrl: 'resources/html/users.html', controller: 'usersCtrl' }) |
17 | 18 |
.otherwise({ redirectTo: '/search' }); |
18 | 19 |
}); |
... | ... | |
240 | 241 |
|
241 | 242 |
}); |
242 | 243 |
|
243 |
orgsModule.controller('showSimilaritiesCtrl', function ($scope, $http, $routeParams) {
|
|
244 |
orgsModule.controller('showEnrichmentsCtrl', function ($scope, $http, $routeParams) {
|
|
244 | 245 |
$scope.orgId = $routeParams.id; |
245 |
$scope.similarities = [];
|
|
246 |
$scope.enrichments = [];
|
|
246 | 247 |
$scope.vocabularies = {}; |
247 | 248 |
|
248 | 249 |
$http.get('api/vocabularies').then(function successCallback(res) { |
249 | 250 |
$scope.vocabularies = res.data; |
250 | 251 |
|
251 |
$http.get('api/organizations/similarities?id=' + $routeParams.id).then(function successCallback(res) {
|
|
252 |
$scope.similarities = res.data;
|
|
252 |
$http.get('api/organizations/enrichments?id=' + $routeParams.id).then(function successCallback(res) {
|
|
253 |
$scope.enrichments = res.data;
|
|
253 | 254 |
}, function errorCallback(res) { |
254 | 255 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); |
255 | 256 |
}); |
... | ... | |
258 | 259 |
}); |
259 | 260 |
|
260 | 261 |
|
261 |
$scope.saveSimilarities = function() {
|
|
262 |
$scope.saveEnrichments = function() {
|
|
262 | 263 |
$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8"; |
263 |
$http.post('api/organizations/similarities', $scope.similarities).then(function successCallback(res) {
|
|
264 |
alert('Similarities updated !!!');
|
|
265 |
$scope.similarities = res.data;
|
|
264 |
$http.post('api/organizations/enrichments', $scope.enrichments).then(function successCallback(res) {
|
|
265 |
alert('Enrichments updated !!!');
|
|
266 |
$scope.enrichments = res.data;
|
|
266 | 267 |
}, function errorCallback(res) { |
267 | 268 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); |
268 | 269 |
}); |
269 | 270 |
} |
270 | 271 |
}); |
271 | 272 |
|
272 |
|
|
273 |
orgsModule.controller('showWarningsCtrl', function ($scope, $http, $routeParams) { |
|
273 |
orgsModule.controller('showConflictsCtrl', function ($scope, $http, $routeParams) { |
|
274 | 274 |
$scope.orgId = $routeParams.id; |
275 |
$scope.warnings = []; |
|
275 |
$scope.conflicts = []; |
|
276 |
$scope.vocabularies = {}; |
|
276 | 277 |
|
277 |
$http.get('api/organizations/warnings?id=' + $routeParams.id).then(function successCallback(res) { |
|
278 |
$scope.warnings = res.data; |
|
278 |
$http.get('api/vocabularies').then(function successCallback(res) { |
|
279 |
$scope.vocabularies = res.data; |
|
280 |
|
|
281 |
$http.get('api/organizations/conflicts?id=' + $routeParams.id).then(function successCallback(res) { |
|
282 |
$scope.conflicts = res.data; |
|
283 |
}, function errorCallback(res) { |
|
284 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); |
|
285 |
}); |
|
279 | 286 |
}, function errorCallback(res) { |
280 | 287 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); |
281 | 288 |
}); |
289 |
}); |
|
282 | 290 |
|
291 |
orgsModule.controller('showAllConflictsCtrl', function ($scope, $http) { |
|
292 |
$scope.conflicts = []; |
|
293 |
$http.get('api/organizations/conflicts/all').then(function successCallback(res) { |
|
294 |
$scope.conflicts = res.data; |
|
295 |
}, function errorCallback(res) { |
|
296 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); |
|
297 |
}); |
|
283 | 298 |
}); |
284 | 299 |
|
285 |
|
|
286 | 300 |
orgsModule.controller('usersCtrl', function ($scope, $http, $timeout, $route) { |
287 | 301 |
$scope.users = []; |
288 | 302 |
$scope.vocs = {}; |
Also available in: Unified diff
warning -> conflicts