From 246c924749e23684dd02c1ae0df7388deae7d1b9 Mon Sep 17 00:00:00 2001 From: "michele.artini" Date: Wed, 7 Apr 2021 09:36:14 +0200 Subject: [PATCH] ec flags --- .../model/view/OpenaireDuplicateView.java | 110 ++++++++++++++++++ .../src/main/resources/sql/schema.sql | 32 +++-- .../resources/html/parts/org_details.html | 14 ++- .../resources/html/parts/org_duplicates.html | 11 ++ .../html/parts/org_metadata.form.html | 22 ++-- 5 files changed, 169 insertions(+), 20 deletions(-) diff --git a/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/model/view/OpenaireDuplicateView.java b/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/model/view/OpenaireDuplicateView.java index 633169f5..2ae92694 100644 --- a/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/model/view/OpenaireDuplicateView.java +++ b/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/model/view/OpenaireDuplicateView.java @@ -56,6 +56,36 @@ public class OpenaireDuplicateView implements Serializable { @Column(name = "created_by") private String createdBy; + @Column(name = "ec_legalbody") + private Boolean ecLegalBody; + + @Column(name = "ec_legalperson") + private Boolean ecLegalPerson; + + @Column(name = "ec_nonprofit") + private Boolean ecNonProfit; + + @Column(name = "ec_researchorganization") + private Boolean ecResearchOrganization; + + @Column(name = "ec_highereducation") + private Boolean ecHigherEducation; + + @Column(name = "ec_internationalorganizationeurinterests") + private Boolean ecInternationalOrganizationEurInterests; + + @Column(name = "ec_internationalorganization") + private Boolean ecInternationalOrganization; + + @Column(name = "ec_enterprise") + private Boolean ecEnterprise; + + @Column(name = "ec_smevalidated") + private Boolean ecSmeValidated; + + @Column(name = "ec_nutscode") + private Boolean ecNutscode; + public String getLocalId() { return localId; } @@ -136,4 +166,84 @@ public class OpenaireDuplicateView implements Serializable { this.createdBy = createdBy; } + public Boolean getEcLegalBody() { + return ecLegalBody; + } + + public void setEcLegalBody(final Boolean ecLegalBody) { + this.ecLegalBody = ecLegalBody; + } + + public Boolean getEcLegalPerson() { + return ecLegalPerson; + } + + public void setEcLegalPerson(final Boolean ecLegalPerson) { + this.ecLegalPerson = ecLegalPerson; + } + + public Boolean getEcNonProfit() { + return ecNonProfit; + } + + public void setEcNonProfit(final Boolean ecNonProfit) { + this.ecNonProfit = ecNonProfit; + } + + public Boolean getEcResearchOrganization() { + return ecResearchOrganization; + } + + public void setEcResearchOrganization(final Boolean ecResearchOrganization) { + this.ecResearchOrganization = ecResearchOrganization; + } + + public Boolean getEcHigherEducation() { + return ecHigherEducation; + } + + public void setEcHigherEducation(final Boolean ecHigherEducation) { + this.ecHigherEducation = ecHigherEducation; + } + + public Boolean getEcInternationalOrganizationEurInterests() { + return ecInternationalOrganizationEurInterests; + } + + public void setEcInternationalOrganizationEurInterests(final Boolean ecInternationalOrganizationEurInterests) { + this.ecInternationalOrganizationEurInterests = ecInternationalOrganizationEurInterests; + } + + public Boolean getEcInternationalOrganization() { + return ecInternationalOrganization; + } + + public void setEcInternationalOrganization(final Boolean ecInternationalOrganization) { + this.ecInternationalOrganization = ecInternationalOrganization; + } + + public Boolean getEcEnterprise() { + return ecEnterprise; + } + + public void setEcEnterprise(final Boolean ecEnterprise) { + this.ecEnterprise = ecEnterprise; + } + + public Boolean getEcSmeValidated() { + return ecSmeValidated; + } + + public void setEcSmeValidated(final Boolean ecSmeValidated) { + this.ecSmeValidated = ecSmeValidated; + } + + public Boolean getEcNutscode() { + return ecNutscode; + } + + public void setEcNutscode(final Boolean ecNutscode) { + this.ecNutscode = ecNutscode; + } + } diff --git a/apps/dnet-orgs-database-application/src/main/resources/sql/schema.sql b/apps/dnet-orgs-database-application/src/main/resources/sql/schema.sql index 397b17e3..51db3db3 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/sql/schema.sql +++ b/apps/dnet-orgs-database-application/src/main/resources/sql/schema.sql @@ -394,10 +394,6 @@ CREATE INDEX urls_id_idx ON urls(id); CREATE TABLE oa_duplicates ( local_id text REFERENCES organizations(id) ON UPDATE CASCADE ON DELETE CASCADE, oa_original_id text REFERENCES organizations(id) ON UPDATE CASCADE ON DELETE CASCADE, - oa_name text NOT NULL, - oa_acronym text, - oa_country text, - oa_url text, oa_collectedfrom text, reltype text NOT NULL DEFAULT 'suggested', creation_date timestamp DEFAULT NOW(), @@ -413,13 +409,23 @@ CREATE VIEW oa_duplicates_view AS d.local_id as local_id, d.oa_original_id as oa_original_id, o.name as oa_name, - array_to_string(array_agg(a.acronym), ', ') as oa_acronym, + array_to_string(array_agg(DISTINCT a.acronym), ', ') as oa_acronym, o.country as oa_country, - array_to_string(array_agg(u.url), ', ') as oa_url, + array_to_string(array_agg(DISTINCT u.url), ', ') as oa_url, COALESCE(jsonb_agg(DISTINCT jsonb_build_object('id', oid.otherid, 'type', oid.type)) FILTER (WHERE oid.otherid IS NOT NULL), '[]') AS oa_other_ids, d.oa_collectedfrom as oa_collectedfrom, d.reltype as reltype, - d.created_by as created_by + d.created_by as created_by, + o.ec_legalbody, + o.ec_legalperson, + o.ec_nonprofit, + o.ec_researchorganization, + o.ec_highereducation, + o.ec_internationalorganizationeurinterests, + o.ec_internationalorganization, + o.ec_enterprise, + o.ec_smevalidated, + o.ec_nutscode FROM oa_duplicates d LEFT OUTER JOIN organizations o ON (o.id = d.oa_original_id) @@ -433,7 +439,17 @@ GROUP BY o.name, o.country, d.oa_collectedfrom, - d.reltype; + d.reltype, + o.ec_legalbody, + o.ec_legalperson, + o.ec_nonprofit, + o.ec_researchorganization, + o.ec_highereducation, + o.ec_internationalorganizationeurinterests, + o.ec_internationalorganization, + o.ec_enterprise, + o.ec_smevalidated, + o.ec_nutscode; CREATE TABLE oa_conflicts ( id1 text REFERENCES organizations(id) ON UPDATE CASCADE ON DELETE CASCADE, diff --git a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_details.html b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_details.html index 59e0c4c7..7452777d 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_details.html +++ b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_details.html @@ -12,7 +12,19 @@ Type - {{org.type}} + + {{org.type}} + legal body + legal person + non profit + research organization + higher education + international organization Eur interests + international organization + enterprise + sme validated + nuts code + Place diff --git a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_duplicates.html b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_duplicates.html index 40b43ab7..b2958ee7 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_duplicates.html +++ b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_duplicates.html @@ -20,6 +20,17 @@
PID ({{oid.type}}): {{oid.id}}
URL: {{sr.oaUrl}}
+
+ legal body + legal person + non profit + research organization + higher education + international organization Eur interests + international organization + enterprise + sme validated + nuts code {{sr.oaAcronym}} {{sr.oaCountry}} diff --git a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_metadata.form.html b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_metadata.form.html index b6c43802..9170dec7 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_metadata.form.html +++ b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_metadata.form.html @@ -36,7 +36,7 @@
- + EC flags
@@ -321,16 +321,16 @@