2020-03-16 14:09:46 +01:00
import { ChangeDetectorRef , Component , Input , ViewChild } from '@angular/core' ;
2019-09-05 10:49:33 +02:00
import { ActivatedRoute , Router } from '@angular/router' ;
import { Meta , Title } from '@angular/platform-browser' ;
import { EnvProperties } from '../../utils/properties/env-properties' ;
2020-03-20 13:01:55 +01:00
import { Id , ResultLandingInfo } from '../../utils/entities/resultLandingInfo' ;
2019-09-05 10:49:33 +02:00
import { RouterHelper } from '../../utils/routerHelper.class' ;
import { PiwikService } from '../../utils/piwik/piwik.service' ;
import { ResultLandingService } from './resultLanding.service' ;
import { SEOService } from '../../sharedComponents/SEO/SEO.service' ;
import { HelperFunctions } from '../../utils/HelperFunctions.class' ;
import { HelperService } from '../../utils/helper/helper.service' ;
2019-11-07 10:51:09 +01:00
import { Location } from "@angular/common" ;
2020-03-16 14:09:46 +01:00
import { MetricsService } from "../../services/metrics.service" ;
import { Organization , RelationResult , ResultPreview } from "../../utils/result-preview/result-preview" ;
2019-09-05 10:49:33 +02:00
@Component ( {
selector : 'result-landing' ,
templateUrl : 'resultLanding.component.html' ,
} )
export class ResultLandingComponent {
@Input ( ) type : string = "publication" ;
@Input ( ) piwikSiteId = null ;
@Input ( ) communityId = null ;
// Active tab variable for responsiveness
@Input ( ) activeTab : string = "References" ;
@ViewChild ( 'AlertModalDeletedByInference' ) alertModalDeletedByInference ;
2020-03-16 14:09:46 +01:00
@ViewChild ( 'referencesModal' ) referencesModal ;
@ViewChild ( 'bioentitiesModal' ) bioentitiesModal ;
@ViewChild ( 'relationModal' ) relationModal ;
@ViewChild ( 'organizationModal' ) organizationModal ;
2019-09-30 13:02:06 +02:00
public deleteByInferenceOpened : boolean = false ;
2019-09-05 10:49:33 +02:00
public resultLandingInfo : ResultLandingInfo ;
2020-03-16 14:09:46 +01:00
public relationResults : RelationResult [ ] ;
public relation : string = 'trust' ;
2019-09-05 10:49:33 +02:00
public id : string ;
public title : string ;
// Links for SEO
public linkToLandingPage : string = null ;
public linkToSearchPage : string = null ;
2020-03-16 14:09:46 +01:00
public thresholdDescription : number = 670 ;
public showNumDescription : number = 670 ;
2019-09-05 10:49:33 +02:00
// Metrics tab variables
public metricsClicked : boolean ;
2020-03-16 14:09:46 +01:00
public hasAltMetrics : boolean = false ;
2019-09-05 10:49:33 +02:00
public viewsFrameUrl : string ;
public downloadsFrameUrl : string ;
public totalViews : number ;
public totalDownloads : number ;
public pageViews : number ;
// Custom tab paging variables
public referencesPage : number = 1 ;
2020-03-16 14:09:46 +01:00
public bioentitiesPage : number = 1 ;
public relationPage : number = 1 ;
2019-09-05 10:49:33 +02:00
public organizationsPage : number = 1 ;
public softwarePage : number = 1 ;
public openCitationsPage : number = 1 ;
public pageSize : number = 10 ;
// Map counting variables
public bioentitiesNum : number = 0 ;
// Message variables
public warningMessage = "" ;
public errorMessage = "" ;
public showLoading : boolean = true ;
public routerHelper : RouterHelper = new RouterHelper ( ) ;
private doi : string ;
public doiURL : string ;
sub : any ;
piwiksub : any ;
infoSub : any ;
properties : EnvProperties ;
2020-03-16 14:09:46 +01:00
public indexUpdateDate : Date ;
2019-09-05 10:49:33 +02:00
public pageContents = null ;
public divContents = null ;
2020-03-16 14:09:46 +01:00
public addThis : boolean = true ;
public showFeedback : boolean = false ;
public feedbackFields : string [ ] = [
'Title' , 'Authors' , 'Access rights' ,
'Publisher information' , 'Funding Information' ,
'Persistent identifiers' , 'Other' ] ;
2019-10-17 15:24:09 +02:00
2019-09-05 10:49:33 +02:00
constructor ( private _resultLaningService : ResultLandingService ,
private _piwikService : PiwikService ,
private route : ActivatedRoute ,
private router : Router ,
private _meta : Meta ,
private _title : Title ,
private _router : Router ,
private helper : HelperService ,
2019-10-17 15:24:09 +02:00
private seoService : SEOService ,
2020-03-16 14:09:46 +01:00
private metricsService : MetricsService ,
private cdr : ChangeDetectorRef ,
2019-11-07 10:51:09 +01:00
private _location : Location ) {
2019-09-05 10:49:33 +02:00
}
ngOnInit() {
this . route . data
. subscribe ( ( data : { envSpecific : EnvProperties } ) = > {
this . properties = data . envSpecific ;
2020-03-16 14:09:46 +01:00
if ( this . properties . lastIndexUpdate ) {
this . indexUpdateDate = new Date ( this . properties . lastIndexUpdate ) ;
}
2019-09-05 10:49:33 +02:00
//this.getDivContents();
this . getPageContents ( ) ;
this . doiURL = this . properties . doiURL ;
this . updateUrl ( data . envSpecific . baseLink + this . _router . url ) ;
this . sub = this . route . queryParams . subscribe ( data = > {
this . resultLandingInfo = null ;
if ( this . type == "publication" ) {
this . updateTitle ( "Publication" ) ;
this . linkToLandingPage = this . properties . searchLinkToPublication ;
this . linkToSearchPage = this . properties . searchLinkToPublications ;
this . id = data [ 'articleId' ] ;
this . title = "Publication" ;
} else if ( this . type == "dataset" ) {
this . updateTitle ( "Dataset" ) ;
this . linkToLandingPage = this . properties . searchLinkToDataset ;
this . linkToSearchPage = this . properties . searchLinkToDatasets ;
this . id = data [ 'datasetId' ] ;
this . title = "Research Data" ;
} else if ( this . type == "software" ) {
this . updateTitle ( "Software" ) ;
this . linkToLandingPage = this . properties . searchLinkToSoftware ;
this . linkToSearchPage = this . properties . searchLinkToSoftwareLanding ;
this . id = data [ 'softwareId' ] ;
this . title = "Software" ;
} else if ( this . type == "orp" ) {
this . updateTitle ( "Other Research Product" ) ;
this . linkToLandingPage = this . properties . searchLinkToOrp ;
this . linkToSearchPage = this . properties . searchLinkToOrps ;
this . id = data [ 'orpId' ] ;
this . title = "Other Research Product" ;
2020-03-04 15:29:50 +01:00
} else if ( this . type == "result" ) {
this . id = data [ "id" ] ;
this . updateTitle ( "Research Result" ) ;
this . linkToLandingPage = this . properties . searchLinkToOrp ;
this . linkToSearchPage = this . properties . searchLinkToResults ;
this . title = "Research Result" ;
2019-09-05 10:49:33 +02:00
}
this . updateDescription ( "" ) ;
this . metricsClicked = false ;
if ( this . id ) {
2019-10-09 15:28:23 +02:00
this . getProvenanceVocabularyAndResultLandingInfo ( ) ;
2019-09-05 10:49:33 +02:00
} else {
this . showLoading = false ;
2019-11-07 10:51:09 +01:00
this . _router . navigate ( [ '/error' ] , { queryParams : { "page" : this . _location . path ( true ) , "page_type" : this . type } } ) ;
2019-10-31 12:39:23 +01:00
/ *
2019-09-05 10:49:33 +02:00
this . warningMessage = "No valid " ;
if ( this . type == "publication" || this . type == "software" ) {
this . warningMessage += this . type + " " ;
} else if ( this . type == "dataset" ) {
this . warningMessage += "research data " ;
} else if ( this . type == "orp" ) {
this . warningMessage += "other research product " ;
}
this . warningMessage += "id" ;
2019-10-31 12:39:23 +01:00
* /
2019-09-05 10:49:33 +02:00
}
2019-12-04 13:56:37 +01:00
this . viewsFrameUrl = this . properties . framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this . id + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":80,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false' ;
this . downloadsFrameUrl = this . properties . framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"' + this . id + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":80,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false' ;
2019-09-05 10:49:33 +02:00
this . scroll ( ) ;
} ) ;
} ) ;
}
private getPageContents() {
this . helper . getPageHelpContents ( this . _router . url , this . properties , this . communityId ) . subscribe ( contents = > {
this . pageContents = contents ;
} ) ;
}
private getDivContents() {
this . helper . getDivHelpContents ( this . _router . url , this . properties , this . communityId ) . subscribe ( contents = > {
this . divContents = contents ;
} ) ;
}
ngOnDestroy() {
if ( this . sub ) {
this . sub . unsubscribe ( ) ;
}
if ( this . piwiksub ) {
this . piwiksub . unsubscribe ( ) ;
}
if ( this . infoSub ) {
this . infoSub . unsubscribe ( ) ;
}
}
2020-03-16 14:09:46 +01:00
public getTypeName ( ) : string {
if ( this . type === "dataset" ) {
return "research data" ;
} else if ( this . type === "orp" || this . type === "other" ) {
return "other research product" ;
} else {
return this . type ;
}
}
public removeUnknown ( array : string [ ] , type : boolean = false ) : string [ ] {
if ( type ) {
return this . removeDuplicates ( array ) . filter ( value = > value . toLowerCase ( ) !== 'unknown' ) ;
} else {
return array . filter ( value = > value . toLowerCase ( ) !== 'unknown' ) ;
}
}
public removeDuplicates ( array : string [ ] ) : string [ ] {
let type = this . getTypeName ( ) ;
return array . filter ( value = > value . toLowerCase ( ) !== type ) ;
}
2019-09-05 10:49:33 +02:00
2020-03-16 14:09:46 +01:00
private getOpenCitations() {
2019-09-05 10:49:33 +02:00
this . _resultLaningService . getOpenCitations ( this . id , this . properties ) . subscribe (
data = > {
this . resultLandingInfo . openCitations = data [ 1 ] ;
} ,
err = > {
this . handleError ( "Error getting open citation for " + this . type + " with id: " + this . id , err ) ;
}
) ;
}
2019-10-09 15:28:23 +02:00
private getProvenanceVocabularyAndResultLandingInfo() {
2019-09-05 10:49:33 +02:00
this . warningMessage = '' ;
this . errorMessage = '' ;
this . showLoading = true ;
this . resultLandingInfo = null ;
2019-10-09 15:28:23 +02:00
this . _resultLaningService . getProvenanceActionVocabulary ( this . properties ) . subscribe (
provenanceActionVocabulary = > {
this . getResultLandingInfo ( provenanceActionVocabulary ) ;
} , err = > {
this . getResultLandingInfo ( null ) ;
this . handleError ( "Error getting provenance action vocabulary for " + this . type + " with id: " + this . id , err ) ;
}
) ;
}
private getResultLandingInfo ( provenanceActionVocabulary : any ) {
this . infoSub = this . _resultLaningService . getResultLandingInfo ( this . id , this . type , provenanceActionVocabulary , this . properties ) . subscribe (
2019-09-05 10:49:33 +02:00
data = > {
this . resultLandingInfo = data ;
2020-03-04 15:29:50 +01:00
if ( this . type == "result" ) { // no type was specified - update URL based this.resultLandingInfo.resultType
this . updateUrlWithType ( ) ;
}
2019-09-05 10:49:33 +02:00
this . seoService . createLinkForCanonicalURL ( this . properties . baseLink + this . linkToLandingPage + this . resultLandingInfo . record [ "result" ] [ "header" ] [ "dri:objIdentifier" ] ) ;
if ( ( this . type == "publication" ) && ( this . properties . environment == "beta" || this . properties . environment == "development" ) && ( typeof document !== 'undefined' ) ) {
2020-03-16 14:09:46 +01:00
this . getOpenCitations ( ) ;
2019-09-05 10:49:33 +02:00
}
if ( this . resultLandingInfo . title ) {
this . updateTitle ( this . resultLandingInfo . title ) ;
this . updateDescription ( ( this . resultLandingInfo . description ? ( this . resultLandingInfo . description ) : ( "," + this . resultLandingInfo . title ) ) ) ;
}
if ( this . properties . enablePiwikTrack && ( typeof document !== 'undefined' ) ) {
this . piwiksub = this . _piwikService . trackView ( this . properties , this . resultLandingInfo . title /*.name*/ , this . piwikSiteId ) . subscribe ( ) ;
}
let bioentitiesNum = 0 ;
if ( this . resultLandingInfo . bioentities != undefined ) {
this . resultLandingInfo . bioentities . forEach ( function ( value , key , map ) {
bioentitiesNum += value . size ;
} ) ;
}
this . bioentitiesNum = bioentitiesNum ;
if ( this . resultLandingInfo . identifiers != undefined && this . resultLandingInfo . identifiers . has ( 'doi' ) ) {
this . doi = this . resultLandingInfo . identifiers . get ( 'doi' ) [ 0 ] ;
2020-03-16 14:09:46 +01:00
this . metricsService . hasAltMetrics ( this . properties . altMetricsAPIURL , this . doi ) . subscribe ( hasAltMetrics = > {
this . hasAltMetrics = hasAltMetrics ;
} , error = > {
this . hasAltMetrics = false ;
} ) ;
2019-09-05 10:49:33 +02:00
}
this . showLoading = false ;
if ( this . resultLandingInfo . references ) {
this . activeTab = "References" ;
} else if ( this . resultLandingInfo . relatedResearchResults ) {
this . activeTab = "Related Research Results" ;
} else if ( this . resultLandingInfo . similarResearchResults ) {
this . activeTab = "Similar Research Results" ;
} else if ( this . resultLandingInfo . organizations ) {
this . activeTab = "Related Organizations" ;
} else if ( this . resultLandingInfo . bioentities ) {
this . activeTab = "Bioentities" ;
} else {
this . activeTab = "Metrics" ;
//this.metricsClicked = true;
}
} ,
err = > {
this . handleError ( "Error getting " + this . type + " for id: " + this . id , err ) ;
2019-10-31 12:39:23 +01:00
if ( err . status == 404 ) {
2019-11-07 10:51:09 +01:00
this . _router . navigate ( [ '/error' ] , { queryParams : { "page" : this . _location . path ( true ) , "page_type" : this . type } } ) ;
2019-10-31 12:39:23 +01:00
}
2019-09-05 10:49:33 +02:00
if ( this . type == "publication" || this . type == "software" ) {
this . errorMessage = 'No ' + this . type + ' found' ;
} else if ( this . type == "dataset" ) {
this . errorMessage += "No research data found" ;
} else if ( this . type == "orp" ) {
this . errorMessage += "No research product found" ;
}
this . showLoading = false ;
this . seoService . createLinkForCanonicalURL ( this . properties . baseLink + this . linkToSearchPage ) ;
}
) ;
}
public metricsResults ( $event ) {
this . totalViews = $event . totalViews ;
this . totalDownloads = $event . totalDownloads ;
this . pageViews = $event . pageViews ;
}
public buildCurationTooltip ( ) : string {
let tooltipContent : string = "<div class='uk-margin uk-padding-small'>" ;
tooltipContent += "<h4>Record in preview</h4>" ;
tooltipContent += "<p>Bibliographic record accepted by the system, but not yet processed by <br> OpenAIRE tools for information quality improvement and de-duplication</p>" ;
tooltipContent += "</div>" ;
return tooltipContent ;
}
private updateDescription ( description : string ) {
2019-12-05 17:07:07 +01:00
this . _meta . updateTag ( { content : description.substring ( 0 , 160 ) } , "name='description'" ) ;
this . _meta . updateTag ( { content : description.substring ( 0 , 160 ) } , "property='og:description'" ) ;
2019-09-05 10:49:33 +02:00
}
private updateTitle ( title : string ) {
var _prefix = "" ;
2019-12-05 17:07:07 +01:00
// if(!this.communityId) {
// _prefix = "OpenAIRE | ";
// }
// var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this . _title . setTitle ( title ) ;
this . _meta . updateTag ( { content : title } , "property='og:title'" ) ;
2019-09-05 10:49:33 +02:00
}
private updateUrl ( url : string ) {
this . _meta . updateTag ( { content : url } , "property='og:url'" ) ;
}
public totalPages ( totalResults : number ) : number {
let totalPages : any = totalResults / this . pageSize ;
if ( ! ( Number . isInteger ( totalPages ) ) ) {
totalPages = ( parseInt ( totalPages , this . pageSize ) + 1 ) ;
}
return totalPages ;
}
public updateReferencesPage ( $event ) {
this . referencesPage = $event . value ;
}
2020-03-16 14:09:46 +01:00
public updateBioentitiesPage ( $event ) {
this . bioentitiesPage = $event . value ;
}
public updateRelationPage ( $event ) {
this . relationPage = $event . value ;
}
2019-09-05 10:49:33 +02:00
public updateOrganizationsPage ( $event ) {
this . organizationsPage = $event . value ;
}
public updateSoftwarePage ( $event ) {
this . softwarePage = $event . value ;
}
public updateOpenCitationsPage ( $event ) {
this . openCitationsPage = $event . value ;
}
2020-02-07 14:05:07 +01:00
public accessClass ( accessMode : string ) : string {
if ( accessMode . toLowerCase ( ) . indexOf ( 'open' ) !== - 1 ) {
return 'open' ;
} else if ( accessMode . toLowerCase ( ) === 'not available' ) {
return 'unknown' ;
} else {
return 'closed' ;
}
}
2019-09-05 10:49:33 +02:00
public keysToArray ( bioentities : Map < string , string > ) : string [ ] {
let keys : string [ ] = [ ] ;
bioentities . forEach ( function ( value , key , map ) {
keys . push ( key ) ;
} ) ;
return keys ;
}
public getKeys ( map ) {
return Array . from ( map . keys ( ) ) ;
}
public scroll() {
HelperFunctions . scroll ( ) ;
}
private handleError ( message : string , error ) {
if ( this . type == "publication" ) {
console . error ( "Publication Landing Page: " + message , error ) ;
} else if ( this . type == "dataset" ) {
console . error ( "Research Data Landing Page: " + message , error ) ;
} else if ( this . type == "software" ) {
console . error ( "Software Landing Page: " + message , error ) ;
} else if ( this . type == "orp" ) {
console . error ( "Other Research Product Landing Page: " + message , error ) ;
} else {
console . error ( "Landing Page: " + message , error ) ;
}
}
isRouteAvailable ( routeToCheck : string ) {
for ( let i = 0 ; i < this . router . config . length ; i ++ ) {
let routePath : string = this . router . config [ i ] . path ;
if ( routePath == routeToCheck ) {
return true ;
}
}
return false ;
}
openDeletedByInference() {
2019-09-30 13:02:06 +02:00
this . deleteByInferenceOpened = true ;
2019-09-05 10:49:33 +02:00
this . alertModalDeletedByInference . cancelButton = false ;
this . alertModalDeletedByInference . okButton = false ;
2020-03-16 14:09:46 +01:00
this . alertModalDeletedByInference . alertTitle = "Other versions of" ;
2019-09-05 10:49:33 +02:00
this . alertModalDeletedByInference . open ( ) ;
}
2020-03-16 14:09:46 +01:00
openReferences() {
this . referencesModal . cancelButton = false ;
this . referencesModal . okButton = false ;
this . referencesModal . alertTitle = "References of" ;
this . referencesPage = 1 ;
this . referencesModal . open ( ) ;
}
openBioentities() {
this . bioentitiesModal . cancelButton = false ;
this . bioentitiesModal . okButton = false ;
this . bioentitiesModal . alertTitle = "Bioentities of" ;
this . bioentitiesPage = 1 ;
this . bioentitiesModal . open ( ) ;
}
openRelationResults ( title : string , relationResults : RelationResult [ ] , relation : string = 'trust' ) {
this . relationResults = relationResults ;
this . relation = relation ;
this . relationModal . cancelButton = false ;
this . relationModal . okButton = false ;
this . relationModal . alertTitle = title ;
this . relationPage = 1 ;
this . relationModal . open ( ) ;
}
openOrganizations() {
this . relation = 'trust' ;
this . organizationModal . cancelButton = false ;
this . organizationModal . okButton = false ;
this . organizationModal . alertTitle = 'Related organizations of' ;
this . organizationsPage = 1 ;
this . organizationModal . open ( ) ;
2019-10-17 15:24:09 +02:00
}
2020-03-16 14:09:46 +01:00
public getResultPreview ( result : RelationResult ) : ResultPreview {
return ResultPreview . relationResultConvert ( result , this . relation ) ;
}
public getResultPreviewFromOrg ( result : Organization ) : ResultPreview {
return ResultPreview . organizationConvert ( result , this . relation ) ;
}
public hideAddThis ( value : boolean ) {
this . addThis = value ;
this . cdr . detectChanges ( ) ;
}
2020-03-04 15:29:50 +01:00
updateUrlWithType ( ) {
this . type = this . resultLandingInfo . resultType ;
if ( this . type == "publication" ) {
this . _location . go ( "test" ) ;
this . linkToLandingPage = this . properties . searchLinkToPublication ;
this . linkToSearchPage = this . properties . searchLinkToPublications ;
} else if ( this . type == "dataset" ) {
this . linkToLandingPage = this . properties . searchLinkToDataset ;
this . linkToSearchPage = this . properties . searchLinkToDatasets ;
} else if ( this . type == "software" ) {
this . linkToLandingPage = this . properties . searchLinkToSoftware ;
this . linkToSearchPage = this . properties . searchLinkToSoftwareLanding ;
} else if ( this . type == "other" ) {
this . type = "orp" ;
this . linkToLandingPage = this . properties . searchLinkToOrp ;
this . linkToSearchPage = this . properties . searchLinkToOrps ;
}
this . _location . go ( this . linkToLandingPage + this . id ) ;
}
2020-03-20 13:01:55 +01:00
public getReferenceUrl ( id : Id ) : string {
if ( id . type === "doi" ) {
return this . properties . doiURL + id . value ;
} else if ( id . type === "pmc" ) {
return this . properties . pmcURL + id . value ;
} else if ( id . type === "pmid" ) {
return this . properties . pmidURL + id . value ;
} else if ( id . type === "handle" ) {
return this . properties . handleURL + id . value ;
} else {
return null ;
}
}
public getReferenceIdName ( id : Id ) : string {
if ( id . type === "doi" ) {
return 'DOI'
} else if ( id . type === "pmc" ) {
return 'Europe PMC'
} else if ( id . type === "pmid" ) {
return 'PubMed' ;
} else if ( id . type === "handle" ) {
return 'Handle.NET' ;
} else {
return null ;
}
}
2019-09-05 10:49:33 +02:00
}