2019-06-13 14:40:03 +02:00
import { SearchCustomFilter } from "../openaireLibrary/searchPages/searchUtils/searchUtils.class" ;
2020-11-25 18:39:05 +01:00
import { Portal } from "../openaireLibrary/utils/entities/adminTool/portal" ;
2021-11-25 15:10:20 +01:00
import { properties } from "../../environments/environment" ;
2019-06-13 14:40:03 +02:00
2020-12-15 13:48:37 +01:00
export class AggregatorInfo {
2019-06-13 14:40:03 +02:00
menuId : string ;
title : string ;
logoUrl : string ;
fieldName : string ; //Country
queryFieldName : string ; //country
valueId : string ; //gr
valueName : string ; // Greece
2020-12-15 13:48:37 +01:00
mainColor :string ;
darkColor :string ;
background :string ;
2021-01-28 10:45:22 +01:00
graphSectionTitle : string ;
graphSectionText : string ;
2022-02-18 15:58:47 +01:00
enableLogin : boolean ;
2019-06-13 14:40:03 +02:00
2021-01-28 10:45:22 +01:00
constructor ( menuId : string , title : string , logoUrl : string , fieldName : string , queryFieldName : string , valueId : string ,
2022-02-18 15:58:47 +01:00
valueName : string , mainColor :string = null , darkColor :string = null , background :string = null , graphSectionTitle : string = null , graphSectionText :string = null , enableLogin :boolean = true ) {
2019-06-13 14:40:03 +02:00
this . menuId = menuId ;
this . title = title ;
this . logoUrl = logoUrl ;
this . fieldName = fieldName ;
this . queryFieldName = queryFieldName ;
this . valueId = valueId ;
this . valueName = valueName ;
2020-12-15 13:48:37 +01:00
this . mainColor = mainColor ;
this . darkColor = darkColor ;
this . background = background ;
2021-01-28 10:45:22 +01:00
this . graphSectionTitle = graphSectionTitle ;
this . graphSectionText = graphSectionText ;
2022-02-18 15:58:47 +01:00
this . enableLogin = enableLogin ;
2019-06-13 14:40:03 +02:00
}
}
export class PortalAggregators {
2020-12-15 13:48:37 +01:00
static list : AggregatorInfo [ ] = [
2021-01-28 10:45:22 +01:00
new AggregatorInfo ( "canada" , "Canadian Aggregator" , "assets/canada-logo.png" , "Country" , "country" , "CA" , "Canada" , "#E80000" , "#ad0000" , "/assets/canada-background.svg" ,
"Portal to Canadian Research Outputs" , ` <span>
2021-12-08 15:00:44 +01:00
Welcome to the Portal of Canadian Research Outputs . This has been developed as part of a collaboration between
Canadian Association of Research Libraries ( CARL ) and OpenAIRE . The portal presents research results collected
from Canadian institutional repositories compliant to < a
href = "https://guidelines.openaire.eu/" target = "_blank" > OpenAIRE guidelines < / a > and from the OpenAIRE Research Graph .
It links them to three Canadian funders , Natural Sciences and Engineering Research Council of Canada , Canadian Institutes of Health Research and
Social Sciences and Humanities Research Council . For more information , visit the < a
Social Sciences and Humanities Research Council . For more information , visit the < a
2021-01-28 10:45:22 +01:00
href = "https://www.carl-abrc.ca/advancing-research/institutional-repositories/open-repositories-working-group/openaire-collaboration/" target = "_blank" > CARL website < / a > .
< / span >
< br >
< span >
2021-12-08 15:00:44 +01:00
Bienvenue sur le portal 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 ,
2021-01-28 10:45:22 +01:00
< a
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 > .
< / span > ` ),
2020-12-15 13:48:37 +01:00
new AggregatorInfo ( "italy" , "Italian Aggregator" , "assets/common-assets/logo-small-aggregator.png" , "Country" , "country" , "IT" , "Italy" ) ,
new AggregatorInfo ( "greece" , "Greek Aggregator" , "assets/common-assets/logo-small-aggregator.png" , "Country" , "country" , "GR" , "Greece" ) ,
2022-02-18 15:58:47 +01:00
new AggregatorInfo ( "eosc" , "Eosc Explore" , "https://providers.eosc-portal.eu/assets/images/EOSC_Portal_Logo.png" , null , null , null , null , "#3540b6" , "#233d4c" , null , null , null , false )
2019-06-13 14:40:03 +02:00
] ;
2020-11-25 18:39:05 +01:00
static disabled = {
2021-01-04 12:50:58 +01:00
"canada" : { pages : [ ] , entities : [ "software" ] } ,
2020-11-25 18:39:05 +01:00
"italy" : { pages : [ ] , entities : [ ] } ,
2022-02-18 15:58:47 +01:00
"greece" : { pages : [ ] , entities : [ ] } ,
"eosc" : { pages : [ "/participate/deposit/search" , "/participate/deposit/learn-how" , "/participate/claim" , "/participate/direct-claim" , "/myclaims" , "/claims" , "/develop" ]
, entities : [ ] }
2020-11-25 18:39:05 +01:00
} ;
2020-12-15 13:48:37 +01:00
static defaultAggregator : AggregatorInfo = PortalAggregators . list [ 0 ] ;
2019-06-13 14:40:03 +02:00
2020-12-15 13:48:37 +01:00
public static getList ( ) : AggregatorInfo [ ] {
2019-06-13 14:40:03 +02:00
return PortalAggregators . list ;
}
2020-12-15 13:48:37 +01:00
public static getFilterInfoByMenuId ( menuId : string ) : AggregatorInfo {
2019-06-13 14:40:03 +02:00
for ( let agg of this . getList ( ) ) {
if ( agg . menuId == menuId ) {
return agg ;
}
}
return PortalAggregators . defaultAggregator ;
}
2020-12-15 13:48:37 +01:00
public static getSearchCustomFilterByAggregator ( agg : AggregatorInfo ) : SearchCustomFilter {
2019-06-13 14:40:03 +02:00
let filter :SearchCustomFilter = null ;
2022-02-18 15:58:47 +01:00
if ( agg && agg . fieldName ) {
2019-06-13 14:40:03 +02:00
filter = new SearchCustomFilter ( agg . fieldName , agg . queryFieldName , agg . valueId , agg . valueName ) ;
2020-11-26 16:03:13 +01:00
filter . promptToAddFilter = false ;
filter . isHiddenFilter = true ;
2019-06-13 14:40:03 +02:00
}
return filter ;
}
2020-11-25 18:39:05 +01:00
public static getCommunityInfoByMenuId ( menuId : string ) : any {
if ( PortalAggregators . disabled [ menuId ] ) {
return Portal . getMockCommunityInfo ( PortalAggregators . disabled [ menuId ] . entities , PortalAggregators . disabled [ menuId ] . pages ) ;
}
return Portal . getMockCommunityInfo ( [ ] , [ ] ) ;
}
2019-06-13 14:40:03 +02:00
}