[Trunk | Library]: Merging branch "mergeResultLandingPages" into Trunk 56883:56968

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@56969 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2019-09-05 08:49:33 +00:00
parent 72ebe262af
commit 3b849c78d6
30 changed files with 1064 additions and 3772 deletions

View File

@ -9,10 +9,7 @@ import { EnvironmentSpecificService } from './utils/properties/environment-speci
import { ErrorPageComponent } from './error/errorPage.component';
import {SearchComponent} from './searchPages/find/search.component';
import {PublicationComponent} from './landingPages/publication/publication.component';
import {DatasetComponent} from './landingPages/dataset/dataset.component';
import {SoftwareComponent} from './landingPages/software/software.component';
import {OrpComponent} from './landingPages/orp/orp.component';
import {ResultLandingComponent} from "./landingPages/result/resultLanding.component";
import {DataProviderComponent} from './landingPages/dataProvider/dataProvider.component';
import {ProjectComponent} from './landingPages/project/project.component';
import {OrganizationComponent} from './landingPages/organization/organization.component';
@ -60,10 +57,10 @@ const routes: Routes = [
{ path: '', component: SearchComponent, resolve: { envSpecific: EnvironmentSpecificResolver }, canActivate: [ ]},
{ path: 'home', component: SearchComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
{ path: 'search/publication', component: PublicationComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
{ path: 'search/dataset', component: DatasetComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
{ path: 'search/software', component: SoftwareComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
{ path: 'search/other', component: OrpComponent, resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'search/publication', component: ResultLandingComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
{ path: 'search/dataset', component: ResultLandingComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
{ path: 'search/software', component: ResultLandingComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
{ path: 'search/other', component: ResultLandingComponent, resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'search/project', component: ProjectComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
{ path: 'search/dataprovider', component: DataProviderComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
{ path: 'search/organization', component: OrganizationComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },

View File

@ -13,10 +13,8 @@ import { BottomModule } from './sharedComponents/bottom.module';
// import { ErrorModule } from './error/error.module';
import { ConfigurationService } from './utils/configuration/configuration.service';
import {MainSearchModule} from './searchPages/find/mainSearch.module';
import {PublicationModule} from './landingPages/publication/publication.module';
import {DatasetModule} from './landingPages/dataset/dataset.module';
import {SoftwareModule} from './landingPages/software/software.module';
import {OrpModule} from './landingPages/orp/orp.module';
import {ResultLandingModule} from "./landingPages/result/resultLanding.module";
import {DataProviderModule} from './landingPages/dataProvider/dataProvider.module';
import {ProjectModule} from './landingPages/project/project.module';
import {OrganizationModule} from './landingPages/organization/organization.module';
@ -78,7 +76,7 @@ import { AppRoutingModule } from './app-routing.module';
DepositDatasetsModule,DepositDatasetsResultsModule, DepositBySubjectResultsModule,DepositPublicationsModule , DepositPublicationsResultsModule,
SearchPublicationsModule,SearchDatasetsModule, SearchSoftwareModule, SearchOrpsModule, SearchDataProvidersModule, SearchProjectsModule, SearchOrganizationsModule,
AdvancedSearchPublicationsModule,AdvancedSearchDatasetsModule, AdvancedSearchSoftwareModule, AdvancedSearchOrpsModule, AdvancedSearchDataProvidersModule, AdvancedSearchProjectsModule, AdvancedSearchOrganizationsModule,
PublicationModule, DatasetModule, DataProviderModule, OrganizationModule, ProjectModule, SoftwareModule, OrpModule,
ResultLandingModule, DataProviderModule, OrganizationModule, ProjectModule,
EntityRegistriesModule, CompatibleDataProvidersModule, JournalsModule,
JournalsTableModule, EntityRegistriesTableModule, CompatibleDataProvidersTableModule,
ClaimsAdminModule, MyClaimsModule, ClaimsByTokenModule, LinkingGenericModule, DirectLinkingModule,

View File

@ -1,18 +0,0 @@
// import { NgModule } from '@angular/core';
// import { RouterModule } from '@angular/router';
//
// import { DatasetComponent } from './dataset.component';
// import {FreeGuard} from'../../login/freeGuard.guard';
// import {PreviousRouteRecorder} from'../../utils/piwik/previousRouteRecorder.guard';
// import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
//
// @NgModule({
// imports: [
// RouterModule.forChild([
// { path: '', component: DatasetComponent, canActivate: [FreeGuard, IsRouteEnabled], data: {
// redirect: '/error'
// },canDeactivate: [PreviousRouteRecorder] }
// ])
// ]
// })
// export class DatasetRoutingModule { }

View File

@ -1,342 +0,0 @@
<div id="tm-main" class=" uk-section uk-padding-remove-top uk-margin-small-top tm-middle">
<div uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container dataset">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper>
<div *ngIf="datasetInfo != null" class="uk-grid">
<div class="uk-width-2-3@m uk-width-1-1@s uk-margin-bottom">
<schema2jsonld *ngIf="datasetInfo.record" [data]=datasetInfo.record
[URL]="properties.baseLink+'/search/dataset?datasetId='+datasetId"></schema2jsonld>
<showTitle [titleName]="datasetInfo.title"></showTitle>
<p class="uk-text-large" *ngIf="datasetInfo.subtitle">
<span [innerHTML]="datasetInfo.subtitle"></span>
</p>
<span *ngIf="datasetInfo.types && datasetInfo.types.length > 0" class="uk-label custom-label label-dataset "
title="Type">{{datasetInfo.types.join(", ")}}</span>{{" "}}
<span *ngIf="datasetInfo.languages && datasetInfo.languages.length > 0"
class="uk-label custom-label label-language "
title="Language">{{datasetInfo.languages.join(", ")}}</span>{{" "}}
<span *ngIf="datasetInfo.countries && datasetInfo.countries.length > 0"
class="uk-label custom-label label-country "
title="Country">{{datasetInfo.countries.join(", ")}}</span>{{" "}}
<!-- <span *ngIf="datasetInfo.title && datasetInfo.title.accessMode" [class]="'uk-label custom-label label-'+ datasetInfo.title.accessMode " title="Access Mode">{{datasetInfo.title.accessMode}}</span> -->
<span *ngIf="datasetInfo.accessMode" [class]="'uk-label custom-label label-'+ datasetInfo.accessMode "
title="Access Mode">{{datasetInfo.accessMode}}</span>{{" "}}
<span *ngIf="datasetInfo.underCurationMessage" class="uk-label custom-label label-underCuration ">{{" "}}
<span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}">
<i>Record in preview</i>
<i class="uk-icon-info-circle"></i>
</span></span>
<!--div *ngIf="datasetInfo.underCurationMessage">
<span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}">
<i>Record in preview</i>
<i class="uk-icon-info-circle"></i>
</span>
</div-->
<div class=" uk-margin-top">
<showAuthors [authors]="datasetInfo.authors"></showAuthors>
<span *ngIf="datasetInfo.date != ''">({{datasetInfo.date}})</span>
</div>
<ul class="uk-list">
<showPublisher [publisher]="datasetInfo.publisher"
[journal]="datasetInfo.journal" [properties]="properties"></showPublisher>
<li *ngIf="datasetInfo.embargoEndDate"><span
class="uk-text-bold">Embargo end date:</span> {{datasetInfo.embargoEndDate}}</li>
<li *ngIf="datasetInfo.identifiers && datasetInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="datasetInfo.identifiers"></showIdentifiers>
</li>
<li *ngIf="datasetInfo.subjects ||datasetInfo.otherSubjects || datasetInfo.classifiedSubjects">
<showSubjects [subjects]="datasetInfo.subjects"
[otherSubjects]="datasetInfo.otherSubjects"
[classifiedSubjects]="datasetInfo.classifiedSubjects">
</showSubjects>
</li>
</ul>
<hr *ngIf="datasetInfo.description">
<div *ngIf="datasetInfo.description"
class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<span>{{datasetInfo.description.substring(0, showNumDescription)}}</span
><span
*ngIf="showNumDescription == thresholdDescription && datasetInfo.description.length > thresholdDescription">...</span
><span
*ngIf="showNumDescription == thresholdDescription && datasetInfo.description.length > thresholdDescription"
class="uk-text-right">
<a (click)="showNumDescription = datasetInfo.description.length;">
View more
</a>
</span>
</div>
<div *ngIf="datasetInfo.description && showNumDescription > thresholdDescription"
class="uk-width-1-1 uk-text-right">
<a (click)="showNumDescription = thresholdDescription;">
View less
</a>
</div>
<ul class="custom-accordion" uk-accordion>
<li *ngIf="datasetInfo.references" (click)="activeTab='References'">
<a class="uk-accordion-title" href="#">
References ({{datasetInfo.references.length | number}})
</a>
<div class="uk-accordion-content">
<div>
<div *ngIf="datasetInfo.references.length > pageSize" class="uk-margin-bottom">
<span class="uk-h6">{{datasetInfo.references.length | number}}
references, page {{referencesPage | number}}
of {{totalPages(datasetInfo.references.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="referencesPage"
[totalResults]="datasetInfo.references.length" [size]="pageSize"
(pageChange)="updateReferencesPage($event)"></paging-no-load>
</div>
<div
*ngFor="let item of datasetInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
<p *ngIf=" item && item['url']"
class="custom-external custom-icon">
<a href="{{item['url']}}" target="_blank">
{{item['name']}}
</a>
</p>
<p *ngIf="!item['url']" class="pseudo-external custom-icon">
{{item['name']}}
</p>
</div>
</div>
</div>
</li>
<li *ngIf="datasetInfo.relatedResearchResults" (click)="activeTab='Related Research Results'">
<a class="uk-accordion-title" href="#">
Related Research Results
<!-- <span *ngIf="!datasetInfo.relatedResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="datasetInfo.relatedResearchResults" class="uk-badge uk-badge-notification">
{{relatedResearchResultsNum | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{relatedResearchResultsNum | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!datasetInfo.relatedResearchResults" class = "uk-alert uk-alert-primary">
No related research results available
</div>
<div *ngIf="datasetInfo.relatedResearchResults"> -->
<div>
<div *ngFor="let provenanceaction of getKeys(datasetInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div>
<tabTable percentageName="trust"
[info]="datasetInfo.relatedResearchResults.get(provenanceaction)"
[properties]=properties></tabTable>
</div>
</div>
</div>
</li>
<li *ngIf="datasetInfo.similarResearchResults" (click)="activeTab='Similar Research Results'">
<a class="uk-accordion-title" href="#">
Similar Research Results
<!-- <span *ngIf="!datasetInfo.similarResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="datasetInfo.similarResearchResults" class="uk-badge uk-badge-notification">
{{datasetInfo.similarResearchResults.length | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{datasetInfo.similarResearchResults.length | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!datasetInfo.similarResearchResults" class = "uk-alert uk-alert-primary" >
No similar research results available
</div>
<div *ngIf="datasetInfo.similarResearchResults"> -->
<div>
<tabTable percentageName="similarity" [info]="datasetInfo.similarResearchResults"
[properties]=properties></tabTable>
</div>
</div>
</li>
<li (click)="metricsClicked=true; activeTab='Metrics'">
<a class="uk-accordion-title" href="#">
Metrics
</a>
<div class="uk-accordion-content">
<metrics [pageViews]="pageViews"
[id]="datasetId" [entityType]="'results'" [entity]="'Research Data'"
(metricsResults)="metricsResults($event)" [properties]=properties>
</metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250">
</i-frame>
</div>
</li>
<li (click)="activeTab='Other Versions'"
*ngIf="properties.environment != 'production' && datasetInfo.deletedByInferenceIds">
<a class="uk-accordion-title" href="#">
Other Versions
({{datasetInfo.deletedByInferenceIds.length | number}})
</a>
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
<deletedByInference [id]="datasetId" [ids]="datasetInfo.deletedByInferenceIds"
[type]="'research data'"></deletedByInference>
</div>
</li>
</ul>
</div>
<div class="uk-width-1-3@m uk-width-1-1@s">
<div class=" uk-padding-small" *ngIf="isRouteAvailable('participate/direct-claim') ">
<button class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
height="25"><path
d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path
d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975"
fill="none" stroke="#000"
stroke-width="1.1"></path></svg>
</span> Link this dataset to...
</button>
<div class=" uk-text-center uk-margin-expand uk-padding-small uk-margin-auto default-dropdown "
uk-dropdown="mode:click">
<div class="uk-grid uk-child-width-1-3 uk-width-large ">
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','project'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim"
>
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="album" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect height="1" width="10" x="5" y="2"></rect><rect
height="1" width="14" x="3" y="4"></rect><rect fill="none" height="11" stroke="#000"
width="17" x="1.5" y="6.5"></rect></svg></span>
</button>
<div>Projects</div>
</a></div>
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="copy" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect fill="none" height="16" stroke="#000"
width="12" x="3.5" y="2.5"></rect><polyline
fill="none" points="5 0.5 17.5 0.5 17.5 17" stroke="#000"></polyline></svg></span>
</button>
<div>Research results</div>
</a></div>
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','context'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="users" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><circle cx="7.7" cy="8.6" fill="none" r="3.5"
stroke="#000" stroke-width="1.1"></circle><path
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3" fill="none"
stroke="#000" stroke-width="1.1"></path><path
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"
fill="none" stroke="#000" stroke-width="1.1"></path></svg></span>
</button>
<div>Communities</div>
</a></div>
</div>
</div>
</div>
<div>
<div class="sideInfoTitle uk-margin-small-bottom uk-margin-small-top">Share - Bookmark</div>
<addThis></addThis>
</div>
<altmetrics *ngIf="datasetInfo.identifiers && datasetInfo.identifiers.get('doi')"
id="{{datasetInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics>
<ul class="uk-list uk-margin-remove-bottom ">
<li *ngIf="datasetInfo.hostedBy_collectedFrom && datasetInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="datasetInfo.hostedBy_collectedFrom"></availableOn>
</li>
<li *ngIf="datasetInfo.fundedByProjects != undefined && datasetInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="datasetInfo.fundedByProjects"></fundedBy>
</li>
<li *ngIf="datasetInfo.contexts && datasetInfo.contexts.length >0 ">
<dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of datasetInfo.contexts">
<span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span>
<mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
</dl>
</li>
<!--li>
<metrics [pageViews]="pageViews" shortView=true
[id]="datasetId" [entityType]="'results'" [entity]="'Research Data'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics>
</li-->
<li>
<div class="sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this research data
</div>
<div class=" ">
<citeThis [result]="datasetInfo" [id]="datasetId" type="research data"></citeThis>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']"></helper>
</div>

View File

@ -1,268 +0,0 @@
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser';
import {DatasetInfo} from '../../utils/entities/datasetInfo';
import {EnvProperties} from '../../utils/properties/env-properties';
import {RouterHelper} from '../../utils/routerHelper.class';
import {DatasetService} from './dataset.service';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({
selector: 'dataset',
templateUrl: 'dataset.component.html',
})
export class DatasetComponent {
@Input() piwikSiteId = null;
@Input() communityId = null;
public datasetInfo: DatasetInfo;
public datasetId: string;
// APP BOX variables
public showAllCollectedFrom: boolean = false;
public showAllDownloadFrom: boolean = false;
public showAllPublishedIn: boolean = false;
public thresholdDescription: number = 270;
public showNumDescription: number = 270;
// Metrics tab variables
public metricsClicked: boolean;
public viewsFrameUrl: string;
public downloadsFrameUrl: string;
public totalViews: number;
public totalDownloads: number;
public pageViews: number;
// Custom tab paging variables
public referencesPage: number = 1;
public pageSize: number = 10;
// Active tab variable for responsiveness
public activeTab: string = "References";
// Map counting variable
public relatedResearchResultsNum: number = 0;
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
public pageContents = null;
public divContents = null;
public routerHelper: RouterHelper = new RouterHelper();
private result;
sub: any;
piwiksub: any;
infoSub: any;
properties: EnvProperties;
constructor(private _datasetService: DatasetService,
private _piwikService: PiwikService,
private route: ActivatedRoute,
private router: Router,
private _meta: Meta,
private _title: Title,
private _router: Router,
private seoService: SEOService,
private helper: HelperService) {
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
//this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
});
this.sub = this.route.queryParams.subscribe(params => {
this.datasetInfo = null;
this.updateTitle("Dataset");
this.updateDescription("");
this.datasetId = params['datasetId'];
if (this.datasetId) {
this.getDatasetInfo(this.datasetId);
} else {
this.showLoading = false;
this.warningMessage = "No valid research data id";
}
this.metricsClicked = false;
this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this.datasetId + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","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.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resViewsTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","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(124, 181, 236, 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.datasetId + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","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';
/*this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","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';
*/
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();
}
}
private getDatasetInfo(id: string) {
this.warningMessage = '';
this.errorMessage = ""
this.showLoading = true;
this.datasetInfo = null;
this.infoSub = this._datasetService.getDatasetInfo(id, this.properties).subscribe(
data => {
this.datasetInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDataset + this.datasetInfo.record["result"]["header"]["dri:objIdentifier"]);
/*
if(this.datasetInfo.title.name != undefined && this.datasetInfo.title.name!= ''){
this.updateTitle(this.datasetInfo.title.name);
this.updateDescription("Dataset, search, repositories, open access,"+this.datasetInfo.title.name);
}
*/
if (this.datasetInfo.title) {
this.updateTitle(this.datasetInfo.title);
this.updateDescription((this.datasetInfo.description ? (this.datasetInfo.description) : ("," + this.datasetInfo.title)));
}
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.datasetInfo.title/*.name*/, this.piwikSiteId).subscribe();
}
this.result = []
this.result = {
id: id,
type: "dataset",
source: "openaire",
title: this.datasetInfo.title,
url: '',
result: '',
accessRights: /*this.datasetInfo.title.accessMode*/ this.datasetInfo.accessMode,
embargoEndDate: ''
};
let relatedResearchResultsNum = 0;
if (this.datasetInfo.relatedResearchResults != undefined) {
this.datasetInfo.relatedResearchResults.forEach(function (value, key, map) {
relatedResearchResultsNum += value.length;
});
}
this.relatedResearchResultsNum = relatedResearchResultsNum;
this.showLoading = false;
},
err => {
//console.log(err)
this.handleError("Error getting research data for id: " + this.datasetId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDatasets);
this.errorMessage = 'No research data found';
this.showLoading = false;
}
);
}
// showChange($event) {
// this.showAllReferences=$event.value;
// }
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _prefix = "";
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'");
}
private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
public buildCurationTooltip() {
let tooltipContent: string = "<div class='uk-padding-small uk-light'>";
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></di>";
return tooltipContent;
}
public getKeys(map) {
return Array.from(map.keys());
}
private handleError(message: string, error) {
console.error("Research Data Landing Page: " + message, error);
}
public updateReferencesPage($event) {
this.referencesPage = $event.value;
}
public totalPages(totalResults: number): number {
let totalPages: any = totalResults / this.pageSize;
if (!(Number.isInteger(totalPages))) {
totalPages = (parseInt(totalPages, this.pageSize) + 1);
}
return totalPages;
}
public scroll() {
HelperFunctions.scroll();
}
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;
}
}

View File

@ -1,48 +0,0 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
import {SharedModule} from '../../shared/shared.module';
import {DatasetComponent} from './dataset.component';
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';;
import {LandingModule} from '../landing-utils/landing.module';
import {ResultLandingModule} from '../landing-utils/resultLanding.module';
import {MetricsModule} from '../landing-utils/metrics.module';
import {AltMetricsModule} from '../../utils/altmetrics.module';
import {ConfigurationServiceModule} from '../../utils/configuration/configurationService.module';
import {IFrameModule} from '../../utils/iframe.module';
import {PagingModule} from '../../utils/paging.module';
import {DatasetService} from './dataset.service';
import {FreeGuard} from '../../login/freeGuard.guard';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module';
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
import {DeletedByInferenceModule} from "../landing-utils/deletedByInference/deletedByInference.module";
import {HelperModule} from "../../utils/helper/helper.module";
@NgModule({
imports: [
CommonModule, FormsModule, SharedModule, RouterModule, LandingModule,
CiteThisModule, ResultLandingModule, MetricsModule, IFrameModule, PagingModule,
AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule,
ShowAuthorsModule, DeletedByInferenceModule, HelperModule
],
declarations: [
DatasetComponent
],
providers:[
DatasetService, FreeGuard, IsRouteEnabled
],
exports: [
DatasetComponent
]
})
export class DatasetModule { }

View File

@ -1,271 +0,0 @@
import {Injectable} from '@angular/core';
import {Http, Response} from '@angular/http';
import {HttpClient, HttpErrorResponse} from "@angular/common/http";
import {Observable, throwError} from 'rxjs';
import {DatasetInfo} from '../../utils/entities/datasetInfo';
import{EnvProperties} from '../../utils/properties/env-properties';
import { ParsingFunctions } from '../landing-utils/parsingFunctions.class';
import {map} from "rxjs/operators";
@Injectable()
export class DatasetService {
constructor(private http: HttpClient ) {
this.parsingFunctions = new ParsingFunctions();
}
public parsingFunctions: ParsingFunctions;
datasetInfo: DatasetInfo;
getDatasetInfo (id: string, properties:EnvProperties):any {
let url = properties.searchAPIURLLAst+'datasets/'+id+"?format=json";
let key = url;
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
//.map(res => <any> res.json())
.pipe(map(res => [res['result']['header']['dri:status'], res['result']['metadata']['oaf:entity']['oaf:result'],res]))
.pipe(map(res => [res[1], //0
res[1]['title'], //1
res[1]['rels']['rel'], //2
res[1]['children'], //3
res[1]['pid'], //4
res[1]['subject'], //5
res[1]['bestaccessright'], //6
res[1]['collectedfrom'], //7
res[1]['context'], //8
//res[1]['resulttype'],
res[0], //9
res[1]['creator'], //10
res[1]['language'], //11
res[1]['country'], //12
res[2], //13
(res[1]['extraInfo']!= undefined && res[1]['extraInfo']['citations']!= undefined)? res[1]['extraInfo']['citations']['citation']:null, //14
res[1]['journal'] //15
]))
.pipe(map(res => this.parseDatasetInfo(res, properties)));
}
private handleError (error: HttpErrorResponse) {
// in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console
console.log(error);
return throwError(error || 'Server error');
}
parseDatasetInfo (data: any, properties: EnvProperties):any {
this.datasetInfo = new DatasetInfo();
this.datasetInfo.record = data[13];
// ['result']['metadata']['oaf:entity']['oaf:result']
if(data[0] != null) {
var date:string = (data[0].dateofacceptance)+""; // transform to string in case it is an integer
this.datasetInfo.date = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
this.datasetInfo.dateofacceptance = data[0].dateofacceptance;
this.datasetInfo.publisher = data[0].publisher;
if(!Array.isArray(data[0].description)) {
this.datasetInfo.description = String(data[0].description);
} else {
this.datasetInfo.description = String(data[0].description[0]);
}
this.datasetInfo.embargoEndDate = data[0].embargoenddate;
}
/*this.datasetInfo.title = {"name": "", "url": "", "accessMode": ""};
if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
this.datasetInfo.title.accessMode = data[0]['bestaccessright'].classid;
}
if(data[1] != null) {
if(Array.isArray(data[1])) {
this.datasetInfo.title['name'] = data[1][0].content;
} else {
this.datasetInfo.title['name'] = data[1].content;
}
}*/
if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
this.datasetInfo.accessMode = data[0]['bestaccessright'].classid;
}
// ['result']['metadata']['oaf:entity']['oaf:result']['title']
if(data[1] != null) {
if(Array.isArray(data[1])) {
this.datasetInfo.title = String(data[1][0].content);
if(data[1][1].classid == "subtitle") {
this.datasetInfo.subtitle = String(data[1][1].content);
}
} else {
this.datasetInfo.title = String(data[1].content);
}
}
// ['result']['metadata']['oaf:entity']['oaf:result']['rels']['rel']
if(data[2] != null) {
let relation;
let length = data[2].length!=undefined ? data[2].length : 1;
for(let i=0; i<length; i++) {
relation = data[2].length!=undefined ? data[2][i] : data[2];
if(relation.hasOwnProperty("to")) {
if(relation['to'].class == "isProducedBy") {
this.datasetInfo.fundedByProjects = this.parsingFunctions.parseFundingByProjects(this.datasetInfo.fundedByProjects, relation, this.datasetInfo.projectsProvenanceVocabulary);
} else if(relation['to'].class == "isRelatedTo") {
let provenanceAction: string;
if(relation.provenanceaction in this.datasetInfo.researchResultsProvenanceVocabulary) {
provenanceAction = this.datasetInfo.researchResultsProvenanceVocabulary[relation.provenanceaction];
} else {
provenanceAction = "Other"
}
this.datasetInfo.relatedResearchResults = this.parsingFunctions.parseRelatedResearchResults(this.datasetInfo.relatedResearchResults, relation, provenanceAction);
} else if(relation['to'].class == "hasAmongTopNSimilarDocuments") {
this.datasetInfo.similarResearchResults = this.parsingFunctions.parseSimilarResearchResults(this.datasetInfo.similarResearchResults, relation);
}
}
}
}
// ['result']['metadata']['oaf:entity']['oaf:result']['children']
if(data[3] != null) {
if(data[3].hasOwnProperty("result")) {
this.datasetInfo.deletedByInferenceIds = [];
let length = Array.isArray(data[3]['result']) ? data[3]['result'].length : 1;
for(let i=0; i<length; i++) {
let result = Array.isArray(data[3]['result']) ? data[3]['result'][i] : data[3]['result'];
this.datasetInfo.deletedByInferenceIds.push(result.objidentifier);
}
}
if(data[3].hasOwnProperty("instance")) {
this.datasetInfo.hostedBy_collectedFrom = new Array<{ "downloadName": string, "downloadUrl": string[],
"collectedName": string, "collectedId": string,
"accessMode": string[], "bestAccessMode": string,
"type": string, "year":string}>();
this.datasetInfo.types = new Array<string>();
let types = new Set<string>();
let counter = 0;
let instance;
let length = data[3]['instance'].length!=undefined ? data[3]['instance'].length : 1;
for(let i=0; i<length; i++) {
instance = data[3]['instance'].length!=undefined ? data[3]['instance'][i] : data[3]['instance'];
this.parsingFunctions.parseTypes(this.datasetInfo.types, types, instance);
if(instance.hasOwnProperty("webresource")) {
let url;
if(instance['webresource'].length == undefined) {
url = instance['webresource'].url;
} else{
url = instance['webresource'][0].url;
}
if(instance.hasOwnProperty("hostedby")) {
counter = this.parsingFunctions.parseHostedBy_collectedFrom(this.datasetInfo.hostedBy_collectedFrom, instance, data[0], url, counter/*, this.datasetInfo.title*/, this.datasetInfo.accessMode);
}
}
}
}
}
// ['result']['metadata']['oaf:entity']['oaf:result']['pid']
if(data[4] != null) {
this.datasetInfo.identifiers = this.parsingFunctions.parseIdentifiers(data[4]);
}
// ['result']['metadata']['oaf:entity']['oaf:result']['subject']
if(data[5] != null) {
let subjectResults: [string[], Map<string, string[]>, Map<string, string[]>] = this.parsingFunctions.parseAllSubjects(data[5]);
this.datasetInfo.subjects = subjectResults[0];
this.datasetInfo.otherSubjects = subjectResults[1];
this.datasetInfo.classifiedSubjects = subjectResults[2];
}
this.datasetInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom(
this.datasetInfo.hostedBy_collectedFrom, this.datasetInfo.publisher,
null, this.datasetInfo.identifiers/*, this.datasetInfo.title*/);
// ['result']['metadata']['oaf:entity']['oaf:result']['context']
if(data[8] != null) {
this.datasetInfo.contexts = this.parsingFunctions.parseContexts(data[8]);
}
// if(data[9] != null && this.datasetInfo.type == undefined) {
// if(data[9].hasOwnProperty('classname')) {
// this.datasetInfo.type = data[9].classname;
// }
// }
// ['result']['header']['dri:status']
if(data[9] != null && data[9] == "under curation") {
this.datasetInfo.underCurationMessage = true;
} else {
this.datasetInfo.underCurationMessage = false;
}
// ['result']['metadata']['oaf:entity']['oaf:result']['creator']
if(data[10] != null) {
if(this.datasetInfo.authors == undefined) {
this.datasetInfo.authors = new Array<{"fullName": string, "orcid": string}>();
}
let authors = data[10];
let length = Array.isArray(authors) ? authors.length : 1;
for(let i=0; i<length; i++) {
let author = Array.isArray(authors) ? authors[i] : authors;
if(author) {
/*if (author.ORCID && author.ORCID.indexOf(properties.orcidURL) != -1) {
author.ORCID = author.ORCID.substr(properties.orcidURL.length);
}*/
this.datasetInfo['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID};
}
}
this.datasetInfo.authors = this.datasetInfo.authors.filter(function (item) {
return (item != undefined && item.fullName != undefined);
});
}
// ['result']['metadata']['oaf:entity']['oaf:result']['language']
if(data[11] != null) {
this.datasetInfo.languages = this.parsingFunctions.parseLanguages(data[11]);
}
// ['result']['metadata']['oaf:entity']['oaf:result']['country']
if(data[12] != null) {
this.datasetInfo.countries = this.parsingFunctions.parseCountries(data[12]);
}
// ['result']['metadata']['oaf:entity']['oaf:result']['extraInfo']['citations']['citation']
if(data[14] != null) {
this.datasetInfo.references = this.parsingFunctions.parseReferences(data[14]);
}
if(this.datasetInfo.relatedResearchResults) {
let self = this;
this.datasetInfo.relatedResearchResults.forEach(function (value, key, map) {
self.datasetInfo.relatedResearchResults.set(key, self.parsingFunctions.sortByPercentage(value));
});
}
this.datasetInfo.similarResearchResults = this.parsingFunctions.sortByPercentage(this.datasetInfo.similarResearchResults);
if(data[15] != null) {
this.datasetInfo.journal = {"journal": "", "issn": "", "lissn": "", "eissn": "", "issue": "", "volume": "", "start_page": "", "end_page": ""}
this.datasetInfo.journal['journal'] = data[15].content;
this.datasetInfo.journal['issn'] = data[15].issn;
this.datasetInfo.journal['lissn'] = data[15].lissn;
this.datasetInfo.journal['eissn'] = data[15].eissn;
this.datasetInfo.journal['issue'] = data[15].iss;
this.datasetInfo.journal['volume'] = data[15].vol;
this.datasetInfo.journal['start_page'] = data[15].sp;
this.datasetInfo.journal['end_page'] = data[15].ep;
}
return this.datasetInfo;
}
}

View File

@ -107,7 +107,7 @@ export class DeletedByInferenceComponent {
// Custom tab paging variables
public page: number = 1;
public pageSize: number = 10;
public pageSize: number = 5;
public status: number;
public routerHelper:RouterHelper = new RouterHelper();

View File

@ -7,7 +7,7 @@ import { FormsModule } from '@angular/forms';
import { DeletedByInferenceComponent } from './deletedByInference.component';
import { DeletedByInferenceService } from './deletedByInference.service';
import {ResultLandingModule} from '../resultLanding.module';
import {ResultLandingUtilsModule} from '../resultLandingUtils.module';
import {PagingModule} from '../../../utils/paging.module';
@ -16,7 +16,7 @@ import {ShowAuthorsModule} from "../../../utils/authors/showAuthors.module";
@NgModule({
imports: [
CommonModule, FormsModule, ResultLandingModule,
CommonModule, FormsModule, ResultLandingUtilsModule,
PagingModule, ErrorMessagesModule, ShowAuthorsModule
],
declarations: [

View File

@ -31,4 +31,4 @@ import {ShowPublisherModule} from "./showPublisher.module";
FundedByComponent, PublishedInComponent, AvailableOnComponent, TabTableComponent, ShowPublisherComponent
]
})
export class ResultLandingModule { }
export class ResultLandingUtilsModule { }

View File

@ -4,34 +4,36 @@ import {ActivatedRoute} from '@angular/router';
@Component({
selector: 'showTitle',
template: `
<h2 *ngIf="title != undefined" class="landingTitle">
<span *ngIf="title['url'] != undefined && title['url'] != null && title['url'] != ''"
class="custom-external">
<a *ngIf="title['name'] != undefined && title['name'] != ''"
href="{{title['url']}}" target="_blank"
[innerHTML]="title['name']">
</a>
<a *ngIf="title['name'] == undefined || title['name'] == ''"
href="{{title['url']}}" target="_blank">
[no title available]
</a>
</span>
<span *ngIf="(title['name'] != undefined && title['name'] != '') &&
(title['url'] == undefined || title['url'] == null || title['url'] == '')"
[innerHTML]="title['name']">
</span>
<span *ngIf="(title['name'] == undefined || title['name'] == '') &&
(title['url'] == undefined || title['url'] == null || title['url'] == '')"
>
[no title available]
</span>
</h2>
<h2 *ngIf="titleName">
<span [innerHTML]="titleName"></span>
</h2>
<h2 *ngIf="!titleName && !title">
<span>[no title available]</span>
<h2 [class]="classNames">
<div *ngIf="title != undefined" class="landingTitle">
<span *ngIf="title['url'] != undefined && title['url'] != null && title['url'] != ''"
class="custom-external">
<a *ngIf="title['name'] != undefined && title['name'] != ''"
href="{{title['url']}}" target="_blank"
[innerHTML]="title['name']">
</a>
<a *ngIf="title['name'] == undefined || title['name'] == ''"
href="{{title['url']}}" target="_blank">
[no title available]
</a>
</span>
<span *ngIf="(title['name'] != undefined && title['name'] != '') &&
(title['url'] == undefined || title['url'] == null || title['url'] == '')"
[innerHTML]="title['name']">
</span>
<span *ngIf="(title['name'] == undefined || title['name'] == '') &&
(title['url'] == undefined || title['url'] == null || title['url'] == '')"
>
[no title available]
</span>
</div>
<div *ngIf="titleName">
<span [innerHTML]="titleName"></span>
</div>
<div *ngIf="!titleName && !title">
<span>[no title available]</span>
</div>
</h2>
`
@ -41,6 +43,7 @@ export class ShowTitleComponent {
@Input() titleName: string;
@Input() title: { [key: string]: string };
@Input() iconClass:string;
@Input() classNames: string = "";
sub: any;

View File

@ -1,278 +0,0 @@
<div id="tm-main" class=" uk-section uk-padding-remove-top uk-margin-small-top tm-middle">
<div uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first">
<div class="uk-container orp">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper>
<div *ngIf="orpInfo != null" class="uk-grid">
<div class="uk-width-2-3@m uk-width-1-1@s uk-margin-bottom">
<schema2jsonld *ngIf="orpInfo.record" [data]=orpInfo.record
[URL]="properties.baseLink+'/search/orp?orpId='+orpId"></schema2jsonld>
<showTitle [titleName]="orpInfo.title"></showTitle>
<span *ngIf="orpInfo.types && orpInfo.types.length > 0" class="uk-label custom-label label-orp "
title="Type">{{orpInfo.types.join(", ")}}</span>{{" "}}
<span *ngIf="orpInfo.languages && orpInfo.languages.length > 0"
class="uk-label custom-label label-language "
title="Language">{{orpInfo.languages.join(", ")}}</span>{{" "}}
<span *ngIf="orpInfo.countries && orpInfo.countries.length > 0"
class="uk-label custom-label label-country "
title="Country">{{orpInfo.countries.join(", ")}}</span>{{" "}}
<span *ngIf="orpInfo.accessMode" [class]="'uk-label custom-label label-'+ orpInfo.accessMode "
title="Access Mode">{{orpInfo.accessMode}}</span>{{" "}}
<span *ngIf="orpInfo.underCurationMessage" class="uk-label custom-label label-underCuration">
<span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}">
<i>Record in preview</i>
<i class="uk-icon-info-circle"></i>
</span>
</span>{{" "}}
<div class=" uk-margin-top">
<showAuthors [authors]="orpInfo.authors"></showAuthors>
<span *ngIf="orpInfo.date != ''">({{orpInfo.date}})</span>
</div>
<ul class="uk-list">
<showPublisher [publisher]="orpInfo.publisher"
[journal]="orpInfo.journal" [properties]="properties"></showPublisher>
<li *ngIf="orpInfo.embargoEndDate"><span
class="uk-text-bold">Embargo end date:</span> {{orpInfo.embargoEndDate}}</li>
<li *ngIf="orpInfo.identifiers && orpInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="orpInfo.identifiers"></showIdentifiers>
</li>
<li *ngIf="orpInfo.subjects ||orpInfo.otherSubjects || orpInfo.classifiedSubjects">
<showSubjects [subjects]="orpInfo.subjects"
[otherSubjects]="orpInfo.otherSubjects"
[classifiedSubjects]="orpInfo.classifiedSubjects">
</showSubjects>
</li>
</ul>
<hr *ngIf="orpInfo.description">
<div *ngIf="orpInfo.description"
class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<span>{{orpInfo.description.substring(0, showNumDescription)}}</span
><span
*ngIf="showNumDescription == thresholdDescription && orpInfo.description.length > thresholdDescription">...</span
><span
*ngIf="showNumDescription == thresholdDescription && orpInfo.description.length > thresholdDescription"
class="uk-text-right">
<a (click)="showNumDescription = orpInfo.description.length;">
View more
</a>
</span>
</div>
<div *ngIf="orpInfo.description && showNumDescription > thresholdDescription"
class="uk-width-1-1 uk-text-right">
<a (click)="showNumDescription = thresholdDescription;">
View less
</a>
</div>
<ul class="custom-accordion" uk-accordion>
<li *ngIf="orpInfo.references" (click)="activeTab='References'">
<a class="uk-accordion-title" href="#">
References ({{orpInfo.references.length | number}})
</a>
<div class="uk-accordion-content">
<div>
<div *ngIf="orpInfo.references.length > pageSize" class="uk-margin-bottom">
<span class="uk-h6">{{orpInfo.references.length | number}}
references, page {{referencesPage | number}}
of {{totalPages(orpInfo.references.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="referencesPage"
[totalResults]="orpInfo.references.length" [size]="pageSize"
(pageChange)="updateReferencesPage($event)"></paging-no-load>
</div>
<div
*ngFor="let item of orpInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
<p *ngIf=" item && item['url']"
class="custom-external custom-icon">
<a href="{{item['url']}}" target="_blank">
{{item['name']}}
</a>
</p>
<p *ngIf="!item['url']" class="pseudo-external custom-icon">
{{item['name']}}
</p>
</div>
</div>
</div>
</li>
<li *ngIf="orpInfo.relatedResearchResults" (click)="activeTab='Related Research Results'">
<a class="uk-accordion-title" href="#">
Related Research Results
<!-- <span class="uk-badge uk-badge-notification"> -->
({{relatedResearchResultsNum | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<div>
<div *ngFor="let provenanceaction of getKeys(orpInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div>
<tabTable percentageName="trust" [info]="orpInfo.relatedResearchResults.get(provenanceaction)"
[properties]=properties></tabTable>
</div>
</div>
</div>
</li>
<li *ngIf="orpInfo.similarResearchResults" (click)="activeTab='Similar Research Results'">
<a class="uk-accordion-title" href="#">
Similar Research Results
<!-- <span class="uk-badge uk-badge-notification"> -->
({{orpInfo.similarResearchResults.length | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<div>
<tabTable percentageName="similarity" [info]="orpInfo.similarResearchResults"
[properties]=properties></tabTable>
</div>
</div>
</li>
<li (click)="metricsClicked=true; activeTab='Metrics'">
<a class="uk-accordion-title" href="#">
Metrics
</a>
<div class="uk-accordion-content">
<metrics [pageViews]="pageViews"
[id]="orpId" [entityType]="'results'" [entity]="'Other Research Product'"
(metricsResults)="metricsResults($event)" [properties]=properties>
</metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250">
</i-frame>
</div>
</li>
<li (click)="activeTab='Other Versions'"
*ngIf="properties.environment != 'production' && orpInfo.deletedByInferenceIds">
<a class="uk-accordion-title" href="#">
Other Versions
({{orpInfo.deletedByInferenceIds.length | number}})
</a>
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
<deletedByInference [id]="orpId" [ids]="orpInfo.deletedByInferenceIds"
[type]="'other research products'"></deletedByInference>
</div>
</li>
</ul>
</div>
<div class="uk-width-1-3@m uk-width-1-1@s">
<div class=" uk-padding-small">
<button *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg>
</span> Link this product to...
</button>
<div *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-text-center uk-margin-expand uk-padding-small uk-margin-auto default-dropdown "
uk-dropdown="mode:click" >
<div class="uk-grid uk-child-width-1-3 uk-width-large ">
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim"
>
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="album" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect height="1" width="10" x="5" y="2"></rect><rect
height="1" width="14" x="3" y="4"></rect><rect fill="none" height="11" stroke="#000"
width="17" x="1.5" y="6.5"></rect></svg></span>
</button>
<div>Projects</div>
</a></div>
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="copy" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect fill="none" height="16" stroke="#000"
width="12" x="3.5" y="2.5"></rect><polyline
fill="none" points="5 0.5 17.5 0.5 17.5 17" stroke="#000"></polyline></svg></span>
</button>
<div>Research results</div>
</a></div>
<div> <a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="users" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><circle cx="7.7" cy="8.6" fill="none" r="3.5"
stroke="#000" stroke-width="1.1"></circle><path
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3" fill="none"
stroke="#000" stroke-width="1.1"></path><path
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"
fill="none" stroke="#000" stroke-width="1.1"></path></svg></span>
</button>
<div>Communities</div>
</a></div>
</div>
</div>
<div>
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis></addThis>
</div>
<altmetrics *ngIf="orpInfo.identifiers && orpInfo.identifiers.get('doi')"
id="{{orpInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics>
<ul class="uk-list">
<li *ngIf="orpInfo.hostedBy_collectedFrom && orpInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="orpInfo.hostedBy_collectedFrom"></availableOn>
</li>
<li *ngIf="orpInfo.fundedByProjects != undefined && orpInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="orpInfo.fundedByProjects"></fundedBy>
</li>
<li *ngIf="orpInfo.contexts && orpInfo.contexts.length >0 ">
<dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of orpInfo.contexts">
<span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span>
<mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
</dl>
</li>
<li>
<div class="sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this research product
</div>
<div class="">
<citeThis [result]="orpInfo" [id]="orpId" type="other research product"></citeThis>
</div>
</li>
</ul>
</div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']"></helper>
</div>
</div>
</div>
</div>

View File

@ -1,254 +0,0 @@
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser';
import {OrpInfo} from '../../utils/entities/orpInfo';
import {EnvProperties} from '../../utils/properties/env-properties';
import {RouterHelper} from '../../utils/routerHelper.class';
import {OrpService} from './orp.service';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({
selector: 'orp',
templateUrl: 'orp.component.html',
})
export class OrpComponent {
@Input() piwikSiteId = null;
@Input() communityId = null;
public orpInfo: OrpInfo;
public orpId: string;
// APP BOX variables
public showAllCollectedFrom: boolean = false;
public showAllDownloadFrom: boolean = false;
public showAllPublishedIn: boolean = false;
public thresholdDescription: number = 270;
public showNumDescription: number = 270;
// Metrics tab variables
public metricsClicked: boolean;
public viewsFrameUrl: string;
public downloadsFrameUrl: string;
public totalViews: number;
public totalDownloads: number;
public pageViews: number;
// Custom tab paging variables
public referencesPage: number = 1;
public pageSize: number = 10;
// Active tab variable for responsiveness
public activeTab: string = "References";
// Map counting variable
public relatedResearchResultsNum: number = 0;
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
public pageContents = null;
public divContents = null;
public routerHelper: RouterHelper = new RouterHelper();
private result;
sub: any;
piwiksub: any;
infoSub: any;
properties: EnvProperties;
constructor(private _orpService: OrpService,
private _piwikService: PiwikService,
private route: ActivatedRoute,
private router: Router,
private _meta: Meta,
private _title: Title,
private _router: Router,
private helper: HelperService,
private seoService: SEOService) {
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
//this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
});
this.sub = this.route.queryParams.subscribe(params => {
this.orpInfo = null;
this.updateTitle("Other Research Product");
this.updateDescription("");
this.orpId = params['orpId'];
if (this.orpId) {
this.getOrpInfo(this.orpId);
} else {
this.showLoading = false;
this.warningMessage = "No valid research product id";
}
this.metricsClicked = false;
this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this.orpId + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","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.orpId + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","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';
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();
}
}
private getOrpInfo(id: string) {
this.warningMessage = '';
this.errorMessage = ""
this.showLoading = true;
this.orpInfo = null;
this.infoSub = this._orpService.getOrpInfo(id, this.properties).subscribe(
data => {
this.orpInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrp + this.orpInfo.record["result"]["header"]["dri:objIdentifier"]);
if (this.orpInfo.title) {
this.updateTitle(this.orpInfo.title);
this.updateDescription((this.orpInfo.description ? (this.orpInfo.description) : ("," + this.orpInfo.title)));
}
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.orpInfo.title, this.piwikSiteId).subscribe();
}
this.result = []
this.result = {
id: id,
type: "orp",
source: "openaire",
title: this.orpInfo.title,
url: '',
result: '',
accessRights: this.orpInfo.accessMode,
embargoEndDate: ''
};
let relatedResearchResultsNum = 0;
if (this.orpInfo.relatedResearchResults != undefined) {
this.orpInfo.relatedResearchResults.forEach(function (value, key, map) {
relatedResearchResultsNum += value.length;
});
}
this.relatedResearchResultsNum = relatedResearchResultsNum;
this.showLoading = false;
},
err => {
//console.log(err)
this.handleError("Error getting other research product for id: " + this.orpId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrps);
this.errorMessage = 'No research product found';
this.showLoading = false;
}
);
}
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _prefix = "";
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'");
}
private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
public buildCurationTooltip() {
let tooltipContent: string = "<div class='uk-padding-small uk-light'>";
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></di>";
return tooltipContent;
}
public getKeys(map) {
return Array.from(map.keys());
}
public scroll() {
HelperFunctions.scroll();
}
private handleError(message: string, error) {
console.error("Other Research Product Landing Page: " + message, error);
}
public updateReferencesPage($event) {
this.referencesPage = $event.value;
}
public totalPages(totalResults: number): number {
let totalPages: any = totalResults / this.pageSize;
if (!(Number.isInteger(totalPages))) {
totalPages = (parseInt(totalPages, this.pageSize) + 1);
}
return totalPages;
}
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;
}
}

View File

@ -1,48 +0,0 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
import {SharedModule} from '../../shared/shared.module';
import {OrpComponent} from './orp.component';
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
import {LandingModule} from '../landing-utils/landing.module';
import {ResultLandingModule} from '../landing-utils/resultLanding.module';
import {MetricsModule} from '../landing-utils/metrics.module';
import {AltMetricsModule} from '../../utils/altmetrics.module';
import {ConfigurationServiceModule} from '../../utils/configuration/configurationService.module';
import {IFrameModule} from '../../utils/iframe.module';
import {PagingModule} from '../../utils/paging.module';
import {OrpService} from './orp.service';
import {FreeGuard} from '../../login/freeGuard.guard';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module';
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
import {DeletedByInferenceModule} from "../landing-utils/deletedByInference/deletedByInference.module";
import {HelperModule} from "../../utils/helper/helper.module";
@NgModule({
imports: [
CommonModule, FormsModule, SharedModule, RouterModule, LandingModule,
CiteThisModule, ResultLandingModule, MetricsModule, IFrameModule, PagingModule,
AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule,
ShowAuthorsModule, DeletedByInferenceModule, HelperModule
],
declarations: [
OrpComponent
],
providers: [
OrpService, FreeGuard
],
exports: [
OrpComponent
]
})
export class OrpModule {
}

View File

@ -1,233 +0,0 @@
import {Injectable} from '@angular/core';
import {HttpClient, HttpErrorResponse} from "@angular/common/http";
import {throwError} from 'rxjs';
import {OrpInfo} from '../../utils/entities/orpInfo';
import {EnvProperties} from '../../utils/properties/env-properties';
import {ParsingFunctions} from '../landing-utils/parsingFunctions.class';
import {map} from "rxjs/operators";
@Injectable()
export class OrpService {
constructor(private http: HttpClient ) {
this.parsingFunctions = new ParsingFunctions();
}
public parsingFunctions: ParsingFunctions;
orpInfo: OrpInfo;
getOrpInfo (id: string, properties:EnvProperties):any {
let url = properties.searchAPIURLLAst+'other/'+id+"?format=json";
let key = url;
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
//.map(res => <any> res.json())
.pipe(map(res => [res['result']['header']['dri:status'], res['result']['metadata']['oaf:entity'],res]))
.pipe(map(res => [res[1]['oaf:result'], //0
res[1]['oaf:result']['title'], //1
res[1]['oaf:result']['rels']['rel'], //2
res[1]['oaf:result']['children'], //3
res[1]['oaf:result']['pid'], //4
res[1]['oaf:result']['subject'], //5
res[1]['oaf:result']['bestaccessright'], //6
res[1]['oaf:result']['collectedfrom'], //7
res[1]['oaf:result']['context'], //8
res[0], //9
res[1]['oaf:result']['creator'], //10
res[1]['oaf:result']['language'], //11
res[1]['oaf:result']['country'], //12
res[2], //13
(res[1]['extraInfo']!= undefined && res[1]['extraInfo']['citations']!= undefined)? res[1]['extraInfo']['citations']['citation']:null, //14
res[1]['oaf:result']['journal'] //15
]))
.pipe(map(res => this.parseOrpInfo(res, properties)));
}
private handleError (error: HttpErrorResponse) {
// in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console
console.log(error);
return throwError(error || 'Server error');
}
parseOrpInfo (data: any, properties: EnvProperties):any {
this.orpInfo = new OrpInfo();
this.orpInfo.record = data[13];
if(data[0] != null) {
var date:string = (data[0].dateofacceptance)+""; // transform to string in case it is an integer
this.orpInfo.date = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
this.orpInfo.dateofacceptance = data[0].dateofacceptance;
this.orpInfo.publisher = data[0].publisher;
if(!Array.isArray(data[0].description)) {
this.orpInfo.description = String(data[0].description);
} else {
this.orpInfo.description = String(data[0].description[0]);
}
this.orpInfo.embargoEndDate = data[0].embargoenddate;
}
if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
this.orpInfo.accessMode = data[0]['bestaccessright'].classid;
}
if(data[1] != null) {
if(Array.isArray(data[1])) {
this.orpInfo.title = String(data[1][0].content);
} else {
this.orpInfo.title = String(data[1].content);
}
}
if(data[2] != null) {
let relation;
let length = data[2].length!=undefined ? data[2].length : 1;
for(let i=0; i<length; i++) {
relation = data[2].length!=undefined ? data[2][i] : data[2];
if(relation.hasOwnProperty("to")) {
if(relation['to'].class == "isProducedBy") {
this.orpInfo.fundedByProjects = this.parsingFunctions.parseFundingByProjects(this.orpInfo.fundedByProjects, relation, this.orpInfo.projectsProvenanceVocabulary);
} else if(relation['to'].class == "isRelatedTo") {
let provenanceAction: string;
if(relation.provenanceaction in this.orpInfo.researchResultsProvenanceVocabulary) {
provenanceAction = this.orpInfo.researchResultsProvenanceVocabulary[relation.provenanceaction];
} else {
provenanceAction = "Other"
}
this.orpInfo.relatedResearchResults = this.parsingFunctions.parseRelatedResearchResults(this.orpInfo.relatedResearchResults, relation, provenanceAction);
} else if(relation['to'].class == "hasAmongTopNSimilarDocuments") {
this.orpInfo.similarResearchResults = this.parsingFunctions.parseSimilarResearchResults(this.orpInfo.similarResearchResults, relation);
}
}
}
}
if(data[3] != null) {
if(data[3].hasOwnProperty("result")) {
this.orpInfo.deletedByInferenceIds = [];
let length = Array.isArray(data[3]['result']) ? data[3]['result'].length : 1;
for(let i=0; i<length; i++) {
let result = Array.isArray(data[3]['result']) ? data[3]['result'][i] : data[3]['result'];
this.orpInfo.deletedByInferenceIds.push(result.objidentifier);
}
}
if(data[3].hasOwnProperty("instance")) {
this.orpInfo.hostedBy_collectedFrom = new Array<{ "downloadName": string, "downloadUrl": string[],
"collectedName": string, "collectedId": string,
"accessMode": string[], "bestAccessMode": string,
"type": string, "year":string}>();
this.orpInfo.types = new Array<string>();
let types = new Set<string>();
let counter = 0;
let instance;
let length = data[3]['instance'].length!=undefined ? data[3]['instance'].length : 1;
for(let i=0; i<length; i++) {
instance = data[3]['instance'].length!=undefined ? data[3]['instance'][i] : data[3]['instance'];
this.parsingFunctions.parseTypes(this.orpInfo.types, types, instance);
if(instance.hasOwnProperty("webresource")) {
let url;
if(instance['webresource'].length == undefined) {
url = instance['webresource'].url;
} else{
url = instance['webresource'][0].url;
}
if(instance.hasOwnProperty("hostedby")) {
counter = this.parsingFunctions.parseHostedBy_collectedFrom(this.orpInfo.hostedBy_collectedFrom, instance, data[0], url, counter/*, this.orpInfo.title*/, this.orpInfo.accessMode);
}
}
}
}
}
if(data[4] != null) {
this.orpInfo.identifiers = this.parsingFunctions.parseIdentifiers(data[4]);
}
if(data[5] != null) {
let subjectResults: [string[], Map<string, string[]>, Map<string, string[]>] = this.parsingFunctions.parseAllSubjects(data[5]);
this.orpInfo.subjects = subjectResults[0];
this.orpInfo.otherSubjects = subjectResults[1];
this.orpInfo.classifiedSubjects = subjectResults[2];
}
this.orpInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom(
this.orpInfo.hostedBy_collectedFrom, this.orpInfo.publisher,
null, this.orpInfo.identifiers/*, this.orpInfo.title*/);
if(data[8] != null) {
this.orpInfo.contexts = this.parsingFunctions.parseContexts(data[8]);
}
if(data[9] != null && data[9] == "under curation") {
this.orpInfo.underCurationMessage = true;
} else {
this.orpInfo.underCurationMessage = false;
}
if(data[10] != null) {
if(this.orpInfo.authors == undefined) {
this.orpInfo.authors = new Array<{"fullName": string, "orcid": string}>();
}
let authors = data[10];
let length = Array.isArray(authors) ? authors.length : 1;
for(let i=0; i<length; i++) {
let author = Array.isArray(authors) ? authors[i] : authors;
if(author) {
/*if (author.ORCID && author.ORCID.indexOf(properties.orcidURL) != -1) {
author.ORCID = author.ORCID.substr(properties.orcidURL.length);
}*/
this.orpInfo['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID};
}
}
this.orpInfo.authors = this.orpInfo.authors.filter(function (item) {
return (item != undefined && item.fullName != undefined);
});
}
if(data[11] != null) {
this.orpInfo.languages = this.parsingFunctions.parseLanguages(data[11]);
}
if(data[12] != null) {
this.orpInfo.countries = this.parsingFunctions.parseCountries(data[12]);
}
if(data[14] != null) {
this.orpInfo.references = this.parsingFunctions.parseReferences(data[14]);
}
if(this.orpInfo.relatedResearchResults) {
let self = this;
this.orpInfo.relatedResearchResults.forEach(function (value, key, map) {
self.orpInfo.relatedResearchResults.set(key, self.parsingFunctions.sortByPercentage(value));
});
}
this.orpInfo.similarResearchResults = this.parsingFunctions.sortByPercentage(this.orpInfo.similarResearchResults);
if(data[15] != null) {
this.orpInfo.journal = {"journal": "", "issn": "", "lissn": "", "eissn": "", "issue": "", "volume": "", "start_page": "", "end_page": ""}
this.orpInfo.journal['journal'] = data[15].content;
this.orpInfo.journal['issn'] = data[15].issn;
this.orpInfo.journal['lissn'] = data[15].lissn;
this.orpInfo.journal['eissn'] = data[15].eissn;
this.orpInfo.journal['issue'] = data[15].iss;
this.orpInfo.journal['volume'] = data[15].vol;
this.orpInfo.journal['start_page'] = data[15].sp;
this.orpInfo.journal['end_page'] = data[15].ep;
}
return this.orpInfo;
}
}

View File

@ -233,7 +233,7 @@
Metrics
</a>
<div class="uk-accordion-content">
<metrics [pageViews]="pageViews"
<metrics *ngIf="metricsClicked" [pageViews]="pageViews"
[id]="projectId" [entityType]="'projects'" [entity]="'Project'"
(metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics>

View File

@ -1,18 +0,0 @@
// import { NgModule } from '@angular/core';
// import { RouterModule } from '@angular/router';
//
// import { PublicationComponent } from './publication.component';
// import {FreeGuard} from'../../login/freeGuard.guard';
// import {PreviousRouteRecorder} from'../../utils/piwik/previousRouteRecorder.guard';
// import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
//
// @NgModule({
// imports: [
// RouterModule.forChild([
// { path: '', component: PublicationComponent, canActivate: [FreeGuard, IsRouteEnabled], data: {
// redirect: '/error'
// },canDeactivate: [PreviousRouteRecorder] }
// ])
// ]
// })
// export class PublicationRoutingModule { }

View File

@ -1,408 +0,0 @@
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser';
import {EnvProperties} from '../../utils/properties/env-properties';
import {PublicationInfo} from '../../utils/entities/publicationInfo';
import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {PublicationService} from './publication.service';
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({
selector: 'publication',
templateUrl: 'publication.component.html',
})
export class PublicationComponent {
@Input() piwikSiteId = null;
@Input() communityId = null;
public publicationInfo: PublicationInfo;
public articleId: string;
// APP BOX variables
public showAllCollectedFrom: boolean = false;
public showAllDownloadFrom: boolean = false;
public thresholdDescription: number = 270;
public showNumDescription: number = 270;
// Metrics tab variables
public metricsClicked: boolean;
public viewsFrameUrl: string;
public downloadsFrameUrl: string;
public totalViews: number;
public totalDownloads: number;
public pageViews: number;
// Custom tab paging variables
public referencesPage: number = 1;
public organizationsPage: number = 1;
public softwarePage: number = 1;
public bioentitiesPage: number = 1;
public openCitationsPage: number = 1;
public pageSize: number = 10;
/*
public startt: number = 0;
public stopp: number = 0;
*/
// Active tab variable for responsiveness
public activeTab: string = "References";
// Map counting variables
public bioentitiesNum: number = 0;
public relatedResearchResultsNum: number = 0;
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
public routerHelper: RouterHelper = new RouterHelper();
private doi: string;
public doiURL: string;
private result;
sub: any;
piwiksub: any;
infoSub: any;
properties: EnvProperties;
public pageContents = null;
public divContents = null;
constructor(private _publicationService: PublicationService,
private _piwikService: PiwikService,
private route: ActivatedRoute,
private router: Router,
private _meta: Meta,
private _title: Title,
private _router: Router,
private helper: HelperService,
private seoService: SEOService) {
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
//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.publicationInfo = null;
this.updateTitle("Publication");
this.updateDescription("");
this.articleId = data['articleId'];
this.metricsClicked = false;
if (this.articleId) {
this.getPublicationInfo(this.articleId);
// if (typeof document !== 'undefined') {
// switcher(UIkit);
// }
} else {
this.showLoading = false;
this.warningMessage = "No valid publication id";
}
this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this.articleId + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","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.articleId + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","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';
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();
}
}
private getOpenCitations(id: string) {
this._publicationService.getOpenCitations(this.articleId, this.properties).subscribe(
data => {
this.publicationInfo.openCitations = data[1];
},
err => {
//console.log(err);
this.handleError("Error getting open citation for publication with id: " + this.articleId, err);
}
);
}
private getPublicationInfo(id: string) {
this.warningMessage = '';
this.errorMessage = ""
this.showLoading = true;
this.publicationInfo = null;
this.infoSub = this._publicationService.getPublicationInfo(this.articleId, this.properties).subscribe(
data => {
this.publicationInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToPublication + this.publicationInfo.record["result"]["header"]["dri:objIdentifier"]);
if ((this.properties.environment == "beta" || this.properties.environment == "development") && (typeof document !== 'undefined')) {
this.getOpenCitations(this.articleId);
}
// this.result = []
// this.result = {id: id, type :"dataset", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.bestaccessright, embargoEndDate: ''};
/*if(this.publicationInfo.title.name != undefined && this.publicationInfo.title.name!= ''){
this.updateTitle(this.publicationInfo.title.name);
this.updateDescription("Dataset, search, repositories, open access,"+this.publicationInfo.title.name);
}*/
if (this.publicationInfo.title) {
this.updateTitle(this.publicationInfo.title);
this.updateDescription((this.publicationInfo.description ? (this.publicationInfo.description) : ("," + this.publicationInfo.title)));
}
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.publicationInfo.title/*.name*/, this.piwikSiteId).subscribe();
}
let bioentitiesNum = 0;
if (this.publicationInfo.bioentities != undefined) {
this.publicationInfo.bioentities.forEach(function (value, key, map) {
bioentitiesNum += value.size;
});
}
this.bioentitiesNum = bioentitiesNum;
let relatedResearchResultsNum = 0;
if (this.publicationInfo.relatedResearchResults != undefined) {
this.publicationInfo.relatedResearchResults.forEach(function (value, key, map) {
relatedResearchResultsNum += value.length;
});
}
this.relatedResearchResultsNum = relatedResearchResultsNum;
this.result = {
id: this.articleId,
type: "publication",
source: "openaire",
title: this.publicationInfo.title,
url: '',
result: '',
accessRights: /*this.publicationInfo.title.accessMode*/this.publicationInfo.accessMode,
embargoEndDate: ''
};
// this.result.push(result_);
if (this.publicationInfo.identifiers != undefined && this.publicationInfo.identifiers.has('doi')) {
this.doi = this.publicationInfo.identifiers.get('doi')[0];
}
this.showLoading = false;
if (this.publicationInfo.references) {
this.activeTab = "References";
} else if (this.publicationInfo.relatedResearchResults) {
this.activeTab = "Related Research Results";
} else if (this.publicationInfo.similarResearchResults) {
this.activeTab = "Similar Research Results";
} else if (this.publicationInfo.organizations) {
this.activeTab = "Related Organizations";
} else if (this.publicationInfo.bioentities) {
this.activeTab = "bioentities";
} else if (this.publicationInfo.software) {
this.activeTab = "Software";
} else {
this.activeTab = "Metrics";
this.metricsClicked = true;
}
},
err => {
//console.log(err);
this.handleError("Error getting publication for id: " + this.articleId, err);
this.errorMessage = 'No publication found';
this.showLoading = false;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToPublications);
}
);
}
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
}
public buildCurationTooltip() {
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>";
return tooltipContent += "</div>";
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _prefix = "";
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'");
}
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;
}
public updateOrganizationsPage($event) {
this.organizationsPage = $event.value;
}
public updateSoftwarePage($event) {
this.softwarePage = $event.value;
}
public updateBioentitiesPage($event) {
this.bioentitiesPage = $event.value;
}
public updateOpenCitationsPage($event) {
this.openCitationsPage = $event.value;
}
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();
}
/*
start(i: number, bioentitiesPage: number) {
let sum = 0;
let index=0;
let retValue = 0;
let valuesToPage = this.pageSize*bioentitiesPage;
let valuesToPreviousPage = valuesToPage - this.pageSize;
if(bioentitiesPage == 1) {
return 0;
}
this.publicationInfo.bioentities.forEach(function (value, key, map) {
sum += map.get(key).size;
if(index == i) {
if(sum <= valuesToPreviousPage) {
retValue = 0;
} else if((sum-map.get(key).size) >= valuesToPage){
retValue = 0;
} else {
if(map.get(key).size < (sum - valuesToPreviousPage)) {
retValue = 0;
} else {
retValue = map.get(key).size - (sum - valuesToPreviousPage);
}
}
}
index++;
});
this.startt = retValue;
return retValue;
}
stop(i: number, bioentitiesPage: number) {
let sum = 0;
let index=0;
let retValue = 0;
let valuesToPage = this.pageSize*bioentitiesPage;
let valuesToPreviousPage = valuesToPage - this.pageSize;
this.publicationInfo.bioentities.forEach(function (value, key, map) {
sum += map.get(key).size;
if(index == i) {
if(sum <= valuesToPreviousPage) {
retValue = 0;
} else if((sum - map.get(key).size) >= valuesToPage){
retValue = 0;
} else {
if(sum < valuesToPage) {
retValue = map.get(key).size;
} else {
retValue = map.get(key).size - (sum - valuesToPage);
}
}
}
index++;
});
this.stopp = retValue;
return retValue;
}
*/
private handleError(message: string, error) {
console.error("Publication 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;
}
}

View File

@ -1,423 +0,0 @@
import {Injectable} from '@angular/core';
import {HttpClient, HttpErrorResponse} from "@angular/common/http";
import {throwError} from 'rxjs';
import {PublicationInfo} from '../../utils/entities/publicationInfo';
import {EnvProperties} from '../../utils/properties/env-properties';
import {ParsingFunctions} from '../landing-utils/parsingFunctions.class';
import {map} from "rxjs/operators";
@Injectable()
export class PublicationService {
constructor(private http: HttpClient ) {
this.parsingFunctions = new ParsingFunctions();
}
public parsingFunctions: ParsingFunctions;
publicationInfo: PublicationInfo;
getPublicationInfo (id: string, properties:EnvProperties):any {
let url = properties.searchAPIURLLAst + 'publications/' +id+"?format=json";
let key = url;
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
//.map(res => <any> res.json())
.pipe(map(res => [res['result']['header']['dri:status'], res['result']['metadata']['oaf:entity'], res]))
.pipe(map(res => [ res[1]['oaf:result'], //0
res[1]['oaf:result']['title'], //1
res[1]['oaf:result']['rels']['rel'], //2
res[1]['oaf:result']['children'], //3
res[1]['oaf:result']['pid'], //4
res[1]['oaf:result']['journal'], //5
res[1]['oaf:result']['language'], //6
res[1]['oaf:result']['subject'], //7
res[1]['oaf:result']['bestaccessright'], //8
res[1]['oaf:result']['collectedfrom'], //9
(res[1]['extraInfo']!= undefined && res[1]['extraInfo']['citations']!= undefined)? res[1]['extraInfo']['citations']['citation']:null, //10
res[1]['oaf:result']['context'], //11
res[0], //12
res[1]['oaf:result']['creator'], //13
res[2], //14
res[1]['oaf:result']['country'] //15
]))
.pipe(map(res => this.parsePublicationInfo(res, properties)));
}
private handleError (error: HttpErrorResponse) {
// in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console
console.log(error);
return throwError(error || 'Server error');
}
parsePublicationInfo (data: any, properties: EnvProperties):any {
this.publicationInfo = new PublicationInfo();
this.publicationInfo.record = data[14];
if(data[0] != null) {
var date:string = (data[0].dateofacceptance)+""; // transform to string in case it is an integer
this.publicationInfo.date = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
this.publicationInfo.dateofacceptance = data[0].dateofacceptance;
this.publicationInfo.publisher = data[0].publisher;
if(!Array.isArray(data[0].description)) {
this.publicationInfo.description = String(data[0].description);
} else {
this.publicationInfo.description = String(data[0].description[0]);
}
this.publicationInfo.embargoEndDate = data[0].embargoenddate;
}
/*
this.publicationInfo.title = {"name": "", "url": "", "accessMode": ""};
if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
this.publicationInfo.title.accessMode = data[0]['bestaccessright'].classid;
}
if(data[1] != null) {
if(Array.isArray(data[1])) {
this.publicationInfo.title['name'] = data[1][0].content;
} else {
this.publicationInfo.title['name'] = data[1].content;
}
}
*/
if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
this.publicationInfo.accessMode = data[0]['bestaccessright'].classid;
}
if(data[1] != null) {
if(Array.isArray(data[1])) {
this.publicationInfo.title = String(data[1][0].content);
} else {
this.publicationInfo.title = String(data[1].content);
}
}
if(data[2] != null) {
let relation;
let length = Array.isArray(data[2]) ? data[2].length : 1;
for(let i=0; i<length; i++) {
relation = Array.isArray(data[2]) ? data[2][i] : data[2];
if(relation.hasOwnProperty("to")) {
if(relation['to'].class == "isProducedBy") {
this.publicationInfo.fundedByProjects = this.parsingFunctions.parseFundingByProjects(this.publicationInfo.fundedByProjects, relation, this.publicationInfo.projectsProvenanceVocabulary);
} else if(relation['to'].class == "isRelatedTo") {
let provenanceAction: string;
if(relation.provenanceaction in this.publicationInfo.researchResultsProvenanceVocabulary) {
provenanceAction = this.publicationInfo.researchResultsProvenanceVocabulary[relation.provenanceaction];
} else {
provenanceAction = "Other";
}
this.publicationInfo.relatedResearchResults = this.parsingFunctions.parseRelatedResearchResults(this.publicationInfo.relatedResearchResults, relation, provenanceAction);
} else if(relation['to'].class == "hasAmongTopNSimilarDocuments") {
this.publicationInfo.similarResearchResults = this.parsingFunctions.parseSimilarResearchResults(this.publicationInfo.similarResearchResults, relation);
} else if(relation['to'].class == "hasAuthorInstitution") {
this.publicationInfo.organizations = this.parseRelatedOrganizations(this.publicationInfo.organizations, relation);
}
}
}
}
if(data[3] != null) {
if(data[3].hasOwnProperty("result")) {
this.publicationInfo.deletedByInferenceIds = [];
let length = Array.isArray(data[3]['result']) ? data[3]['result'].length : 1;
for(let i=0; i<length; i++) {
let result = Array.isArray(data[3]['result']) ? data[3]['result'][i] : data[3]['result'];
this.publicationInfo.deletedByInferenceIds.push(result.objidentifier);
}
}
if(data[3].hasOwnProperty("instance")) {
//this.publicationInfo.collectedFrom = new Array<{"name": string, "id": string}>();
//this.publicationInfo.downloadFrom = new Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>();
//this.publicationInfo.publishedIn = new Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>();
this.publicationInfo.hostedBy_collectedFrom = new Array<{"downloadName": string, "downloadUrl": string[], "collectedName": string, "collectedId": string, "accessMode": string[], "bestAccessMode": string, "type": string, "year":string}>();
this.publicationInfo.types = new Array<string>();
let types = new Set<string>();
let counter = 0;
let instance;
let length = Array.isArray(data[3]['instance']) ? data[3]['instance'].length : 1;
for(let i=0; i<length; i++) {
instance = Array.isArray(data[3]['instance']) ? data[3]['instance'][i] : data[3]['instance'];
this.parsingFunctions.parseTypes(this.publicationInfo.types, types, instance);
if(instance.hasOwnProperty("webresource")) {
let url;
if(!Array.isArray(instance['webresource'])) {
url = instance['webresource'].url;
} else{
url = instance['webresource'][0].url;
}
/**********************************************************/
if(instance.hasOwnProperty("hostedby")) {
counter = this.parsingFunctions.parseHostedBy_collectedFrom(this.publicationInfo.hostedBy_collectedFrom, instance, data[0], url, counter/*, this.publicationInfo.title*/, this.publicationInfo.accessMode);
}
/**********************************************************/
}
}
}
if(data[3].hasOwnProperty("externalreference")) {
let externalResults: [Map<string, Map<string, string>>, { "name": string, "url": string}[]] = this.parseBioentitiesAndSoftware(data[3]);
this.publicationInfo.bioentities = externalResults[0];
this.publicationInfo.software = externalResults[1];
}
}
if(data[4] != null) {
this.publicationInfo.identifiers = this.parsingFunctions.parseIdentifiers(data[4]);
}
if(data[5] != null) {
this.publicationInfo.journal = {"journal": "", "issn": "", "lissn": "", "eissn": "", "issue": "", "volume": "", "start_page": "", "end_page": ""}
this.publicationInfo.journal['journal'] = data[5].content;
this.publicationInfo.journal['issn'] = data[5].issn;
this.publicationInfo.journal['lissn'] = data[5].lissn;
this.publicationInfo.journal['eissn'] = data[5].eissn;
this.publicationInfo.journal['issue'] = data[5].iss;
this.publicationInfo.journal['volume'] = data[5].vol;
this.publicationInfo.journal['start_page'] = data[5].sp;
this.publicationInfo.journal['end_page'] = data[5].ep;
}
if(data[6] != null) {
this.publicationInfo.languages = this.parsingFunctions.parseLanguages(data[6]);
}
if(data[15] != null) {
this.publicationInfo.countries = this.parsingFunctions.parseCountries(data[15]);
}
if(data[7] != null) {
let subjectResults: [string[], Map<string, string[]>, Map<string, string[]>] = this.parsingFunctions.parseAllSubjects(data[7]);
this.publicationInfo.subjects = subjectResults[0];
this.publicationInfo.otherSubjects = subjectResults[1];
this.publicationInfo.classifiedSubjects = subjectResults[2];
}
// if(data[8] != null) {
// this.publicationInfo.bestaccessright = data[8].classid;
// }
// if(data[9] != null) {
// this.publicationInfo.collectedFrom = this.parsingFunctions.parseCollectedFrom(data[9]);
// }
this.publicationInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom(
this.publicationInfo.hostedBy_collectedFrom, this.publicationInfo.publisher,
this.publicationInfo.journal, this.publicationInfo.identifiers/*,
this.publicationInfo.title*/);
if(data[10] != null) {
this.publicationInfo.references = this.parsingFunctions.parseReferences(data[10]);
}
if(data[11] != null) {
this.publicationInfo.contexts = this.parsingFunctions.parseContexts(data[11]);
}
if(data[12] != null && data[12] == "under curation") {
this.publicationInfo.underCurationMessage = true;
} else {
this.publicationInfo.underCurationMessage = false;
}
if(data[13] != null) {
if(this.publicationInfo.authors == undefined) {
this.publicationInfo.authors = new Array<{"fullName": string, "orcid": string}>();
}
let authors = data[13];
let length = Array.isArray(authors) ? authors.length : 1;
for(let i=0; i<length; i++) {
let author = Array.isArray(authors) ? authors[i] : authors;
if(author) {
/*if (author.ORCID && author.ORCID.indexOf(properties.orcidURL) != -1) {
author.ORCID = author.ORCID.substr(properties.orcidURL.length);
}*/
this.publicationInfo['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID};
}
}
this.publicationInfo.authors = this.publicationInfo.authors.filter(function (item) {
return (item != undefined && item.fullName != undefined);
});
}
if(this.publicationInfo.relatedResearchResults) {
let self = this;
this.publicationInfo.relatedResearchResults.forEach(function (value, key, map) {
self.publicationInfo.relatedResearchResults.set(key, self.parsingFunctions.sortByPercentage(value));
});
}
this.publicationInfo.similarResearchResults = this.parsingFunctions.sortByPercentage(this.publicationInfo.similarResearchResults);
return this.publicationInfo;
}
parseRelatedOrganizations(organizations: {"name": string, "shortname":string, "id": string, "websiteUrl": string, "country": string, "trust": number}[], relation: any):
{"name": string, "shortname":string, "id": string, "websiteUrl": string, "country": string, "trust": number}[] {
if(organizations == undefined) {
organizations = new Array<{
"name": string, "shortname": string,
"id": string, "websiteUrl": string,
"country": string, "trust": number}>();
}
let organization: { "name": string, "shortname": string,
"id": string, "websiteUrl": string,
"country": string, "trust": number
} = {
"name": "", "shortname": "",
"id": "", "websiteUrl": "",
"country": "", "trust": null
};
organization.id = relation['to'].content;
organization.name = relation.legalname;
organization.shortname = relation.legalshortname;
organization.websiteUrl = relation.websiteurl;
if(relation.country) {
organization.country = relation.country.classname;
}
if(relation.trust) {
organization.trust = Math.round(relation.trust*100);
}
organizations.push(organization);
return organizations;
}
parseBioentitiesAndSoftware(children: any) : [Map<string, Map<string, string>>, { "name": string, "url": string}[]] {
let bioentities: Map<string, Map<string, string>>;
let software: {"name": string, "url": string}[];
let length = Array.isArray(children['externalreference']) ? children['externalreference'].length : 1;
let externalreference;
for(let i=0; i<length; i++) {
externalreference = Array.isArray(children['externalreference']) ? children['externalreference'][i] : children['externalreference'];
if(externalreference.hasOwnProperty("qualifier")) {
if(externalreference['qualifier'].classid == "accessionNumber") {
if(bioentities == undefined) {
bioentities = new Map<string, Map<string, string>>();
}
if(!bioentities.has(externalreference.sitename)) {
bioentities.set(externalreference.sitename, new Map<string, string>());
}
bioentities.get(externalreference.sitename).set(externalreference.refidentifier, externalreference.url);
} else if(externalreference['qualifier'].classid == "software") {
if(software == undefined) {
software = new Array<{"name": string, "url": string}>();
}
software.push({"name": externalreference.sitename, "url": externalreference.url});
}
}
}
return [bioentities, software];
}
/*
parseReferences(citations: any): {"name": string, "url": string}[] {
let references = new Array<{"name": string, "url": string}>();
let citation;
let length = Array.isArray(citations) ? citations.length : 1;
for(let i=0; i<length; i++) {
citation = Array.isArray(citations) ? citations[i] : citations;
let url;
if(citation.hasOwnProperty("id")) {
let citationId;
let length1 = Array.isArray(citation['id']) ? citation['id'].length : 1;
for(let j=0; j<length1; j++) {
citationId = Array.isArray(citation['id']) ? citation['id'][j] : citation['id'];
if(citationId.type == "pmid") {
url = "http://www.ncbi.nlm.nih.gov/pubmed/"+citationId.value;
}
}
}
references[citation.position-1] = { "name": "", "url": ""};
references[citation.position-1]['name'] = citation.rawText;
references[citation.position-1]['url'] = url;
}
return references;
}
*/
getOpenCitations(id: string, properties:EnvProperties) {
//https://services.openaire.eu/opencitations/getCitations?id=doajarticles::2634200c24772ee8f10232d3e184ec65
let url = properties.openCitationsAPIURL+id;// "https://services.openaire.eu/opencitations/getCitations?id=" + id;
let key = url;
//return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
return this.http.get(url)
//.map(res => <any> res.json())
.pipe(map(res => [res['total'], this.parseOpenCitations(res['results'])]));
}
parseOpenCitations(openCitations: any): {"url": string, "title": string, "year": string, "doi": string, "authors": string[]}[] {
//title, doi, authors
let citations = new Array<{"url": string, "title": string, "year": string, "doi": string, "authors": string[]}>();
let openCitation;
let length = Array.isArray(openCitations) ? openCitations.length : 1;
for(let i=0; i<length; i++) {
openCitation = Array.isArray(openCitations) ? openCitations[i] : openCitations;
let citation: {"url": string, "title": string, "year": string, "doi": string, "authors": string[]} = {"url": "", "title": "", "year": "", "doi": "", "authors": []};
if(openCitation && openCitation.id) {
citation.url = openCitation.id;
citation.title = openCitation.title;
//citation.type = openCitation.type;
citation.year = (openCitation.pubDate && (openCitation.pubDate).indexOf('-') !== -1)?openCitation.pubDate.split('-')[0]:openCitation.pubDate;
citation.doi = openCitation.doi;
let authorsLength = Array.isArray(openCitation.authors) ? openCitation.authors.length : 1;
for(let i=0; i<authorsLength; i++) {
let author = Array.isArray(openCitation.authors) ? openCitation.authors[i] : openCitation.authors;
if(author) {
let lastFirstName: string = "";
if(author.lastName) {
lastFirstName = author.lastName;
}
if(author.lastName && author.firstName) {
lastFirstName += ", ";
}
if(author.firstName) {
lastFirstName += author.firstName;
}
if(lastFirstName) {
citation.authors.push(lastFirstName);
}
}
}
citations.push(citation);
}
}
return citations;
}
}

View File

@ -1,7 +1,6 @@
<div id="tm-main" class=" uk-section uk-padding-remove-top uk-margin-small-top tm-middle">
<div uk-grid >
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container publication">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
role="alert">{{warningMessage}}</div>
@ -12,27 +11,38 @@
class="loading-gif uk-align-center"></span></div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper>
<div *ngIf="publicationInfo != null" class="uk-grid">
<div *ngIf="resultLandingInfo != null" class="uk-grid">
<div class="uk-width-2-3@m uk-width-1-1@s uk-margin-bottom">
<schema2jsonld *ngIf="publicationInfo.record" [data]=publicationInfo.record
[URL]="properties.baseLink+'/search/publication?articleId='+articleId"></schema2jsonld>
<showTitle [titleName]="publicationInfo.title"></showTitle>
<span *ngIf="publicationInfo.types && publicationInfo.types.length > 0"
<schema2jsonld *ngIf="resultLandingInfo.record" [data]=resultLandingInfo.record
[URL]="properties.baseLink+linkToLandingPage+id"></schema2jsonld>
<showTitle [titleName]="resultLandingInfo.title" [classNames]="(properties.environment != 'production' && resultLandingInfo.deletedByInferenceIds) ? 'uk-margin-remove-bottom' : ''"></showTitle>
<div *ngIf="properties.environment != 'production' && resultLandingInfo.deletedByInferenceIds"
class="uk-text-muted uk-text-small uk-margin-bottom" (click)="openDeletedByInference()">
The following information is result of merging
<a>Original sources ({{resultLandingInfo.deletedByInferenceIds.length}})</a>
</div>
<p class="uk-text-large" *ngIf="resultLandingInfo.subtitle">
<span [innerHTML]="resultLandingInfo.subtitle"></span>
</p>
<span *ngIf="resultLandingInfo.types && resultLandingInfo.types.length > 0"
class="uk-label custom-label label-blue label-publication"
title="Type">{{publicationInfo.types.join(", ")}}</span>{{" "}}
<span *ngIf="publicationInfo.languages && publicationInfo.languages.length > 0"
title="Type">{{resultLandingInfo.types.join(", ")}}</span>{{" "}}
<span *ngIf="resultLandingInfo.programmingLanguages && resultLandingInfo.programmingLanguages.length > 0"
class="uk-label custom-label label-progrLanguage "
title="Programming Language">{{resultLandingInfo.programmingLanguages.join(", ")}}</span>{{" "}}
<span *ngIf="resultLandingInfo.languages && resultLandingInfo.languages.length > 0"
class="uk-label custom-label label-language "
title="Language">{{publicationInfo.languages.join(", ")}}</span>{{" "}}
<span *ngIf="publicationInfo.countries && publicationInfo.countries.length > 0"
title="Language">{{resultLandingInfo.languages.join(", ")}}</span>{{" "}}
<span *ngIf="resultLandingInfo.countries && resultLandingInfo.countries.length > 0"
class="uk-label custom-label label-country "
title="Country">{{publicationInfo.countries.join(", ")}}</span>{{" "}}
<!-- <span *ngIf="publicationInfo.title && publicationInfo.title.accessMode" [class]="'uk-label custom-label label-'+ publicationInfo.title.accessMode ">{{publicationInfo.title.accessMode}}</span> -->
<span *ngIf="publicationInfo.accessMode"
[class]="'uk-label custom-label label-'+ publicationInfo.accessMode "
title="Access Mode">{{publicationInfo.accessMode}}</span>{{" "}}
title="Country">{{resultLandingInfo.countries.join(", ")}}</span>{{" "}}
<!-- <span *ngIf="resultLandingInfo.title && resultLandingInfo.title.accessMode" [class]="'uk-label custom-label label-'+ resultLandingInfo.title.accessMode ">{{resultLandingInfo.title.accessMode}}</span> -->
<span *ngIf="resultLandingInfo.accessMode"
[class]="'uk-label custom-label label-'+ resultLandingInfo.accessMode "
title="Access Mode">{{resultLandingInfo.accessMode}}</span>{{" "}}
<span *ngIf="publicationInfo.underCurationMessage" class="uk-label custom-label label-underCuration">
<span *ngIf="resultLandingInfo.underCurationMessage" class="uk-label custom-label label-underCuration">
<span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}">
<i>Record in preview</i>
@ -41,46 +51,41 @@
<div class=" uk-margin-top">
<showAuthors [authors]="publicationInfo.authors"></showAuthors>
<span *ngIf="publicationInfo.date != ''">({{publicationInfo.date}})</span>
<showAuthors [authors]="resultLandingInfo.authors"></showAuthors>
<span *ngIf="resultLandingInfo.date != ''">({{resultLandingInfo.date}})</span>
</div>
<ul class="uk-list">
<showPublisher [publisher]="publicationInfo.publisher"
[journal]="publicationInfo.journal" [properties]="properties"></showPublisher>
<li *ngIf="publicationInfo.embargoEndDate"><span
class="uk-text-bold">Embargo end date:</span> {{publicationInfo.embargoEndDate}}</li>
<li *ngIf="publicationInfo.identifiers && publicationInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="publicationInfo.identifiers"></showIdentifiers>
<showPublisher [publisher]="resultLandingInfo.publisher"
[journal]="resultLandingInfo.journal" [properties]="properties"></showPublisher>
<li *ngIf="resultLandingInfo.embargoEndDate"><span
class="uk-text-bold">Embargo end date:</span> {{resultLandingInfo.embargoEndDate}}</li>
<li *ngIf="resultLandingInfo.identifiers && resultLandingInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="resultLandingInfo.identifiers"></showIdentifiers>
</li>
<li
*ngIf="publicationInfo.subjects || publicationInfo.otherSubjects || publicationInfo.classifiedSubjects">
<showSubjects [subjects]="publicationInfo.subjects"
[otherSubjects]="publicationInfo.otherSubjects"
[classifiedSubjects]="publicationInfo.classifiedSubjects">
*ngIf="resultLandingInfo">
<showSubjects [subjects]="resultLandingInfo.subjects"
[otherSubjects]="resultLandingInfo.otherSubjects"
[classifiedSubjects]="resultLandingInfo.classifiedSubjects">
</showSubjects>
</li>
</ul>
<hr *ngIf="publicationInfo.description">
<div *ngIf="publicationInfo.description"
<hr *ngIf="resultLandingInfo.description">
<div *ngIf="resultLandingInfo.description"
class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<span>{{publicationInfo.description.substring(0, showNumDescription)}}</span
><!--span *ngIf="showNumDescription > thresholdDescription">
<a (click)="showNumDescription = thresholdDescription; scroll()">
View less
</a>
</span
--><span
*ngIf="showNumDescription == thresholdDescription && publicationInfo.description.length > thresholdDescription">...</span
<span>{{resultLandingInfo.description.substring(0, showNumDescription)}}</span
><span
*ngIf="showNumDescription == thresholdDescription && resultLandingInfo.description.length > thresholdDescription">...</span
><span
*ngIf="showNumDescription == thresholdDescription && publicationInfo.description.length > thresholdDescription"
*ngIf="showNumDescription == thresholdDescription && resultLandingInfo.description.length > thresholdDescription"
class="uk-text-right">
<a (click)="showNumDescription = publicationInfo.description.length;">
<a (click)="showNumDescription = resultLandingInfo.description.length;">
View more
</a>
</span>
</div>
<div *ngIf="publicationInfo.description && showNumDescription > thresholdDescription"
<div *ngIf="resultLandingInfo.description && showNumDescription > thresholdDescription"
class="uk-width-1-1 uk-text-right">
<!-- scroll() -->
<a (click)="showNumDescription = thresholdDescription;">
@ -91,35 +96,24 @@
<ul class="custom-accordion" uk-accordion>
<li *ngIf="publicationInfo.references" (click)="activeTab='References'">
<li *ngIf="resultLandingInfo.references" (click)="activeTab='References'">
<a class="uk-accordion-title" href="#">
References
<!-- <span *ngIf="!publicationInfo.references" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.references" class="uk-badge uk-badge-notification">
{{publicationInfo.references.length | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{publicationInfo.references.length | number}})
<!-- </span> -->
({{resultLandingInfo.references.length | number}})
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!publicationInfo.references" class = "uk-alert uk-alert-primary" >
No references available
</div>
<div *ngIf="publicationInfo.references"> -->
<div>
<div *ngIf="publicationInfo.references.length > pageSize" class="uk-margin-bottom">
<span class="uk-h6">{{publicationInfo.references.length | number}}
<div *ngIf="resultLandingInfo.references.length > pageSize" class="uk-margin-bottom">
<span class="uk-h6">{{resultLandingInfo.references.length | number}}
references, page {{referencesPage | number}}
of {{totalPages(publicationInfo.references.length) | number}}</span>
of {{totalPages(resultLandingInfo.references.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="referencesPage"
[totalResults]="publicationInfo.references.length" [size]="pageSize"
[totalResults]="resultLandingInfo.references.length" [size]="pageSize"
(pageChange)="updateReferencesPage($event)"></paging-no-load>
</div>
<div
*ngFor="let item of publicationInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
*ngFor="let item of resultLandingInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
<p *ngIf=" item && item['url']"
class="custom-external custom-icon">
<a href="{{item['url']}}" target="_blank">
@ -134,88 +128,57 @@
</div>
</li>
<li *ngIf="publicationInfo.relatedResearchResults" (click)="activeTab='Related Research Results'">
<li *ngIf="resultLandingInfo.relatedResearchResults" (click)="activeTab='Related Research Results'">
<a class="uk-accordion-title" href="#">
Related Research Results
<!-- <span *ngIf="!publicationInfo.relatedResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.relatedResearchResults" class="uk-badge uk-badge-notification">
{{relatedResearchResultsNum | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{relatedResearchResultsNum | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!publicationInfo.relatedResearchResults" class = "uk-alert uk-alert-primary">
No related research results available
</div>
<div *ngIf="publicationInfo.relatedResearchResults"> -->
<div>
<div *ngFor="let provenanceaction of getKeys(publicationInfo.relatedResearchResults)">
<div *ngFor="let provenanceaction of getKeys(resultLandingInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div>
<tabTable percentageName="trust"
[info]="publicationInfo.relatedResearchResults.get(provenanceaction)"
[info]="resultLandingInfo.relatedResearchResults.get(provenanceaction)"
[properties]=properties></tabTable>
</div>
</div>
</div>
</li>
<li *ngIf="publicationInfo.similarResearchResults" (click)="activeTab='Similar Research Results'">
<li *ngIf="resultLandingInfo.similarResearchResults" (click)="activeTab='Similar Research Results'">
<a class="uk-accordion-title" href="#">
Similar Research Results
<!-- <span *ngIf="!publicationInfo.similarResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.similarResearchResults" class="uk-badge uk-badge-notification">
{{publicationInfo.similarResearchResults.length | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{publicationInfo.similarResearchResults.length | number}})
<!-- </span> -->
({{resultLandingInfo.similarResearchResults.length | number}})
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!publicationInfo.similarResearchResults" class = "uk-alert uk-alert-primary" >
No similar research results available
</div>
<div *ngIf="publicationInfo.similarResearchResults"> -->
<div>
<tabTable percentageName="similarity" [info]="publicationInfo.similarResearchResults"
<tabTable percentageName="similarity" [info]="resultLandingInfo.similarResearchResults"
[properties]=properties></tabTable>
</div>
</div>
</li>
<li *ngIf="publicationInfo.organizations" (click)="activeTab='Related Organizations'">
<li *ngIf="resultLandingInfo.organizations" (click)="activeTab='Related Organizations'">
<a class="uk-accordion-title" href="#">
Related Organizations
<!-- <span *ngIf="!publicationInfo.organizations" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.organizations" class="uk-badge uk-badge-notification">
{{publicationInfo.organizations.length | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{publicationInfo.organizations.length | number}})
<!-- </span> -->
({{resultLandingInfo.organizations.length | number}})
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!publicationInfo.organizations" class = "uk-alert uk-alert-primary">
No related organizations available
</div>
<div *ngIf="publicationInfo.organizations"> -->
<div>
<div *ngIf="publicationInfo.organizations.length > pageSize" class="uk-margin-bottom">
<span class="uk-text-bold">{{publicationInfo.organizations.length | number}}
<div *ngIf="resultLandingInfo.organizations.length > pageSize" class="uk-margin-bottom">
<span class="uk-text-bold">{{resultLandingInfo.organizations.length | number}}
organizations, page {{organizationsPage | number}}
of {{totalPages(publicationInfo.organizations.length) | number}}</span>
of {{totalPages(resultLandingInfo.organizations.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="organizationsPage"
[totalResults]="publicationInfo.organizations.length" [size]="pageSize"
[totalResults]="resultLandingInfo.organizations.length" [size]="pageSize"
(pageChange)="updateOrganizationsPage($event)"></paging-no-load>
</div>
<table class="uk-table uk-table-small uk-table-divider uk-table-middle ">
<tbody>
<tr
*ngFor="let organization of publicationInfo.organizations.slice((organizationsPage-1)*pageSize, organizationsPage*pageSize)">
*ngFor="let organization of resultLandingInfo.organizations.slice((organizationsPage-1)*pageSize, organizationsPage*pageSize)">
<td>
<a *ngIf="(organization['id']) && ((organization['name']) || (organization['shortname']))"
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active"
@ -254,19 +217,13 @@
</div>
</li>
<li *ngIf="publicationInfo.bioentities" (click)="activeTab='Bioentities'">
<li *ngIf="resultLandingInfo.bioentities" (click)="activeTab='Bioentities'">
<a class="uk-accordion-title" href="#">
Bioentities
<!-- <span *ngIf="!publicationInfo.bioentities" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.bioentities" class="uk-badge uk-badge-notification">
{{publicationInfo.bioentitiesNum | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{bioentitiesNum | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<div *ngIf="publicationInfo.bioentities && bioentitiesNum > pageSize" class="uk-margin-bottom">
<div *ngIf="resultLandingInfo.bioentities && bioentitiesNum > pageSize" class="uk-margin-bottom">
<span class="uk-text-bold"> {{bioentitiesNum | number}}
bioentities, page {{bioentitiesPage | number}} of {{totalPages(bioentitiesNum) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="bioentitiesPage"
@ -276,12 +233,12 @@
<table id="bioentitiesTable" class="uk-table ">
<tbody>
<ng-container *ngFor="let key of getKeys(publicationInfo.bioentities) let i=index">
<ng-container *ngFor="let key of getKeys(resultLandingInfo.bioentities) let i=index">
<tr
*ngFor="let keyIn of keysToArray(publicationInfo.bioentities.get(key)).slice((bioentitiesPage-1)*pageSize, bioentitiesPage*pageSize)">
*ngFor="let keyIn of keysToArray(resultLandingInfo.bioentities.get(key)).slice((bioentitiesPage-1)*pageSize, bioentitiesPage*pageSize)">
<td class="uk-text-center" *ngIf="keyIn">
<span class="custom-external custom-icon">
<a href="{{publicationInfo.bioentities.get(key).get(keyIn)}}"
<a href="{{resultLandingInfo.bioentities.get(key).get(keyIn)}}"
target="_blank">
{{keyIn}}
</a>
@ -297,32 +254,26 @@
</div>
</li>
<li *ngIf="publicationInfo.software" (click)="activeTab='Software'">
<li *ngIf="resultLandingInfo.software" (click)="activeTab='Software'">
<a class="uk-accordion-title" href="#">
Software
<!-- <span *ngIf="!publicationInfo.software" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.software" class="uk-badge uk-badge-notification">
{{publicationInfo.software.length | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{publicationInfo.software.length | number}})
<!-- </span> -->
({{resultLandingInfo.software.length | number}})
</a>
<div class="uk-accordion-content">
<div *ngIf="publicationInfo.software && publicationInfo.software.length > pageSize"
<div *ngIf="resultLandingInfo.software && resultLandingInfo.software.length > pageSize"
class="uk-margin-bottom">
<span class="uk-text-bold">{{publicationInfo.software.length | number}}
<span class="uk-text-bold">{{resultLandingInfo.software.length | number}}
software results, page {{softwarePage | number}}
of {{totalPages(publicationInfo.software.length) | number}}</span>
of {{totalPages(resultLandingInfo.software.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="softwarePage"
[totalResults]="publicationInfo.software.length" [size]="pageSize"
[totalResults]="resultLandingInfo.software.length" [size]="pageSize"
(pageChange)="updateSoftwarePage($event)"></paging-no-load>
</div>
<table id="softwareTable" class="uk-table ">
<tbody>
<tr
*ngFor="let item of publicationInfo.software.slice((softwarePage-1)*pageSize, softwarePage*pageSize)"
*ngFor="let item of resultLandingInfo.software.slice((softwarePage-1)*pageSize, softwarePage*pageSize)"
class="uk-text-center">
<td>
<span class="custom-external custom-icon">
@ -338,33 +289,24 @@
</li>
<li (click)="activeTab='Other Citations'"
*ngIf="publicationInfo.openCitations && publicationInfo.openCitations.length > 0">
*ngIf="resultLandingInfo.openCitations && resultLandingInfo.openCitations.length > 0">
<a class="uk-accordion-title" href="#">
Open Citations
({{publicationInfo.openCitations.length | number}})
({{resultLandingInfo.openCitations.length | number}})
</a>
<div class="uk-accordion-content">
<div *ngIf="publicationInfo.openCitations.length > pageSize" class="uk-margin-bottom">
<span class="uk-h6">{{publicationInfo.openCitations.length | number}}
<div *ngIf="resultLandingInfo.openCitations.length > pageSize" class="uk-margin-bottom">
<span class="uk-h6">{{resultLandingInfo.openCitations.length | number}}
open citations, page {{openCitationsPage | number}}
of {{totalPages(publicationInfo.openCitations.length) | number}}</span>
of {{totalPages(resultLandingInfo.openCitations.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="openCitationsPage"
[totalResults]="publicationInfo.openCitations.length" [size]="pageSize"
[totalResults]="resultLandingInfo.openCitations.length" [size]="pageSize"
(pageChange)="updateOpenCitationsPage($event)"></paging-no-load>
</div>
<ul class="uk-list uk-list-divider uk-margin">
<li
*ngFor="let result of publicationInfo.openCitations.slice((openCitationsPage-1)*pageSize, openCitationsPage*pageSize)">
<!-- <h5>
<span *ngIf="result.url" class="custom-external custom-icon" >
<a target="_blank" [href]="result.url" *ngIf="result['title']" [innerHTML]="result['title']"></a>
<a target="_blank" [href]="result.url" *ngIf="!result['title']">[no title available]</a>
</span>
<p *ngIf="!result.url && result['title']"><span [innerHTML]="result['title']"></span></p>
<p *ngIf="!result.url && !result['title']">[no title available]</p>
</h5> -->
*ngFor="let result of resultLandingInfo.openCitations.slice((openCitationsPage-1)*pageSize, openCitationsPage*pageSize)">
<h5 *ngIf="result.title">
<span *ngIf="result.url"
class="custom-external">
@ -406,11 +348,10 @@
Metrics
</a>
<div class="uk-accordion-content">
<metrics [pageViews]="pageViews"
[id]="articleId" [entityType]="'results'" [entity]="'Publication'"
<metrics *ngIf="metricsClicked" [pageViews]="pageViews"
[id]="id" [entityType]="'results'" [entity]="title"
(metricsResults)="metricsResults($event)" [properties]=properties>
</metrics>
<!--i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="100%" height="250"></i-frame-->
<i-frame *ngIf="metricsClicked && totalViews>0"
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
@ -419,18 +360,6 @@
</i-frame>
</div>
</li>
<li (click)="activeTab='Other Versions'"
*ngIf="properties.environment != 'production' && publicationInfo.deletedByInferenceIds">
<a class="uk-accordion-title" href="#">
Other Versions
({{publicationInfo.deletedByInferenceIds.length | number}})
</a>
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
<deletedByInference [id]="articleId" [ids]="publicationInfo.deletedByInferenceIds"
[type]="'publications'"></deletedByInference>
</div>
</li>
</ul>
</div>
@ -438,23 +367,24 @@
<div class="uk-width-1-3@m uk-width-1-1@s">
<div *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-padding-small">
<button class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
height="25"><path
d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path
d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975"
fill="none" stroke="#000"
stroke-width="1.1"></path></svg>
</span> Link this publication to...
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
height="25"><path
d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path
d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975"
fill="none" stroke="#000"
stroke-width="1.1"></path></svg>
</span>
Link this <span *ngIf="type != 'orp'">{{title.toLowerCase()}}</span><span *ngIf="type == 'orp'">product</span> to...
</button>
<div class=" uk-text-center uk-margin-expand uk-padding-small uk-margin-auto default-dropdown "
uk-dropdown="mode:click">
<div class="uk-grid uk-child-width-1-3 uk-width-large ">
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','project'])"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[id,type,'project'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim"
>
<button class="uk-icon-button portal-button">
@ -467,7 +397,7 @@
<div>Projects</div>
</a></div>
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','result'])"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[id,type,'result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
@ -479,7 +409,7 @@
<div>Research results</div>
</a></div>
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','context'])"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[id,type,'context'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
@ -500,23 +430,23 @@
<div class="sideInfoTitle uk-margin-small-bottom uk-margin-small-top">Share - Bookmark</div>
<addThis></addThis>
</div>
<altmetrics *ngIf="publicationInfo.identifiers && publicationInfo.identifiers.get('doi')"
id="{{publicationInfo.identifiers.get('doi')[0]}}" type="doi">
<altmetrics *ngIf="resultLandingInfo.identifiers && resultLandingInfo.identifiers.get('doi')"
id="{{resultLandingInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics>
<ul class="uk-list uk-margin-remove-bottom">
<li *ngIf="publicationInfo.hostedBy_collectedFrom && publicationInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="publicationInfo.hostedBy_collectedFrom"></availableOn>
<li *ngIf="resultLandingInfo.hostedBy_collectedFrom && resultLandingInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="resultLandingInfo.hostedBy_collectedFrom"></availableOn>
</li>
<li
*ngIf="publicationInfo.fundedByProjects != undefined && publicationInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="publicationInfo.fundedByProjects"></fundedBy>
*ngIf="resultLandingInfo.fundedByProjects != undefined && resultLandingInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="resultLandingInfo.fundedByProjects"></fundedBy>
</li>
<li *ngIf="publicationInfo.contexts && publicationInfo.contexts.length >0 ">
<li *ngIf="resultLandingInfo.contexts && resultLandingInfo.contexts.length >0 ">
<dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of publicationInfo.contexts">
<dd class="line" *ngFor="let item of resultLandingInfo.contexts">
<span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
@ -531,33 +461,41 @@
</dl>
</li>
<!-- <li>-->
<!-- <metrics [pageViews]="pageViews" shortView=true-->
<!-- [id]="id" [entityType]="'results'" [entity]="'Publication'"-->
<!-- (metricsResults)="metricsResults($event)" [(properties)] = properties>-->
<!-- </metrics>-->
<!-- </li>-->
<li>
<!--metrics [pageViews]="pageViews" shortView=true
[id]="articleId" [entityType]="'results'" [entity]="'Publication'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics-->
</li>
<li>
<div class=" sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this publication
Cite this <span *ngIf="type != 'orp'">{{title.toLowerCase()}}</span><span *ngIf="type == 'orp'">research product</span>
</div>
<div class=" ">
<citeThis [result]="publicationInfo" [id]="articleId" type="publication"></citeThis>
<citeThis [result]="resultLandingInfo" [id]="id" [type]="title.toLowerCase()"></citeThis>
</div>
</li>
</ul>
</ul>
</div>
<modal-alert *ngIf="resultLandingInfo.deletedByInferenceIds"
#AlertModalDeletedByInference classBody="uk-width-xxlarge">
<deletedByInference *ngIf="type == 'publication'"
[id]="id" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'publications'"></deletedByInference>
<deletedByInference *ngIf="type == 'dataset'"
[id]="id" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'research data'"></deletedByInference>
<deletedByInference *ngIf="type == 'software'"
[id]="id" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'software'"></deletedByInference>
<deletedByInference *ngIf="type == 'orp'"
[id]="id" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'other research products'"></deletedByInference>
</modal-alert>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']"></helper>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,394 @@
import {Component, Input, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser';
import {EnvProperties} from '../../utils/properties/env-properties';
import {ResultLandingInfo} from '../../utils/entities/resultLandingInfo';
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';
@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;
public resultLandingInfo: ResultLandingInfo;
public id: string;
public title: string;
// Links for SEO
public linkToLandingPage: string = null;
public linkToSearchPage: string = null;
// APP BOX variables
public showAllCollectedFrom: boolean = false;
public showAllDownloadFrom: boolean = false;
public thresholdDescription: number = 270;
public showNumDescription: number = 270;
// Metrics tab variables
public metricsClicked: boolean;
public viewsFrameUrl: string;
public downloadsFrameUrl: string;
public totalViews: number;
public totalDownloads: number;
public pageViews: number;
// Custom tab paging variables
public referencesPage: number = 1;
public organizationsPage: number = 1;
public softwarePage: number = 1;
public bioentitiesPage: number = 1;
public openCitationsPage: number = 1;
public pageSize: number = 10;
// Map counting variables
public bioentitiesNum: number = 0;
public relatedResearchResultsNum: number = 0;
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
public routerHelper: RouterHelper = new RouterHelper();
private doi: string;
public doiURL: string;
private result;
sub: any;
piwiksub: any;
infoSub: any;
properties: EnvProperties;
public pageContents = null;
public divContents = null;
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,
private seoService: SEOService) {
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
//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";
}
this.updateDescription("");
this.metricsClicked = false;
if (this.id) {
this.getResultLandingInfo(this.id);
} else {
this.showLoading = false;
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";
}
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":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","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":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","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';
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();
}
}
private getOpenCitations(id: string) {
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);
}
);
}
private getResultLandingInfo(id: string) {
this.warningMessage = '';
this.errorMessage = '';
this.showLoading = true;
this.resultLandingInfo = null;
this.infoSub = this._resultLaningService.getResultLandingInfo(this.id, this.type, this.properties).subscribe(
data => {
this.resultLandingInfo = data;
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')) {
this.getOpenCitations(this.id);
}
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;
let relatedResearchResultsNum = 0;
if (this.resultLandingInfo.relatedResearchResults != undefined) {
this.resultLandingInfo.relatedResearchResults.forEach(function (value, key, map) {
relatedResearchResultsNum += value.length;
});
}
this.relatedResearchResultsNum = relatedResearchResultsNum;
this.result = {
id: this.id,
type: this.type,
source: "openaire",
title: this.resultLandingInfo.title,
url: '',
result: '',
accessRights: this.resultLandingInfo.accessMode,
embargoEndDate: ''
};
if (this.resultLandingInfo.identifiers != undefined && this.resultLandingInfo.identifiers.has('doi')) {
this.doi = this.resultLandingInfo.identifiers.get('doi')[0];
}
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 if (this.resultLandingInfo.software) {
this.activeTab = "Software";
} else {
this.activeTab = "Metrics";
//this.metricsClicked = true;
}
},
err => {
this.handleError("Error getting "+this.type+" for id: " + this.id, err);
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) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _prefix = "";
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'");
}
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;
}
public updateOrganizationsPage($event) {
this.organizationsPage = $event.value;
}
public updateSoftwarePage($event) {
this.softwarePage = $event.value;
}
public updateBioentitiesPage($event) {
this.bioentitiesPage = $event.value;
}
public updateOpenCitationsPage($event) {
this.openCitationsPage = $event.value;
}
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() {
this.alertModalDeletedByInference.cancelButton = false;
this.alertModalDeletedByInference.okButton = false;
this.alertModalDeletedByInference.alertTitle = "Original sources";
//this.alertModalDeletedByInference.message = "There was an error in csv downloading. Please try again later.";
//this.alertModalDeletedByInference.okButtonText = "OK";
this.alertModalDeletedByInference.open();
}
}

View File

@ -1,13 +1,10 @@
//import {MaterialModule} from '@angular/material';
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
// import { PublicationRoutingModule } from './publication-routing.module';
import {SharedModule} from '../../shared/shared.module';
import {MetricsModule} from '../landing-utils/metrics.module';
import {ResultLandingModule} from '../landing-utils/resultLanding.module';
import {LandingModule} from '../landing-utils/landing.module';
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
import {IFrameModule} from '../../utils/iframe.module';
@ -15,32 +12,34 @@ import {AltMetricsModule} from '../../utils/altmetrics.module';
import {PagingModule} from '../../utils/paging.module';
import {ConfigurationServiceModule} from '../../utils/configuration/configurationService.module';
import {FreeGuard} from'../../login/freeGuard.guard';
import {FreeGuard} from '../../login/freeGuard.guard';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
import {PublicationService} from './publication.service';
import {PublicationComponent} from './publication.component';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {ResultLandingService} from './resultLanding.service';
import {ResultLandingComponent} from './resultLanding.component';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {DeletedByInferenceModule} from '../landing-utils/deletedByInference/deletedByInference.module';
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
import {HelperModule} from "../../utils/helper/helper.module";
import {DeletedByInferenceModule} from '../landing-utils/deletedByInference/deletedByInference.module';
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
import {HelperModule} from "../../utils/helper/helper.module";
import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module";
import {AlertModalModule} from "../../utils/modal/alertModal.module";
@NgModule({
imports: [
CommonModule, FormsModule, LandingModule, SharedModule, RouterModule,
CiteThisModule, PagingModule, ResultLandingModule, IFrameModule,
CiteThisModule, PagingModule, IFrameModule,
MetricsModule, AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule,
DeletedByInferenceModule, ShowAuthorsModule, HelperModule
DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule
],
declarations: [
PublicationComponent
ResultLandingComponent
],
providers: [
PublicationService, FreeGuard, IsRouteEnabled
ResultLandingService, FreeGuard, IsRouteEnabled
],
exports: [
PublicationComponent
ResultLandingComponent
]
})
export class PublicationModule { }
export class ResultLandingModule { }

View File

@ -0,0 +1,399 @@
import {Injectable} from '@angular/core';
import {HttpClient, HttpErrorResponse} from "@angular/common/http";
import {throwError} from 'rxjs';
import {ResultLandingInfo} from '../../utils/entities/resultLandingInfo';
import {EnvProperties} from '../../utils/properties/env-properties';
import {ParsingFunctions} from '../landing-utils/parsingFunctions.class';
import {map} from "rxjs/operators";
@Injectable()
export class ResultLandingService {
constructor(private http: HttpClient ) {
this.parsingFunctions = new ParsingFunctions();
}
public parsingFunctions: ParsingFunctions;
resultLandingInfo: ResultLandingInfo;
getResultLandingInfo (id: string, type: string, properties: EnvProperties): any {
let url = properties.searchAPIURLLAst;
if (type === 'publication') {
url += 'publications/';
} else if (type === 'dataset') {
url += 'datasets/';
} else if (type === 'software') {
url += 'software/';
} else if (type === 'orp') {
url += 'other/';
}
url += id + '?format=json';
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
.pipe(map(res => [res['result']['header']['dri:status'], res['result']['metadata']['oaf:entity'], res]))
.pipe(map(res => [
res[1]['oaf:result'], // 0
res[1]['oaf:result']['title'], // 1
res[1]['oaf:result']['rels']['rel'], // 2
res[1]['oaf:result']['children'], // 3
res[1]['oaf:result']['pid'], // 4
res[1]['oaf:result']['journal'], // 5
res[1]['oaf:result']['language'], // 6
res[1]['oaf:result']['subject'], // 7
res[1]['oaf:result']['context'], // 8
res[1]['oaf:result']['creator'], // 9
res[1]['oaf:result']['country'] , // 10
res[1]['oaf:result']['programmingLanguage'], // 11 - software
//res[1]['oaf:result']['resulttype'],
(res[1]['extraInfo'] !== undefined && res[1]['extraInfo']['citations'] !== undefined)
? res[1]['extraInfo']['citations']['citation'] : null, // 12
res[0], // 13
res[2] // 14
]))
.pipe(map(res => this.parseResultLandingInfo(res, properties)));
}
private handleError (error: HttpErrorResponse) {
// in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console
console.log(error);
return throwError(error || 'Server error');
}
parseResultLandingInfo (data: any, properties: EnvProperties): any {
this.resultLandingInfo = new ResultLandingInfo();
// res
this.resultLandingInfo.record = data[14];
// res['result']['metadata']['oaf:entity']['oaf:result']
if (data[0] != null) {
let date: string = (data[0].dateofacceptance) + ''; // transform to string in case it is an integer
this.resultLandingInfo.date = (date && (date).indexOf('-') !== -1) ? date.split('-')[0] : date;
this.resultLandingInfo.dateofacceptance = data[0].dateofacceptance;
this.resultLandingInfo.publisher = data[0].publisher;
if(!Array.isArray(data[0].description)) {
this.resultLandingInfo.description = String(data[0].description);
} else {
this.resultLandingInfo.description = String(data[0].description[0]);
}
this.resultLandingInfo.embargoEndDate = data[0].embargoenddate;
}
if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
this.resultLandingInfo.accessMode = data[0]['bestaccessright'].classid;
}
// res['result']['metadata']['oaf:entity']['oaf:result']['title']
if(data[1] != null) {
if(Array.isArray(data[1])) {
this.resultLandingInfo.title = String(data[1][0].content);
if(data[1][1].classid === 'subtitle') {
this.resultLandingInfo.subtitle = String(data[1][1].content);
}
} else {
this.resultLandingInfo.title = String(data[1].content);
}
}
// res['result']['metadata']['oaf:entity']['oaf:result']['rels']['rel']
if(data[2] != null) {
let relation;
let length = Array.isArray(data[2]) ? data[2].length : 1;
for(let i=0; i<length; i++) {
relation = Array.isArray(data[2]) ? data[2][i] : data[2];
if(relation.hasOwnProperty("to")) {
if(relation['to'].class == "isProducedBy") {
this.resultLandingInfo.fundedByProjects = this.parsingFunctions.parseFundingByProjects(this.resultLandingInfo.fundedByProjects, relation, this.resultLandingInfo.projectsProvenanceVocabulary);
} else if(relation['to'].class == "isRelatedTo") {
let provenanceAction: string;
if(relation.provenanceaction in this.resultLandingInfo.researchResultsProvenanceVocabulary) {
provenanceAction = this.resultLandingInfo.researchResultsProvenanceVocabulary[relation.provenanceaction];
} else {
provenanceAction = "Other";
}
this.resultLandingInfo.relatedResearchResults = this.parsingFunctions.parseRelatedResearchResults(this.resultLandingInfo.relatedResearchResults, relation, provenanceAction);
} else if(relation['to'].class == "hasAmongTopNSimilarDocuments") {
this.resultLandingInfo.similarResearchResults = this.parsingFunctions.parseSimilarResearchResults(this.resultLandingInfo.similarResearchResults, relation);
} else if(relation['to'].class == "hasAuthorInstitution") {
this.resultLandingInfo.organizations = this.parseRelatedOrganizations(this.resultLandingInfo.organizations, relation);
}
}
}
}
// res['result']['metadata']['oaf:entity']['oaf:result']['children']
if(data[3] != null) {
if(data[3].hasOwnProperty("result")) {
this.resultLandingInfo.deletedByInferenceIds = [];
let length = Array.isArray(data[3]['result']) ? data[3]['result'].length : 1;
for(let i=0; i<length; i++) {
let result = Array.isArray(data[3]['result']) ? data[3]['result'][i] : data[3]['result'];
this.resultLandingInfo.deletedByInferenceIds.push(result.objidentifier);
}
}
if(data[3].hasOwnProperty("instance")) {
this.resultLandingInfo.hostedBy_collectedFrom = new Array<{"downloadName": string, "downloadUrl": string[], "collectedName": string, "collectedId": string, "accessMode": string[], "bestAccessMode": string, "type": string, "year":string}>();
this.resultLandingInfo.types = new Array<string>();
let types = new Set<string>();
let counter = 0;
let instance;
let length = Array.isArray(data[3]['instance']) ? data[3]['instance'].length : 1;
for(let i=0; i<length; i++) {
instance = Array.isArray(data[3]['instance']) ? data[3]['instance'][i] : data[3]['instance'];
this.parsingFunctions.parseTypes(this.resultLandingInfo.types, types, instance);
if(instance.hasOwnProperty("webresource")) {
let url;
if(!Array.isArray(instance['webresource'])) {
url = instance['webresource'].url;
} else{
url = instance['webresource'][0].url;
}
/**********************************************************/
if(instance.hasOwnProperty("hostedby")) {
counter = this.parsingFunctions.parseHostedBy_collectedFrom(this.resultLandingInfo.hostedBy_collectedFrom, instance, data[0], url, counter/*, this.resultLandingInfo.title*/, this.resultLandingInfo.accessMode);
}
/**********************************************************/
}
}
}
if(data[3].hasOwnProperty("externalreference")) {
let externalResults: [Map<string, Map<string, string>>, { "name": string, "url": string}[]] = this.parseBioentitiesAndSoftware(data[3]);
this.resultLandingInfo.bioentities = externalResults[0];
this.resultLandingInfo.software = externalResults[1];
}
}
// res['result']['metadata']['oaf:entity']['oaf:result']['pid']
if(data[4] != null) {
this.resultLandingInfo.identifiers = this.parsingFunctions.parseIdentifiers(data[4]);
}
// res['result']['metadata']['oaf:entity']['oaf:result']['journal']
if(data[5] != null) {
this.resultLandingInfo.journal = {"journal": "", "issn": "", "lissn": "", "eissn": "", "issue": "", "volume": "", "start_page": "", "end_page": ""}
this.resultLandingInfo.journal['journal'] = data[5].content;
this.resultLandingInfo.journal['issn'] = data[5].issn;
this.resultLandingInfo.journal['lissn'] = data[5].lissn;
this.resultLandingInfo.journal['eissn'] = data[5].eissn;
this.resultLandingInfo.journal['issue'] = data[5].iss;
this.resultLandingInfo.journal['volume'] = data[5].vol;
this.resultLandingInfo.journal['start_page'] = data[5].sp;
this.resultLandingInfo.journal['end_page'] = data[5].ep;
}
// res['result']['metadata']['oaf:entity']['oaf:result']['language']
if(data[6] != null) {
this.resultLandingInfo.languages = this.parsingFunctions.parseLanguages(data[6]);
}
// res['result']['metadata']['oaf:entity']['oaf:result']['country']
if(data[10] != null) {
this.resultLandingInfo.countries = this.parsingFunctions.parseCountries(data[10]);
}
// res['result']['metadata']['oaf:entity']['oaf:result']['subject']
if(data[7] != null) {
let subjectResults: [string[], Map<string, string[]>, Map<string, string[]>] = this.parsingFunctions.parseAllSubjects(data[7]);
this.resultLandingInfo.subjects = subjectResults[0];
this.resultLandingInfo.otherSubjects = subjectResults[1];
this.resultLandingInfo.classifiedSubjects = subjectResults[2];
}
this.resultLandingInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom(
this.resultLandingInfo.hostedBy_collectedFrom, this.resultLandingInfo.publisher,
this.resultLandingInfo.journal, this.resultLandingInfo.identifiers);
// res['result']['metadata']['oaf:entity']['oaf:result']['programmingLanguage']
if(data[11] != null) {
this.resultLandingInfo.programmingLanguages = this.parsingFunctions.parseProgrammingLanguages(data[11]);
}
// res['result']['metadata']['oaf:entity']['extraInfo']['citations']['citation']
if(data[12] != null) {
this.resultLandingInfo.references = this.parsingFunctions.parseReferences(data[12]);
}
// res['result']['metadata']['oaf:entity']['oaf:result']['context']
if(data[8] != null) {
this.resultLandingInfo.contexts = this.parsingFunctions.parseContexts(data[8]);
}
// res['result']['header']['dri:status']
if(data[13] != null && data[13] == "under curation") {
this.resultLandingInfo.underCurationMessage = true;
} else {
this.resultLandingInfo.underCurationMessage = false;
}
// res['result']['metadata']['oaf:entity']['oaf:result']['creator']
if(data[9] != null) {
if(this.resultLandingInfo.authors == undefined) {
this.resultLandingInfo.authors = new Array<{"fullName": string, "orcid": string}>();
}
let authors = data[9];
let length = Array.isArray(authors) ? authors.length : 1;
for(let i=0; i<length; i++) {
let author = Array.isArray(authors) ? authors[i] : authors;
if(author) {
this.resultLandingInfo['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID};
}
}
this.resultLandingInfo.authors = this.resultLandingInfo.authors.filter(function (item) {
return (item != undefined && item.fullName != undefined);
});
}
if(this.resultLandingInfo.relatedResearchResults) {
let self = this;
this.resultLandingInfo.relatedResearchResults.forEach(function (value, key, map) {
self.resultLandingInfo.relatedResearchResults.set(key, self.parsingFunctions.sortByPercentage(value));
});
}
this.resultLandingInfo.similarResearchResults = this.parsingFunctions.sortByPercentage(this.resultLandingInfo.similarResearchResults);
return this.resultLandingInfo;
}
parseRelatedOrganizations(organizations: {"name": string, "shortname":string, "id": string, "websiteUrl": string, "country": string, "trust": number}[], relation: any):
{"name": string, "shortname":string, "id": string, "websiteUrl": string, "country": string, "trust": number}[] {
if(organizations == undefined) {
organizations = new Array<{
"name": string, "shortname": string,
"id": string, "websiteUrl": string,
"country": string, "trust": number}>();
}
let organization: { "name": string, "shortname": string,
"id": string, "websiteUrl": string,
"country": string, "trust": number
} = {
"name": "", "shortname": "",
"id": "", "websiteUrl": "",
"country": "", "trust": null
};
organization.id = relation['to'].content;
organization.name = relation.legalname;
organization.shortname = relation.legalshortname;
organization.websiteUrl = relation.websiteurl;
if(relation.country) {
organization.country = relation.country.classname;
}
if(relation.trust) {
organization.trust = Math.round(relation.trust*100);
}
organizations.push(organization);
return organizations;
}
parseBioentitiesAndSoftware(children: any) : [Map<string, Map<string, string>>, { "name": string, "url": string}[]] {
let bioentities: Map<string, Map<string, string>>;
let software: {"name": string, "url": string}[];
let length = Array.isArray(children['externalreference']) ? children['externalreference'].length : 1;
let externalreference;
for(let i=0; i<length; i++) {
externalreference = Array.isArray(children['externalreference']) ? children['externalreference'][i] : children['externalreference'];
if(externalreference.hasOwnProperty("qualifier")) {
if(externalreference['qualifier'].classid == "accessionNumber") {
if(bioentities == undefined) {
bioentities = new Map<string, Map<string, string>>();
}
if(!bioentities.has(externalreference.sitename)) {
bioentities.set(externalreference.sitename, new Map<string, string>());
}
bioentities.get(externalreference.sitename).set(externalreference.refidentifier, externalreference.url);
} else if(externalreference['qualifier'].classid == "software") {
if(software == undefined) {
software = new Array<{"name": string, "url": string}>();
}
software.push({"name": externalreference.sitename, "url": externalreference.url});
}
}
}
return [bioentities, software];
}
getOpenCitations(id: string, properties:EnvProperties) {
//https://services.openaire.eu/opencitations/getCitations?id=doajarticles::2634200c24772ee8f10232d3e184ec65
let url = properties.openCitationsAPIURL+id;// "https://services.openaire.eu/opencitations/getCitations?id=" + id;
let key = url;
//return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
return this.http.get(url)
.pipe(map(res => [res['total'], this.parseOpenCitations(res['results'])]));
}
parseOpenCitations(openCitations: any): {"url": string, "title": string, "year": string, "doi": string, "authors": string[]}[] {
//title, doi, authors
let citations = new Array<{"url": string, "title": string, "year": string, "doi": string, "authors": string[]}>();
let openCitation;
let length = Array.isArray(openCitations) ? openCitations.length : 1;
for(let i=0; i<length; i++) {
openCitation = Array.isArray(openCitations) ? openCitations[i] : openCitations;
let citation: {"url": string, "title": string, "year": string, "doi": string, "authors": string[]} = {"url": "", "title": "", "year": "", "doi": "", "authors": []};
if(openCitation && openCitation.id) {
citation.url = openCitation.id;
citation.title = openCitation.title;
//citation.type = openCitation.type;
citation.year = (openCitation.pubDate && (openCitation.pubDate).indexOf('-') !== -1)?openCitation.pubDate.split('-')[0]:openCitation.pubDate;
citation.doi = openCitation.doi;
let authorsLength = Array.isArray(openCitation.authors) ? openCitation.authors.length : 1;
for(let i=0; i<authorsLength; i++) {
let author = Array.isArray(openCitation.authors) ? openCitation.authors[i] : openCitation.authors;
if(author) {
let lastFirstName: string = "";
if(author.lastName) {
lastFirstName = author.lastName;
}
if(author.lastName && author.firstName) {
lastFirstName += ", ";
}
if(author.firstName) {
lastFirstName += author.firstName;
}
if(lastFirstName) {
citation.authors.push(lastFirstName);
}
}
}
citations.push(citation);
}
}
return citations;
}
}

View File

@ -1,15 +0,0 @@
// import { NgModule } from '@angular/core';
// import { RouterModule } from '@angular/router';
//
// import {SoftwareComponent } from './software.component';
// import {FreeGuard} from'../../login/freeGuard.guard';
// import {PreviousRouteRecorder} from'../../utils/piwik/previousRouteRecorder.guard';
//
// @NgModule({
// imports: [
// RouterModule.forChild([
// { path: '', component: SoftwareComponent, canActivate: [FreeGuard],canDeactivate: [PreviousRouteRecorder] }
// ])
// ]
// })
// export class SoftwareRoutingModule { }

View File

@ -1,347 +0,0 @@
<div id="tm-main" class=" uk-section uk-padding-remove-top uk-margin-small-top tm-middle">
<div uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container software">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper>
<div *ngIf="softwareInfo != null" class="uk-grid">
<div class="uk-width-2-3@m uk-width-1-1@s uk-margin-bottom">
<schema2jsonld *ngIf="softwareInfo.record" [data]=softwareInfo.record
[URL]="properties.baseLink+'/search/software?softwareId='+softwareId"></schema2jsonld>
<showTitle [titleName]="softwareInfo.title"></showTitle>
<span *ngIf="softwareInfo.types && softwareInfo.types.length > 0"
class="uk-label custom-label label-software "
title="Type">{{softwareInfo.types.join(", ")}}</span>{{" "}}
<span *ngIf="softwareInfo.programmingLanguages && softwareInfo.programmingLanguages.length > 0"
class="uk-label custom-label label-progrLanguage "
title="Programming Language">{{softwareInfo.programmingLanguages.join(", ")}}</span>{{" "}}
<span *ngIf="softwareInfo.languages && softwareInfo.languages.length > 0"
class="uk-label custom-label label-language "
title="Language">{{softwareInfo.languages.join(", ")}}</span>{{" "}}
<span *ngIf="softwareInfo.countries && softwareInfo.countries.length > 0"
class="uk-label custom-label label-country "
title="Country">{{softwareInfo.countries.join(", ")}}</span>{{" "}}
<!-- <span *ngIf="softwareInfo.title && softwareInfo.title.accessMode" [class]="'uk-label custom-label label-'+ softwareInfo.title.accessMode " title="Access Mode">{{softwareInfo.title.accessMode}}</span> -->
<span *ngIf="softwareInfo.accessMode" [class]="'uk-label custom-label label-'+ softwareInfo.accessMode "
title="Access Mode">{{softwareInfo.accessMode}}</span>{{" "}}
<span *ngIf="softwareInfo.underCurationMessage" class="uk-label custom-label label-underCuration ">
<span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}">
<i>Record in preview</i>
<i class="uk-icon-info-circle"></i>
</span></span>{{" "}}
<!--div *ngIf="softwareInfo.underCurationMessage">
<span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}">
<i>Record in preview</i>
<i class="uk-icon-info-circle"></i>
</span>
</div-->
<div class=" uk-margin-top">
<showAuthors [authors]="softwareInfo.authors"></showAuthors>
<span *ngIf="softwareInfo.date != ''">({{softwareInfo.date}})</span>
</div>
<ul class="uk-list">
<showPublisher [publisher]="softwareInfo.publisher" [properties]="properties"
[journal]="softwareInfo.journal"></showPublisher>
<li *ngIf="softwareInfo.embargoEndDate"><span
class="uk-text-bold">Embargo end date:</span> {{softwareInfo.embargoEndDate}}</li>
<li *ngIf="softwareInfo.identifiers && softwareInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="softwareInfo.identifiers"></showIdentifiers>
</li>
<li *ngIf="softwareInfo.subjects ||softwareInfo.otherSubjects || softwareInfo.classifiedSubjects">
<showSubjects [subjects]="softwareInfo.subjects"
[otherSubjects]="softwareInfo.otherSubjects"
[classifiedSubjects]="softwareInfo.classifiedSubjects">
</showSubjects>
</li>
</ul>
<hr *ngIf="softwareInfo.description">
<div *ngIf="softwareInfo.description"
class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<span>{{softwareInfo.description.substring(0, showNumDescription)}}</span
><span
*ngIf="showNumDescription == thresholdDescription && softwareInfo.description.length > thresholdDescription">...</span
><span
*ngIf="showNumDescription == thresholdDescription && softwareInfo.description.length > thresholdDescription"
class="uk-text-right">
<a (click)="showNumDescription = softwareInfo.description.length;">
View more
</a>
</span>
</div>
<div *ngIf="softwareInfo.description && showNumDescription > thresholdDescription"
class="uk-width-1-1 uk-text-right">
<a (click)="showNumDescription = thresholdDescription;">
View less
</a>
</div>
<!-- <div class="uk-clearfix"><div class="uk-button-group uk-float-right uk-margin-top">
<button class="uk-button uk-button-small uk-button-action">
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="link" ratio="1"><path fill="none" stroke="#000" stroke-width="1.1" d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M7.925,11.875 L11.925,7.975"></path></svg></span>
Link this software to
</button>
<div class="uk-inline">
<button class="uk-button uk-button-small uk-button-action" type="button">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="triangle-down" ratio="1"><polygon points="5 7 15 7 10 12"></polygon></svg></span>
</button>
<div uk-dropdown="mode: click; boundary: ! .uk-button-group; boundary-align: true;"
class="uk-dropdown uk-dropdown-boundary uk-dropdown-bottom-left" style="top: 40px; left: -236.5px;">
<ul class="uk-nav uk-dropdown-nav uk-padding-small" >
<li><a class="uk-width-1-1" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
Projects</a></li>
<li><a class="uk-width-1-1"[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
Communities</a></li>
<li><a class="uk-width-1-1" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
Other research results</a></li>
</ul>
</div>
</div>
</div></div> -->
<ul class="custom-accordion " uk-accordion>
<li *ngIf="softwareInfo.relatedResearchResults" (click)="activeTab='Related Research Results'">
<a class="uk-accordion-title" href="#">
Related Research Results
<!-- <span *ngIf="!softwareInfo.relatedResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="softwareInfo.relatedResearchResults" class="uk-badge uk-badge-notification">
{{relatedResearchResultsNum | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{relatedResearchResultsNum | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!softwareInfo.relatedResearchResults" class = "uk-alert uk-alert-primary">
No related research results available
</div>
<div *ngIf="softwareInfo.relatedResearchResults"> -->
<div>
<div *ngFor="let provenanceaction of getKeys(softwareInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div>
<tabTable percentageName="trust"
[info]="softwareInfo.relatedResearchResults.get(provenanceaction)"
[properties]=properties></tabTable>
</div>
</div>
</div>
</li>
<li *ngIf="softwareInfo.similarResearchResults" (click)="activeTab='Similar Research Results'">
<a class="uk-accordion-title" href="#">
Similar Research Results
<!-- <span *ngIf="!softwareInfo.similarResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="softwareInfo.similarResearchResults" class="uk-badge uk-badge-notification">
{{softwareInfo.similarResearchResults.length | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{softwareInfo.similarResearchResults.length | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!softwareInfo.similarResearchResults" class = "uk-alert uk-alert-primary" >
No similar research results available
</div>
<div *ngIf="softwareInfo.similarResearchResults"> -->
<div>
<tabTable percentageName="similarity" [info]="softwareInfo.similarResearchResults"
[properties]=properties></tabTable>
</div>
</div>
</li>
<li (click)="metricsClicked=true; activeTab='Metrics'">
<a class="uk-accordion-title" href="#">
Metrics
</a>
<div class="uk-accordion-content">
<metrics [pageViews]="pageViews"
[id]="softwareId" [entityType]="'results'" [entity]="'Software'"
(metricsResults)="metricsResults($event)" [properties]=properties>
</metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250">
</i-frame>
</div>
</li>
<li (click)="activeTab='Other Versions'"
*ngIf="properties.environment != 'production' && softwareInfo.deletedByInferenceIds">
<a class="uk-accordion-title" href="#">
Other Versions
({{softwareInfo.deletedByInferenceIds.length | number}})
</a>
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
<deletedByInference [id]="softwareId" [ids]="softwareInfo.deletedByInferenceIds"
[type]="'software'"></deletedByInference>
</div>
</li>
</ul>
</div>
<div class="uk-width-1-3@m uk-width-1-1@s">
<div *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-padding-small">
<button class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
height="25"><path
d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path
d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975"
fill="none" stroke="#000"
stroke-width="1.1"></path></svg>
</span> Link this software to...
</button>
<div class=" uk-text-center uk-margin-expand uk-padding-small uk-margin-auto default-dropdown "
uk-dropdown="mode:click">
<div class="uk-grid uk-child-width-1-3 uk-width-large ">
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','project'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim"
>
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="album" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect height="1" width="10" x="5" y="2"></rect><rect
height="1" width="14" x="3" y="4"></rect><rect fill="none" height="11" stroke="#000"
width="17" x="1.5" y="6.5"></rect></svg></span>
</button>
<div>Projects</div>
</a></div>
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="copy" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect fill="none" height="16" stroke="#000"
width="12" x="3.5" y="2.5"></rect><polyline
fill="none" points="5 0.5 17.5 0.5 17.5 17" stroke="#000"></polyline></svg></span>
</button>
<div>Research results</div>
</a></div>
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','context'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="users" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><circle cx="7.7" cy="8.6" fill="none" r="3.5"
stroke="#000" stroke-width="1.1"></circle><path
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3" fill="none"
stroke="#000" stroke-width="1.1"></path><path
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"
fill="none" stroke="#000" stroke-width="1.1"></path></svg></span>
</button>
<div>Communities</div>
</a></div>
</div>
</div>
</div>
<div class="sideInfoTitle uk-margin-small-bottom uk-margin-small-top">Share - Bookmark</div>
<addThis></addThis>
<altmetrics *ngIf="softwareInfo.identifiers && softwareInfo.identifiers.get('doi')"
id="{{softwareInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics>
<ul class="uk-list uk-margin-remove-bottom">
<li *ngIf="softwareInfo.hostedBy_collectedFrom && softwareInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="softwareInfo.hostedBy_collectedFrom"></availableOn>
</li>
<li *ngIf="softwareInfo.fundedByProjects != undefined && softwareInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="softwareInfo.fundedByProjects"></fundedBy>
</li>
<li *ngIf="softwareInfo.contexts && softwareInfo.contexts.length >0 ">
<dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of softwareInfo.contexts">
<span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span>
<mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
</dl>
</li>
<!--li>
<metrics [pageViews]="pageViews" shortView=true
[id]="softwareId" [entityType]="'results'" [entity]="'Software'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics>
</li-->
<li>
<div class=" sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this software
</div>
<div class="">
<citeThis [result]="softwareInfo" [id]="softwareId" type="software"></citeThis>
</div>
</li>
<!--li>
<ul uk-accordion class="uk-padding-remove">
<li>
<button class="uk-button uk-button-primary uk-accordion-title link-to-button uk-width-1-1" type="button">
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="link" ratio="1"><path fill="none" stroke="#000" stroke-width="1.1" d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M7.925,11.875 L11.925,7.975"></path></svg></span>
<span class="uk-margin-right">Link this software to</span>
</button>
<div class="uk-accordion-content">
<ul class="uk-nav uk-dropdown-nav uk-padding-small" >
<li><a class="uk-width-1-1" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
Projects</a></li>
<li><a class="uk-width-1-1" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
Communities</a></li>
<li><a class="uk-width-1-1" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
Other research results</a></li>
</ul>
</div>
</li>
</ul>
</li-->
</ul>
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']"></helper>
</div>
</div>
</div>
</div>

View File

@ -1,249 +0,0 @@
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser';
import {SoftwareService} from './software.service';
import {SoftwareInfo} from '../../utils/entities/softwareInfo';
import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {EnvProperties} from '../../utils/properties/env-properties';
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({
selector: 'software',
templateUrl: 'software.component.html',
})
export class SoftwareComponent {
@Input() piwikSiteId = null;
@Input() communityId = null;
public softwareInfo: SoftwareInfo;
public softwareId: string;
// APP BOX variables
public showAllCollectedFrom: boolean = false;
public showAllDownloadFrom: boolean = false;
public showAllPublishedIn: boolean = false;
public thresholdDescription: number = 270;
public showNumDescription: number = 270;
// Metrics tab variables
public metricsClicked: boolean;
public viewsFrameUrl: string;
public downloadsFrameUrl: string;
public totalViews: number;
public totalDownloads: number;
public pageViews: number;
// Active tab variable for responsiveness
public activeTab: string = "Related Research Results";
// Map counting variable
public relatedResearchResultsNum: number = 0;
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
public routerHelper: RouterHelper = new RouterHelper();
private result;
sub: any;
piwiksub: any;
infoSub: any;
properties: EnvProperties;
public pageContents = null;
public divContents = null;
constructor(private _softwareService: SoftwareService,
private _piwikService: PiwikService,
private route: ActivatedRoute,
private router: Router,
private _meta: Meta,
private _title: Title,
private _router: Router,
private helper: HelperService,
private seoService: SEOService) {
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
//this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
});
this.sub = this.route.queryParams.subscribe(params => {
this.softwareInfo = null;
this.updateTitle("Software");
this.updateDescription("Software, search, open access");
this.softwareId = params['softwareId'];
if (this.softwareId) {
this.getSoftwareInfo(this.softwareId);
} else {
this.showLoading = false;
this.warningMessage = "No valid software id";
}
this.metricsClicked = false;
this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this.softwareId + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","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.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resViewsTimeline", "resTitle":"'+this.softwareId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","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(124, 181, 236, 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.softwareId + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","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';
/*this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.softwareId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","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';
*/
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();
}
}
private getSoftwareInfo(id: string) {
this.warningMessage = '';
this.errorMessage = ""
this.showLoading = true;
this.softwareInfo = null;
this.infoSub = this._softwareService.getSoftwareInfo(id, this.properties).subscribe(
data => {
this.softwareInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToSoftwareLanding + this.softwareInfo.record["result"]["header"]["dri:objIdentifier"]);
/*if(this.softwareInfo.title.name != undefined && this.softwareInfo.title.name!= ''){
this.updateTitle(this.softwareInfo.title.name);
this.updateDescription("Software, search, repositories, open access,"+this.softwareInfo.title.name);
}*/
if (this.softwareInfo.title) {
this.updateTitle(this.softwareInfo.title);
this.updateDescription("Software, " + this.softwareInfo.title);
}
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.softwareInfo.title/*.name*/, this.piwikSiteId).subscribe();
}
this.result = []
this.result = {
id: id,
type: "software",
source: "openaire",
title: this.softwareInfo.title,
url: '',
result: '',
accessRights: /*this.softwareInfo.title.accessMode*/this.softwareInfo.accessMode,
embargoEndDate: ''
};
let relatedResearchResultsNum = 0;
if (this.softwareInfo.relatedResearchResults != undefined) {
this.softwareInfo.relatedResearchResults.forEach(function (value, key, map) {
relatedResearchResultsNum += value.length;
});
}
this.relatedResearchResultsNum = relatedResearchResultsNum;
this.showLoading = false;
},
err => {
//console.log(err)
this.handleError("Error getting software for id: " + this.softwareId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToSoftware);
this.errorMessage = 'No software found';
this.showLoading = false;
}
);
}
// showChange($event) {
// this.showAllReferences=$event.value;
// }
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _prefix = "";
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'");
}
private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
public buildCurationTooltip() {
let tooltipContent: string = "<div class='uk-padding-small uk-light'>";
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></di>";
return tooltipContent;
}
public getKeys(map) {
return Array.from(map.keys());
}
public scroll() {
HelperFunctions.scroll();
}
private handleError(message: string, error) {
console.error("Software 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;
}
}

View File

@ -1,42 +0,0 @@
//import {MaterialModule} from '@angular/material';
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
import {SoftwareService} from './software.service';
import {SoftwareComponent} from './software.component';
// import { SoftwareRoutingModule } from './software-routing.module';
import {MetricsModule} from '../landing-utils/metrics.module';
import {IFrameModule} from '../../utils/iframe.module';
import {AltMetricsModule} from '../../utils/altmetrics.module';
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
import {PagingModule} from '../../utils/paging.module';
import {ResultLandingModule} from '../landing-utils/resultLanding.module';
import {LandingModule} from '../landing-utils/landing.module';
import {FreeGuard} from '../../login/freeGuard.guard';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module';
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
import {DeletedByInferenceModule} from "../landing-utils/deletedByInference/deletedByInference.module";
import {HelperModule} from "../../utils/helper/helper.module";
@NgModule({
imports: [
CommonModule, FormsModule, LandingModule, RouterModule, CiteThisModule, PagingModule,
ResultLandingModule, IFrameModule, MetricsModule, AltMetricsModule, Schema2jsonldModule, SEOServiceModule,
ShowAuthorsModule, DeletedByInferenceModule, HelperModule
],
declarations: [
SoftwareComponent
],
providers:[
SoftwareService, FreeGuard
],
exports: [
SoftwareComponent
]
})
export class SoftwareModule { }

View File

@ -1,253 +0,0 @@
import {Injectable} from '@angular/core';
import {HttpClient, HttpErrorResponse} from "@angular/common/http";
import {throwError} from 'rxjs';
import {SoftwareInfo} from '../../utils/entities/softwareInfo';
import {EnvProperties} from '../../utils/properties/env-properties';
import {ParsingFunctions} from '../landing-utils/parsingFunctions.class';
import {map} from "rxjs/operators";
@Injectable()
export class SoftwareService {
constructor(private http: HttpClient ) {
this.parsingFunctions = new ParsingFunctions();
}
public parsingFunctions: ParsingFunctions;
softwareInfo: SoftwareInfo;
getSoftwareInfo (id: string, properties:EnvProperties):any {
let url = properties.searchAPIURLLAst+'software/'+id+"?format=json";
let key = url;
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
//.map(res => <any> res.json())
.pipe(map(res => [res['result']['header']['dri:status'], res['result']['metadata']['oaf:entity']['oaf:result'], res]))
.pipe(map(res => [res[1],
res[1]['title'],
res[1]['rels']['rel'],
res[1]['children'],
res[1]['pid'],
res[1]['subject'],
res[1]['bestaccessright'],
res[1]['collectedfrom'],
res[1]['context'],
//res[1]['resulttype'],
res[0],
res[1]['creator'],
res[1]['language'],
res[1]['country'],
res[1]['programmingLanguage'],
res[2],
res[1]['journal'] //15
]))
.pipe(map(res => this.parseSoftwareInfo(res, properties)));
}
private handleError (error: HttpErrorResponse) {
// in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console
console.log(error);
return throwError(error || 'Server error');
}
parseSoftwareInfo (data: any, properties: EnvProperties):any {
this.softwareInfo = new SoftwareInfo();
this.softwareInfo.record = data[14];
if(data[0] != null) {
var date:string = (data[0].dateofacceptance)+""; // transform to string in case it is an integer
this.softwareInfo.date = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
this.softwareInfo.dateofacceptance = data[0].dateofacceptance;
this.softwareInfo.publisher = data[0].publisher;
if(!Array.isArray(data[0].description)) {
this.softwareInfo.description = String(data[0].description);
} else {
this.softwareInfo.description = String(data[0].description[0]);
}
this.softwareInfo.embargoEndDate = data[0].embargoenddate;
}
/*
this.softwareInfo.title = {"name": "", "url": "", "accessMode": ""};
if(data[0]['bestaccessright'] && data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
this.softwareInfo.title.accessMode = data[0]['bestaccessright'].classid;
}
if(data[1] != null) {
if(Array.isArray(data[1])) {
this.softwareInfo.title['name'] = data[1][0].content;
} else {
this.softwareInfo.title['name'] = data[1].content;
}
}
*/
if(data[0]['bestaccessright'] && data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
this.softwareInfo.accessMode = data[0]['bestaccessright'].classid;
}
if(data[1] != null) {
if(Array.isArray(data[1])) {
this.softwareInfo.title = String(data[1][0].content);
} else {
this.softwareInfo.title = String(data[1].content);
}
}
if(data[2] != null) {
let relation;
let length = data[2].length!=undefined ? data[2].length : 1;
for(let i=0; i<length; i++) {
relation = data[2].length!=undefined ? data[2][i] : data[2];
if(relation.hasOwnProperty("to")) {
if(relation['to'].class == "isProducedBy") {
this.softwareInfo.fundedByProjects = this.parsingFunctions.parseFundingByProjects(this.softwareInfo.fundedByProjects, relation, this.softwareInfo.projectsProvenanceVocabulary);
} else if(relation['to'].class == "isRelatedTo") {
let provenanceAction: string;
if(relation.provenanceaction in this.softwareInfo.researchResultsProvenanceVocabulary) {
provenanceAction = this.softwareInfo.researchResultsProvenanceVocabulary[relation.provenanceaction];
} else {
provenanceAction = "Other"
}
this.softwareInfo.relatedResearchResults = this.parsingFunctions.parseRelatedResearchResults(this.softwareInfo.relatedResearchResults, relation, provenanceAction);
} else if(relation['to'].class == "hasAmongTopNSimilarDocuments") {
this.softwareInfo.similarResearchResults = this.parsingFunctions.parseSimilarResearchResults(this.softwareInfo.similarResearchResults, relation);
}
}
}
}
if(data[3] != null) {
if(data[3].hasOwnProperty("result")) {
this.softwareInfo.deletedByInferenceIds = [];
let length = Array.isArray(data[3]['result']) ? data[3]['result'].length : 1;
for(let i=0; i<length; i++) {
let result = Array.isArray(data[3]['result']) ? data[3]['result'][i] : data[3]['result'];
this.softwareInfo.deletedByInferenceIds.push(result.objidentifier);
}
}
if(data[3].hasOwnProperty("instance")) {
this.softwareInfo.hostedBy_collectedFrom = new Array<{ "downloadName": string, "downloadUrl": string[],
"collectedName": string, "collectedId": string,
"accessMode": string[], "bestAccessMode": string,
"type": string, "year":string}>();
this.softwareInfo.types = new Array<string>();
let types = new Set<string>();
let counter = 0;
let instance;
let length = data[3]['instance'].length!=undefined ? data[3]['instance'].length : 1;
for(let i=0; i<length; i++) {
instance = data[3]['instance'].length!=undefined ? data[3]['instance'][i] : data[3]['instance'];
this.parsingFunctions.parseTypes(this.softwareInfo.types, types, instance);
if(instance.hasOwnProperty("webresource")) {
let url;
if(instance['webresource'].length == undefined) {
url = instance['webresource'].url;
} else{
url = instance['webresource'][0].url;
}
if(instance.hasOwnProperty("hostedby")) {
counter = this.parsingFunctions.parseHostedBy_collectedFrom(this.softwareInfo.hostedBy_collectedFrom, instance, data[0], url, counter/*, this.softwareInfo.title*/, this.softwareInfo.accessMode);
}
}
}
}
}
if(data[4] != null) {
this.softwareInfo.identifiers = this.parsingFunctions.parseIdentifiers(data[4]);
}
if(data[5] != null) {
let subjectResults: [string[], Map<string, string[]>, Map<string, string[]>] = this.parsingFunctions.parseAllSubjects(data[5]);
this.softwareInfo.subjects = subjectResults[0];
this.softwareInfo.otherSubjects = subjectResults[1];
this.softwareInfo.classifiedSubjects = subjectResults[2];
}
// null argument is for journal
this.softwareInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom(
this.softwareInfo.hostedBy_collectedFrom, this.softwareInfo.publisher,
null, this.softwareInfo.identifiers/*, this.softwareInfo.title*/);
if(data[8] != null) {
this.softwareInfo.contexts = this.parsingFunctions.parseContexts(data[8]);
}
// if(data[9] != null && this.softwareInfo.type == undefined) {
// if(data[9].hasOwnProperty('classname')) {
// this.softwareInfo.type = data[9].classname;
// }
// }
if(data[9] != null && data[9] == "under curation") {
this.softwareInfo.underCurationMessage = true;
} else {
this.softwareInfo.underCurationMessage = false;
}
if(data[10] != null) {
if(this.softwareInfo.authors == undefined) {
this.softwareInfo.authors = new Array<{"fullName": string, "orcid": string}>();
}
let authors = data[10];
let length = Array.isArray(authors) ? authors.length : 1;
for(let i=0; i<length; i++) {
let author = Array.isArray(authors) ? authors[i] : authors;
if(author) {
/*if (author.ORCID && author.ORCID.indexOf(properties.orcidURL) != -1) {
author.ORCID = author.ORCID.substr(properties.orcidURL.length);
}*/
this.softwareInfo['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID};
}
}
this.softwareInfo.authors = this.softwareInfo.authors.filter(function (item) {
return (item != undefined && item.fullName != undefined);
});
}
if(data[11] != null) {
this.softwareInfo.languages = this.parsingFunctions.parseLanguages(data[11]);
}
if(data[12] != null) {
this.softwareInfo.countries = this.parsingFunctions.parseCountries(data[12]);
}
if(data[13] != null) {
this.softwareInfo.programmingLanguages = this.parsingFunctions.parseProgrammingLanguages(data[13]);
}
if(this.softwareInfo.relatedResearchResults) {
let self = this;
this.softwareInfo.relatedResearchResults.forEach(function (value, key, map) {
self.softwareInfo.relatedResearchResults.set(key, self.parsingFunctions.sortByPercentage(value));
});
}
this.softwareInfo.similarResearchResults = this.parsingFunctions.sortByPercentage(this.softwareInfo.similarResearchResults);
if(data[15] != null) {
this.softwareInfo.journal = {"journal": "", "issn": "", "lissn": "", "eissn": "", "issue": "", "volume": "", "start_page": "", "end_page": ""}
this.softwareInfo.journal['journal'] = data[15].content;
this.softwareInfo.journal['issn'] = data[15].issn;
this.softwareInfo.journal['lissn'] = data[15].lissn;
this.softwareInfo.journal['eissn'] = data[15].eissn;
this.softwareInfo.journal['issue'] = data[15].iss;
this.softwareInfo.journal['volume'] = data[15].vol;
this.softwareInfo.journal['start_page'] = data[15].sp;
this.softwareInfo.journal['end_page'] = data[15].ep;
}
return this.softwareInfo;
}
}

View File

@ -0,0 +1,78 @@
export class ResultLandingInfo {
// PUBLICATION, DATASET, SOFTWARE, ORP
record;
underCurationMessage: boolean;
title: string;
accessMode: string;
authors: {"fullName": string, "orcid": string}[];
date: string;
dateofacceptance: string;
embargoEndDate: string;
types: string[];
hostedBy_collectedFrom: {"downloadName": string, "downloadUrl": string[],
"collectedName": string, "collectedId": string,
"accessMode": string[], "bestAccessMode": string,
"type": string, "year":string}[];
identifiers: Map<string, string[]>; //key is the classname
publisher: string;
journal: {"journal": string, "issn": string, "lissn": string, "eissn": string,
"issue": string, "volume": string, "start_page": string, "end_page": string};
languages: string[];
countries: string[];
subjects: string[];
otherSubjects: Map<string, string[]>;
classifiedSubjects: Map<string, string[]>; //<class of subject, subjects>
description: string;
projectsProvenanceVocabulary: { "sysimport:crosswalk:repository": string,
"sysimport:crosswalk:entityregistry": string,
"sysimport:crosswalk:datasetarchive": string,
"iis": string,
"sysimport:mining:repository": string,
"user:claim:pid": string,
"user:claim:search": string,
"user:claim:datacite": string
} = {
"sysimport:crosswalk:repository": "Repository",
"sysimport:crosswalk:entityregistry": "Repository",
"sysimport:crosswalk:datasetarchive": "Repository",
"iis": "OpenAIRE",
"sysimport:mining:repository": "OpenAIRE",
"user:claim:pid": "User",
"user:claim:search": "User",
"user:claim:datacite": "User"
};
fundedByProjects: { "id": string, "acronym": string, "title": string,
"funderShortname": string, "funderName": string,
"funding": string, "code": string, "provenanceAction": string, "inline": boolean}[];
researchResultsProvenanceVocabulary: {"iis": string, "sysimport": string, "user": string} =
{"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"};
// percentage is for trust
relatedResearchResults: Map<string, { "name": string, "id": string, "date": string, "percentage": number, "class": string}[]>;
// percentage is for similarity
similarResearchResults: { "name": string, "id": string, "date": string, "percentage": number, "class": string}[];
contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}[];
deletedByInferenceIds: string[];
// PUBLICATION, DATASET, ORP
references: { "name": string, "url": string}[];
// PUBLICATION
bioentities: Map<string, Map<string, string>>; //<site name, <>>
software: { "name": string, "url": string}[]; //<site name, <>>
organizations: {"name": string, "shortname":string, "id": string, "websiteUrl": string, "country": string, "trust": number}[];
openCitations: {"url": string, "title": string, "year": string, "doi": string, "authors": string[]}[];
// DATASET
subtitle: string;
// SOFTWARE
programmingLanguages: string[];
}

View File

@ -5,7 +5,7 @@ import {Component, ViewEncapsulation, ElementRef, EventEmitter, Output, Input} f
template: `
<div [class]="(!isOpen)?'uk-modal ':'uk-modal uk-open'" uk-modal [open]="!isOpen" id="myModal"
tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="uk-modal-dialog uk-modal-body uk-animation-slide-bottom-small uk-text-left" role="">
<div [class]="'uk-modal-dialog uk-modal-body uk-animation-slide-bottom-small uk-text-left '+classBody" role="">
<div class="uk-modal-title" [hidden]=!alertHeader>
<button class="uk-modal-close-default uk-float-right" (click)='cancel()' uk-close></button>
<h4 class="modal-title" id="myModalLabel">{{alertTitle}}</h4>
@ -52,6 +52,7 @@ import {Component, ViewEncapsulation, ElementRef, EventEmitter, Output, Input} f
* API to an open alert window.
*/
export class AlertModal {
@Input() classBody: string ="";
/**
* Caption for the title.
*/