merged master

This commit is contained in:
Sandro La Bruzzo 2022-03-29 12:13:33 +02:00
commit c0277c4938
19 changed files with 38 additions and 35 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@
*.iml
*.ipr
*.iws
*.java-version
*~
/**/*.sh
/**/my_application.properties

View File

@ -4,8 +4,8 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId>
<version>3.2.3-SNAPSHOT</version>
<relativePath>../</relativePath>
<version>3.2.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -4,8 +4,8 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId>
<version>3.2.3-SNAPSHOT</version>
<relativePath>../</relativePath>
<version>3.2.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -4,8 +4,8 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId>
<version>3.2.3-SNAPSHOT</version>
<relativePath>../</relativePath>
<version>3.2.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId>
<version>3.2.3-SNAPSHOT</version>
<version>3.2.5-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

View File

@ -14,11 +14,19 @@ UPDATE tmp_dedup_events SET local_id = oa_original_id WHERE local_id = '' OR lo
UPDATE tmp_dedup_events SET oa_country = 'UNKNOWN' WHERE oa_country = '' OR oa_country IS NULL;
UPDATE tmp_dedup_events SET oa_name = oa_acronym WHERE oa_name = '' OR oa_name IS NULL;
DELETE FROM tmp_dedup_events WHERE oa_name = '' OR oa_name IS NULL;
-- delete invalid relations (a raw org can not be suggested as duplicate and as new org)
DELETE FROM tmp_dedup_events WHERE oa_original_id IN (
SELECT oa_original_id
FROM tmp_dedup_events
GROUP BY oa_original_id HAVING count(oa_original_id) > 1)
AND (local_id = '' OR local_id is NULL);
-- delete invalid relations (a raw org can not be suggested to multiple orgs)
DELETE FROM tmp_dedup_events WHERE oa_original_id IN (
SELECT oa_original_id
FROM tmp_dedup_events
GROUP BY oa_original_id HAVING count(*) > 1)
GROUP BY oa_original_id HAVING count(oa_original_id) > 1)
AND local_id NOT LIKE 'openorgs____::%';
-- IMPORT MISSING TERMS
@ -137,14 +145,4 @@ DELETE FROM oa_duplicates d
USING oa_duplicates d1
WHERE d.oa_original_id = d1.oa_original_id AND d.reltype = 'suggested' AND d1.reltype = 'is_similar';
COMMIT;

View File

@ -648,7 +648,6 @@ GROUP BY o.id, o.name, o.city, o.country
ORDER BY o.name;
CREATE TABLE org_index_search(id text PRIMARY KEY, txt tsvector);
CREATE INDEX org_index_search_txt_idx ON org_index_search(txt);
CREATE INDEX org_index_search_txt_gin_idx ON org_index_search USING gin(txt);
CREATE OR REPLACE FUNCTION refresh_index_search() RETURNS bigint AS $$
@ -656,9 +655,10 @@ CREATE OR REPLACE FUNCTION refresh_index_search() RETURNS bigint AS $$
WITH d as (
INSERT INTO org_index_search(id, txt) SELECT
o.id,
to_tsvector(o.id||' '||o.name||' '||array_to_string(array_agg(DISTINCT n.name), ' ','')||' '||array_to_string(array_agg(DISTINCT a.acronym), ' ','')||' '||array_to_string(array_agg(DISTINCT u.url), ' ',''))
to_tsvector(o.id||' '||o.name||' '||array_to_string(array_agg(DISTINCT n.name), ' ','')||' '||array_to_string(array_agg(DISTINCT i.otherid), ' ','')||' '||array_to_string(array_agg(DISTINCT a.acronym), ' ','')||' '||array_to_string(array_agg(DISTINCT u.url), ' ',''))
FROM organizations o
LEFT OUTER JOIN other_names n on (o.id = n.id)
LEFT OUTER JOIN other_ids i on (o.id = i.id)
LEFT OUTER JOIN acronyms a on (o.id = a.id)
LEFT OUTER JOIN urls u on (o.id = u.id)
GROUP BY o.id, o.name RETURNING *
@ -680,9 +680,10 @@ CREATE OR REPLACE FUNCTION insert_or_update_index_search_trigger() RETURNS trigg
BEGIN
INSERT INTO org_index_search(id, txt) (SELECT
o.id,
to_tsvector(o.id||' '||o.name||' '||array_to_string(array_agg(DISTINCT n.name), ' ','')||' '||array_to_string(array_agg(DISTINCT a.acronym), ' ','')||' '||array_to_string(array_agg(DISTINCT u.url), ' ',''))
to_tsvector(o.id||' '||o.name||' '||array_to_string(array_agg(DISTINCT n.name), ' ','')||' '||array_to_string(array_agg(DISTINCT i.otherid), ' ','')||' '||array_to_string(array_agg(DISTINCT a.acronym), ' ','')||' '||array_to_string(array_agg(DISTINCT u.url), ' ',''))
FROM organizations o
LEFT OUTER JOIN other_names n on (o.id = n.id)
LEFT OUTER JOIN other_ids i on (o.id = i.id)
LEFT OUTER JOIN acronyms a on (o.id = a.id)
LEFT OUTER JOIN urls u on (o.id = u.id)
WHERE o.id = new.id

View File

@ -59,7 +59,7 @@
required="required"
ng-class="{'is-invalid' : organizationForm.org_cntr.$error.required}">
<option disabled="disabled" value='' ng-if="!org.country">country...</option>
<option ng-repeat="c in vocabularies.countries"value="{{c.value}}">{{c.name}}</option>
<option ng-repeat="c in vocabularies.countries" value="{{c.value}}">{{c.name}}</option>
</select>
<div class="input-group-append input-group-prepend">
<div class="input-group-text bg-primary text-white" ng-class="{'bg-light text-dark' : mode == 'readonly' || mode == 'not_authorized', 'bg-warning' : mode == 'approve'}">lat</div>
@ -252,7 +252,7 @@
<tr ng-if="org.relations.length == 0">
<td class="text-center text-muted" colspan="4">No relations</td>
</tr>
<tr ng-repeat="r in org.relations | orderBy:['type','relatedOrgName']">
<tr ng-repeat="r in org.relations">
<td class="pl-3" colspan="3">This organizazion
<!-- NB: The showed value MUST be the inverse -->
<span ng-switch="r.type">

View File

@ -513,7 +513,7 @@ orgsModule.controller('byTypeCtrl', function ($scope, $http, $routeParams, $loca
});
orgsModule.controller('showEditCtrl', function ($scope, $http, $routeParams, $route, $location, $timeout, $window, vocabulariesService) {
orgsModule.controller('showEditCtrl', function ($scope, $http, $routeParams, $route, $location, $timeout, $window, $filter, vocabulariesService) {
$scope.orgId = $routeParams.id;
$scope.org = {};
$scope.duplicates = [];
@ -529,7 +529,10 @@ orgsModule.controller('showEditCtrl', function ($scope, $http, $routeParams, $ro
$scope.gotoTab = function(tab) {
$scope.org = {};
call_http_get($http, 'api/organizations/get?id=' + $scope.orgId, function(res) { $scope.org = res.data; });
call_http_get($http, 'api/organizations/get?id=' + $scope.orgId, function(res) {
res.data.relations = $filter('orderBy')(res.data.relations, ['type','relatedOrgName'], false);
$scope.org = res.data;
});
if (tab == 2) {
$scope.duplicates = [];

View File

@ -3,7 +3,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>dnet-applications</artifactId>
<version>3.2.3-SNAPSHOT</version>
<version>3.2.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId>
<version>3.2.3-SNAPSHOT</version>
<version>3.2.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>cmd-line-apps</artifactId>
<version>3.2.3-SNAPSHOT</version>
<version>3.2.5-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

View File

@ -3,7 +3,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>dnet-applications</artifactId>
<version>3.2.3-SNAPSHOT</version>
<version>3.2.5-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>libs</artifactId>
<version>3.2.3-SNAPSHOT</version>
<version>3.2.5-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>libs</artifactId>
<version>3.2.3-SNAPSHOT</version>
<version>3.2.5-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

View File

@ -3,7 +3,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>libs</artifactId>
<version>3.2.3-SNAPSHOT</version>
<version>3.2.5-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>dnet-applications</artifactId>
<version>3.2.3-SNAPSHOT</version>
<version>3.2.5-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

View File

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>dnet-applications</artifactId>
<version>3.2.3-SNAPSHOT</version>
<version>3.2.5-SNAPSHOT</version>
<packaging>pom</packaging>
<licenses>
@ -398,7 +398,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.plugin.version>3.6.0</maven.compiler.plugin.version>
<java.version>1.8</java.version>
<dhp-schemas-version>2.10.30-SCHOLEXPLORER-SNAPSHOT</dhp-schemas-version>
<dhp-schemas-version>2.11.33</dhp-schemas-version>
<apache.solr.version>7.1.0</apache.solr.version>
<mongodb.driver.version>3.4.2</mongodb.driver.version>
<springfox-version>2.8.0</springfox-version>