Revision 57804
Added by Michele Artini over 4 years ago
modules/dnet-orgs-database-application/trunk/src/main/resources/sql/schema.sql | ||
---|---|---|
174 | 174 |
count(DISTINCT c.oa_original_id) as n_conflicts |
175 | 175 |
FROM organizations org |
176 | 176 |
LEFT OUTER JOIN openaire_simrels e ON (org.id = e.local_id AND e.oa_original_id NOT LIKE 'openorgs____::%' AND e.reltype = 'suggested') |
177 |
LEFT OUTER JOIN openaire_simrels c ON (org.id = c.local_id AND c.oa_original_id LIKE 'openorgs____::%' AND e.reltype = 'suggested')
|
|
177 |
LEFT OUTER JOIN openaire_simrels c ON (org.id = c.local_id AND c.oa_original_id LIKE 'openorgs____::%' AND c.reltype = 'suggested')
|
|
178 | 178 |
GROUP BY org.id; |
179 | 179 |
|
180 | 180 |
CREATE VIEW organizations_simple_view AS SELECT |
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/part/org_form_dedup_events.html | ||
---|---|---|
1 |
<h2>Duplicates</h2> |
|
2 |
|
|
3 |
<div class="card-body text-muted" ng-if="events.duplicates.length == 0"> |
|
4 |
No duplicates |
|
5 |
</div> |
|
1 |
<div class="card-body"> |
|
2 |
<div class="card"> |
|
3 |
<div class="card-header bg-primary text-white py-1">Duplicates</div> |
|
4 |
|
|
5 |
<div class="card-body text-muted" ng-if="events.duplicates.length == 0"> |
|
6 |
No duplicates |
|
7 |
</div> |
|
8 |
|
|
9 |
<table class="table table-sm mt-2" ng-if="events.duplicates.length > 0"> |
|
10 |
<thead> |
|
11 |
<tr class="d-flex"> |
|
12 |
<th class="col-4 pl-3" style="border-top: none;">Related organization</th> |
|
13 |
<th class="col-1 text-center" style="border-top: none;">Acronym</th> |
|
14 |
<th class="col-1 text-center" style="border-top: none;">Country</th> |
|
15 |
<th class="col-4" style="border-top: none;">Source</th> |
|
16 |
<th class="col-2" style="border-top: none;"></th> |
|
17 |
</tr> |
|
18 |
</thead> |
|
19 |
<tbody> |
|
20 |
<tr class="d-flex" ng-repeat="sr in events.duplicates"> |
|
21 |
<td class="col-4 pl-3"> |
|
22 |
{{sr.oaName}} |
|
23 |
<span class="small" ng-if="sr.oaUrl" ><br /><b>URL: </b><a href="{{sr.oaUrl}}" target="_blank">{{sr.oaUrl}}</a></span> |
|
24 |
</td> |
|
25 |
<td class="col-1 text-center small">{{sr.oaAcronym}}</td> |
|
26 |
<td class="col-1 text-center small"><img ng-src="resources/images/flags/{{sr.oaCountry}}.gif" /> {{sr.oaCountry}}</td> |
|
27 |
<td class="col-4 small"> |
|
28 |
<b>Collected from:</b> {{sr.oaCollectedFrom}}<br /> |
|
29 |
<b>Original Id:</b> <span class="text-monospace">{{sr.oaOriginalId}}</span> |
|
30 |
</td> |
|
31 |
<td class="col-2 text-right"> |
|
32 |
<div class="btn-group btn-group-toggle btn-group-sm" data-toggle="buttons"> |
|
33 |
<label class="btn" ng-class="{'btn-danger' : sr.relType == 'is_different', 'btn-outline-danger' : sr.relType != 'is_different'}"> |
|
34 |
<input type="radio" autocomplete="off" ng-model="sr.relType" value="is_different" ng-class="{'active' : sr.relType == 'is_different'}"><i class="fas fa-times fa-fw"></i> |
|
35 |
</label> |
|
36 |
<label class="btn" ng-class="{'btn-info' : sr.relType == 'suggested', 'btn-outline-info' : sr.relType != 'suggested'}"> |
|
37 |
<input type="radio" autocomplete="off" ng-model="sr.relType" value="suggested" ng-class="{'active' : sr.relType == 'suggested'}"><i class="fas fa-question fa-fw"></i> |
|
38 |
</label> |
|
39 |
<label class="btn" ng-class="{'btn-success' : sr.relType == 'is_similar', 'btn-outline-success' : sr.relType != 'is_similar'}"> |
|
40 |
<input type="radio" autocomplete="off" ng-model="sr.relType" value="is_similar" ng-class="{'active' : sr.relType == 'is_similar'}"/><i class="fas fa-check fa-fw"></i> |
|
41 |
</label> |
|
42 |
</div> |
|
43 |
</td> |
|
44 |
</tr> |
|
45 |
</tbody> |
|
46 |
</table> |
|
47 |
|
|
48 |
<div class="card-footer text-right" ng-if="events.duplicates.length > 0"> |
|
49 |
<button class="btn btn-sm btn-primary" ng-click="saveDuplicates()">save</button> |
|
50 |
</div> |
|
51 |
</div> |
|
52 |
|
|
53 |
|
|
54 |
<div class="card"> |
|
55 |
<div class="card-header bg-primary text-white py-1">Conflicts</div> |
|
56 |
|
|
57 |
<div class="card-body text-muted" ng-if="events.conflicts.length == 0"> |
|
58 |
No conflicts |
|
59 |
</div> |
|
60 |
|
|
61 |
<table class="table table-sm mt-2" ng-if="events.conflicts.length > 0"> |
|
62 |
<thead> |
|
63 |
<tr class="d-flex"> |
|
64 |
<th class="col-4 pl-3" style="border-top: none;">Related organization</th> |
|
65 |
<th class="col-1 text-center" style="border-top: none;">Acronym</th> |
|
66 |
<th class="col-1 text-center" style="border-top: none;">Country</th> |
|
67 |
<th class="col-4" style="border-top: none;">Original ID</th> |
|
68 |
<th class="col-2" style="border-top: none;"></th> |
|
69 |
</tr> |
|
70 |
</thead> |
|
71 |
<tbody> |
|
72 |
<tr class="d-flex" ng-repeat="sr in events.conflicts"> |
|
73 |
<td class="col-4 pl-3"> |
|
74 |
{{sr.oaName}} |
|
75 |
<span class="small" ng-if="sr.oaUrl" ><br /><b>URL: </b><a href="{{sr.oaUrl}}" target="_blank">{{sr.oaUrl}}</a></span> |
|
76 |
</td> |
|
77 |
<td class="col-1 text-center small">{{sr.oaAcronym}}</td> |
|
78 |
<td class="col-1 text-center small"><img ng-src="resources/images/flags/{{sr.oaCountry}}.gif" /> {{sr.oaCountry}}</td> |
|
79 |
<td class="col-4 small"> |
|
80 |
<a href="#!/edit/0/{{sr.oaOriginalId}}"><span class="text-monospace">{{sr.oaOriginalId}}</span></a> |
|
81 |
</td> |
|
82 |
<td class="col-2 text-right"> |
|
83 |
<div class="btn-group btn-group-toggle btn-group-sm" data-toggle="buttons"> |
|
84 |
<label class="btn" ng-class="{'btn-danger' : sr.relType == 'is_different', 'btn-outline-danger' : sr.relType != 'is_different'}"> |
|
85 |
<input type="radio" autocomplete="off" ng-model="sr.relType" value="is_different" ng-class="{'active' : sr.relType == 'is_different'}"><i class="fas fa-times fa-fw"></i> |
|
86 |
</label> |
|
87 |
<label class="btn" ng-class="{'btn-info' : sr.relType == 'suggested', 'btn-outline-info' : sr.relType != 'suggested'}"> |
|
88 |
<input type="radio" autocomplete="off" ng-model="sr.relType" value="suggested" ng-class="{'active' : sr.relType == 'suggested'}"><i class="fas fa-question fa-fw"></i> |
|
89 |
</label> |
|
90 |
<label class="btn" ng-class="{'btn-success' : sr.relType == 'is_similar', 'btn-outline-success' : sr.relType != 'is_similar'}"> |
|
91 |
<input type="radio" autocomplete="off" ng-model="sr.relType" value="is_similar" ng-class="{'active' : sr.relType == 'is_similar'}"/><i class="fas fa-check fa-fw"></i> |
|
92 |
</label> |
|
93 |
</div> |
|
94 |
</td> |
|
95 |
</tr> |
|
96 |
</tbody> |
|
97 |
</table> |
|
6 | 98 |
|
7 |
<table class="table table-sm mt-2" ng-if="events.duplicates.length > 0"> |
|
8 |
<thead> |
|
9 |
<tr> |
|
10 |
<th class="pl-3" style="border-top: none;">Related organization</th> |
|
11 |
<th class="text-center" style="border-top: none;">Acronym</th> |
|
12 |
<th class="text-center" style="border-top: none;">Country</th> |
|
13 |
<th style="border-top: none;">Source</th> |
|
14 |
<th style="border-top: none;"></th> |
|
15 |
</tr> |
|
16 |
</thead> |
|
17 |
<tbody> |
|
18 |
<tr ng-repeat="sr in events.duplicates"> |
|
19 |
<td class="pl-3"> |
|
20 |
{{sr.oaName}} |
|
21 |
<span class="small" ng-if="sr.oaUrl" ><br /><b>URL: </b><a href="{{sr.oaUrl}}" target="_blank">{{sr.oaUrl}}</a></span> |
|
22 |
</td> |
|
23 |
<td class="text-center small">{{sr.oaAcronym}}</td> |
|
24 |
<td class="text-center small"><img ng-src="resources/images/flags/{{sr.oaCountry}}.gif" /> {{sr.oaCountry}}</td> |
|
25 |
<td class="small"> |
|
26 |
<b>Collected from:</b> {{sr.oaCollectedFrom}}<br /> |
|
27 |
<b>Original Id:</b> <span class="text-monospace">{{sr.oaOriginalId}}</span> |
|
28 |
</td> |
|
29 |
<td class="text-right"> |
|
30 |
<div class="btn-group btn-group-toggle btn-group-sm" data-toggle="buttons"> |
|
31 |
<label class="btn" ng-class="{'btn-danger' : sr.relType == 'is_different', 'btn-outline-danger' : sr.relType != 'is_different'}"> |
|
32 |
<input type="radio" autocomplete="off" ng-model="sr.relType" value="is_different" ng-class="{'active' : sr.relType == 'is_different'}"><i class="fas fa-times fa-fw"></i> |
|
33 |
</label> |
|
34 |
<label class="btn" ng-class="{'btn-info' : sr.relType == 'suggested', 'btn-outline-info' : sr.relType != 'suggested'}"> |
|
35 |
<input type="radio" autocomplete="off" ng-model="sr.relType" value="suggested" ng-class="{'active' : sr.relType == 'suggested'}"><i class="fas fa-question fa-fw"></i> |
|
36 |
</label> |
|
37 |
<label class="btn" ng-class="{'btn-success' : sr.relType == 'is_similar', 'btn-outline-success' : sr.relType != 'is_similar'}"> |
|
38 |
<input type="radio" autocomplete="off" ng-model="sr.relType" value="is_similar" ng-class="{'active' : sr.relType == 'is_similar'}"/><i class="fas fa-check fa-fw"></i> |
|
39 |
</label> |
|
40 |
</div> |
|
41 |
</td> |
|
42 |
</tr> |
|
43 |
</tbody> |
|
44 |
</table> |
|
45 |
|
|
46 |
<div class="card-footer" ng-if="events.duplicates.length > 0"> |
|
47 |
<button class="btn btn-sm btn-primary" ng-click="saveDuplicates">save</button> |
|
99 |
<div class="card-footer text-right" ng-if="events.conflicts.length > 0"> |
|
100 |
<button class="btn btn-sm btn-primary">todo</button> |
|
101 |
</div> |
|
102 |
</div> |
|
48 | 103 |
</div> |
49 | 104 |
|
50 |
|
|
51 |
<!-- --> |
|
52 |
<h2>Conflicts</h2> |
|
53 |
|
|
54 |
<div class="card-body text-muted" ng-if="events.conflicts.length == 0"> |
|
55 |
No conflicts |
|
56 |
</div> |
|
57 |
|
|
58 |
<table class="table table-sm mt-2" ng-if="events.conflicts.length > 0"> |
|
59 |
<thead> |
|
60 |
<tr> |
|
61 |
<th class="pl-3" style="border-top: none;">Related organization</th> |
|
62 |
<th class="text-center" style="border-top: none;">Acronym</th> |
|
63 |
<th class="text-center" style="border-top: none;">Country</th> |
|
64 |
<th style="border-top: none;"></th> |
|
65 |
</tr> |
|
66 |
</thead> |
|
67 |
<tbody> |
|
68 |
<tr ng-repeat="sr in events.conflicts"> |
|
69 |
<td class="pl-3"> |
|
70 |
<a href="#!/edit/0/{{sr.oaOriginalId}}">{{sr.oaName}}</a> |
|
71 |
<span class="small" ng-if="sr.oaUrl" ><br /><b>URL: </b><a href="{{sr.oaUrl}}" target="_blank">{{sr.oaUrl}}</a></span> |
|
72 |
</td> |
|
73 |
<td class="text-center small">{{sr.oaAcronym}}</td> |
|
74 |
<td class="text-center small"><img ng-src="resources/images/flags/{{sr.oaCountry}}.gif" /> {{sr.oaCountry}}</td> |
|
75 |
<td class="text-right"> |
|
76 |
<div class="btn-group btn-group-toggle btn-group-sm" data-toggle="buttons"> |
|
77 |
<label class="btn" ng-class="{'btn-danger' : sr.relType == 'is_different', 'btn-outline-danger' : sr.relType != 'is_different'}"> |
|
78 |
<input type="radio" autocomplete="off" ng-model="sr.relType" value="is_different" ng-class="{'active' : sr.relType == 'is_different'}"><i class="fas fa-times fa-fw"></i> |
|
79 |
</label> |
|
80 |
<label class="btn" ng-class="{'btn-info' : sr.relType == 'suggested', 'btn-outline-info' : sr.relType != 'suggested'}"> |
|
81 |
<input type="radio" autocomplete="off" ng-model="sr.relType" value="suggested" ng-class="{'active' : sr.relType == 'suggested'}"><i class="fas fa-question fa-fw"></i> |
|
82 |
</label> |
|
83 |
<label class="btn" ng-class="{'btn-success' : sr.relType == 'is_similar', 'btn-outline-success' : sr.relType != 'is_similar'}"> |
|
84 |
<input type="radio" autocomplete="off" ng-model="sr.relType" value="is_similar" ng-class="{'active' : sr.relType == 'is_similar'}"/><i class="fas fa-check fa-fw"></i> |
|
85 |
</label> |
|
86 |
</div> |
|
87 |
</td> |
|
88 |
</tr> |
|
89 |
</tbody> |
|
90 |
</table> |
|
91 |
|
|
92 |
<div class="card-footer" ng-if="events.conflicts > 0"> |
|
93 |
<button class="btn btn-sm btn-primary">save</button> |
|
94 |
</div> |
|
95 |
|
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/part/org_info.html | ||
---|---|---|
1 |
<p class="text-muted"> |
|
2 |
<b>ID: </b>{{info.id}}<br /> |
|
3 |
<b>Name: </b>{{info.name}}<br /> |
|
4 |
<b>Created at</b> {{info.creationDate | date:'MMMM d, y HH:mm:ss'}} <b>by</b> {{info.createdBy}}<br /> |
|
5 |
<b>Modified at</b> {{info.modificationDate | date:'MMMM d, y HH:mm:ss'}} <b>by</b> {{info.modifiedBy}} |
|
6 |
</p> |
|
1 |
<h4>{{info.name}}</h4> |
|
2 |
|
|
3 |
<div class="row"> |
|
4 |
<div class="col-xl-8 col-lg-10"> |
|
5 |
<div class="alert alert-success" ng-if="message">{{message}}</div> |
|
6 |
<p class="text-muted" ng-if="!message"> |
|
7 |
<b>ID: </b>{{info.id}}<br /> |
|
8 |
<b>Created at</b> {{info.creationDate | date:'MMMM d, y HH:mm:ss'}} <b>by</b> {{info.createdBy}}<br /> |
|
9 |
<b>Modified at</b> {{info.modificationDate | date:'MMMM d, y HH:mm:ss'}} <b>by</b> {{info.modifiedBy}} |
|
10 |
</p> |
|
11 |
</div> |
|
12 |
</div> |
|
13 |
|
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/part/org_tabs_menu.html | ||
---|---|---|
4 | 4 |
<a href="javascript:void(0)" class="nav-link" ng-class="{'active': selected == 1}" ng-click="loadOrg()">Metadata Management</a> |
5 | 5 |
</li> |
6 | 6 |
<li class="nav-item"> |
7 |
<a href="javascript:void(0)" class="nav-link" ng-class="{'active': selected == 2}" ng-click="loadDedupEvents()">Dedup Events <span class="badge badge-secondary">{{info.nDuplicates}}</span> <span class="badge badge-secondary">{{info.nConflicts}}</span></a>
|
|
7 |
<a href="javascript:void(0)" class="nav-link" ng-class="{'active': selected == 2}" ng-click="loadDedupEvents()">Dedup Events <span class="badge badge-primary ml-2">{{info.nDuplicates}}</span> <span class="badge badge-danger">{{info.nConflicts}}</span></a>
|
|
8 | 8 |
</li> |
9 | 9 |
</ul> |
10 | 10 |
</div> |
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/edit.html | ||
---|---|---|
1 |
<div class="row"> |
|
2 |
<div class="col-xl-8 col-lg-10"> |
|
3 |
<div class="alert alert-success" ng-if="message">{{message}}</div> |
|
4 |
<organization-info ng-if="orgId && !message" info="info"></organization-info> |
|
5 |
</div> |
|
6 |
</div> |
|
1 |
<organization-info info="info" message="message"></organization-info> |
|
7 | 2 |
|
8 | 3 |
<div class="row"> |
9 | 4 |
<div class="col-xl-8 col-lg-10"> |
10 | 5 |
<div class="card"> |
11 | 6 |
<org-tabs-menu org-id="{{orgId}}" info="info" org="org" events="events" selected="currentTab"></org-tabs-menu> |
12 |
<org-form-metadata org-id="{{orgId}}" org="org" vocabularies="vocabularies" ng-if="currentTab == 1"></org-form-metadata> |
|
13 |
<org-form-dedup-events org-id="{{orgId}}" events="events" vocabularies="vocabularies" ng-if="currentTab == 2"></org-form-dedup-events> |
|
7 |
<org-form-metadata org-id="{{orgId}}" org="org" vocabularies="vocabularies" info-method="getInfo()" ng-if="currentTab == 1"></org-form-metadata>
|
|
8 |
<org-form-dedup-events org-id="{{orgId}}" events="events" vocabularies="vocabularies" info-method="getInfo()" ng-if="currentTab == 2"></org-form-dedup-events>
|
|
14 | 9 |
</div> |
15 | 10 |
</div> |
16 | 11 |
</div> |
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/js/organizations.js | ||
---|---|---|
1 | 1 |
var orgsModule = angular.module('orgs', ['ngRoute', 'checklist-model']); |
2 | 2 |
|
3 |
orgsModule.service('orgInfoService', function($http) { |
|
4 |
this.info = {}; |
|
5 |
this.getInfo = function(id, f) { |
|
6 |
if (id) { |
|
7 |
if (this.info.id == id) { |
|
8 |
f(this.info); |
|
9 |
} else { |
|
10 |
$http.get('api/organizations/info?id=' + id).then(function successCallback(res) { |
|
11 |
if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); } |
|
12 |
this.info = res.data; |
|
13 |
f(angular.copy(this.info)); |
|
14 |
}, function errorCallback(res) { |
|
15 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); |
|
16 |
}); |
|
17 |
} |
|
18 |
} else { |
|
19 |
f({}); |
|
20 |
} |
|
21 |
}; |
|
22 |
}); |
|
23 |
|
|
24 | 3 |
orgsModule.service('vocabulariesService', function($http) { |
25 | 4 |
this.vocs = {}; |
26 | 5 |
this.getVocs = function(f) { |
... | ... | |
42 | 21 |
return { |
43 | 22 |
restrict: 'E', |
44 | 23 |
scope: { |
45 |
info : '=' |
|
24 |
'info' : '=', |
|
25 |
'message' : '=' |
|
46 | 26 |
}, |
47 | 27 |
templateUrl: 'resources/html/part/org_info.html' |
48 | 28 |
} |
... | ... | |
95 | 75 |
'orgId' : '@', |
96 | 76 |
'org' : '=', |
97 | 77 |
'vocabularies' : '=', |
98 |
'mode' : '@' // insert or update |
|
78 |
'mode' : '@', // insert or update |
|
79 |
'infoMethod' : '&' |
|
99 | 80 |
}, |
100 | 81 |
templateUrl: 'resources/html/part/org_form_metadata.html', |
101 | 82 |
link: function(scope, element, attrs, ctrl) { |
... | ... | |
159 | 140 |
scope: { |
160 | 141 |
'orgId' : '@', |
161 | 142 |
'events' : '=', |
162 |
'vocabularies' : '=' |
|
143 |
'vocabularies' : '=', |
|
144 |
'infoMethod' : '&' |
|
163 | 145 |
}, |
164 | 146 |
templateUrl: 'resources/html/part/org_form_dedup_events.html', |
165 | 147 |
link: function(scope, element, attrs, ctrl) { |
... | ... | |
167 | 149 |
$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8"; |
168 | 150 |
$http.post('api/organizations/duplicates', scope.events.duplicates).then(function successCallback(res) { |
169 | 151 |
if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); } |
152 |
if (scope.infoMethod) { scope.infoMethod(); } |
|
170 | 153 |
alert('Events updated !!!'); |
171 |
scope.events = res.data; |
|
154 |
scope.events.duplicates = res.data;
|
|
172 | 155 |
}, function errorCallback(res) { |
173 | 156 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); |
174 | 157 |
}); |
... | ... | |
305 | 288 |
}); |
306 | 289 |
|
307 | 290 |
|
308 |
orgsModule.controller('showEditCtrl', function ($scope, $http, $routeParams, $route, $location, $timeout, orgInfoService, vocabulariesService) {
|
|
291 |
orgsModule.controller('showEditCtrl', function ($scope, $http, $routeParams, $route, $location, $timeout, vocabulariesService) { |
|
309 | 292 |
$scope.orgId = $routeParams.id; |
310 | 293 |
$scope.org = {}; |
311 | 294 |
$scope.events = {}; |
312 |
|
|
313 | 295 |
$scope.info = {}; |
314 |
orgInfoService.getInfo($scope.orgId, function(info) { $scope.info = info; }); |
|
315 | 296 |
|
297 |
$scope.getInfo = function() { |
|
298 |
$http.get('api/organizations/info?id=' + $scope.orgId).then(function successCallback(res) { |
|
299 |
if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); } |
|
300 |
$scope.info = res.data; |
|
301 |
}, function errorCallback(res) { |
|
302 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); |
|
303 |
}); |
|
304 |
}; |
|
305 |
|
|
306 |
$scope.getInfo(); |
|
307 |
|
|
316 | 308 |
$scope.vocabularies = {}; |
317 | 309 |
vocabulariesService.getVocs(function(vocs) { $scope.vocabularies = vocs; }); |
318 | 310 |
|
Also available in: Unified diff