This commit is contained in:
Michele Artini 2021-04-07 09:36:14 +02:00
parent 370da2ae10
commit 246c924749
5 changed files with 169 additions and 20 deletions

View File

@ -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;
}
}

View File

@ -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,

View File

@ -12,7 +12,19 @@
</tr>
<tr class="d-flex">
<th class="col-4 pl-3">Type</th>
<td class="col-8">{{org.type}}</td>
<td class="col-8">
<span class="pr-3">{{org.type}}</span>
<span title="EC flags" class="badge badge-success" ng-show="org.ecLegalBody">legal body</span>
<span title="EC flags" class="badge badge-success" ng-show="org.ecLegalPerson">legal person</span>
<span title="EC flags" class="badge badge-success" ng-show="org.ecNonProfit">non profit</span>
<span title="EC flags" class="badge badge-success" ng-show="org.ecResearchOrganization">research organization</span>
<span title="EC flags" class="badge badge-success" ng-show="org.ecHigherEducation">higher education</span>
<span title="EC flags" class="badge badge-success" ng-show="org.ecInternationalOrganizationEurInterests">international organization Eur interests</span>
<span title="EC flags" class="badge badge-success" ng-show="org.ecInternationalOrganization">international organization</span>
<span title="EC flags" class="badge badge-success" ng-show="org.ecEnterprise">enterprise</span>
<span title="EC flags" class="badge badge-success" ng-show="org.ecSmeValidated">sme validated</span>
<span title="EC flags" class="badge badge-success" ng-show="org.ecNutscode">nuts code</span>
</td>
</tr>
<tr class="d-flex">
<th class="col-4 pl-3">Place</th>

View File

@ -20,6 +20,17 @@
<br /><b>PID ({{oid.type}}): </b>{{oid.id}}
</span>
<span class="small"><br /><b>URL: </b><a href="{{sr.oaUrl}}" target="_blank" ng-if="sr.oaUrl">{{sr.oaUrl}}</a></span>
<br />
<span title="EC flags" class="badge badge-success" ng-show="sr.ecLegalBody">legal body</span>
<span title="EC flags" class="badge badge-success" ng-show="sr.ecLegalPerson">legal person</span>
<span title="EC flags" class="badge badge-success" ng-show="sr.ecNonProfit">non profit</span>
<span title="EC flags" class="badge badge-success" ng-show="sr.ecResearchOrganization">research organization</span>
<span title="EC flags" class="badge badge-success" ng-show="sr.ecHigherEducation">higher education</span>
<span title="EC flags" class="badge badge-success" ng-show="sr.ecInternationalOrganizationEurInterests">international organization Eur interests</span>
<span title="EC flags" class="badge badge-success" ng-show="sr.ecInternationalOrganization">international organization</span>
<span title="EC flags" class="badge badge-success" ng-show="sr.ecEnterprise">enterprise</span>
<span title="EC flags" class="badge badge-success" ng-show="sr.ecSmeValidated">sme validated</span>
<span title="EC flags" class="badge badge-success" ng-show="sr.ecNutscode">nuts code</span>
</td>
<td class="col-1 text-center small">{{sr.oaAcronym}}</td>
<td class="col-2 text-center small"><img ng-src="resources/images/flags/{{sr.oaCountry}}.gif" /> {{sr.oaCountry}}</td>

View File

@ -36,7 +36,7 @@
</select>
<div class="input-group-append">
<button class="btn btn-sm bg-primary text-white" ng-class="{'bg-light text-dark' : mode == 'readonly' || mode == 'not_authorized', 'bg-warning' : mode == 'approve'}" data-toggle="modal" data-target="#ecFlagsModal">EC flags</button>
<a href="javascript:void(0)" class="btn btn-sm bg-primary text-white" ng-class="{'bg-light text-dark' : mode == 'readonly' || mode == 'not_authorized'}" data-toggle="modal" data-target="#ecFlagsModal">EC flags</a>
</div>
</div>
</div>
@ -321,16 +321,16 @@
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body">
<span ng-class="{'text-success font-weight-bold': org.ecLegalBody, 'text-deleted': !org.ecLegalBody}">legal body</span><br />
<span ng-class="{'text-success font-weight-bold': org.ecLegalPerson, 'text-deleted': !org.ecLegalPerson}">legal person</span><br />
<span ng-class="{'text-success font-weight-bold': org.ecNonProfit, 'text-deleted': !org.ecNonProfit}">non profit</span><br />
<span ng-class="{'text-success font-weight-bold': org.ecResearchOrganization, 'text-deleted': !org.ecResearchOrganization}">research organization</span><br />
<span ng-class="{'text-success font-weight-bold': org.ecHigherEducation, 'text-deleted': !org.ecHigherEducation}">higher education</span><br />
<span ng-class="{'text-success font-weight-bold': org.ecInternationalOrganizationEurInterests, 'text-deleted': !org.ecInternationalOrganizationEurInterests}">international organization Eur interests</span><br />
<span ng-class="{'text-success font-weight-bold': org.ecInternationalOrganization, 'text-deleted': !org.ecInternationalOrganization}">international organization</span><br />
<span ng-class="{'text-success font-weight-bold': org.ecEnterprise, 'text-deleted': !org.ecEnterprise}">enterprise</span><br />
<span ng-class="{'text-success font-weight-bold': org.ecSmeValidated, 'text-deleted': !org.ecSmeValidated}">sme validated</span><br />
<span ng-class="{'text-success font-weight-bold': org.ecNutscode, 'text-deleted': !org.ecNutscode}">nuts code</span><br />
<span class="badge" ng-class="{'badge-success': org.ecLegalBody, 'text-deleted': !org.ecLegalBody}">legal body</span>
<span class="badge" ng-class="{'badge-success': org.ecLegalPerson, 'text-deleted': !org.ecLegalPerson}">legal person</span>
<span class="badge" ng-class="{'badge-success': org.ecNonProfit, 'text-deleted': !org.ecNonProfit}">non profit</span>
<span class="badge" ng-class="{'badge-success': org.ecResearchOrganization, 'text-deleted': !org.ecResearchOrganization}">research organization</span>
<span class="badge" ng-class="{'badge-success': org.ecHigherEducation, 'text-deleted': !org.ecHigherEducation}">higher education</span>
<span class="badge" ng-class="{'badge-success': org.ecInternationalOrganizationEurInterests, 'text-deleted': !org.ecInternationalOrganizationEurInterests}">international organization Eur interests</span>
<span class="badge" ng-class="{'badge-success': org.ecInternationalOrganization, 'text-deleted': !org.ecInternationalOrganization}">international organization</span>
<span class="badge" ng-class="{'badge-success': org.ecEnterprise, 'text-deleted': !org.ecEnterprise}">enterprise</span>
<span class="badge" ng-class="{'badge-success': org.ecSmeValidated, 'text-deleted': !org.ecSmeValidated}">sme validated</span>
<span class="badge" ng-class="{'badge-success': org.ecNutscode, 'text-deleted': !org.ecNutscode}">nuts code</span>
</div>
</div>
</div>