new-exporter #5
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.dnetlib.dhp</groupId>
|
<groupId>eu.dnetlib.dhp</groupId>
|
||||||
<artifactId>apps</artifactId>
|
<artifactId>apps</artifactId>
|
||||||
<version>3.2.5-SNAPSHOT</version>
|
<version>3.2.6-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.dnetlib.dhp</groupId>
|
<groupId>eu.dnetlib.dhp</groupId>
|
||||||
<artifactId>apps</artifactId>
|
<artifactId>apps</artifactId>
|
||||||
<version>3.2.5-SNAPSHOT</version>
|
<version>3.2.6-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.dnetlib.dhp</groupId>
|
<groupId>eu.dnetlib.dhp</groupId>
|
||||||
<artifactId>apps</artifactId>
|
<artifactId>apps</artifactId>
|
||||||
<version>3.2.5-SNAPSHOT</version>
|
<version>3.2.6-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.dnetlib.dhp</groupId>
|
<groupId>eu.dnetlib.dhp</groupId>
|
||||||
<artifactId>apps</artifactId>
|
<artifactId>apps</artifactId>
|
||||||
<version>3.2.5-SNAPSHOT</version>
|
<version>3.2.6-SNAPSHOT</version>
|
||||||
<relativePath>../</relativePath>
|
<relativePath>../</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ public class AdminController extends AbstractDnetController {
|
||||||
@GetMapping("/api/restartSuggestionsImport")
|
@GetMapping("/api/restartSuggestionsImport")
|
||||||
public List<String> restartSuggestionsImport(final Authentication authentication) {
|
public List<String> restartSuggestionsImport(final Authentication authentication) {
|
||||||
if (UserInfo.isSuperAdmin(authentication)) {
|
if (UserInfo.isSuperAdmin(authentication)) {
|
||||||
importExecutor.startImport("the portal, user: " + authentication.getName());
|
importExecutor.startImport("the portal, user: " + UserInfo.getEmail(authentication));
|
||||||
return Arrays.asList("The import is running");
|
return Arrays.asList("The import is running");
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("User not authorized");
|
throw new RuntimeException("User not authorized");
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package eu.dnetlib.organizations.utils;
|
package eu.dnetlib.organizations.utils;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -18,7 +17,6 @@ import java.util.stream.Collectors;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
@ -436,7 +434,7 @@ public class DatabaseUtils {
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void importDedupEvents() throws Exception {
|
public void importDedupEvents() throws Exception {
|
||||||
jdbcTemplate.update(IOUtils.toString(getClass().getResourceAsStream("/sql/importDedupEvents.sql"), StandardCharsets.UTF_8));
|
jdbcTemplate.update("CALL import_dedup_events();");
|
||||||
// verifyConflictGroups(true);
|
// verifyConflictGroups(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
BEGIN;
|
CREATE OR REPLACE PROCEDURE import_dedup_events() LANGUAGE plpgsql AS $$
|
||||||
|
BEGIN
|
||||||
|
|
||||||
DELETE FROM oa_conflicts WHERE created_by = 'dedupWf' and modified_by = 'dedupWf' and reltype = 'suggested';
|
DELETE FROM oa_conflicts WHERE created_by = 'dedupWf' and modified_by = 'dedupWf' and reltype = 'suggested';
|
||||||
DELETE FROM oa_duplicates WHERE created_by = 'dedupWf' and modified_by = 'dedupWf' and reltype = 'suggested';
|
DELETE FROM oa_duplicates WHERE created_by = 'dedupWf' and modified_by = 'dedupWf' and reltype = 'suggested';
|
||||||
|
@ -20,7 +21,8 @@ DELETE FROM tmp_dedup_events WHERE oa_original_id IN (
|
||||||
SELECT oa_original_id
|
SELECT oa_original_id
|
||||||
FROM tmp_dedup_events
|
FROM tmp_dedup_events
|
||||||
GROUP BY oa_original_id HAVING count(oa_original_id) > 1)
|
GROUP BY oa_original_id HAVING count(oa_original_id) > 1)
|
||||||
AND (local_id = '' OR local_id is NULL);
|
AND (local_id = '' OR local_id is NULL OR local_id = oa_original_id)
|
||||||
|
AND (group_id = '' OR group_id is NULL);
|
||||||
|
|
||||||
-- delete invalid relations (a raw org can not be suggested to multiple orgs)
|
-- delete invalid relations (a raw org can not be suggested to multiple orgs)
|
||||||
DELETE FROM tmp_dedup_events WHERE oa_original_id IN (
|
DELETE FROM tmp_dedup_events WHERE oa_original_id IN (
|
||||||
|
@ -29,6 +31,13 @@ DELETE FROM tmp_dedup_events WHERE oa_original_id IN (
|
||||||
GROUP BY oa_original_id HAVING count(oa_original_id) > 1)
|
GROUP BY oa_original_id HAVING count(oa_original_id) > 1)
|
||||||
AND local_id NOT LIKE 'openorgs____::%';
|
AND local_id NOT LIKE 'openorgs____::%';
|
||||||
|
|
||||||
|
-- delete invalid groups (only one row)
|
||||||
|
DELETE FROM tmp_dedup_events WHERE group_id IN (
|
||||||
|
SELECT group_id
|
||||||
|
FROM tmp_dedup_events GROUP BY group_id
|
||||||
|
HAVING count(*) = 1
|
||||||
|
);
|
||||||
|
|
||||||
-- IMPORT MISSING TERMS
|
-- IMPORT MISSING TERMS
|
||||||
INSERT INTO id_types(val, name) SELECT distinct arr[2], arr[2] FROM (SELECT string_to_array(unnest(string_to_array(pid_list, '@@@')), '###') AS arr FROM tmp_dedup_events WHERE oa_original_id NOT LIKE 'openorgs\_\_\_\_::%') as c ON CONFLICT DO NOTHING;
|
INSERT INTO id_types(val, name) SELECT distinct arr[2], arr[2] FROM (SELECT string_to_array(unnest(string_to_array(pid_list, '@@@')), '###') AS arr FROM tmp_dedup_events WHERE oa_original_id NOT LIKE 'openorgs\_\_\_\_::%') as c ON CONFLICT DO NOTHING;
|
||||||
|
|
||||||
|
@ -145,4 +154,5 @@ DELETE FROM oa_duplicates d
|
||||||
USING oa_duplicates d1
|
USING oa_duplicates d1
|
||||||
WHERE d.oa_original_id = d1.oa_original_id AND d.reltype = 'suggested' AND d1.reltype = 'is_similar';
|
WHERE d.oa_original_id = d1.oa_original_id AND d.reltype = 'suggested' AND d1.reltype = 'is_similar';
|
||||||
|
|
||||||
COMMIT;
|
END;
|
||||||
|
$$;
|
||||||
|
|
|
@ -40,7 +40,7 @@ INSERT INTO org_types(val) VALUES ('Archive'), ('Company'), ('Education'), ('Fac
|
||||||
UPDATE org_types SET name = val;
|
UPDATE org_types SET name = val;
|
||||||
|
|
||||||
CREATE TABLE id_types (val text PRIMARY KEY, name text);
|
CREATE TABLE id_types (val text PRIMARY KEY, name text);
|
||||||
INSERT INTO id_types(val) VALUES ('CNRS'), ('FundRef'), ('HESA'), ('ISNI'), ('LinkedIn'), ('OrgRef'), ('UCAS'), ('UKPRN'), ('Wikidata'), ('GRID'), ('ROR');
|
INSERT INTO id_types(val) VALUES ('CNRS'), ('FundRef'), ('HESA'), ('ISNI'), ('LinkedIn'), ('OrgRef'), ('UCAS'), ('UKPRN'), ('Wikidata'), ('GRID'), ('ROR'), ('OrgReg');
|
||||||
UPDATE id_types SET name = val;
|
UPDATE id_types SET name = val;
|
||||||
|
|
||||||
CREATE TABLE languages (val text PRIMARY KEY, name text);
|
CREATE TABLE languages (val text PRIMARY KEY, name text);
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<p ng-if="mode == 'select-modal'">Click the <b>organization name</b> to add the organization (multiple selection is allowed)</p>
|
||||||
|
|
||||||
<table class="table table-sm table-hover" ng-if="orgs.content.length > 0">
|
<table class="table table-sm table-hover" ng-if="orgs.content.length > 0">
|
||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
<tr class="d-flex">
|
<tr class="d-flex">
|
||||||
|
@ -49,9 +51,11 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="o in orgs.content" class="d-flex" ng-class="{'table-warning' : showStatus && o.status != 'approved'}">
|
<tr ng-repeat="o in orgs.content" class="d-flex" ng-class="{'table-warning' : showStatus && o.status != 'approved'}">
|
||||||
<td class="col-6">
|
<td class="col-6">
|
||||||
<a ng-if="mode == 'select-modal'" href="javascript:void(0)" title="{{o.id}}" ng-click="selectOrg(o)" data-dismiss="modal">{{o.name}}</a>
|
<a ng-if="(mode == 'select-modal') && !o.selected" href="javascript:void(0)" title="{{o.id}}" ng-click="selectOrg(o)">{{o.name}}</a>
|
||||||
|
<span ng-if="(mode == 'select-modal') && o.selected" title="{{o.id}}" class="text-muted">{{o.name}} <b>(SELECTED)</b></span>
|
||||||
<a ng-if="mode != 'select-modal'" href="#!/edit/0/{{o.id}}" title="{{o.id}}">{{o.name}}</a>
|
<a ng-if="mode != 'select-modal'" href="#!/edit/0/{{o.id}}" title="{{o.id}}">{{o.name}}</a>
|
||||||
<span class="badge badge-warning" ng-if="showStatus && o.status != 'approved'">{{o.status}}</span>
|
<span class="badge badge-warning" ng-if="showStatus && o.status != 'approved'">{{o.status}}</span>
|
||||||
|
<span ng-if="mode == 'select-modal'" class="small" ng-repeat="ourl in o.urls"><br /><b>URL: </b><a href="{{ourl}}" target="_blank" ng-if="ourl">{{ourl}}</a></span>
|
||||||
</td>
|
</td>
|
||||||
<td ng-class="{'col-3' : showNDups, 'col-4' : !showNDups }"><img ng-src="resources/images/flags/{{o.country}}.gif" /> {{o.city || '-'}}, {{o.country}}</td>
|
<td ng-class="{'col-3' : showNDups, 'col-4' : !showNDups }"><img ng-src="resources/images/flags/{{o.country}}.gif" /> {{o.city || '-'}}, {{o.country}}</td>
|
||||||
<td class="col-1 text-center">{{o.acronyms.join()}}</td>
|
<td class="col-1 text-center">{{o.acronyms.join()}}</td>
|
||||||
|
|
|
@ -6,12 +6,14 @@
|
||||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body" style="min-height: 300px">
|
<div class="modal-body" style="min-height: 300px">
|
||||||
|
<form>
|
||||||
<div class="input-group input-group-sm">
|
<div class="input-group input-group-sm">
|
||||||
<input type="text" class="form-control" ng-model="searchText" />
|
<input type="text" class="form-control" ng-model="searchText" />
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<button type="button" class="btn btn-outline-primary" ng-click="search(searchText, 0, 25)">Search</button>
|
<button type="submit" class="btn btn-outline-primary" ng-click="search(searchText, 0, 25)">Search</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
<div ng-show="searchValue">
|
<div ng-show="searchValue">
|
||||||
<org-results-page orgs="searchOrgs"
|
<org-results-page orgs="searchOrgs"
|
||||||
prev-function="search(searchValue, searchOrgs.number - 1, searchOrgs.size)"
|
prev-function="search(searchValue, searchOrgs.number - 1, searchOrgs.size)"
|
||||||
|
@ -22,6 +24,9 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -63,12 +63,6 @@ orgsModule.directive('selectOrgModal', function($http, $timeout) {
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.selectOrg = function() {
|
scope.selectOrg = function() {
|
||||||
$timeout(function() {
|
|
||||||
scope.searchText = '';
|
|
||||||
scope.searchValue = '';
|
|
||||||
scope.searchOrgs = {};
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
if (scope.onSelect) {
|
if (scope.onSelect) {
|
||||||
scope.onSelect();
|
scope.onSelect();
|
||||||
}
|
}
|
||||||
|
@ -219,6 +213,8 @@ orgsModule.directive('orgResultsPage', function($http, $location, $route) {
|
||||||
templateUrl: 'resources/html/parts/org_results_page.html',
|
templateUrl: 'resources/html/parts/org_results_page.html',
|
||||||
link: function(scope, element, attrs, ctrl) {
|
link: function(scope, element, attrs, ctrl) {
|
||||||
scope.selectOrg = function(o) {
|
scope.selectOrg = function(o) {
|
||||||
|
o.selected = true;
|
||||||
|
|
||||||
scope.selectedOrg.id = o.id;
|
scope.selectedOrg.id = o.id;
|
||||||
scope.selectedOrg.name = o.name;
|
scope.selectedOrg.name = o.name;
|
||||||
scope.selectedOrg.type = o.type;
|
scope.selectedOrg.type = o.type;
|
||||||
|
@ -269,7 +265,7 @@ orgsModule.directive('orgDuplicates', function($http, $location, $route) {
|
||||||
'oaUrl' : scope.newDuplicate.urls.join(),
|
'oaUrl' : scope.newDuplicate.urls.join(),
|
||||||
'oaCollectedFrom' : '',
|
'oaCollectedFrom' : '',
|
||||||
'createdBy' : currentUser(),
|
'createdBy' : currentUser(),
|
||||||
'relType' : 'is_similar'
|
'relType' : 'suggested'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -555,7 +551,7 @@ orgsModule.controller('showEditCtrl', function ($scope, $http, $routeParams, $ro
|
||||||
$scope.saveDuplicates = function() {
|
$scope.saveDuplicates = function() {
|
||||||
call_http_post($http, 'api/organizations/duplicates', $scope.duplicates, function(res) {
|
call_http_post($http, 'api/organizations/duplicates', $scope.duplicates, function(res) {
|
||||||
$scope.getInfo();
|
$scope.getInfo();
|
||||||
alert('Events updated !!!');
|
alert('Duplicates updated !!!');
|
||||||
$scope.duplicates = res.data;
|
$scope.duplicates = res.data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.dnetlib.dhp</groupId>
|
<groupId>eu.dnetlib.dhp</groupId>
|
||||||
<artifactId>dnet-applications</artifactId>
|
<artifactId>dnet-applications</artifactId>
|
||||||
<version>3.2.5-SNAPSHOT</version>
|
<version>3.2.6-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.dnetlib.dhp</groupId>
|
<groupId>eu.dnetlib.dhp</groupId>
|
||||||
<artifactId>apps</artifactId>
|
<artifactId>apps</artifactId>
|
||||||
<version>3.2.5-SNAPSHOT</version>
|
<version>3.2.6-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.dnetlib.dhp</groupId>
|
<groupId>eu.dnetlib.dhp</groupId>
|
||||||
<artifactId>cmd-line-apps</artifactId>
|
<artifactId>cmd-line-apps</artifactId>
|
||||||
<version>3.2.5-SNAPSHOT</version>
|
<version>3.2.6-SNAPSHOT</version>
|
||||||
<relativePath>../</relativePath>
|
<relativePath>../</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.dnetlib.dhp</groupId>
|
<groupId>eu.dnetlib.dhp</groupId>
|
||||||
<artifactId>dnet-applications</artifactId>
|
<artifactId>dnet-applications</artifactId>
|
||||||
<version>3.2.5-SNAPSHOT</version>
|
<version>3.2.6-SNAPSHOT</version>
|
||||||
<relativePath>../</relativePath>
|
<relativePath>../</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.dnetlib.dhp</groupId>
|
<groupId>eu.dnetlib.dhp</groupId>
|
||||||
<artifactId>libs</artifactId>
|
<artifactId>libs</artifactId>
|
||||||
<version>3.2.5-SNAPSHOT</version>
|
<version>3.2.6-SNAPSHOT</version>
|
||||||
<relativePath>../</relativePath>
|
<relativePath>../</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.dnetlib.dhp</groupId>
|
<groupId>eu.dnetlib.dhp</groupId>
|
||||||
<artifactId>libs</artifactId>
|
<artifactId>libs</artifactId>
|
||||||
<version>3.2.5-SNAPSHOT</version>
|
<version>3.2.6-SNAPSHOT</version>
|
||||||
<relativePath>../</relativePath>
|
<relativePath>../</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.dnetlib.dhp</groupId>
|
<groupId>eu.dnetlib.dhp</groupId>
|
||||||
<artifactId>libs</artifactId>
|
<artifactId>libs</artifactId>
|
||||||
<version>3.2.5-SNAPSHOT</version>
|
<version>3.2.6-SNAPSHOT</version>
|
||||||
<relativePath>../</relativePath>
|
<relativePath>../</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.dnetlib.dhp</groupId>
|
<groupId>eu.dnetlib.dhp</groupId>
|
||||||
<artifactId>dnet-applications</artifactId>
|
<artifactId>dnet-applications</artifactId>
|
||||||
<version>3.2.5-SNAPSHOT</version>
|
<version>3.2.6-SNAPSHOT</version>
|
||||||
<relativePath>../</relativePath>
|
<relativePath>../</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -10,7 +10,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>eu.dnetlib.dhp</groupId>
|
<groupId>eu.dnetlib.dhp</groupId>
|
||||||
<artifactId>dnet-applications</artifactId>
|
<artifactId>dnet-applications</artifactId>
|
||||||
<version>3.2.5-SNAPSHOT</version>
|
<version>3.2.6-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<licenses>
|
<licenses>
|
||||||
|
|
Loading…
Reference in New Issue