29 |
29 |
|
30 |
30 |
orgsModule.controller('userCtrl', function ($scope, $http, $location) {
|
31 |
31 |
$scope.user = '';
|
32 |
|
$http.get('/api/user/current').then(function successCallback(res) {
|
|
32 |
$http.get('api/user/current').then(function successCallback(res) {
|
33 |
33 |
$scope.user = res.data.name;
|
34 |
34 |
}, function errorCallback(res) {
|
35 |
35 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
|
... | ... | |
58 |
58 |
};
|
59 |
59 |
$scope.vocabularies = {};
|
60 |
60 |
|
61 |
|
$http.get('/api/vocabularies').then(function successCallback(res) {
|
|
61 |
$http.get('api/vocabularies').then(function successCallback(res) {
|
62 |
62 |
$scope.vocabularies = res.data;
|
63 |
63 |
}, function errorCallback(res) {
|
64 |
64 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
|
... | ... | |
66 |
66 |
|
67 |
67 |
$scope.save = function() {
|
68 |
68 |
$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
|
69 |
|
$http.post('/api/organizations/save', $scope.org).then(function successCallback(res) {
|
|
69 |
$http.post('api/organizations/save', $scope.org).then(function successCallback(res) {
|
70 |
70 |
// alert('Organization saved !!!');
|
71 |
71 |
$location.url('/metadata/1/' + res.data[0]);
|
72 |
72 |
}, function errorCallback(res) {
|
... | ... | |
87 |
87 |
|
88 |
88 |
$scope.orgs = {};
|
89 |
89 |
|
90 |
|
$http.get('/api/organizations/search/' + $routeParams.page + '/' + $routeParams.size + '?q=' + $scope.fieldValue).then(function successCallback(res) {
|
|
90 |
$http.get('api/organizations/search/' + $routeParams.page + '/' + $routeParams.size + '?q=' + $scope.fieldValue).then(function successCallback(res) {
|
91 |
91 |
$scope.orgs = res.data;
|
92 |
92 |
}, function errorCallback(res) {
|
93 |
93 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
|
... | ... | |
99 |
99 |
$scope.resultsBasePath = '/byCountry'
|
100 |
100 |
$scope.entries = [];
|
101 |
101 |
|
102 |
|
$http.get('/api/organizations/browse/countries').then(function successCallback(res) {
|
|
102 |
$http.get('api/organizations/browse/countries').then(function successCallback(res) {
|
103 |
103 |
$scope.entries = res.data;
|
104 |
104 |
}, function errorCallback(res) {
|
105 |
105 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
|
... | ... | |
113 |
113 |
|
114 |
114 |
$scope.orgs = [];
|
115 |
115 |
|
116 |
|
$http.get('/api/organizations/byCountry/' + $routeParams.code + '/' + $routeParams.page + '/' + $routeParams.size).then(function successCallback(res) {
|
|
116 |
$http.get('api/organizations/byCountry/' + $routeParams.code + '/' + $routeParams.page + '/' + $routeParams.size).then(function successCallback(res) {
|
117 |
117 |
$scope.orgs = res.data;
|
118 |
118 |
}, function errorCallback(res) {
|
119 |
119 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
|
... | ... | |
125 |
125 |
$scope.resultsBasePath = '/byType'
|
126 |
126 |
$scope.entries = [];
|
127 |
127 |
|
128 |
|
$http.get('/api/organizations/browse/types').then(function successCallback(res) {
|
|
128 |
$http.get('api/organizations/browse/types').then(function successCallback(res) {
|
129 |
129 |
$scope.entries = res.data;
|
130 |
130 |
}, function errorCallback(res) {
|
131 |
131 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
|
... | ... | |
139 |
139 |
|
140 |
140 |
$scope.orgs = [];
|
141 |
141 |
|
142 |
|
$http.get('/api/organizations/byType/' + $routeParams.type + '/' + $routeParams.page + '/' + $routeParams.size).then(function successCallback(res) {
|
|
142 |
$http.get('api/organizations/byType/' + $routeParams.type + '/' + $routeParams.page + '/' + $routeParams.size).then(function successCallback(res) {
|
143 |
143 |
$scope.orgs = res.data;
|
144 |
144 |
}, function errorCallback(res) {
|
145 |
145 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
|
... | ... | |
162 |
162 |
|
163 |
163 |
$timeout(function() { $scope.message = ''; }, 3000)
|
164 |
164 |
|
165 |
|
$http.get('/api/vocabularies').then(function successCallback(res) {
|
|
165 |
$http.get('api/vocabularies').then(function successCallback(res) {
|
166 |
166 |
$scope.vocabularies = res.data;
|
167 |
167 |
|
168 |
|
$http.get('/api/organizations/get?id=' + $routeParams.id).then(function successCallback(res) {
|
|
168 |
$http.get('api/organizations/get?id=' + $routeParams.id).then(function successCallback(res) {
|
169 |
169 |
$scope.org = res.data;
|
170 |
170 |
}, function errorCallback(res) {
|
171 |
171 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
|
... | ... | |
176 |
176 |
|
177 |
177 |
$scope.save = function() {
|
178 |
178 |
$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
|
179 |
|
$http.post('/api/organizations/save', $scope.org).then(function successCallback(res) {
|
|
179 |
$http.post('api/organizations/save', $scope.org).then(function successCallback(res) {
|
180 |
180 |
if ($routeParams.msg == 2) { $route.reload(); }
|
181 |
181 |
else { $location.url('/metadata/2/' + res.data[0]); }
|
182 |
182 |
}, function errorCallback(res) {
|
... | ... | |
197 |
197 |
$scope.newRelType='';
|
198 |
198 |
$scope.newRelation = {};
|
199 |
199 |
|
200 |
|
$http.get('/api/vocabularies').then(function successCallback(res) {
|
|
200 |
$http.get('api/vocabularies').then(function successCallback(res) {
|
201 |
201 |
$scope.vocabularies = res.data;
|
202 |
202 |
|
203 |
|
$http.get('/api/organizations/relations?id=' + $routeParams.id).then(function successCallback(res) {
|
|
203 |
$http.get('api/organizations/relations?id=' + $routeParams.id).then(function successCallback(res) {
|
204 |
204 |
$scope.rels = res.data;
|
205 |
205 |
}, function errorCallback(res) {
|
206 |
206 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
|
... | ... | |
214 |
214 |
}
|
215 |
215 |
|
216 |
216 |
$scope.addRelation = function() {
|
217 |
|
$http.put('/api/organizations/relations', null, {
|
|
217 |
$http.put('api/organizations/relations', null, {
|
218 |
218 |
'params': { 'from': $scope.orgId, 'to': $scope.newRelation.id, 'type': $scope.newRelType }
|
219 |
219 |
}).then(function successCallback(res) {
|
220 |
220 |
$scope.rels = res.data;
|
... | ... | |
227 |
227 |
}
|
228 |
228 |
|
229 |
229 |
$scope.deleteRelation = function(to, type) {
|
230 |
|
$http.delete('/api/organizations/relations', {
|
|
230 |
$http.delete('api/organizations/relations', {
|
231 |
231 |
'params': { 'from': $scope.orgId, 'to': to, 'type': type }
|
232 |
232 |
}).then(function successCallback(res) {
|
233 |
233 |
$scope.rels = res.data;
|
... | ... | |
239 |
239 |
|
240 |
240 |
$scope.search = function(text, page, size) {
|
241 |
241 |
$scope.orgs = [];
|
242 |
|
$http.get('/api/organizations/search/' + page + '/' + size + '?q=' + text).then(function successCallback(res) {
|
|
242 |
$http.get('api/organizations/search/' + page + '/' + size + '?q=' + text).then(function successCallback(res) {
|
243 |
243 |
$scope.searchValue = text;
|
244 |
244 |
$scope.searchOrgs = res.data;
|
245 |
245 |
}, function errorCallback(res) {
|
... | ... | |
254 |
254 |
$scope.similarities = [];
|
255 |
255 |
$scope.vocabularies = {};
|
256 |
256 |
|
257 |
|
$http.get('/api/vocabularies').then(function successCallback(res) {
|
|
257 |
$http.get('api/vocabularies').then(function successCallback(res) {
|
258 |
258 |
$scope.vocabularies = res.data;
|
259 |
259 |
|
260 |
|
$http.get('/api/organizations/similarities?id=' + $routeParams.id).then(function successCallback(res) {
|
|
260 |
$http.get('api/organizations/similarities?id=' + $routeParams.id).then(function successCallback(res) {
|
261 |
261 |
$scope.similarities = res.data;
|
262 |
262 |
}, function errorCallback(res) {
|
263 |
263 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
|
... | ... | |
269 |
269 |
|
270 |
270 |
$scope.saveSimilarities = function() {
|
271 |
271 |
$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
|
272 |
|
$http.post('/api/organizations/similarities', $scope.similarities).then(function successCallback(res) {
|
|
272 |
$http.post('api/organizations/similarities', $scope.similarities).then(function successCallback(res) {
|
273 |
273 |
alert('Similarities updated !!!');
|
274 |
274 |
$scope.similarities = res.data;
|
275 |
275 |
}, function errorCallback(res) {
|
fixed relative urls