1
|
import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/searchUtils.class";
|
2
|
import {Portal} from "../openaireLibrary/utils/entities/adminTool/portal";
|
3
|
|
4
|
export class AggregatorInfo {
|
5
|
menuId: string;
|
6
|
title: string;
|
7
|
logoUrl: string;
|
8
|
fieldName: string; //Country
|
9
|
queryFieldName: string; //country
|
10
|
valueId: string; //gr
|
11
|
valueName: string; // Greece
|
12
|
mainColor:string;
|
13
|
darkColor:string;
|
14
|
background:string;
|
15
|
graphSectionTitle: string;
|
16
|
graphSectionText: string;
|
17
|
|
18
|
constructor(menuId: string, title: string, logoUrl: string, fieldName: string, queryFieldName: string, valueId: string,
|
19
|
valueName: string, mainColor:string=null, darkColor:string=null, background:string=null,graphSectionTitle: string = null, graphSectionText:string = null ) {
|
20
|
this.menuId = menuId;
|
21
|
this.title = title;
|
22
|
this.logoUrl = logoUrl;
|
23
|
this.fieldName = fieldName;
|
24
|
this.queryFieldName = queryFieldName;
|
25
|
this.valueId = valueId;
|
26
|
this.valueName = valueName;
|
27
|
this.mainColor = mainColor;
|
28
|
this.darkColor = darkColor;
|
29
|
this.background = background;
|
30
|
this.graphSectionTitle = graphSectionTitle;
|
31
|
this.graphSectionText = graphSectionText;
|
32
|
}
|
33
|
}
|
34
|
|
35
|
export class PortalAggregators {
|
36
|
static list: AggregatorInfo[] = [
|
37
|
new AggregatorInfo("canada", "Canadian Aggregator", "assets/canada-logo.png", "Country", "country", "CA", "Canada","#E80000","#ad0000", "/assets/canada-background.svg",
|
38
|
"Portal to Canadian Research Outputs", `<span>
|
39
|
Welcome to the beta Portal to Canadian Research Outputs, which has been developed as part of a
|
40
|
collaboration between CARL and OpenAIRE as part of the OpenAIRE Advance Project. The portal enables users
|
41
|
to search and browse Canadian content that is included in the OpenAIRE aggregation. The number of
|
42
|
research products is expected to grow in 2021 as more Canadian repositories become compliant with
|
43
|
OpenAIRE guidelines and Canadian affiliation information is enhanced. For more information, visit the
|
44
|
<a
|
45
|
href="https://www.carl-abrc.ca/advancing-research/institutional-repositories/open-repositories-working-group/openaire-collaboration/" target="_blank">CARL website</a>.
|
46
|
</span>
|
47
|
<br>
|
48
|
<span>
|
49
|
Bienvenue sur la version bêta du portail des résultats de la recherche canadienne, qui a été développé dans le cadre d'une collaboration entre l'ABRC et OpenAIRE dans le contexte du projet OpenAIRE Advance. Le portail permet aux utilisateurs de repérer et de parcourir le contenu canadien inclus sur la plateforme OpenAIRE. La quantité des résultats de la recherche canadienne disponible sur la plateforme augmentera tout au long de l'année 2021 au fur et à mesure que les dépôts canadiens se conformeront aux directives d'OpenAIRE et que les détails relatifs aux affiliations canadiennes seront améliorés. Pour plus d'informations,
|
50
|
<a
|
51
|
href="https://www.carl-abrc.ca/fr/faire-avancer-la-recherche/depots-institutionnels/groupe-de-travail-depots-ouverts/collaboration-avec-openaire/" target="_blank">veuillez visiter le site Web de l’ABRC</a>.
|
52
|
</span>`),
|
53
|
new AggregatorInfo("italy", "Italian Aggregator", "assets/common-assets/logo-small-aggregator.png", "Country", "country", "IT", "Italy"),
|
54
|
new AggregatorInfo("greece", "Greek Aggregator", "assets/common-assets/logo-small-aggregator.png", "Country", "country", "GR", "Greece"),
|
55
|
|
56
|
];
|
57
|
static disabled = {
|
58
|
"canada": {pages: [], entities: ["software"]},
|
59
|
"italy": {pages: [], entities: []},
|
60
|
"greece": {pages: [], entities: []}
|
61
|
};
|
62
|
static defaultAggregator: AggregatorInfo = PortalAggregators.list[0];
|
63
|
|
64
|
public static getList(): AggregatorInfo[] {
|
65
|
return PortalAggregators.list;
|
66
|
}
|
67
|
|
68
|
public static getFilterInfoByMenuId(menuId: string): AggregatorInfo {
|
69
|
for (let agg of this.getList()) {
|
70
|
if (agg.menuId == menuId) {
|
71
|
return agg;
|
72
|
}
|
73
|
}
|
74
|
return PortalAggregators.defaultAggregator;
|
75
|
}
|
76
|
|
77
|
public static getSearchCustomFilterByAggregator(agg: AggregatorInfo): SearchCustomFilter {
|
78
|
let filter:SearchCustomFilter = null;
|
79
|
if(agg) {
|
80
|
filter = new SearchCustomFilter(agg.fieldName, agg.queryFieldName, agg.valueId, agg.valueName);
|
81
|
filter.promptToAddFilter = false;
|
82
|
filter.isHiddenFilter = true;
|
83
|
}
|
84
|
return filter;
|
85
|
}
|
86
|
|
87
|
public static getCommunityInfoByMenuId(menuId: string): any {
|
88
|
if(PortalAggregators.disabled[menuId]){
|
89
|
return Portal.getMockCommunityInfo(PortalAggregators.disabled[menuId].entities,PortalAggregators.disabled[menuId].pages);
|
90
|
}
|
91
|
return Portal.getMockCommunityInfo([],[]);
|
92
|
}
|
93
|
}
|
94
|
|
95
|
|
96
|
|