[Trunk|Library]: Add Helper on search Page, landings and deposit first page.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@56644 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2019-07-22 09:16:50 +00:00
parent 1d64ec947a
commit 11cf47ac5a
28 changed files with 4563 additions and 3864 deletions

View File

@ -1,8 +1,9 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {ZenodoInformationClass} from './utils/zenodoInformation.class'; import {ZenodoInformationClass} from './utils/zenodoInformation.class';
import {EnvProperties} from "../utils/properties/env-properties"; import {EnvProperties} from "../utils/properties/env-properties";
import {ActivatedRoute} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {PiwikService} from "../utils/piwik/piwik.service"; import {PiwikService} from "../utils/piwik/piwik.service";
import {HelperService} from "../utils/helper/helper.service";
@Component({ @Component({
selector: 'deposit-first-page', selector: 'deposit-first-page',
@ -134,11 +135,11 @@ import {PiwikService} from "../utils/piwik/piwik.service";
<!– grey-background–> <!– grey-background–>
<div class="uk-margin-top uk-padding-small"> <div class="uk-margin-top uk-padding-small">
<div class="uk-align-center uk-container uk-container-large uk-margin-top uk-margin-bottom"> <div class="uk-align-center uk-container uk-container-large uk-margin-top uk-margin-bottom">
<helper *ngIf="pageContents && pageContents['bottom']" [texts]="pageContents['bottom']"></helper> <helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0" [texts]="pageContents['bottom']"></helper>
</div> </div>
</div> </div>
</div>--> </div>-->
<helper *ngIf="pageContents && pageContents['bottom']" [texts]="pageContents['bottom']"></helper> <helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0" [texts]="pageContents['bottom']"></helper>
` `
}) })
@ -147,20 +148,27 @@ export class DepositFirstPageComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
piwiksub:any; piwiksub:any;
@Input() pageContents = null; @Input() communityId = null;
@Input() divContents = null;
public pageContents = null;
public divContents = null;
public keyword: string; public keyword: string;
public depositRoute = "/search-deposit"; public depositRoute = "/search-deposit";
public searchPlaceHolder = "Search for repositories by title, country, organization, subject..."; public searchPlaceHolder = "Search for repositories by title, country, organization, subject...";
properties:EnvProperties; properties:EnvProperties;
constructor (private route: ActivatedRoute, private _piwikService:PiwikService) {} constructor (private route: ActivatedRoute, private _piwikService:PiwikService,
private helper: HelperService,
private _router: Router) {}
ngOnInit() { ngOnInit() {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
//this.getDivContents();
this.getPageContents();
if (!this.zenodoInformation) { if (!this.zenodoInformation) {
this.zenodoInformation = new ZenodoInformationClass(); this.zenodoInformation = new ZenodoInformationClass();
} }
@ -177,6 +185,18 @@ export class DepositFirstPageComponent {
}); });
} }
public getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.pageContents = contents;
})
}
public getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.divContents = contents;
})
}
ngOnDestroy() { ngOnDestroy() {
if(this.piwiksub){ if(this.piwiksub){
this.piwiksub.unsubscribe(); this.piwiksub.unsubscribe();

View File

@ -1,15 +1,20 @@
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" > <div id="tm-main" class=" uk-section uk-margin-small-top tm-middle">
<div uk-grid uk-grid> <div uk-grid 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="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container uk-margin-top datasource"> <div class="uk-container uk-margin-top datasource">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div> role="alert">{{warningMessage}}</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> <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>
<div *ngIf="dataProviderInfo != null" uk-grid class="uk-grid-large"> <div *ngIf="dataProviderInfo != null" uk-grid class="uk-grid-large">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
<div class="uk-width-expand@m uk-width-1-1@s"> [texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div class="uk-width-expand@m uk-width-1-1@s">
<!--h3 *ngIf="dataProviderInfo.title != null"> <!--h3 *ngIf="dataProviderInfo.title != null">
<a *ngIf="dataProviderInfo.title['url'] != undefined && dataProviderInfo.title['url'] != null" <a *ngIf="dataProviderInfo.title['url'] != undefined && dataProviderInfo.title['url'] != null"
href="{{dataProviderInfo.title['url']}}" target="_blank" class="custom-external"> href="{{dataProviderInfo.title['url']}}" target="_blank" class="custom-external">
@ -19,24 +24,30 @@
{{dataProviderInfo.title['name']}} {{dataProviderInfo.title['name']}}
</p> </p>
</h3--> </h3-->
<schema2jsonld *ngIf="dataProviderInfo" [data]=dataProviderInfo [URL]="properties.baseLink+'/search/dataprovider?datasourceId='+datasourceId" <schema2jsonld *ngIf="dataProviderInfo" [data]=dataProviderInfo
type="datasource" [otherURL]="(dataProviderInfo.openDoarId)?(properties.openDoarURL+dataProviderInfo.openDoarId):((dataProviderInfo.r3DataId)?properties.r3DataURL+dataProviderInfo.r3DataId:nul)"></schema2jsonld> [URL]="properties.baseLink+'/search/dataprovider?datasourceId='+datasourceId"
type="datasource"
[otherURL]="(dataProviderInfo.openDoarId)?(properties.openDoarURL+dataProviderInfo.openDoarId):((dataProviderInfo.r3DataId)?properties.r3DataURL+dataProviderInfo.r3DataId:nul)"></schema2jsonld>
<showTitle [title]="dataProviderInfo.title"></showTitle> <showTitle [title]="dataProviderInfo.title"></showTitle>
<div class="uk-text-large " *ngIf="dataProviderInfo.officialName && this.dataProviderInfo.title.name != dataProviderInfo.officialName ">{{dataProviderInfo.officialName}}</div> <div class="uk-text-large "
*ngIf="dataProviderInfo.officialName && this.dataProviderInfo.title.name != dataProviderInfo.officialName ">{{dataProviderInfo.officialName}}</div>
<span *ngIf="dataProviderInfo.type" class="uk-label custom-label label-type label-dataprovider " <span *ngIf="dataProviderInfo.type" class="uk-label custom-label label-type label-dataprovider "
title="Type">{{dataProviderInfo.type}}</span>{{" "}} title="Type">{{dataProviderInfo.type}}</span>{{" "}}
<span *ngIf="dataProviderInfo.compatibility" class="uk-label custom-label label-compatibility " title="Compatibility"> <span *ngIf="dataProviderInfo.compatibility" class="uk-label custom-label label-compatibility "
title="Compatibility">
<a *ngIf="!dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id" <a *ngIf="!dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id"
[queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider"> [queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active"
routerLink="/search/dataprovider">
{{dataProviderInfo.compatibility.info}} {{dataProviderInfo.compatibility.info}}
</a> </a>
<span *ngIf="dataProviderInfo.compatibility.name || !dataProviderInfo.compatibility.id"> <span *ngIf="dataProviderInfo.compatibility.name || !dataProviderInfo.compatibility.id">
{{dataProviderInfo.compatibility.info}} {{dataProviderInfo.compatibility.info}}
</span> </span>
<a *ngIf="dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id" <a *ngIf="dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id"
[queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider"> [queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active"
routerLink="/search/dataprovider">
{{dataProviderInfo.compatibility.name}} {{dataProviderInfo.compatibility.name}}
</a> </a>
<span *ngIf="dataProviderInfo.compatibility.name && !dataProviderInfo.compatibility.id"> <span *ngIf="dataProviderInfo.compatibility.name && !dataProviderInfo.compatibility.id">
@ -47,225 +58,242 @@
<ul class="uk-list"> <ul class="uk-list">
<showPublisher [properties]="properties" <showPublisher [properties]="properties"
[journal]="dataProviderInfo.journal"></showPublisher> [journal]="dataProviderInfo.journal"></showPublisher>
<li *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fundedContent && dataProviderInfo.aggregationStatus.fundedContent != -1"><span class="uk-text-bold">Results with funding information: </span> <li
{{dataProviderInfo.aggregationStatus.fundedContent | number}} *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fundedContent && dataProviderInfo.aggregationStatus.fundedContent != -1">
</li> <span class="uk-text-bold">Results with funding information: </span>
<li *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fulltexts && dataProviderInfo.aggregationStatus.fulltexts != -1"><span class="uk-text-bold">Collected full-texts: </span> {{dataProviderInfo.aggregationStatus.fundedContent | number}}
{{dataProviderInfo.aggregationStatus.fulltexts | number}} </li>
</li> <li
<li *ngIf="dataProviderInfo.oaiPmhURL"><span class="uk-text-bold">OAI-PMH: </span> *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fulltexts && dataProviderInfo.aggregationStatus.fulltexts != -1">
<span class="uk-button-text"> <span class="uk-text-bold">Collected full-texts: </span>
{{dataProviderInfo.aggregationStatus.fulltexts | number}}
</li>
<li *ngIf="dataProviderInfo.oaiPmhURL"><span class="uk-text-bold">OAI-PMH: </span>
<span class="uk-button-text">
<a target="_blank" href="{{dataProviderInfo.oaiPmhURL}}"> <a target="_blank" href="{{dataProviderInfo.oaiPmhURL}}">
{{dataProviderInfo.oaiPmhURL}} {{dataProviderInfo.oaiPmhURL}}
</a> </a>
</span> </span>
</li> </li>
<li *ngIf="dataProviderInfo.openDoarId"> <li *ngIf="dataProviderInfo.openDoarId">
<span class="uk-button-text"> <span class="uk-button-text">
<a target="_blank" href="{{properties.openDoarURL+dataProviderInfo.openDoarId}}"> <a target="_blank" href="{{properties.openDoarURL+dataProviderInfo.openDoarId}}">
Detailed content provider information (OpenDOAR) Detailed content provider information (OpenDOAR)
</a> </a>
</span> </span>
</li> </li>
<li *ngIf="dataProviderInfo.r3DataId"> <li *ngIf="dataProviderInfo.r3DataId">
<span class="uk-button-text"> <span class="uk-button-text">
<a target="_blank" href="{{properties.r3DataURL+dataProviderInfo.r3DataId}}"> <a target="_blank" href="{{properties.r3DataURL+dataProviderInfo.r3DataId}}">
Detailed content provider information (Re3data) Detailed content provider information (Re3data)
</a> </a>
</span> </span>
</li> </li>
<li *ngIf="dataProviderInfo.countries != undefined && dataProviderInfo.countries.length > 0"><span class="uk-text-bold">Countries: </span>{{dataProviderInfo.countries.join(", ")}}</li> <li *ngIf="dataProviderInfo.countries != undefined && dataProviderInfo.countries.length > 0"><span
class="uk-text-bold">Countries: </span>{{dataProviderInfo.countries.join(", ")}}</li>
</ul> </ul>
<div *ngIf="showTabs"> <div *ngIf="showTabs">
<ul class="custom-accordion" uk-accordion *ngIf="dataProviderInfo.tabs2 != undefined"> <ul class="custom-accordion" uk-accordion *ngIf="dataProviderInfo.tabs2 != undefined">
<li *ngIf="dataProviderInfo.tabs2.indexOf('Publications') != -1"
(click)="search('publicationsTab', 1, 10); activeTab='Publications'">
<a class="uk-accordion-title" href="#">Publications
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchPublications.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<publicationsTab *ngIf="activeTab=='Publications'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchPublications]="fetchPublications" [(properties)]=properties>
</publicationsTab>
</div>
</li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Research Data') != -1"
(click)="search('datasetsTab', 1, 10); activeTab='Research Data'">
<a class="uk-accordion-title" href="#">Research Data
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchDatasets.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<p>
<datasetsTab *ngIf="activeTab=='Research Data'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchDatasets]="fetchDatasets" [(properties)]=properties>
</datasetsTab>
</p>
</div>
</li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Software') != -1"
(click)="search('softwareTab', 1, 10); activeTab='Software'">
<a class="uk-accordion-title" href="#">Software
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchSoftware.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<softwareTab *ngIf="activeTab=='Software'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchSoftware]="fetchSoftware" [(properties)]=properties>
</softwareTab>
</div>
</li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Other Research Products') != -1"
(click)="search('orpsTab', 1, 10); activeTab='Other Research Products'">
<a class="uk-accordion-title" href="#">Other Research Products
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchOrps.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<orpsTab *ngIf="activeTab=='Other Research Products'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchOrps]="fetchOrps" [(properties)]=properties>
</orpsTab>
</div>
</li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Projects') != -1"
(click)="search('projectsTab', 1, 10); activeTab='Projects'">
<a class="uk-accordion-title" href="#">Projects
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchProjects.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<projectsTab *ngIf="activeTab=='Projects'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchProjects]="fetchProjects" [(properties)]=properties>
</projectsTab>
</div>
</li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Content Providers') != -1"
(click)="search('datasourcesTab', 1, 10); activeTab='Content Providers'">
<a class="uk-accordion-title" href="#">Content Providers
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchDataproviders.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<datasourcesTab *ngIf="activeTab=='Content Providers'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchDataproviders]="fetchDataproviders" [(properties)]=properties>
</datasourcesTab>
</div>
</li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Organizations') != -1"
(click)="search('organizationsTab', 1, 10); activeTab='Organizations'">
<a class="uk-accordion-title" href="#">Organizations
<!-- <span class="uk-badge uk-badge-notification"> -->
({{dataProviderInfo.organizations.length | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<organizationsTab *ngIf="activeTab=='Organizations'"
[organizations]="dataProviderInfo.organizations">
</organizationsTab>
</div>
</li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Related Content Providers') != -1"
(click)="search('relatedDatasourcesTab', 1, 10); activeTab='Related Content Providers'">
<a class="uk-accordion-title" href="#">Related Content Providers</a>
<div class="uk-accordion-content">
<relatedDatasourcesTab *ngIf="activeTab=='Related Content Providers'"
[dataproviderId]="datasourceId"
[results]="dataProviderInfo.relatedDatasources"
[loading]="loadingRelatedDatasources"
[fetchPublications]="fetchAggregatorsPublications"
[fetchDatasets]="fetchAggregatorsDatasets"
[fetchSoftware]="fetchAggregatorsSoftware"
[fetchOrps]="fetchAggregatorsOrps"
[(properties)]=properties>
</relatedDatasourcesTab>
</div>
</li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Statistics') != -1"
(click)="search('statisticsTab', 1, 10); activeTab='Statistics'">
<a class="uk-accordion-title" href="#">Statistics</a>
<div class="uk-accordion-content">
<div *ngIf="activeTab=='Statistics' && statsClicked">
<!-- <errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status]" [type]="'statistics'" tab_error_class=true></errorMessages>
<div *ngIf="(fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE)">
<p class="uk-text-bold">Latest Research Result Timeline</p>
<i-frame [url]=docsTimelineUrl width="100%" height="350"></i-frame>
<p class="uk-text-bold">Research Result Types</p>
<i-frame [url]=docsTypesUrl width="100%" height="350"></i-frame>
</div>
<div *ngIf="fetchPublications.searchUtils.totalResults > 0 || (fetchDatasets.searchUtils.totalResults > 0)">
<p class="uk-text-bold">Funders in Research Results of content provider</p>
<i-frame [url]=docsFunderUrl width="100%" height="350"></i-frame>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Publications') != -1" (click)="search('publicationsTab', 1, 10); activeTab='Publications'">
<a class="uk-accordion-title" href="#">Publications
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchPublications.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<publicationsTab *ngIf="activeTab=='Publications'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchPublications] = "fetchPublications" [(properties)]=properties>
</publicationsTab>
</div> </div>
</li> <div *ngIf="fetchPublications.searchUtils.totalResults > 0 ">
<li *ngIf="dataProviderInfo.tabs2.indexOf('Research Data') != -1" (click)="search('datasetsTab', 1, 10); activeTab='Research Data'"> <p class="uk-text-bold">Projects with most Publications</p>
<a class="uk-accordion-title" href="#">Research Data <i-frame [url]=pubsProjectsUrl width="100%" height="350"></i-frame>
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchDatasets.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<p>
<datasetsTab *ngIf="activeTab=='Research Data'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchDatasets]="fetchDatasets" [(properties)]=properties>
</datasetsTab>
</p>
</div> </div>
</li> <div *ngIf="(fetchDatasets.searchUtils.totalResults > 0)">
<div>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Software') != -1" (click)="search('softwareTab', 1, 10); activeTab='Software'"> <p class="uk-text-bold">Projects with most Research Data</p>
<a class="uk-accordion-title" href="#">Software <i-frame [url]=dataProjectsUrl width="100%" height="350"></i-frame>
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchSoftware.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<softwareTab *ngIf="activeTab=='Software'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchSoftware]="fetchSoftware" [(properties)]=properties>
</softwareTab>
</div>
</li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Other Research Products') != -1" (click)="search('orpsTab', 1, 10); activeTab='Other Research Products'">
<a class="uk-accordion-title" href="#">Other Research Products
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchOrps.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<orpsTab *ngIf="activeTab=='Other Research Products'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchOrps]="fetchOrps" [(properties)]=properties>
</orpsTab>
</div>
</li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Projects') != -1" (click)="search('projectsTab', 1, 10); activeTab='Projects'">
<a class="uk-accordion-title" href="#">Projects
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchProjects.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<projectsTab *ngIf="activeTab=='Projects'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchProjects]="fetchProjects" [(properties)]=properties>
</projectsTab>
</div>
</li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Content Providers') != -1" (click)="search('datasourcesTab', 1, 10); activeTab='Content Providers'">
<a class="uk-accordion-title" href="#">Content Providers
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchDataproviders.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<datasourcesTab *ngIf="activeTab=='Content Providers'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchDataproviders]="fetchDataproviders" [(properties)]=properties>
</datasourcesTab>
</div>
</li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Organizations') != -1" (click)="search('organizationsTab', 1, 10); activeTab='Organizations'">
<a class="uk-accordion-title" href="#">Organizations
<!-- <span class="uk-badge uk-badge-notification"> -->
({{dataProviderInfo.organizations.length | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<organizationsTab *ngIf="activeTab=='Organizations'"
[organizations]="dataProviderInfo.organizations">
</organizationsTab>
</div>
</li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Related Content Providers') != -1" (click)="search('relatedDatasourcesTab', 1, 10); activeTab='Related Content Providers'">
<a class="uk-accordion-title" href="#">Related Content Providers</a>
<div class="uk-accordion-content">
<relatedDatasourcesTab *ngIf="activeTab=='Related Content Providers'"
[dataproviderId]="datasourceId"
[results]="dataProviderInfo.relatedDatasources"
[loading]="loadingRelatedDatasources"
[fetchPublications]="fetchAggregatorsPublications"
[fetchDatasets]="fetchAggregatorsDatasets"
[fetchSoftware]="fetchAggregatorsSoftware"
[fetchOrps]="fetchAggregatorsOrps"
[(properties)]=properties>
</relatedDatasourcesTab>
</div>
</li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Statistics') != -1" (click)="search('statisticsTab', 1, 10); activeTab='Statistics'">
<a class="uk-accordion-title" href="#">Statistics</a>
<div class="uk-accordion-content">
<div *ngIf="activeTab=='Statistics' && statsClicked">
<!-- <errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status]" [type]="'statistics'" tab_error_class=true></errorMessages>
<div *ngIf="(fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE)">
<p class="uk-text-bold">Latest Research Result Timeline</p>
<i-frame [url]=docsTimelineUrl width="100%" height="350"></i-frame>
<p class="uk-text-bold">Research Result Types</p>
<i-frame [url]=docsTypesUrl width="100%" height="350"></i-frame>
</div>
<div *ngIf="fetchPublications.searchUtils.totalResults > 0 || (fetchDatasets.searchUtils.totalResults > 0)">
<p class="uk-text-bold">Funders in Research Results of content provider</p>
<i-frame [url]=docsFunderUrl width="100%" height="350"></i-frame>
</div> </div>
<div *ngIf="fetchPublications.searchUtils.totalResults > 0 "> </div> -->
<p class="uk-text-bold">Projects with most Publications</p> <statisticsTab [fetchPublications]="fetchPublications" [fetchDatasets]="fetchDatasets"
<i-frame [url]=pubsProjectsUrl width="100%" height="350"></i-frame> [datasourceId]="datasourceId"></statisticsTab>
</div> </div>
<div *ngIf="(fetchDatasets.searchUtils.totalResults > 0)"> </div>
<div> </li>
<p class="uk-text-bold">Projects with most Research Data</p>
<i-frame [url]=dataProjectsUrl width="100%" height="350"></i-frame>
</div>
</div> -->
<statisticsTab [fetchPublications]="fetchPublications" [fetchDatasets]="fetchDatasets" [datasourceId]="datasourceId"></statisticsTab>
</div>
</div>
</li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Metrics') != -1"
(click)="search('metricsTab', 1, 10); activeTab='Metrics'">
<a class="uk-accordion-title" href="#">Metrics</a>
<div class="uk-accordion-content">
<metrics *ngIf="activeTab=='Metrics'" [pageViews]="pageViews"
[id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'"
(metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics>
<i-frame *ngIf="activeTab=='Metrics' && metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
<i-frame *ngIf="activeTab=='Metrics' && metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250">
</i-frame>
</div>
</li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Metrics') != -1" (click)="search('metricsTab', 1, 10); activeTab='Metrics'"> </ul>
<a class="uk-accordion-title" href="#">Metrics</a>
<div class="uk-accordion-content">
<metrics *ngIf="activeTab=='Metrics'" [pageViews]="pageViews"
[id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics>
<i-frame *ngIf="activeTab=='Metrics' && metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
<i-frame *ngIf="activeTab=='Metrics' && metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250">
</i-frame>
</div>
</li>
</ul>
</div> </div>
</div>
<div class="uk-width-large@m uk-width-1-1@s">
<div class="uk-card uk-card-default uk-padding-small">
<div>
Share - Bookmark<addThis ></addThis>
</div>
<metrics [pageViews]="pageViews" shortView=true
[id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics>
</div> </div>
<div class="uk-width-large@m uk-width-1-1@s">
<div class="uk-card uk-card-default uk-padding-small">
<div>
Share - Bookmark
<addThis></addThis>
</div>
<metrics [pageViews]="pageViews" shortView=true
[id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'"
(metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics>
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
</div> </div>

View File

@ -1,44 +1,41 @@
import {merge as observableMerge} from 'rxjs';
import {merge as observableMerge, Observable} from 'rxjs'; import {Component, Input} from '@angular/core';
import {Component, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router';
import {Input} from '@angular/core'; import {Meta, Title} from '@angular/platform-browser';
import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
import {EnvProperties} from '../../utils/properties/env-properties';
import {DataProviderInfo} from '../../utils/entities/dataProviderInfo';
import {EnvProperties} from '../../utils/properties/env-properties'; import {DataProviderService} from './dataProvider.service';
import {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class';
import {DataProviderInfo} from '../../utils/entities/dataProviderInfo'; import {SearchPublicationsService} from '../../services/searchPublications.service';
import {DataProviderService} from './dataProvider.service'; import {FetchDatasets} from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
import {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class'; import {SearchDatasetsService} from '../../services/searchDatasets.service';
import {SearchPublicationsService} from '../../services/searchPublications.service'; import {FetchSoftware} from '../../utils/fetchEntitiesClasses/fetchSoftware.class';
import {FetchDatasets} from '../../utils/fetchEntitiesClasses/fetchDatasets.class'; import {SearchSoftwareService} from '../../services/searchSoftware.service';
import {SearchDatasetsService} from '../../services/searchDatasets.service'; import {FetchOrps} from '../../utils/fetchEntitiesClasses/fetchOrps.class';
import {FetchSoftware} from '../../utils/fetchEntitiesClasses/fetchSoftware.class'; import {SearchOrpsService} from '../../services/searchOrps.service';
import {SearchSoftwareService} from '../../services/searchSoftware.service'; import {FetchProjects} from '../../utils/fetchEntitiesClasses/fetchProjects.class';
import {FetchOrps} from '../../utils/fetchEntitiesClasses/fetchOrps.class'; import {SearchProjectsService} from '../../services/searchProjects.service';
import {SearchOrpsService} from '../../services/searchOrps.service'; import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
import {FetchProjects} from '../../utils/fetchEntitiesClasses/fetchProjects.class'; import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
import {SearchProjectsService} from '../../services/searchProjects.service'; import {ErrorCodes} from '../../utils/properties/errorCodes';
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class'; import {RouterHelper} from '../../utils/routerHelper.class';
import {SearchDataprovidersService} from '../../services/searchDataproviders.service'; import {PiwikService} from '../../utils/piwik/piwik.service';
import {RelatedDatasourcesTabComponent} from './relatedDatasourcesTab.component'; import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {ErrorCodes} from '../../utils/properties/errorCodes';
import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({ @Component({
selector: 'dataprovider', selector: 'dataprovider',
templateUrl: 'dataProvider.component.html', templateUrl: 'dataProvider.component.html',
}) })
export class DataProviderComponent { export class DataProviderComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() communityId = null;
public dataProviderInfo: DataProviderInfo; public dataProviderInfo: DataProviderInfo;
public datasourceId: string; public datasourceId: string;
@ -61,13 +58,13 @@ export class DataProviderComponent {
// Statistics tab variables // Statistics tab variables
public statsClicked: boolean = false; public statsClicked: boolean = false;
public docsTimelineUrl: string; public docsTimelineUrl: string;
public docsTypesUrl:string; public docsTypesUrl: string;
public docsFunderUrl:string; public docsFunderUrl: string;
public dataProjectsUrl:string ; public dataProjectsUrl: string;
public pubsProjectsUrl:string; public pubsProjectsUrl: string;
// Variables for publications, research data, projects, content providers, related content providers tabs // Variables for publications, research data, projects, content providers, related content providers tabs
public fetchPublications : FetchPublications; public fetchPublications: FetchPublications;
public fetchDatasets: FetchDatasets; public fetchDatasets: FetchDatasets;
public fetchSoftware: FetchSoftware; public fetchSoftware: FetchSoftware;
public fetchOrps: FetchOrps; public fetchOrps: FetchOrps;
@ -82,10 +79,12 @@ export class DataProviderComponent {
// Active tab variable for responsiveness - show tabs only if main request is completed // Active tab variable for responsiveness - show tabs only if main request is completed
public activeTab: string = ""; public activeTab: string = "";
public showTabs:boolean = false; public showTabs: boolean = false;
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
public errorCodes:ErrorCodes = new ErrorCodes(); public errorCodes: ErrorCodes = new ErrorCodes();
public pageContents = null;
public divContents = null;
// Request results of each tab only the one time (first time tab is clicked) // Request results of each tab only the one time (first time tab is clicked)
private reloadPublications: boolean = true; private reloadPublications: boolean = true;
@ -100,401 +99,447 @@ export class DataProviderComponent {
piwiksub: any; piwiksub: any;
subInfo: any; subInfo: any;
relatedDatasourcesSub: any; relatedDatasourcesSub: any;
properties:EnvProperties; properties: EnvProperties;
constructor (private _dataproviderService: DataProviderService, constructor(private _dataproviderService: DataProviderService,
private _piwikService:PiwikService, private _piwikService: PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
private _meta: Meta, private _meta: Meta,
private _title: Title, private _title: Title,
private _router: Router, private _router: Router,
private _searchPublicationsService: SearchPublicationsService, private _searchPublicationsService: SearchPublicationsService,
private _searchDatasetsService: SearchDatasetsService, private _searchDatasetsService: SearchDatasetsService,
private _searchSoftwareService: SearchSoftwareService, private _searchSoftwareService: SearchSoftwareService,
private _searchOrpsService: SearchOrpsService, private _searchOrpsService: SearchOrpsService,
private _searchProjectsService: SearchProjectsService, private _searchProjectsService: SearchProjectsService,
private _searchDataprovidersService: SearchDataprovidersService, private _searchDataprovidersService: SearchDataprovidersService,
private seoService: SEOService) { private seoService: SEOService,
this.fetchPublications = new FetchPublications(this._searchPublicationsService); private helper: HelperService) {
this.fetchDatasets = new FetchDatasets(this._searchDatasetsService); this.fetchPublications = new FetchPublications(this._searchPublicationsService);
this.fetchSoftware = new FetchSoftware(this._searchSoftwareService); this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
this.fetchOrps = new FetchOrps(this._searchOrpsService); this.fetchSoftware = new FetchSoftware(this._searchSoftwareService);
this.fetchProjects = new FetchProjects(this._searchProjectsService); this.fetchOrps = new FetchOrps(this._searchOrpsService);
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService); this.fetchProjects = new FetchProjects(this._searchProjectsService);
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
} }
ngOnInit() { ngOnInit() {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url); //this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
}); });
this.sub = this.route.queryParams.subscribe(data => { this.sub = this.route.queryParams.subscribe(data => {
this.updateTitle("Content provider"); this.updateTitle("Content provider");
this.updateDescription(""); this.updateDescription("");
this.datasourceId = data['datasourceId']; this.datasourceId = data['datasourceId'];
if(this.datasourceId){ if (this.datasourceId) {
this.getDataProviderInfo(this.datasourceId); this.getDataProviderInfo(this.datasourceId);
} }
HelperFunctions.scroll(); HelperFunctions.scroll();
}); });
} }
ngOnDestroy() { private getPageContents() {
if(this.sub){ this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.sub.unsubscribe(); this.pageContents = contents;
} })
if(this.piwiksub){ }
this.piwiksub.unsubscribe();
} private getDivContents() {
if(this.subInfo) { 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.subInfo) {
this.subInfo.unsubscribe(); this.subInfo.unsubscribe();
} }
if(this.relatedDatasourcesSub) { if (this.relatedDatasourcesSub) {
this.relatedDatasourcesSub.unsubscribe(); this.relatedDatasourcesSub.unsubscribe();
} }
} }
private getDataProviderInfo(id:string) {
private getDataProviderInfo(id: string) {
this.warningMessage = ''; this.warningMessage = '';
this.errorMessage="" this.errorMessage = ""
this.showLoading = true; this.showLoading = true;
this.dataProviderInfo = null; this.dataProviderInfo = null;
this.showTabs = false ; this.showTabs = false;
if(this.datasourceId==null || this.datasourceId==''){ if (this.datasourceId == null || this.datasourceId == '') {
this.showLoading = false; this.showLoading = false;
this.warningMessage="No valid datasource id"; this.warningMessage = "No valid datasource id";
}else{ } else {
this.subInfo = this._dataproviderService.getDataproviderInfo(this.datasourceId, this.properties).subscribe( this.subInfo = this._dataproviderService.getDataproviderInfo(this.datasourceId, this.properties).subscribe(
data => { data => {
this.dataProviderInfo = data; this.dataProviderInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url);
if (typeof document !== 'undefined') { if (typeof document !== 'undefined') {
this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId); this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId);
} }
this.initTabs(); this.initTabs();
this.showTabs = true ; this.showTabs = true;
this.updateTitle(this.dataProviderInfo.title.name); this.updateTitle(this.dataProviderInfo.title.name);
this.updateDescription("Content provider, "+this.dataProviderInfo.title.name); this.updateDescription("Content provider, " + this.dataProviderInfo.title.name);
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.dataProviderInfo.title.name, this.piwikSiteId).subscribe(); this.piwiksub = this._piwikService.trackView(this.properties, this.dataProviderInfo.title.name, this.piwikSiteId).subscribe();
} }
this.showLoading = false; this.showLoading = false;
if(this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) { if (this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) {
this.activeTab = this.dataProviderInfo.tabs[0].name; this.activeTab = this.dataProviderInfo.tabs[0].name;
} }
}, },
err => { err => {
//console.log(err); //console.log(err);
this.handleError("Error getting content provider for id: "+this.datasourceId, err); this.handleError("Error getting content provider for id: " + this.datasourceId, err);
this.errorMessage = 'No dataProvider found'; this.errorMessage = 'No dataProvider found';
this.showLoading = false; this.showLoading = false;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDataProviders); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDataProviders);
} }
); );
} }
} }
private getDataProviderAggregationStatus(originalId: string) { private getDataProviderAggregationStatus(originalId: string) {
this.subInfo = this._dataproviderService.getDataproviderAggregationStatus(originalId, this.properties).subscribe( this.subInfo = this._dataproviderService.getDataproviderAggregationStatus(originalId, this.properties).subscribe(
data => { data => {
this.dataProviderInfo.aggregationStatus = data; this.dataProviderInfo.aggregationStatus = data;
}, },
err => { err => {
//console.log(err); //console.log(err);
this.handleError("Error getting content provider aggregation status for id: "+this.datasourceId, err); this.handleError("Error getting content provider aggregation status for id: " + this.datasourceId, err);
} }
); );
} }
private updateDescription(description:string) { private updateDescription(description: string) {
this._meta.updateTag({content:description},"name='description'"); this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content:description},"property='og:description'"); this._meta.updateTag({content: description}, "property='og:description'");
} }
private updateTitle(title:string) {
var _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'");
}
private initTabs(){ private updateTitle(title: string) {
var _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'");
}
if(this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) { private updateUrl(url: string) {
this.reloadPublications = true; this._meta.updateTag({content: url}, "property='og:url'");
this.reloadDatasets = true; }
this.reloadSoftware = true;
this.reloadOrps = true;
this.reloadProjects = true;
this.reloadDataproviders = true;
this.reloadRelatedDatasources = true;
this.statsClicked = false;
//this.search(this.dataProviderInfo.tabs[0].content, 1, 10); private initTabs() {
this.count(1, 0);
this.metricsClicked = false; if (this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) {
this.reloadPublications = true;
this.reloadDatasets = true;
this.reloadSoftware = true;
this.reloadOrps = true;
this.reloadProjects = true;
this.reloadDataproviders = true;
this.reloadRelatedDatasources = true;
this.statsClicked = false;
this.viewsFrameUrl = this.properties.framesAPIURL +'merge.php?com=query&data=[{"query":"dtsrcRepoViews","dtsrcName":"'+this.datasourceId+'","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":"","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&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.search(this.dataProviderInfo.tabs[0].content, 1, 10);
/*this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"dtsrcOpenAIRETimeline", "dtsrcName":"'+this.datasourceId+'", "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":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"dtsrcRepoTimeline", "dtsrcName":"'+this.datasourceId+'", "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":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","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'; this.count(1, 0);
*/
this.downloadsFrameUrl = this.properties.framesAPIURL +'merge.php?com=query&data=[{"query":"dtsrcRepoDownloads","dtsrcName":"'+this.datasourceId+'","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":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&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.metricsClicked = false;
/*
this.downloadsFrameUrl = this.properties.framesAPIURL +'merge.php?com=query&data=[{"query":"dtsrcDownloadsTimeline","dtsrcName":"'+this.datasourceId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"chart","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":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["spline"]&stacking=&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';
*/
this.docsTimelineUrl =this.properties.statisticsFrameAPIURL+'chart.php?com=query&persistent=false&data={"query":"dtsrcYear","dtsrcName":"'+this.datasourceId+'","table": "result", "fields": [{"fld": "number", "agg": "count", "type": "line", "yaxis":1, "c":true}], "xaxis":{"name": "year", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": -30, "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [{"f":0, "text": "Yearly"}], "filters": [{"name":"year","max":"2016","min":"1997"},{"name": "result_datasources-datasource-name", "values":[""], "to": "-1"}],"having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": "Year"}&w=100%&h=250'; this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"dtsrcRepoViews","dtsrcName":"' + this.datasourceId + '","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":"","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&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.docsTypesUrl = this.properties.statisticsFrameAPIURL+'chart.php?com=query&persistent=false&data={"query":"dtsrcPubs","dtsrcName":"'+this.datasourceId+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250'; /*this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"dtsrcOpenAIRETimeline", "dtsrcName":"'+this.datasourceId+'", "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":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"dtsrcRepoTimeline", "dtsrcName":"'+this.datasourceId+'", "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":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","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';
this.docsFunderUrl =this.properties.statisticsFrameAPIURL+'chart.php?com=query&persistent=false&data={"query":"dtsrcPubsFund","dtsrcName":"'+this.datasourceId+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250'; */
this.dataProjectsUrl =this.properties.statisticsFrameAPIURL+'chart.php?com=query&persistent=false&data={"query":"dtsrcProjData","dtsrcName":"'+this.datasourceId+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Data"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250';
this.pubsProjectsUrl =this.properties.statisticsFrameAPIURL+'chart.php?com=query&persistent=false&data={"query":"dtsrcProjPubs","dtsrcName":"'+this.datasourceId+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Publications"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250';
//if({"name": "Publications", "content": "publicationsTab"} in this.dataProviderInfo.tabs) { this.downloadsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"dtsrcRepoDownloads","dtsrcName":"' + this.datasourceId + '","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":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&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';
//if(this.dataProviderInfo.tabs.some(function (tab) { /*
// return tab.name === 'Publications'; this.downloadsFrameUrl = this.properties.framesAPIURL +'merge.php?com=query&data=[{"query":"dtsrcDownloadsTimeline","dtsrcName":"'+this.datasourceId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"chart","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":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["spline"]&stacking=&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';
//})) { */
// this.relatedDataprovidersResultsType = 'publications';
this.fetchAggregatorsPublications = new FetchPublications(this._searchPublicationsService);
//} else {
// this.relatedDataprovidersResultsType = 'datasets';
this.fetchAggregatorsDatasets = new FetchDatasets(this._searchDatasetsService);
//}
this.fetchAggregatorsSoftware = new FetchSoftware(this._searchSoftwareService);
this.fetchAggregatorsOrps = new FetchOrps(this._searchOrpsService);
}
if(this.dataProviderInfo.resultsBy == "collectedFrom") {
//this.paramsForSearchLink = "?collectedFrom="+this.datasourceId+"&co=and";
this.paramsForSearchLink = this.routerHelper.createQueryParams(['collectedFrom', 'cl'], [this.datasourceId, 'and']);
} else if (this.dataProviderInfo.resultsBy == "hostedBy") {
//this.paramsForSearchLink = "?hostedBy="+this.datasourceId+"&ho=and";
this.paramsForSearchLink = this.routerHelper.createQueryParams(['hostedBy', 'hs'], [this.datasourceId, 'and']);
}
} this.docsTimelineUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"dtsrcYear","dtsrcName":"' + this.datasourceId + '","table": "result", "fields": [{"fld": "number", "agg": "count", "type": "line", "yaxis":1, "c":true}], "xaxis":{"name": "year", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": -30, "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [{"f":0, "text": "Yearly"}], "filters": [{"name":"year","max":"2016","min":"1997"},{"name": "result_datasources-datasource-name", "values":[""], "to": "-1"}],"having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": "Year"}&w=100%&h=250';
this.docsTypesUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"dtsrcPubs","dtsrcName":"' + this.datasourceId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250';
this.docsFunderUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"dtsrcPubsFund","dtsrcName":"' + this.datasourceId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250';
this.dataProjectsUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"dtsrcProjData","dtsrcName":"' + this.datasourceId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Data"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250';
this.pubsProjectsUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"dtsrcProjPubs","dtsrcName":"' + this.datasourceId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Publications"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250';
private count(page: number, size: number) { //if({"name": "Publications", "content": "publicationsTab"} in this.dataProviderInfo.tabs) {
for(let i=0; i<this.dataProviderInfo.tabs.length; i++) { //if(this.dataProviderInfo.tabs.some(function (tab) {
let content: string = this.dataProviderInfo.tabs[i].content; // return tab.name === 'Publications';
//})) {
if(content=='publicationsTab') { // this.relatedDataprovidersResultsType = 'publications';
this.countPublications(page, size); this.fetchAggregatorsPublications = new FetchPublications(this._searchPublicationsService);
} else if(content=='datasetsTab') { //} else {
this.countDatasets(page, size); // this.relatedDataprovidersResultsType = 'datasets';
} else if(content=='softwareTab') { this.fetchAggregatorsDatasets = new FetchDatasets(this._searchDatasetsService);
this.countSoftware(page, size); //}
} else if(content=='orpsTab') { this.fetchAggregatorsSoftware = new FetchSoftware(this._searchSoftwareService);
this.countOrps(page, size); this.fetchAggregatorsOrps = new FetchOrps(this._searchOrpsService);
} else if(content=='projectsTab') { }
this.countProjects(page, size); if (this.dataProviderInfo.resultsBy == "collectedFrom") {
} else if(content=='datasourcesTab') { //this.paramsForSearchLink = "?collectedFrom="+this.datasourceId+"&co=and";
this.countDatasources(page, size); this.paramsForSearchLink = this.routerHelper.createQueryParams(['collectedFrom', 'cl'], [this.datasourceId, 'and']);
}// else if(content=='relatedDatasourcesTab') { } else if (this.dataProviderInfo.resultsBy == "hostedBy") {
// this.countRelatedDatasources(page, size); //this.paramsForSearchLink = "?hostedBy="+this.datasourceId+"&ho=and";
//} this.paramsForSearchLink = this.routerHelper.createQueryParams(['hostedBy', 'hs'], [this.datasourceId, 'and']);
}
}
public search(content: string, page: number, size: number) {
if(content=='publicationsTab') {
this.searchPublications(page, size);
} else if(content=='datasetsTab') {
this.searchDatasets(page, size);
} else if(content=='softwareTab') {
this.searchSoftware(page, size);
} else if(content=='orpsTab') {
this.searchOrps(page, size);
} else if(content=='projectsTab') {
this.searchProjects(page, size);
} else if(content=='datasourcesTab') {
this.searchDatasources(page, size);
} else if(content=='relatedDatasourcesTab') {
this.searchRelatedDatasources(1, 0);
} else if(content=='metricsTab') {
this.metricsClicked = true;
} else if(content=='statisticsTab') {
this.statsClicked = !this.statsClicked;
}
}
private searchPublications(page: number, size: number) {
if( this.reloadPublications &&
( this.fetchPublications.searchUtils.status == this.errorCodes.LOADING ||
this.fetchPublications.searchUtils.status == this.errorCodes.DONE ) ) {
this.fetchPublications.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
}
this.reloadPublications = false;
} }
private countPublications(page: number, size: number) { }
private count(page: number, size: number) {
for (let i = 0; i < this.dataProviderInfo.tabs.length; i++) {
let content: string = this.dataProviderInfo.tabs[i].content;
if (content == 'publicationsTab') {
this.countPublications(page, size);
} else if (content == 'datasetsTab') {
this.countDatasets(page, size);
} else if (content == 'softwareTab') {
this.countSoftware(page, size);
} else if (content == 'orpsTab') {
this.countOrps(page, size);
} else if (content == 'projectsTab') {
this.countProjects(page, size);
} else if (content == 'datasourcesTab') {
this.countDatasources(page, size);
}// else if(content=='relatedDatasourcesTab') {
// this.countRelatedDatasources(page, size);
//}
}
}
public search(content: string, page: number, size: number) {
if (content == 'publicationsTab') {
this.searchPublications(page, size);
} else if (content == 'datasetsTab') {
this.searchDatasets(page, size);
} else if (content == 'softwareTab') {
this.searchSoftware(page, size);
} else if (content == 'orpsTab') {
this.searchOrps(page, size);
} else if (content == 'projectsTab') {
this.searchProjects(page, size);
} else if (content == 'datasourcesTab') {
this.searchDatasources(page, size);
} else if (content == 'relatedDatasourcesTab') {
this.searchRelatedDatasources(1, 0);
} else if (content == 'metricsTab') {
this.metricsClicked = true;
} else if (content == 'statisticsTab') {
this.statsClicked = !this.statsClicked;
}
}
private searchPublications(page: number, size: number) {
if (this.reloadPublications &&
(this.fetchPublications.searchUtils.status == this.errorCodes.LOADING ||
this.fetchPublications.searchUtils.status == this.errorCodes.DONE)) {
this.fetchPublications.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties); this.fetchPublications.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
} }
this.reloadPublications = false;
}
private searchDatasets(page: number, size: number) { private countPublications(page: number, size: number) {
if( this.reloadDatasets && this.fetchPublications.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
( this.fetchDatasets.searchUtils.status == this.errorCodes.LOADING || }
this.fetchDatasets.searchUtils.status == this.errorCodes.DONE ) ) {
this.fetchDatasets.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
}
this.reloadDatasets = false;
}
private countDatasets(page: number, size: number) { private searchDatasets(page: number, size: number) {
if (this.reloadDatasets &&
(this.fetchDatasets.searchUtils.status == this.errorCodes.LOADING ||
this.fetchDatasets.searchUtils.status == this.errorCodes.DONE)) {
this.fetchDatasets.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties); this.fetchDatasets.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
} }
this.reloadDatasets = false;
}
private searchSoftware(page: number, size: number) { private countDatasets(page: number, size: number) {
if( this.reloadSoftware && this.fetchDatasets.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
( this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING || }
this.fetchSoftware.searchUtils.status == this.errorCodes.DONE ) ) {
this.fetchSoftware.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
}
this.reloadSoftware = false;
}
private countSoftware(page: number, size: number) { private searchSoftware(page: number, size: number) {
if (this.reloadSoftware &&
(this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING ||
this.fetchSoftware.searchUtils.status == this.errorCodes.DONE)) {
this.fetchSoftware.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties); this.fetchSoftware.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
} }
this.reloadSoftware = false;
}
private searchOrps(page: number, size: number) { private countSoftware(page: number, size: number) {
if( this.reloadOrps && this.fetchSoftware.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
( this.fetchOrps.searchUtils.status == this.errorCodes.LOADING || }
this.fetchOrps.searchUtils.status == this.errorCodes.DONE ) ) {
this.fetchOrps.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
}
this.reloadOrps = false;
}
private countOrps(page: number, size: number) { private searchOrps(page: number, size: number) {
if (this.reloadOrps &&
(this.fetchOrps.searchUtils.status == this.errorCodes.LOADING ||
this.fetchOrps.searchUtils.status == this.errorCodes.DONE)) {
this.fetchOrps.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties); this.fetchOrps.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
} }
this.reloadOrps = false;
}
private searchProjects(page: number, size: number) { private countOrps(page: number, size: number) {
if( this.reloadProjects && this.fetchOrps.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
( this.fetchProjects.searchUtils.status == this.errorCodes.LOADING || }
this.fetchProjects.searchUtils.status == this.errorCodes.DONE ) ) {
this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
}
this.reloadProjects = false;
}
private countProjects(page: number, size: number) { private searchProjects(page: number, size: number) {
if (this.reloadProjects &&
(this.fetchProjects.searchUtils.status == this.errorCodes.LOADING ||
this.fetchProjects.searchUtils.status == this.errorCodes.DONE)) {
this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size, this.properties); this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
} }
this.reloadProjects = false;
}
private searchDatasources(page: number, size: number) { private countProjects(page: number, size: number) {
if( this.reloadDataproviders && this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
( this.fetchDataproviders.searchUtils.status == this.errorCodes.LOADING || }
this.fetchDataproviders.searchUtils.status == this.errorCodes.DONE ) ) {
this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
}
this.reloadDataproviders = false;
}
private countDatasources(page: number, size: number) { private searchDatasources(page: number, size: number) {
if (this.reloadDataproviders &&
(this.fetchDataproviders.searchUtils.status == this.errorCodes.LOADING ||
this.fetchDataproviders.searchUtils.status == this.errorCodes.DONE)) {
this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size, this.properties); this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
} }
this.reloadDataproviders = false;
}
private searchRelatedDatasources(page: number, size: number) { private countDatasources(page: number, size: number) {
// Currently no counting is done for this tab. Following condition is always false this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
}
if( this.reloadRelatedDatasources && private searchRelatedDatasources(page: number, size: number) {
( this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.LOADING || // Currently no counting is done for this tab. Following condition is always false
this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE )
&&
( this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.LOADING ||
this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE )
&&
( this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.LOADING ||
this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.DONE )
&&
( this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.LOADING ||
this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.DONE )) {
this.relatedDatasourcesSub = observableMerge(this.fetchAggregatorsPublications.requestComplete, this.fetchAggregatorsDatasets.requestComplete, this.fetchAggregatorsSoftware.requestComplete, this.fetchAggregatorsOrps.requestComplete)
.subscribe(
data => {},
err => {},
() => { this.preprocessRelatedDatasources(); }
)
this.fetchAggregatorsPublications.getAggregatorResults(this.datasourceId, page, size, this.properties); if (this.reloadRelatedDatasources &&
this.fetchAggregatorsDatasets.getAggregatorResults(this.datasourceId, page, size, this.properties); (this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.LOADING ||
this.fetchAggregatorsSoftware.getAggregatorResults(this.datasourceId, page, size, this.properties); this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE)
this.fetchAggregatorsOrps.getAggregatorResults(this.datasourceId, page, size, this.properties); &&
} else { (this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.LOADING ||
this.loadingRelatedDatasources = false; this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE)
} &&
(this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.LOADING ||
this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.DONE)
&&
(this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.LOADING ||
this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.DONE)) {
this.relatedDatasourcesSub = observableMerge(this.fetchAggregatorsPublications.requestComplete, this.fetchAggregatorsDatasets.requestComplete, this.fetchAggregatorsSoftware.requestComplete, this.fetchAggregatorsOrps.requestComplete)
.subscribe(
data => {
},
err => {
},
() => {
this.preprocessRelatedDatasources();
}
)
this.reloadRelatedDatasources = false;
}
private countRelatedDatasources(page: number, size: number) {
this.fetchAggregatorsPublications.getAggregatorResults(this.datasourceId, page, size, this.properties); this.fetchAggregatorsPublications.getAggregatorResults(this.datasourceId, page, size, this.properties);
this.fetchAggregatorsDatasets.getAggregatorResults(this.datasourceId, page, size, this.properties); this.fetchAggregatorsDatasets.getAggregatorResults(this.datasourceId, page, size, this.properties);
this.fetchAggregatorsSoftware.getAggregatorResults(this.datasourceId, page, size, this.properties); this.fetchAggregatorsSoftware.getAggregatorResults(this.datasourceId, page, size, this.properties);
this.fetchAggregatorsOrps.getAggregatorResults(this.datasourceId, page, size, this.properties); this.fetchAggregatorsOrps.getAggregatorResults(this.datasourceId, page, size, this.properties);
} } else {
private preprocessRelatedDatasources() {
if( this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE ||
this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE ||
this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.DONE ||
this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.DONE ) {
this.dataProviderInfo.relatedDatasources = new Map<string, {"name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string}>();
}
for(let result of this.fetchAggregatorsPublications.results) {
if(!this.dataProviderInfo.relatedDatasources.has(result.id)) {
this.dataProviderInfo.relatedDatasources.set(result.id, {"name": result.name, "countPublications": result.count, "countDatasets": "0", "countSoftware": "0", "countOrps": "0"});
} else {
this.dataProviderInfo.relatedDatasources.get(result.id).countPublications = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countPublications + result.count)+"";
}
}
for(let result of this.fetchAggregatorsDatasets.results) {
if(!this.dataProviderInfo.relatedDatasources.has(result.id)) {
this.dataProviderInfo.relatedDatasources.set(result.id, {"name": result.name, "countPublications": "0", "countDatasets": result.count, "countSoftware": "0", "countOrps": "0"});
} else {
this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets + result.count)+"";
}
}
for(let result of this.fetchAggregatorsSoftware.results) {
if(!this.dataProviderInfo.relatedDatasources.has(result.id)) {
this.dataProviderInfo.relatedDatasources.set(result.id, {"name": result.name, "countPublications": "0", "countDatasets": "0", "countSoftware": result.count, "countOrps": "0"});
} else {
this.dataProviderInfo.relatedDatasources.get(result.id).countSoftware = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countSoftware + result.count)+"";
}
}
for(let result of this.fetchAggregatorsOrps.results) {
if(!this.dataProviderInfo.relatedDatasources.has(result.id)) {
this.dataProviderInfo.relatedDatasources.set(result.id, {"name": result.name, "countPublications": "0", "countDatasets": "0", "countSoftware": "0", "countOrps": result.count});
} else {
this.dataProviderInfo.relatedDatasources.get(result.id).countOrps = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countOrps + result.count)+"";
}
}
this.loadingRelatedDatasources = false; this.loadingRelatedDatasources = false;
} }
public metricsResults($event) {
this.totalViews = $event.totalViews; this.reloadRelatedDatasources = false;
this.totalDownloads = $event.totalDownloads; }
this.pageViews = $event.pageViews;
private countRelatedDatasources(page: number, size: number) {
this.fetchAggregatorsPublications.getAggregatorResults(this.datasourceId, page, size, this.properties);
this.fetchAggregatorsDatasets.getAggregatorResults(this.datasourceId, page, size, this.properties);
this.fetchAggregatorsSoftware.getAggregatorResults(this.datasourceId, page, size, this.properties);
this.fetchAggregatorsOrps.getAggregatorResults(this.datasourceId, page, size, this.properties);
}
private preprocessRelatedDatasources() {
if (this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE ||
this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE ||
this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.DONE ||
this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.DONE) {
this.dataProviderInfo.relatedDatasources = new Map<string, { "name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string }>();
}
for (let result of this.fetchAggregatorsPublications.results) {
if (!this.dataProviderInfo.relatedDatasources.has(result.id)) {
this.dataProviderInfo.relatedDatasources.set(result.id, {
"name": result.name,
"countPublications": result.count,
"countDatasets": "0",
"countSoftware": "0",
"countOrps": "0"
});
} else {
this.dataProviderInfo.relatedDatasources.get(result.id).countPublications = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countPublications + result.count) + "";
}
} }
private handleError(message: string, error) { for (let result of this.fetchAggregatorsDatasets.results) {
console.error("Content Provider Landing Page: "+message, error); if (!this.dataProviderInfo.relatedDatasources.has(result.id)) {
this.dataProviderInfo.relatedDatasources.set(result.id, {
"name": result.name,
"countPublications": "0",
"countDatasets": result.count,
"countSoftware": "0",
"countOrps": "0"
});
} else {
this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets + result.count) + "";
}
} }
for (let result of this.fetchAggregatorsSoftware.results) {
if (!this.dataProviderInfo.relatedDatasources.has(result.id)) {
this.dataProviderInfo.relatedDatasources.set(result.id, {
"name": result.name,
"countPublications": "0",
"countDatasets": "0",
"countSoftware": result.count,
"countOrps": "0"
});
} else {
this.dataProviderInfo.relatedDatasources.get(result.id).countSoftware = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countSoftware + result.count) + "";
}
}
for (let result of this.fetchAggregatorsOrps.results) {
if (!this.dataProviderInfo.relatedDatasources.has(result.id)) {
this.dataProviderInfo.relatedDatasources.set(result.id, {
"name": result.name,
"countPublications": "0",
"countDatasets": "0",
"countSoftware": "0",
"countOrps": result.count
});
} else {
this.dataProviderInfo.relatedDatasources.get(result.id).countOrps = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countOrps + result.count) + "";
}
}
this.loadingRelatedDatasources = false;
}
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
}
private handleError(message: string, error) {
console.error("Content Provider Landing Page: " + message, error);
}
} }

View File

@ -31,19 +31,19 @@ import {PublicationsServiceModule} from '../../services/publicationsService.modu
import {SoftwareServiceModule} from '../../services/softwareService.module'; import {SoftwareServiceModule} from '../../services/softwareService.module';
import {OrpsServiceModule} from '../../services/orpsService.module'; import {OrpsServiceModule} from '../../services/orpsService.module';
// import { DataProviderRoutingModule } from './dataProvider-routing.module';
import {FreeGuard} from'../../login/freeGuard.guard'; import {FreeGuard} from'../../login/freeGuard.guard';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {ShowPublisherModule} from "../landing-utils/showPublisher.module"; import {ShowPublisherModule} from "../landing-utils/showPublisher.module";
import {HelperModule} from "../../utils/helper/helper.module";
@NgModule({ @NgModule({
imports: imports:
[CommonModule, FormsModule, RouterModule, [CommonModule, FormsModule, RouterModule,
TabResultModule, IFrameModule, ErrorMessagesModule, MetricsModule, LandingModule, TabResultModule, IFrameModule, ErrorMessagesModule, MetricsModule, LandingModule,
DataProvidersServiceModule, DatasetsServiceModule, ProjectsServiceModule, PublicationsServiceModule, DataProvidersServiceModule, DatasetsServiceModule, ProjectsServiceModule, PublicationsServiceModule,
SoftwareServiceModule, OrpsServiceModule, PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule], SoftwareServiceModule, OrpsServiceModule, PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule, HelperModule],
declarations: declarations:
[PublicationsTabComponent, DatasetsTabComponent, StatisticsTabComponent, ProjectsTabComponent, DatasourcesTabComponent, OrganizationsTabComponent, [PublicationsTabComponent, DatasetsTabComponent, StatisticsTabComponent, ProjectsTabComponent, DatasourcesTabComponent, OrganizationsTabComponent,
RelatedDatasourcesTabComponent, DataProviderComponent, SoftwareTabComponent, OrpsTabComponent RelatedDatasourcesTabComponent, DataProviderComponent, SoftwareTabComponent, OrpsTabComponent

View File

@ -1,29 +1,39 @@
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" > <div id="tm-main" class=" uk-section uk-margin-small-top tm-middle">
<div uk-grid uk-grid> <div uk-grid 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="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container uk-margin-top dataset">
<div class="uk-container uk-margin-top dataset"> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
role="alert">{{warningMessage}}</div>
<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"
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div> 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> <div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
<div *ngIf="datasetInfo != null" uk-grid class="uk-grid-large"> class="loading-gif uk-align-center"></span></div>
<div class="uk-width-expand@m uk-width-1-1@s"> <div *ngIf="datasetInfo != null" uk-grid>
<schema2jsonld *ngIf="datasetInfo.record" [data]=datasetInfo.record [URL]="properties.baseLink+'/search/dataset?datasetId='+datasetId"></schema2jsonld> <helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
<showTitle [titleName]="datasetInfo.title"></showTitle> [texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div class="uk-width-expand@m uk-width-1-1@s">
<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"> <p class="uk-text-large" *ngIf="datasetInfo.subtitle">
<span [innerHTML]="datasetInfo.subtitle"></span> <span [innerHTML]="datasetInfo.subtitle"></span>
</p> </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.types && datasetInfo.types.length > 0" class="uk-label custom-label label-dataset "
<span *ngIf="datasetInfo.languages && datasetInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{datasetInfo.languages.join(", ")}}</span>{{" "}} title="Type">{{datasetInfo.types.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.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.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.accessMode" [class]="'uk-label custom-label label-'+ datasetInfo.accessMode "
<span *ngIf="datasetInfo.underCurationMessage" class="uk-label custom-label label-underCuration " >{{" "}} title="Access Mode">{{datasetInfo.accessMode}}</span>{{" "}}
<span *ngIf="datasetInfo.underCurationMessage" class="uk-label custom-label label-underCuration ">{{" "}}
<span uk-tooltip="pos:right; delay:10" <span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}"> title="{{buildCurationTooltip()}}">
<i>Record in preview</i> <i>Record in preview</i>
<i class="uk-icon-info-circle"></i> <i class="uk-icon-info-circle"></i>
</span></span> </span></span>
@ -35,36 +45,42 @@
</span> </span>
</div--> </div-->
<div class= " uk-margin-top"> <div class=" uk-margin-top">
<showAuthors [authors]="datasetInfo.authors"></showAuthors> <showAuthors [authors]="datasetInfo.authors"></showAuthors>
<span *ngIf="datasetInfo.date != ''">({{datasetInfo.date}})</span> <span *ngIf="datasetInfo.date != ''">({{datasetInfo.date}})</span>
</div> </div>
<ul class="uk-list"> <ul class="uk-list">
<showPublisher [publisher]="datasetInfo.publisher" <showPublisher [publisher]="datasetInfo.publisher"
[journal]="datasetInfo.journal" [properties]="properties"></showPublisher> [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.embargoEndDate"><span
<li *ngIf="datasetInfo.identifiers && datasetInfo.identifiers.size > 0"> class="uk-text-bold">Embargo end date:</span> {{datasetInfo.embargoEndDate}}</li>
<showIdentifiers [identifiers]="datasetInfo.identifiers"></showIdentifiers> <li *ngIf="datasetInfo.identifiers && datasetInfo.identifiers.size > 0">
</li> <showIdentifiers [identifiers]="datasetInfo.identifiers"></showIdentifiers>
<li *ngIf="datasetInfo.subjects ||datasetInfo.otherSubjects || datasetInfo.classifiedSubjects"> </li>
<showSubjects [subjects]="datasetInfo.subjects" <li *ngIf="datasetInfo.subjects ||datasetInfo.otherSubjects || datasetInfo.classifiedSubjects">
[otherSubjects]="datasetInfo.otherSubjects" <showSubjects [subjects]="datasetInfo.subjects"
[classifiedSubjects]="datasetInfo.classifiedSubjects"> [otherSubjects]="datasetInfo.otherSubjects"
[classifiedSubjects]="datasetInfo.classifiedSubjects">
</showSubjects> </showSubjects>
</li> </li>
</ul> </ul>
<hr *ngIf="datasetInfo.description" > <hr *ngIf="datasetInfo.description">
<div *ngIf="datasetInfo.description" class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto"> <div *ngIf="datasetInfo.description"
class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<span>{{datasetInfo.description.substring(0, showNumDescription)}}</span <span>{{datasetInfo.description.substring(0, showNumDescription)}}</span
><span *ngIf="showNumDescription == thresholdDescription && datasetInfo.description.length > thresholdDescription">...</span ><span
><span *ngIf="showNumDescription == thresholdDescription && datasetInfo.description.length > thresholdDescription" class="uk-text-right"> *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;"> <a (click)="showNumDescription = datasetInfo.description.length;">
View more View more
</a> </a>
</span> </span>
</div> </div>
<div *ngIf="datasetInfo.description && showNumDescription > thresholdDescription" class="uk-width-1-1 uk-text-right"> <div *ngIf="datasetInfo.description && showNumDescription > thresholdDescription"
class="uk-width-1-1 uk-text-right">
<a (click)="showNumDescription = thresholdDescription;"> <a (click)="showNumDescription = thresholdDescription;">
View less View less
</a> </a>
@ -94,146 +110,156 @@
<ul class="custom-accordion" uk-accordion> <ul class="custom-accordion" uk-accordion>
<li *ngIf="datasetInfo.references" (click)="activeTab='References'"> <li *ngIf="datasetInfo.references" (click)="activeTab='References'">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
References ({{datasetInfo.references.length | number}}) References ({{datasetInfo.references.length | number}})
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<div> <div>
<div *ngIf="datasetInfo.references.length > pageSize" class="uk-margin-bottom"> <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> <span class="uk-h6">{{datasetInfo.references.length | number}}
<paging-no-load class="uk-float-right" [currentPage]="referencesPage" [totalResults]="datasetInfo.references.length" [size]="pageSize" (pageChange)="updateReferencesPage($event)"></paging-no-load> references, page {{referencesPage | number}}
</div> 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)"> <div
<p *ngIf=" item && item['url']" *ngFor="let item of datasetInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
class="custom-external custom-icon"> <p *ngIf=" item && item['url']"
<a href="{{item['url']}}" target="_blank"> class="custom-external custom-icon">
{{item['name']}} <a href="{{item['url']}}" target="_blank">
</a> {{item['name']}}
</p> </a>
<p *ngIf="!item['url']" class="pseudo-external custom-icon"> </p>
{{item['name']}} <p *ngIf="!item['url']" class="pseudo-external custom-icon">
</p> {{item['name']}}
</div> </p>
</div> </div>
</div> </div>
</li> </div>
</li>
<li *ngIf="datasetInfo.relatedResearchResults" (click)="activeTab='Related Research Results'"> <li *ngIf="datasetInfo.relatedResearchResults" (click)="activeTab='Related Research Results'">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Related Research Results 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">0</span>
<span *ngIf="datasetInfo.relatedResearchResults" class="uk-badge uk-badge-notification"> <span *ngIf="datasetInfo.relatedResearchResults" class="uk-badge uk-badge-notification">
{{relatedResearchResultsNum | number}} {{relatedResearchResultsNum | number}}
</span> --> </span> -->
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{relatedResearchResultsNum | number}}) ({{relatedResearchResultsNum | number}})
<!-- </span> --> <!-- </span> -->
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<!-- <div *ngIf="!datasetInfo.relatedResearchResults" class = "uk-alert uk-alert-primary"> <!-- <div *ngIf="!datasetInfo.relatedResearchResults" class = "uk-alert uk-alert-primary">
No related research results available No related research results available
</div> </div>
<div *ngIf="datasetInfo.relatedResearchResults"> --> <div *ngIf="datasetInfo.relatedResearchResults"> -->
<div> <div>
<div *ngFor="let provenanceaction of getKeys(datasetInfo.relatedResearchResults)"> <div *ngFor="let provenanceaction of getKeys(datasetInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div> <div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [percentageName]="trust" [info]="datasetInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable> <tabTable [percentageName]="trust"
</div> [info]="datasetInfo.relatedResearchResults.get(provenanceaction)"
</div> [(properties)]=properties></tabTable>
</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> </div>
</li> </div>
</div>
</li>
<li (click)="metricsClicked=true; activeTab='Metrics'"> <li *ngIf="datasetInfo.similarResearchResults" (click)="activeTab='Similar Research Results'">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Metrics Similar Research Results
</a> <!-- <span *ngIf="!datasetInfo.similarResearchResults" class="uk-badge uk-badge-notification">0</span>
<div class="uk-accordion-content"> <span *ngIf="datasetInfo.similarResearchResults" class="uk-badge uk-badge-notification">
<metrics [pageViews]="pageViews" {{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'" [id]="datasetId" [entityType]="'results'" [entity]="'Research Data'"
(metricsResults)="metricsResults($event)" [(properties)] = properties> (metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics> </metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0" <i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250"> [url]=viewsFrameUrl width="100%" height="250">
</i-frame> </i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads > 0" <i-frame *ngIf="metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250"> [url]=downloadsFrameUrl width="100%" height="250">
</i-frame> </i-frame>
</div> </div>
</li> </li>
<li (click)="activeTab='Other Versions'" *ngIf="properties.environment == 'development' && datasetInfo.deletedByInferenceIds"> <li (click)="activeTab='Other Versions'"
<a class="uk-accordion-title" href="#"> *ngIf="properties.environment == 'development' && datasetInfo.deletedByInferenceIds">
Other Versions <a class="uk-accordion-title" href="#">
({{datasetInfo.deletedByInferenceIds.length | number}}) Other Versions
</a> ({{datasetInfo.deletedByInferenceIds.length | number}})
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content"> </a>
<deletedByInference [id]="datasetId" [ids]="datasetInfo.deletedByInferenceIds" [type]="'research data'"></deletedByInference> <div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
</div> <deletedByInference [id]="datasetId" [ids]="datasetInfo.deletedByInferenceIds"
</li> [type]="'research data'"></deletedByInference>
</div>
</li>
</ul> </ul>
</div>
<div class="uk-width-large@m uk-width-1-1@s">
<div class=" uk-padding-small">
<div >
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis></addThis>
</div> </div>
<altmetrics *ngIf="datasetInfo.identifiers && datasetInfo.identifiers.get('doi')"
id="{{datasetInfo.identifiers.get('doi')[0]}}" type="doi"> <div class="uk-width-large@m uk-width-1-1@s">
</altmetrics > <div class=" uk-padding-small">
<ul class="uk-list uk-margin-remove-bottom "> <div>
<div class="sideInfoTitle uk-margin-small-bottom">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"> <li *ngIf="datasetInfo.hostedBy_collectedFrom && datasetInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="datasetInfo.hostedBy_collectedFrom"></availableOn> <availableOn [availableOn]="datasetInfo.hostedBy_collectedFrom"></availableOn>
</li> </li>
<li *ngIf="datasetInfo.fundedByProjects != undefined && datasetInfo.fundedByProjects.length > 0"> <li *ngIf="datasetInfo.fundedByProjects != undefined && datasetInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="datasetInfo.fundedByProjects"></fundedBy> <fundedBy [fundedByProjects]="datasetInfo.fundedByProjects"></fundedBy>
</li> </li>
<li *ngIf="datasetInfo.contexts && datasetInfo.contexts.length >0 "> <li *ngIf="datasetInfo.contexts && datasetInfo.contexts.length >0 ">
<dl class="uk-description-list-line" > <dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to </dt> <dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of datasetInfo.contexts"> <dd class="line" *ngFor="let item of datasetInfo.contexts">
<span *ngIf = "!item['inline']" > <span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span> <span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span> <span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span> </span>
<mark *ngIf = "item['inline']" > <mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span> <span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span> <span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark> </mark>
</dd> </dd>
</dl> </dl>
</li> </li>
@ -255,41 +281,71 @@
</li> </li>
</ul> </ul>
<button *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-button portal-button uk-width-1-1 "> <button *ngIf="isRouteAvailable('participate/direct-claim') "
class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon"> <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> <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... </span> Link this dataset to...
</button> </button>
<div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;"> <div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click"
<ul class="uk-iconnav uk-iconnav-vertical"> style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>"> <ul class="uk-iconnav uk-iconnav-vertical">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>">
<span class="uk-icon" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album" ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span> [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','project'])"
</a> routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
</li> <span class="uk-icon">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>"> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album"
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14"
<span class="uk-icon" > height="1"></rect><rect
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="users" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1" 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"></path><path fill="none" stroke="#000" stroke-width="1.1" 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"></path></svg></span> fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
</a> </a>
</li> </li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>"> <li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
<span class="uk-icon" > [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','context'])"
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span> routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
</a> <span class="uk-icon">
</li> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
icon="users" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7"
cy="8.6" r="3.5"></circle><path fill="none" stroke="#000"
stroke-width="1.1"
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"></path><path
fill="none" stroke="#000" stroke-width="1.1"
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"></path></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;"
title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy"
ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline
fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
</ul> </ul>
</div>
</div>
</div> </div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div>
</div> </div>

View File

@ -1,231 +1,262 @@
import {Component, ViewChild} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Input} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router';
import {ActivatedRoute, Router} from '@angular/router'; import {Meta, Title} from '@angular/platform-browser';
import {Title, Meta} from '@angular/platform-browser';
import {Observable} from 'rxjs'; import {DatasetInfo} from '../../utils/entities/datasetInfo';
import {EnvProperties} from '../../utils/properties/env-properties';
import {RouterHelper} from '../../utils/routerHelper.class';
import {DatasetInfo} from '../../utils/entities/datasetInfo'; import {DatasetService} from './dataset.service';
import {EnvProperties} from '../../utils/properties/env-properties'; import {PiwikService} from '../../utils/piwik/piwik.service';
import {RouterHelper} from '../../utils/routerHelper.class'; import {SEOService} from '../../sharedComponents/SEO/SEO.service';
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 {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({ @Component({
selector: 'dataset', selector: 'dataset',
templateUrl: 'dataset.component.html', templateUrl: 'dataset.component.html',
}) })
export class DatasetComponent { export class DatasetComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
public datasetInfo: DatasetInfo; @Input() communityId = null;
public datasetId : string ; public datasetInfo: DatasetInfo;
public datasetId: string;
// APP BOX variables // APP BOX variables
public showAllCollectedFrom: boolean = false; public showAllCollectedFrom: boolean = false;
public showAllDownloadFrom: boolean = false; public showAllDownloadFrom: boolean = false;
public showAllPublishedIn: boolean = false; public showAllPublishedIn: boolean = false;
public thresholdDescription: number = 270; public thresholdDescription: number = 270;
public showNumDescription: 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 // Metrics tab variables
public referencesPage: number = 1; public metricsClicked: boolean;
public pageSize: number = 10; public viewsFrameUrl: string;
public downloadsFrameUrl: string;
public totalViews: number;
public totalDownloads: number;
public pageViews: number;
// Active tab variable for responsiveness // Custom tab paging variables
public activeTab: string = "References"; public referencesPage: number = 1;
public pageSize: number = 10;
// Map counting variable // Active tab variable for responsiveness
public relatedResearchResultsNum: number = 0; public activeTab: string = "References";
// Message variables // Map counting variable
public warningMessage = ""; public relatedResearchResultsNum: number = 0;
public errorMessage = "";
public showLoading: boolean = true;
public routerHelper:RouterHelper = new RouterHelper(); // Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
public pageContents = null;
public divContents = null;
private result ; public routerHelper: RouterHelper = new RouterHelper();
sub: any; piwiksub: any; infoSub: any;
properties:EnvProperties;
constructor (private _datasetService: DatasetService, private result;
private _piwikService:PiwikService, sub: any;
private route: ActivatedRoute, piwiksub: any;
private router: Router, infoSub: any;
private _meta: Meta, properties: EnvProperties;
private _title: Title,
private _router: Router,
private seoService: SEOService) {
}
ngOnInit() { constructor(private _datasetService: DatasetService,
this.route.data private _piwikService: PiwikService,
.subscribe((data: { envSpecific: EnvProperties }) => { private route: ActivatedRoute,
this.properties = data.envSpecific; private router: Router,
this.updateUrl(data.envSpecific.baseLink+this._router.url); private _meta: Meta,
private _title: Title,
private _router: Router,
private seoService: SEOService,
private helper: HelperService) {
}
}); ngOnInit() {
this.sub = this.route.queryParams.subscribe(params => { this.route.data
this.datasetInfo = null; .subscribe((data: { envSpecific: EnvProperties }) => {
this.updateTitle("Dataset"); this.properties = data.envSpecific;
this.updateDescription(""); //this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
this.datasetId = params['datasetId']; });
this.sub = this.route.queryParams.subscribe(params => {
this.datasetInfo = null;
this.updateTitle("Dataset");
this.updateDescription("");
if(this.datasetId){ this.datasetId = params['datasetId'];
this.getDatasetInfo(this.datasetId);
}else{
this.showLoading = false;
this.warningMessage="No valid research data id";
}
this.metricsClicked = false; if (this.datasetId) {
this.getDatasetInfo(this.datasetId);
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'; } else {
/*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.showLoading = false;
*/ this.warningMessage = "No valid research data id";
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();
});
}
ngOnDestroy() {
if(this.sub){
this.sub.unsubscribe();
} }
if(this.piwiksub){
this.piwiksub.unsubscribe(); this.metricsClicked = false;
}
if(this.infoSub) { 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.infoSub.unsubscribe(); /*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 = "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;
}
private getDatasetInfo(id:string) { public scroll() {
this.warningMessage = ''; HelperFunctions.scroll();
this.errorMessage="" }
this.showLoading = true;
this.datasetInfo = null; isRouteAvailable(routeToCheck: string) {
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 ="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++) { for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path; let routePath: string = this.router.config[i].path;
if(routePath == routeToCheck){ if (routePath == routeToCheck) {
return true; return true;
} }
} }

View File

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

View File

@ -1,278 +1,305 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {ActivatedRoute, Params, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser'; import {Meta, Title} from '@angular/platform-browser';
import {Observable} from 'rxjs'; import {EnvProperties} from '../../utils/properties/env-properties';
import {EnvProperties} from '../../utils/properties/env-properties'; import {HtmlProjectReportService} from './htmlProjectReport.service';
import {ProjectService} from '../project/project.service';
import {HtmlProjectReportService} from './htmlProjectReport.service'; import {PiwikService} from '../../utils/piwik/piwik.service';
import {ProjectService} from '../project/project.service'; import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {PiwikService} from '../../utils/piwik/piwik.service'; import {HelperService} from "../../utils/helper/helper.service";
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
declare var UIkit: any; declare var UIkit: any;
@Component({ @Component({
selector: 'htmlProjectReport', selector: 'htmlProjectReport',
template: ` template: `
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" > <div id="tm-main" class=" uk-section uk-margin-small-top tm-middle">
<div uk-grid uk-grid> <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="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div class="uk-container uk-margin-top uk-width-1-1">
<div *ngIf="warningMessage" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</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>
<div class="uk-container uk-margin-top"> <div *ngIf="!showLoading && !warningMessage">
<div *ngIf="warningMessage" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div> <h1 *ngIf="header1">{{header1}}</h1>
<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> <h2 *ngIf="header1 || htmlResult">{{header2}}</h2>
<div *ngIf="!showLoading && !warningMessage"> <div class="uk-clearfix uk-margin-bottom">
<h1 *ngIf="header1">{{header1}}</h1> <button *ngIf="htmlResult" class="uk-icon-clipboard uk-button uk-button-primary clipBtn uk-float-right"
<h2 *ngIf="header1 || htmlResult">{{header2}}</h2> (click)="copied()">
<div class="uk-clearfix uk-margin-bottom">
<button *ngIf="htmlResult" class="uk-icon-clipboard uk-button uk-button-primary clipBtn uk-float-right" (click)="copied()">
Copy to clipboard Copy to clipboard
</button> </button>
</div> </div>
<!--div class="uk-panel-scrollable custom-html-table-height" *ngIf="htmlResult" id="clipboard" [innerHTML]="htmlResult"></div--> <!--div class="uk-panel-scrollable custom-html-table-height" *ngIf="htmlResult" id="clipboard" [innerHTML]="htmlResult"></div-->
<div class="uk-overflow-auto custom-html-table-height" *ngIf="htmlResult" id="clipboard" [innerHTML]="htmlResult"></div> <div class="uk-overflow-auto custom-html-table-height" *ngIf="htmlResult" id="clipboard"
[innerHTML]="htmlResult"></div>
<div *ngIf="errorMessage" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div> <div *ngIf="errorMessage" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div>
</div>
</div> </div>
</div> <helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div>
</div> </div>
</div> </div>
</div>
` `
}) })
export class HtmlProjectReportComponent{ export class HtmlProjectReportComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
private projectId: string; @Input() communityId = null;
private totalResults: number = 10; private projectId: string;
private resultsType: string = "publication"; private totalResults: number = 10;
private resultsType: string = "publication";
public header1: string = ""; public header1: string = "";
public header2: string = ""; public header2: string = "";
public htmlResult: string = ""; public htmlResult: string = "";
public sub: any; piwiksub: any; public sub: any;
public subHTML: any; piwiksub: any;
public subHTMLInfo: any; public subHTML: any;
public subHTMLInfo: any;
public warningMessage: string = ""; public warningMessage: string = "";
public errorMessage: string = ""; public errorMessage: string = "";
public showLoading: boolean = true; public showLoading: boolean = true;
properties:EnvProperties; properties: EnvProperties;
public pageContents = null;
public divContents = null;
constructor ( private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private htmlService: HtmlProjectReportService, private htmlService: HtmlProjectReportService,
private _piwikService:PiwikService, private _piwikService: PiwikService,
private _projectService: ProjectService, private _projectService: ProjectService,
private _meta: Meta, private _meta: Meta,
private _title: Title, private _title: Title,
private _router: Router, private _router: Router,
private seoService: SEOService) { private helper: HelperService,
} private seoService: SEOService) {
}
ngOnInit() { ngOnInit() {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url); //this.getDivContents();
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url); this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url);
});
this.sub = this.route.queryParams.subscribe(params => {
this.projectId = params['projectId'];
if (params['size'] == parseInt(params['size'], 10)) {
this.totalResults = params['size'];
} else {
this.showLoading = false;
this.warningMessage="Requested size is not an integer";
}
if(params['type'] && (params['type'] == "publication" || params['type'] == "dataset" || params['type'] == "software" || params['type'] == "other")){
if(params['type'] == "publication") {
this.resultsType = 'publication';
} else if(params['type'] == "dataset") {
this.resultsType = 'research data';
} else if(params['type'] == "software") {
this.resultsType = 'software';
} else if(params['type'] == "other") {
this.resultsType = "other research product";
}
var title = "Project's "+this.resultsType+" report";
var description = "project, project "+ this.resultsType +" report, funding, open access, publications, research data, software, other research products";
this.updateTitle(title);
this.updateDescription(description);
} else {
this.showLoading = false;
this.warningMessage="Requested type should be publication or research data or software or other research product";
}
//showLoading is true if no warnings
if(this.showLoading) {
if(this.projectId) {
this.createHeaders();
} else {
this.showLoading = false;
this.warningMessage="No valid project id";
}
}
});
}
ngOnDestroy() {
this.sub.unsubscribe();
if(this.piwiksub){
this.piwiksub.unsubscribe();
}
if(this.subHTML) {
this.subHTML.unsubscribe();
}
if(this.subHTMLInfo) {
this.subHTMLInfo.unsubscribe();
}
}
private createHeaders() {
this.subHTMLInfo = this._projectService.getHTMLInfo(this.projectId, this.properties).subscribe(
data => {
this.createHeader1(data);
if(data.acronym) {
this.updateTitle(data.acronym+" "+this.resultsType+" report");
} else if(data.title){
this.updateTitle(data.title+" "+this.resultsType+" report");
}
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, ((data.acronym)?data.acronym:data.title)+" "+this.resultsType+" report", this.piwikSiteId).subscribe();
}
},
err => {
this.handleError("Error getting html information for project id: "+this.projectId, err);
//console.log(err);
this.createClipboard();
}
);
if(this.resultsType == "publication") {
this.header2 += this.totalResults.toLocaleString('en-US') + " publications";
} else if(this.resultsType == "research data") {
this.header2 += this.totalResults.toLocaleString('en-US') + " research data";
} else if(this.resultsType == "software") {
this.header2 += this.totalResults.toLocaleString('en-US') + " software";
} else if(this.resultsType == "other research product") {
this.header2 += this.totalResults.toLocaleString('en-US') + " other";
}
}
private createClipboard() {
let intro: string = '<!doctype html>';
intro += '<html lang="en-gb" dir="ltr" vocab="http://schema.org/">';
intro += '<head>';
intro += '<title>'+this.header1+'</title>'
intro += '</head>';
if (typeof window !== 'undefined') {
this.subHTML = this.htmlService.getHTML(this.projectId, this.totalResults, this.resultsType, this.properties.csvAPIURL).subscribe(
data => {
//let body: string = intro+'<body><h1>'+this.header1+'</h1><h2>'+this.header2+'</h2>'+data+'</body></html>';
let body: string = intro+'<body><h1>'+this.header1+'</h1><h2>'+this.header2+'</h2>';
body += "<table><thead><tr> <th>Title</th><th>Authors</th><th>Publication Year</th><th>DOI</th><th>Permanent Identifier</th><th>Publication type</th><th>Journal</th><th>Project Name (GA Number)</th><th>Access Mode</th></tr></thead><tbody>"+data+"</tbody></table>";
body += '</body></html>';
//this.htmlResult = data;
this.htmlResult = "<table><thead><tr> <th>Title</th><th>Authors</th><th>Publication Year</th><th>DOI</th><th>Permanent Identifier</th><th>Publication type</th><th>Journal</th><th>Project Name (GA Number)</th><th>Access Mode</th></tr></thead><tbody>"+data+"</tbody></table>";
let clipboard;
let Clipboard;
Clipboard = require('clipboard');
clipboard = new Clipboard('.clipBtn', {
/*target: function(trigger) {
return document.getElementById("clipboard");
}*/
text: function(trigger) {
return body;//document.getElementById("clipboard").getAttribute('innerHTML');//"aaaa"+tmp+"oo";
}
});
this.showLoading = false;
},
err => {
//console.log(err);
this.handleError("Error getting html for id: "+this.projectId, err);
this.errorMessage = 'Service not available';
this.showLoading = false;
}
);
}
}
createHeader1(data: {"title": string, "acronym": string, "callIdentifier": string}) {
if(this.resultsType == "publication") {
this.header1 += "Publications";
} else if(this.resultsType == "research data") {
this.header1 += "Research Data";
} else if(this.resultsType == "software") {
this.header1 += "Software";
} else if(this.resultsType == "other research product") {
this.header1 += "Other Research Products";
}
if(data != undefined) {
if(data.title != undefined && data.title != "") {
this.header1 += data.title;
}
if((data.title != undefined && data.title != "") &&
((data.acronym != undefined && data.acronym != "") ||
(data.callIdentifier != undefined && data.callIdentifier != ""))) {
this.header1 += "(";
}
if(data.acronym != undefined && data.acronym != "") {
this.header1 += data.acronym + " - ";
}
if(data.callIdentifier != undefined && data.callIdentifier != "") {
this.header1 += data.callIdentifier;
}
if((data.title != undefined && data.title != "") &&
((data.acronym != undefined && data.acronym != "") ||
(data.callIdentifier != undefined && data.callIdentifier != ""))) {
this.header1 += ")";
}
}
this.createClipboard();
}
public copied() {
UIkit.notification({
message : '<strong>Raw html is copied. Please paste it on an html file.<strong>',
status : 'success',
timeout : 3000,
pos : 'top-center'
}); });
this.sub = this.route.queryParams.subscribe(params => {
this.projectId = params['projectId'];
if (params['size'] == parseInt(params['size'], 10)) {
this.totalResults = params['size'];
} else {
this.showLoading = false;
this.warningMessage = "Requested size is not an integer";
}
if (params['type'] && (params['type'] == "publication" || params['type'] == "dataset" || params['type'] == "software" || params['type'] == "other")) {
if (params['type'] == "publication") {
this.resultsType = 'publication';
} else if (params['type'] == "dataset") {
this.resultsType = 'research data';
} else if (params['type'] == "software") {
this.resultsType = 'software';
} else if (params['type'] == "other") {
this.resultsType = "other research product";
}
var title = "Project's " + this.resultsType + " report";
var description = "project, project " + this.resultsType + " report, funding, open access, publications, research data, software, other research products";
this.updateTitle(title);
this.updateDescription(description);
} else {
this.showLoading = false;
this.warningMessage = "Requested type should be publication or research data or software or other research product";
}
//showLoading is true if no warnings
if (this.showLoading) {
if (this.projectId) {
this.createHeaders();
} else {
this.showLoading = false;
this.warningMessage = "No valid project id";
}
}
});
}
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() {
this.sub.unsubscribe();
if (this.piwiksub) {
this.piwiksub.unsubscribe();
}
if (this.subHTML) {
this.subHTML.unsubscribe();
}
if (this.subHTMLInfo) {
this.subHTMLInfo.unsubscribe();
}
}
private createHeaders() {
this.subHTMLInfo = this._projectService.getHTMLInfo(this.projectId, this.properties).subscribe(
data => {
this.createHeader1(data);
if (data.acronym) {
this.updateTitle(data.acronym + " " + this.resultsType + " report");
} else if (data.title) {
this.updateTitle(data.title + " " + this.resultsType + " report");
}
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, ((data.acronym) ? data.acronym : data.title) + " " + this.resultsType + " report", this.piwikSiteId).subscribe();
}
},
err => {
this.handleError("Error getting html information for project id: " + this.projectId, err);
//console.log(err);
this.createClipboard();
}
);
if (this.resultsType == "publication") {
this.header2 += this.totalResults.toLocaleString('en-US') + " publications";
} else if (this.resultsType == "research data") {
this.header2 += this.totalResults.toLocaleString('en-US') + " research data";
} else if (this.resultsType == "software") {
this.header2 += this.totalResults.toLocaleString('en-US') + " software";
} else if (this.resultsType == "other research product") {
this.header2 += this.totalResults.toLocaleString('en-US') + " other";
}
}
private createClipboard() {
let intro: string = '<!doctype html>';
intro += '<html lang="en-gb" dir="ltr" vocab="http://schema.org/">';
intro += '<head>';
intro += '<title>' + this.header1 + '</title>'
intro += '</head>';
if (typeof window !== 'undefined') {
this.subHTML = this.htmlService.getHTML(this.projectId, this.totalResults, this.resultsType, this.properties.csvAPIURL).subscribe(
data => {
//let body: string = intro+'<body><h1>'+this.header1+'</h1><h2>'+this.header2+'</h2>'+data+'</body></html>';
let body: string = intro + '<body><h1>' + this.header1 + '</h1><h2>' + this.header2 + '</h2>';
body += "<table><thead><tr> <th>Title</th><th>Authors</th><th>Publication Year</th><th>DOI</th><th>Permanent Identifier</th><th>Publication type</th><th>Journal</th><th>Project Name (GA Number)</th><th>Access Mode</th></tr></thead><tbody>" + data + "</tbody></table>";
body += '</body></html>';
//this.htmlResult = data;
this.htmlResult = "<table><thead><tr> <th>Title</th><th>Authors</th><th>Publication Year</th><th>DOI</th><th>Permanent Identifier</th><th>Publication type</th><th>Journal</th><th>Project Name (GA Number)</th><th>Access Mode</th></tr></thead><tbody>" + data + "</tbody></table>";
let clipboard;
let Clipboard;
Clipboard = require('clipboard');
clipboard = new Clipboard('.clipBtn', {
/*target: function(trigger) {
return document.getElementById("clipboard");
}*/
text: function (trigger) {
return body;//document.getElementById("clipboard").getAttribute('innerHTML');//"aaaa"+tmp+"oo";
}
});
this.showLoading = false;
},
err => {
//console.log(err);
this.handleError("Error getting html for id: " + this.projectId, err);
this.errorMessage = 'Service not available';
this.showLoading = false;
}
);
}
}
createHeader1(data: { "title": string, "acronym": string, "callIdentifier": string }) {
if (this.resultsType == "publication") {
this.header1 += "Publications";
} else if (this.resultsType == "research data") {
this.header1 += "Research Data";
} else if (this.resultsType == "software") {
this.header1 += "Software";
} else if (this.resultsType == "other research product") {
this.header1 += "Other Research Products";
} }
private updateDescription(description:string){ if (data != undefined) {
this._meta.updateTag({content:description},"name='description'"); if (data.title != undefined && data.title != "") {
this._meta.updateTag({content:description},"property='og:description'"); this.header1 += data.title;
} }
private updateTitle(title:string){ if ((data.title != undefined && data.title != "") &&
var _prefix ="OpenAIRE | "; ((data.acronym != undefined && data.acronym != "") ||
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); (data.callIdentifier != undefined && data.callIdentifier != ""))) {
this._title.setTitle(_title); this.header1 += "(";
this._meta.updateTag({content:_title},"property='og:title'"); }
} if (data.acronym != undefined && data.acronym != "") {
private updateUrl(url:string){ this.header1 += data.acronym + " - ";
this._meta.updateTag({content:url},"property='og:url'"); }
if (data.callIdentifier != undefined && data.callIdentifier != "") {
this.header1 += data.callIdentifier;
}
if ((data.title != undefined && data.title != "") &&
((data.acronym != undefined && data.acronym != "") ||
(data.callIdentifier != undefined && data.callIdentifier != ""))) {
this.header1 += ")";
}
} }
private handleError(message: string, error) { this.createClipboard();
console.error("Html Project Report Page: "+message, error); }
}
public copied() {
UIkit.notification({
message: '<strong>Raw html is copied. Please paste it on an html file.<strong>',
status: 'success',
timeout: 3000,
pos: 'top-center'
});
}
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 = "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'");
}
private handleError(message: string, error) {
console.error("Html Project Report Page: " + message, error);
}
} }

View File

@ -11,10 +11,13 @@ import {HtmlProjectReportComponent} from './htmlProjectReport.component';
import {FreeGuard} from'../../login/freeGuard.guard'; import {FreeGuard} from'../../login/freeGuard.guard';
import {PiwikServiceModule} from '../../utils/piwik/piwikService.module'; import {PiwikServiceModule} from '../../utils/piwik/piwikService.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {HelperModule} from "../../utils/helper/helper.module";
import {RouterModule} from '@angular/router';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, ProjectServiceModule,PiwikServiceModule, SEOServiceModule CommonModule, FormsModule, ProjectServiceModule, PiwikServiceModule, SEOServiceModule, HelperModule,
RouterModule
], ],
declarations: [ declarations: [
HtmlProjectReportComponent HtmlProjectReportComponent

View File

@ -1,164 +1,204 @@
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" > <div id="tm-main" class=" uk-section uk-margin-small-top tm-middle">
<div uk-grid uk-grid> <div uk-grid 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="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container uk-margin-top organization"> <div class="uk-container uk-margin-top organization">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div> role="alert">{{warningMessage}}</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> <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>
<div *ngIf="organizationInfo != null" uk-grid class="uk-grid-large"> <div *ngIf="organizationInfo != null" uk-grid class="uk-grid-large">
<div class="uk-width-expand@m uk-width-1-1@s"> <helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
<schema2jsonld *ngIf="organizationInfo" [data]=organizationInfo [URL]="properties.baseLink+'/search/organization?organizationId='+organizationId" type="organization"></schema2jsonld> [texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="organizationInfo" [data]=organizationInfo
[URL]="properties.baseLink+'/search/organization?organizationId='+organizationId"
type="organization"></schema2jsonld>
<showTitle [title]="organizationInfo.title"></showTitle> <showTitle [title]="organizationInfo.title"></showTitle>
<div class="uk-text-large " *ngIf="organizationInfo.title.name && organizationInfo.title.name != organizationInfo.name ">{{organizationInfo.name}}</div> <div class="uk-text-large "
<span class="uk-label custom-label label-blue label-organization" title="Type">Organization</span>{{" "}} *ngIf="organizationInfo.title.name && organizationInfo.title.name != organizationInfo.name ">{{organizationInfo.name}}</div>
<span *ngIf="organizationInfo.country" class="uk-label custom-label label-country " title="Country">{{organizationInfo.country}}</span>{{" "}} <span class="uk-label custom-label label-blue label-organization" title="Type">Organization</span>{{" "}}
<span *ngIf="organizationInfo.country" class="uk-label custom-label label-country "
title="Country">{{organizationInfo.country}}</span>{{" "}}
<ul class="custom-accordion" uk-accordion> <ul class="custom-accordion" uk-accordion>
<li *ngIf="fetchPublications.searchUtils.totalResults > 0" (click)="activeTab='Publications'; searchPublicationsInit()"> <li *ngIf="fetchPublications.searchUtils.totalResults > 0"
<a class="uk-accordion-title" href="#"> (click)="activeTab='Publications'; searchPublicationsInit()">
Publications <a class="uk-accordion-title" href="#">
<!-- <span class="uk-badge uk-badge-notification"> --> Publications
<!-- ({{fetchPublications.searchUtils.totalResults | number}}) --> <!-- <span class="uk-badge uk-badge-notification"> -->
<!-- </span> --> <!-- ({{fetchPublications.searchUtils.totalResults | number}}) -->
</a> <!-- </span> -->
<div class="uk-accordion-content"> </a>
<errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'" tab_error_class=true></errorMessages> <div class="uk-accordion-content">
<errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'"
tab_error_class=true></errorMessages>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.DONE"> <div *ngIf="fetchPublications.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10"> <div class="uk-text-right" *ngIf="fetchPublications.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])" <a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications" class="uk-button uk-button-text"> routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications"
View all {{fetchPublications.searchUtils.totalResults | number}} results class="uk-button uk-button-text">
</a> View all {{fetchPublications.searchUtils.totalResults | number}} results
</div> </a>
<tab-result [(results)]="fetchPublications.results"
[(status)]= "fetchPublications.status"
type="publication" urlParam="articleId">
</tab-result>
</div>
</div>
</li>
<!-- <li (click)="activeTab='Research Data'; searchDatasetsInit()">
<a class="uk-accordion-title" href="#">
Research Data
<span class="uk-badge uk-badge-notification">
{{fetchDatasets.searchUtils.totalResults | number}}
</span>
</a>
<div class="uk-accordion-content">
<errorMessages [status]="[fetchDatasets.searchUtils.status]" [type]="'publications'" tab_error_class=true></errorMessages>
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchDatasets" class="uk-button uk-button-text">
View all {{fetchDatasets.searchUtils.totalResults | number}} results
</a>
</div>
<tab-result [(results)]="fetchDatasets.results"
[(status)]= "fetchDatasets.status"
type="dataset" urlParam="datasetId">
</tab-result>
</div>
</div> </div>
</li> --> <tab-result [(results)]="fetchPublications.results"
[(status)]="fetchPublications.status"
type="publication" urlParam="articleId">
</tab-result>
</div>
</div>
</li>
<li (click)="activeTab='Projects'; projectsClicked=true;"> <!-- <li (click)="activeTab='Research Data'; searchDatasetsInit()">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Projects Research Data
<!-- <span class="uk-badge uk-badge-notification"> --> <span class="uk-badge uk-badge-notification">
({{fetchProjects.searchUtils.totalResultsNoFilters | number}}) {{fetchDatasets.searchUtils.totalResults | number}}
<!-- </span> --> </span>
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<searchingProjectsTab *ngIf="projectsClicked" [(fetchProjects)]="fetchProjects" [organizationId]="organizationId" [(properties)]=properties></searchingProjectsTab> <errorMessages [status]="[fetchDatasets.searchUtils.status]" [type]="'publications'" tab_error_class=true></errorMessages>
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchDatasets" class="uk-button uk-button-text">
View all {{fetchDatasets.searchUtils.totalResults | number}} results
</a>
</div>
<tab-result [(results)]="fetchDatasets.results"
[(status)]= "fetchDatasets.status"
type="dataset" urlParam="datasetId">
</tab-result>
</div> </div>
</li> </div>
</li> -->
<li (click)="activeTab='Content Providers'; searchDataprovidersInit()"> <li (click)="activeTab='Projects'; projectsClicked=true;">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Content Providers Projects
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchDataproviders.searchUtils.totalResults | number}}) ({{fetchProjects.searchUtils.totalResultsNoFilters | number}})
<!-- </span> --> <!-- </span> -->
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<errorMessages [status]="[fetchDataproviders.searchUtils.status]" [type]="'content providers'" tab_error_class=true></errorMessages> <searchingProjectsTab *ngIf="projectsClicked" [(fetchProjects)]="fetchProjects"
[organizationId]="organizationId"
[(properties)]=properties></searchingProjectsTab>
</div>
</li>
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.DONE"> <li (click)="activeTab='Content Providers'; searchDataprovidersInit()">
<a class="uk-accordion-title" href="#">
Content Providers
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchDataproviders.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<errorMessages [status]="[fetchDataproviders.searchUtils.status]" [type]="'content providers'"
tab_error_class=true></errorMessages>
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10"> <div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.DONE">
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchDataproviders" class="uk-button uk-button-text"> <div class="uk-text-right" *ngIf="fetchDataproviders.searchUtils.totalResults > 10">
View all {{fetchDataproviders.searchUtils.totalResults | number}} results <a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
</a> routerLinkActive="router-link-active" [routerLink]="linkToSearchDataproviders"
</div> class="uk-button uk-button-text">
<tab-result [(results)]="fetchDataproviders.results" View all {{fetchDataproviders.searchUtils.totalResults | number}} results
[(status)]= "fetchDataproviders.status" </a>
type="dataprovider" urlParam="datasourceId"> </div>
</tab-result> <tab-result [(results)]="fetchDataproviders.results"
</div> [(status)]="fetchDataproviders.status"
</div> type="dataprovider" urlParam="datasourceId">
</li> </tab-result>
</div>
</div>
</li>
</ul> </ul>
</div>
<div class="uk-width-large@m uk-width-1-1@s">
<div class="uk-card uk-card-default uk-padding-small">
<div>
Share - Bookmark<addThis ></addThis>
</div> </div>
<div *ngIf="fetchPublications.searchUtils.totalResults > 0 || (fetchProjects && fetchProjects.funders.length > 0)" class="uk-margin-medium-top uk-margin-medium-bottom">
<div class="uk-text-center uk-text-large"> <div class="uk-width-large@m uk-width-1-1@s">
Application Box <div class="uk-card uk-card-default uk-padding-small">
<div>
Share - Bookmark
<addThis></addThis>
</div> </div>
<div class="app-box app-box uk-padding-small" > <div
<ul class="uk-list"> *ngIf="fetchPublications.searchUtils.totalResults > 0 || (fetchProjects && fetchProjects.funders.length > 0)"
class="uk-margin-medium-top uk-margin-medium-bottom">
<div class="uk-text-center uk-text-large">
Application Box
</div>
<div class="app-box app-box uk-padding-small">
<ul class="uk-list">
<ng-container *ngIf="fetchProjects && fetchProjects.funders.length > 0"> <ng-container *ngIf="fetchProjects && fetchProjects.funders.length > 0">
<li *ngFor="let funder of fetchProjects.funders"> <li *ngFor="let funder of fetchProjects.funders">
<!--a href="{{downloadURLAPI}}resources?size={{organizationInfo.projects.get(key).length}}&{{csvProjectParamsHead}}{{organizationInfo.projects.get(key)[0]['funderId']}}{{csvParamsTail}}"> <!--a href="{{downloadURLAPI}}resources?size={{organizationInfo.projects.get(key).length}}&{{csvProjectParamsHead}}{{organizationInfo.projects.get(key)[0]['funderId']}}{{csvParamsTail}}">
Download projects report (CSV) for {{key}} Download projects report (CSV) for {{key}}
</a--> </a-->
<a class="clickable" (click)="downloadFile(downloadURLAPI+'?'+csvProjectParamsHead+encodeURI(funder.id)+csvParamsTail, 'funder-projects-report')"> <a class="clickable"
<!--span class="clickable" (click)="downloadProjectsFile(downloadURLAPI+'organizations/'+organizationId+'/projects?fq=(funderid exact '+funder.id+')&size='+funder.number)"--> (click)="downloadFile(downloadURLAPI+'?'+csvProjectParamsHead+encodeURI(funder.id)+csvParamsTail, 'funder-projects-report')">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span> <!--span class="clickable" (click)="downloadProjectsFile(downloadURLAPI+'organizations/'+organizationId+'/projects?fq=(funderid exact '+funder.id+')&size='+funder.number)"-->
<span class="uk-icon-download"> Project list for {{funder.name}} (CSV)</span> <span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
</a> xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline
</li> fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17"
width="13"
height="1"></rect><line
fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span>
<span class="uk-icon-download"> Project list for {{funder.name}} (CSV)</span>
</a>
</li>
<li *ngFor="let funder of fetchProjects.funders"> <li *ngFor="let funder of fetchProjects.funders">
<a class="clickable" (click)="confirmOpenApplyAll(funder.name,encodeURI(funder.id), funder.number)"> <a class="clickable"
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span> (click)="confirmOpenApplyAll(funder.name,encodeURI(funder.id), funder.number)">
<span class="uk-icon-download"> Project Publications for {{funder.name}} (CSV)</span> <span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
</a> xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline
</li> fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17"
width="13"
height="1"></rect><line
fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span>
<span class="uk-icon-download"> Project Publications for {{funder.name}} (CSV)</span>
</a>
</li>
</ng-container> </ng-container>
<li *ngIf="fetchPublications.searchUtils.totalResults > 0"> <li *ngIf="fetchPublications.searchUtils.totalResults > 0">
<!-- url = this.downloadURLAPI+"format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact '"+projects[index].id+"'))"--> <!-- url = this.downloadURLAPI+"format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact '"+projects[index].id+"'))"-->
<!-- <a class="clickable" (click)="downloadFile(downloadURLAPI+'/organizations/'+organizationId+'?type=publications&format=csv')"> --> <!-- <a class="clickable" (click)="downloadFile(downloadURLAPI+'/organizations/'+organizationId+'?type=publications&format=csv')"> -->
<a class="clickable" (click)="downloadFile(csvAffiliatedPublications, 'organization-publications-report')"> <a class="clickable"
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span> (click)="downloadFile(csvAffiliatedPublications, 'organization-publications-report')">
<span class="uk-icon-download"> Publications of organization (CSV) - based on the affiliation information.</span> <span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
</a> xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline
fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17"
width="13"
height="1"></rect><line
fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span>
<span class="uk-icon-download"> Publications of organization (CSV) - based on the affiliation information.</span>
</a>
</li> </li>
</ul> </ul>
</div>
</div> </div>
</div> </div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div> </div>
<modal-loading></modal-loading>
<modal-alert #AlertModalApplyAll (alertOutput)="confirmCloseApplyAll($event)"></modal-alert>
<modal-alert #AlertModalCsvError></modal-alert>
</div>
</div> </div>
<modal-loading></modal-loading> </div>
<modal-alert #AlertModalApplyAll (alertOutput)="confirmCloseApplyAll($event)"></modal-alert>
<modal-alert #AlertModalCsvError></modal-alert>
</div>
</div>
</div>
</div> </div>

File diff suppressed because it is too large Load Diff

View File

@ -1,30 +1,30 @@
import { NgModule} from '@angular/core'; import {NgModule} from '@angular/core';
import { CommonModule } from '@angular/common'; import {CommonModule} from '@angular/common';
import { FormsModule } from '@angular/forms'; import {FormsModule} from '@angular/forms';
import { RouterModule } from '@angular/router'; import {RouterModule} from '@angular/router';
import {LoadingModalModule} from '../../utils/modal/loadingModal.module'; import {LoadingModalModule} from '../../utils/modal/loadingModal.module';
import {AlertModalModule} from '../../utils/modal/alertModal.module'; import {AlertModalModule} from '../../utils/modal/alertModal.module';
import {ErrorMessagesModule} from '../../utils/errorMessages.module'; import {ErrorMessagesModule} from '../../utils/errorMessages.module';
import { OrganizationServiceModule} from '../../services/organizationService.module'; import {OrganizationServiceModule} from '../../services/organizationService.module';
// import { ProjectsServiceModule} from '../../services/projectsService.module'; // import { ProjectsServiceModule} from '../../services/projectsService.module';
import { OrganizationComponent } from './organization.component'; import {OrganizationComponent} from './organization.component';
// import { OrganizationRoutingModule } from './organization-routing.module'; import {LandingModule} from '../landing-utils/landing.module';
import {TabResultModule} from '../../searchPages/searchUtils/tabResult.module';
import { LandingModule } from '../landing-utils/landing.module';
import {TabResultModule } from '../../searchPages/searchUtils/tabResult.module';
import {DataProvidersServiceModule} from '../../services/dataProvidersService.module'; import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
import {ReportsServiceModule} from '../../services/reportsService.module'; import {ReportsServiceModule} from '../../services/reportsService.module';
import {PublicationsServiceModule} from '../../services/publicationsService.module'; import {PublicationsServiceModule} from '../../services/publicationsService.module';
// import {DatasetsServiceModule} from '../../services/datasetsService.module'; // import {DatasetsServiceModule} from '../../services/datasetsService.module';
import {ProjectsServiceModule} from '../../services/projectsService.module'; import {ProjectsServiceModule} from '../../services/projectsService.module';
import { SearchingProjectsTabModule} from '../landing-utils/searchingProjectsInTab.module'; import {SearchingProjectsTabModule} from '../landing-utils/searchingProjectsInTab.module';
import {FreeGuard} from'../../login/freeGuard.guard'; import {FreeGuard} from '../../login/freeGuard.guard';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module';
import {HelperModule} from "../../utils/helper/helper.module";
@NgModule({ @NgModule({
imports: [ imports: [
@ -38,19 +38,19 @@ import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
SearchingProjectsTabModule, SearchingProjectsTabModule,
OrganizationServiceModule, OrganizationServiceModule,
PublicationsServiceModule, PublicationsServiceModule,
// DatasetsServiceModule,
ProjectsServiceModule, ProjectsServiceModule,
Schema2jsonldModule, SEOServiceModule Schema2jsonldModule, SEOServiceModule, HelperModule
], ],
declarations: [ declarations: [
OrganizationComponent, OrganizationComponent,
], ],
providers:[ providers: [
FreeGuard, IsRouteEnabled FreeGuard, IsRouteEnabled
], ],
exports: [ exports: [
OrganizationComponent OrganizationComponent
] ]
}) })
export class OrganizationModule { } export class OrganizationModule {
}

View File

@ -2,18 +2,31 @@
<div uk-grid uk-grid> <div uk-grid 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="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first">
<div class="uk-container uk-margin-top orp"> <div class="uk-container uk-margin-top orp">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div> role="alert">{{warningMessage}}</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> <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>
<div *ngIf="orpInfo != null" uk-grid class="uk-grid-large"> <div *ngIf="orpInfo != null" uk-grid class="uk-grid-large">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div class="uk-width-expand@m uk-width-1-1@s"> <div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="orpInfo.record" [data]=orpInfo.record [URL]="properties.baseLink+'/search/orp?orpId='+orpId"></schema2jsonld> <schema2jsonld *ngIf="orpInfo.record" [data]=orpInfo.record
<showTitle [titleName]="orpInfo.title"></showTitle> [URL]="properties.baseLink+'/search/orp?orpId='+orpId"></schema2jsonld>
<span *ngIf="orpInfo.types && orpInfo.types.length > 0"class="uk-label custom-label label-orp " title="Type">{{orpInfo.types.join(", ")}}</span>{{" "}} <showTitle [titleName]="orpInfo.title"></showTitle>
<span *ngIf="orpInfo.languages && orpInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{orpInfo.languages.join(", ")}}</span>{{" "}} <span *ngIf="orpInfo.types && orpInfo.types.length > 0" class="uk-label custom-label label-orp "
<span *ngIf="orpInfo.countries && orpInfo.countries.length > 0" class="uk-label custom-label label-country " title="Country">{{orpInfo.countries.join(", ")}}</span>{{" "}} title="Type">{{orpInfo.types.join(", ")}}</span>{{" "}}
<span *ngIf="orpInfo.accessMode" [class]="'uk-label custom-label label-'+ orpInfo.accessMode " title="Access Mode">{{orpInfo.accessMode}}</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 *ngIf="orpInfo.underCurationMessage" class="uk-label custom-label label-underCuration">
<span uk-tooltip="pos:right; delay:10" <span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}"> title="{{buildCurationTooltip()}}">
@ -22,7 +35,7 @@
</span> </span>
</span>{{" "}} </span>{{" "}}
<div class= " uk-margin-top"> <div class=" uk-margin-top">
<showAuthors [authors]="orpInfo.authors"></showAuthors> <showAuthors [authors]="orpInfo.authors"></showAuthors>
<span *ngIf="orpInfo.date != ''">({{orpInfo.date}})</span> <span *ngIf="orpInfo.date != ''">({{orpInfo.date}})</span>
</div> </div>
@ -30,7 +43,8 @@
<ul class="uk-list"> <ul class="uk-list">
<showPublisher [publisher]="orpInfo.publisher" <showPublisher [publisher]="orpInfo.publisher"
[journal]="orpInfo.journal" [properties]="properties"></showPublisher> [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.embargoEndDate"><span
class="uk-text-bold">Embargo end date:</span> {{orpInfo.embargoEndDate}}</li>
<li *ngIf="orpInfo.identifiers && orpInfo.identifiers.size > 0"> <li *ngIf="orpInfo.identifiers && orpInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="orpInfo.identifiers"></showIdentifiers> <showIdentifiers [identifiers]="orpInfo.identifiers"></showIdentifiers>
</li> </li>
@ -42,16 +56,21 @@
</li> </li>
</ul> </ul>
<hr *ngIf="orpInfo.description"> <hr *ngIf="orpInfo.description">
<div *ngIf="orpInfo.description" class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto"> <div *ngIf="orpInfo.description"
class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<span>{{orpInfo.description.substring(0, showNumDescription)}}</span <span>{{orpInfo.description.substring(0, showNumDescription)}}</span
><span *ngIf="showNumDescription == thresholdDescription && orpInfo.description.length > thresholdDescription">...</span ><span
><span *ngIf="showNumDescription == thresholdDescription && orpInfo.description.length > thresholdDescription" class="uk-text-right"> *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;"> <a (click)="showNumDescription = orpInfo.description.length;">
View more View more
</a> </a>
</span> </span>
</div> </div>
<div *ngIf="orpInfo.description && showNumDescription > thresholdDescription" class="uk-width-1-1 uk-text-right"> <div *ngIf="orpInfo.description && showNumDescription > thresholdDescription"
class="uk-width-1-1 uk-text-right">
<a (click)="showNumDescription = thresholdDescription;"> <a (click)="showNumDescription = thresholdDescription;">
View less View less
</a> </a>
@ -59,43 +78,49 @@
<ul class="custom-accordion" uk-accordion> <ul class="custom-accordion" uk-accordion>
<li *ngIf="orpInfo.references" (click)="activeTab='References'"> <li *ngIf="orpInfo.references" (click)="activeTab='References'">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
References ({{orpInfo.references.length | number}}) References ({{orpInfo.references.length | number}})
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<div> <div>
<div *ngIf="orpInfo.references.length > pageSize" class="uk-margin-bottom"> <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> <span class="uk-h6">{{orpInfo.references.length | number}}
<paging-no-load class="uk-float-right" [currentPage]="referencesPage" [totalResults]="orpInfo.references.length" [size]="pageSize" (pageChange)="updateReferencesPage($event)"></paging-no-load> references, page {{referencesPage | number}}
</div> 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)"> <div
<p *ngIf=" item && item['url']" *ngFor="let item of orpInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
class="custom-external custom-icon"> <p *ngIf=" item && item['url']"
<a href="{{item['url']}}" target="_blank"> class="custom-external custom-icon">
{{item['name']}} <a href="{{item['url']}}" target="_blank">
</a> {{item['name']}}
</p> </a>
<p *ngIf="!item['url']" class="pseudo-external custom-icon"> </p>
{{item['name']}} <p *ngIf="!item['url']" class="pseudo-external custom-icon">
</p> {{item['name']}}
</div> </p>
</div> </div>
</div> </div>
</li> </div>
</li>
<li *ngIf="orpInfo.relatedResearchResults" (click)="activeTab='Related Research Results'"> <li *ngIf="orpInfo.relatedResearchResults" (click)="activeTab='Related Research Results'">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Related Research Results Related Research Results
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{relatedResearchResultsNum | number}}) ({{relatedResearchResultsNum | number}})
<!-- </span> --> <!-- </span> -->
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<div> <div>
<div *ngFor="let provenanceaction of getKeys(orpInfo.relatedResearchResults)"> <div *ngFor="let provenanceaction of getKeys(orpInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div> <div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [percentageName]="trust" [info]="orpInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable> <tabTable [percentageName]="trust" [info]="orpInfo.relatedResearchResults.get(provenanceaction)"
[(properties)]=properties></tabTable>
</div> </div>
</div> </div>
</div> </div>
@ -105,12 +130,13 @@
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Similar Research Results Similar Research Results
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{orpInfo.similarResearchResults.length | number}}) ({{orpInfo.similarResearchResults.length | number}})
<!-- </span> --> <!-- </span> -->
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<div> <div>
<tabTable [percentageName]="similarity" [info]="orpInfo.similarResearchResults" [(properties)]=properties></tabTable> <tabTable [percentageName]="similarity" [info]="orpInfo.similarResearchResults"
[(properties)]=properties></tabTable>
</div> </div>
</div> </div>
</li> </li>
@ -120,25 +146,27 @@
Metrics Metrics
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<metrics [pageViews]="pageViews" <metrics [pageViews]="pageViews"
[id]="orpId" [entityType]="'results'" [entity]="'Other Research Product'" [id]="orpId" [entityType]="'results'" [entity]="'Other Research Product'"
(metricsResults)="metricsResults($event)" [(properties)] = properties> (metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics> </metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0" <i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250"> [url]=viewsFrameUrl width="100%" height="250">
</i-frame> </i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads > 0" <i-frame *ngIf="metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250"> [url]=downloadsFrameUrl width="100%" height="250">
</i-frame> </i-frame>
</div> </div>
</li> </li>
<li (click)="activeTab='Other Versions'" *ngIf="properties.environment == 'development' && orpInfo.deletedByInferenceIds"> <li (click)="activeTab='Other Versions'"
*ngIf="properties.environment == 'development' && orpInfo.deletedByInferenceIds">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Other Versions Other Versions
({{orpInfo.deletedByInferenceIds.length | number}}) ({{orpInfo.deletedByInferenceIds.length | number}})
</a> </a>
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content"> <div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
<deletedByInference [id]="orpId" [ids]="orpInfo.deletedByInferenceIds" [type]="'other research products'"></deletedByInference> <deletedByInference [id]="orpId" [ids]="orpInfo.deletedByInferenceIds"
[type]="'other research products'"></deletedByInference>
</div> </div>
</li> </li>
</ul> </ul>
@ -147,7 +175,7 @@
<div class="uk-width-large@m uk-width-1-1@s"> <div class="uk-width-large@m uk-width-1-1@s">
<div class=" uk-padding-small"> <div class=" uk-padding-small">
<div> <div>
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div> <div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis></addThis> <addThis></addThis>
</div> </div>
<altmetrics *ngIf="orpInfo.identifiers && orpInfo.identifiers.get('doi')" <altmetrics *ngIf="orpInfo.identifiers && orpInfo.identifiers.get('doi')"
@ -160,101 +188,129 @@
<li *ngIf="orpInfo.fundedByProjects != undefined && orpInfo.fundedByProjects.length > 0"> <li *ngIf="orpInfo.fundedByProjects != undefined && orpInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="orpInfo.fundedByProjects"></fundedBy> <fundedBy [fundedByProjects]="orpInfo.fundedByProjects"></fundedBy>
</li> </li>
<li *ngIf="orpInfo.contexts && orpInfo.contexts.length >0 "> <li *ngIf="orpInfo.contexts && orpInfo.contexts.length >0 ">
<dl class="uk-description-list-line" > <dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to </dt> <dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of orpInfo.contexts"> <dd class="line" *ngFor="let item of orpInfo.contexts">
<span *ngIf = "!item['inline']" > <span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span> <span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span> <span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span> </span>
<mark *ngIf = "item['inline']" > <mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span> <span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span> <span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark> </mark>
</dd> </dd>
</dl> </dl>
</li> </li>
<li> <li>
<div class="sideInfoTitle cite-this-button uk-width-1-1" type="button"> <div class="sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this research product Cite this research product
</div> </div>
<div class=""> <div class="">
<citeThis [result]="orpInfo" [id]="orpId" type="other research product"></citeThis> <citeThis [result]="orpInfo" [id]="orpId" type="other research product"></citeThis>
</div> </div>
</li> </li>
</ul> </ul>
<button *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-button portal-button uk-width-1-1 "> <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') " uk-dropdown="pos: bottom-left; mode:click"
style="background: transparent
!important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','project'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album"
ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14"
height="1"></rect><rect
fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','context'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="users"
ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6"
r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1"
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"></path><path
fill="none" stroke="#000" stroke-width="1.1"
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"></path></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;"
title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy"
ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline
fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
</ul>
</div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div>
<!-- Claiming FAB -->
<!--div class="uk-inline">
<div class=" uk-float-right " style="z-index: 200; bottom: 55px; position: fixed; right: 45%;">
<button class=" uk-button uk-button-danger ">
<span class="uk-icon"> <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> <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... </span> Link this product to
</button> </button>
<div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click" style="background: transparent <div uk-dropdown="pos: top-right; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
!important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical"> <ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>"> <li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Projects</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" > <span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album" ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album" ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
</a> </a>
</li> </li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>"> <li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Communities</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" > <span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="users" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1" 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"></path><path fill="none" stroke="#000" stroke-width="1.1" 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"></path></svg></span> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="users" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1" 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"></path><path fill="none" stroke="#000" stroke-width="1.1" 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"></path></svg></span>
</a> </a>
</li> </li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>"> <li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light uk-margin-small'>Other research results</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" > <span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a> </a>
</li> </li>
</ul> </ul>
</div> </div>
</div>
</div> </div>
</div-->
</div> </div>
<!-- Claiming FAB --> </div>
<!--div class="uk-inline"> </div>
<div class=" uk-float-right " style="z-index: 200; bottom: 55px; position: fixed; right: 45%;">
<button class=" uk-button uk-button-danger ">
<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 uk-dropdown="pos: top-right; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Projects</div>">
<a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album" ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
</a>
</li>
<li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Communities</div>">
<a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="users" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1" 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"></path><path fill="none" stroke="#000" stroke-width="1.1" 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"></path></svg></span>
</a>
</li>
<li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light uk-margin-small'>Other research results</div>">
<a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
</ul>
</div>
</div>
</div-->
</div>
</div>
</div>
</div> </div>

View File

@ -1,217 +1,248 @@
import {Component, ViewChild} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Input} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router';
import {ActivatedRoute, Router} from '@angular/router'; import {Meta, Title} from '@angular/platform-browser';
import {Title, Meta} from '@angular/platform-browser';
import {Observable} from 'rxjs'; import {OrpInfo} from '../../utils/entities/orpInfo';
import {EnvProperties} from '../../utils/properties/env-properties';
import {RouterHelper} from '../../utils/routerHelper.class';
import {OrpInfo} from '../../utils/entities/orpInfo'; import {OrpService} from './orp.service';
import {EnvProperties} from '../../utils/properties/env-properties'; import {PiwikService} from '../../utils/piwik/piwik.service';
import {RouterHelper} from '../../utils/routerHelper.class'; import {SEOService} from '../../sharedComponents/SEO/SEO.service';
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 {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({ @Component({
selector: 'orp', selector: 'orp',
templateUrl: 'orp.component.html', templateUrl: 'orp.component.html',
}) })
export class OrpComponent { export class OrpComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
public orpInfo: OrpInfo; @Input() communityId = null;
public orpId : string ; public orpInfo: OrpInfo;
public orpId: string;
// APP BOX variables // APP BOX variables
public showAllCollectedFrom: boolean = false; public showAllCollectedFrom: boolean = false;
public showAllDownloadFrom: boolean = false; public showAllDownloadFrom: boolean = false;
public showAllPublishedIn: boolean = false; public showAllPublishedIn: boolean = false;
public thresholdDescription: number = 270; public thresholdDescription: number = 270;
public showNumDescription: 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 // Metrics tab variables
public referencesPage: number = 1; public metricsClicked: boolean;
public pageSize: number = 10; public viewsFrameUrl: string;
public downloadsFrameUrl: string;
public totalViews: number;
public totalDownloads: number;
public pageViews: number;
// Active tab variable for responsiveness // Custom tab paging variables
public activeTab: string = "References"; public referencesPage: number = 1;
public pageSize: number = 10;
// Map counting variable // Active tab variable for responsiveness
public relatedResearchResultsNum: number = 0; public activeTab: string = "References";
// Message variables // Map counting variable
public warningMessage = ""; public relatedResearchResultsNum: number = 0;
public errorMessage = "";
public showLoading: boolean = true;
public routerHelper:RouterHelper = new RouterHelper(); // Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
public pageContents = null;
public divContents = null;
private result ; public routerHelper: RouterHelper = new RouterHelper();
sub: any; piwiksub: any; infoSub: any;
properties:EnvProperties;
constructor (private _orpService: OrpService, private result;
private _piwikService:PiwikService, sub: any;
private route: ActivatedRoute, piwiksub: any;
private router: Router, infoSub: any;
private _meta: Meta, properties: EnvProperties;
private _title: Title,
private _router: Router,
private seoService: SEOService) {
}
ngOnInit() { constructor(private _orpService: OrpService,
this.route.data private _piwikService: PiwikService,
.subscribe((data: { envSpecific: EnvProperties }) => { private route: ActivatedRoute,
this.properties = data.envSpecific; private router: Router,
this.updateUrl(data.envSpecific.baseLink+this._router.url); private _meta: Meta,
private _title: Title,
private _router: Router,
private helper: HelperService,
private seoService: SEOService) {
}
}); ngOnInit() {
this.sub = this.route.queryParams.subscribe(params => { this.route.data
this.orpInfo = null; .subscribe((data: { envSpecific: EnvProperties }) => {
this.updateTitle("Other Research Product"); this.properties = data.envSpecific;
this.updateDescription(""); //this.getDivContents();
this.orpId = params['orpId']; this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
if(this.orpId){ });
this.getOrpInfo(this.orpId); this.sub = this.route.queryParams.subscribe(params => {
}else{ this.orpInfo = null;
this.showLoading = false; this.updateTitle("Other Research Product");
this.warningMessage="No valid research product id"; this.updateDescription("");
} this.orpId = params['orpId'];
this.metricsClicked = false; if (this.orpId) {
this.getOrpInfo(this.orpId);
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'; } else {
this.showLoading = 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.warningMessage = "No valid research product id";
this.scroll();
});
}
ngOnDestroy() {
if(this.sub){
this.sub.unsubscribe();
} }
if(this.piwiksub){
this.piwiksub.unsubscribe(); this.metricsClicked = false;
}
if(this.infoSub) { 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.infoSub.unsubscribe();
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 = "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;
}
private getOrpInfo(id:string) { isRouteAvailable(routeToCheck: 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 ="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++) { for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path; let routePath: string = this.router.config[i].path;
if(routePath == routeToCheck){ if (routePath == routeToCheck) {
return true; return true;
} }
} }

View File

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

View File

@ -1,15 +1,23 @@
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" > <div id="tm-main" class=" uk-section uk-margin-small-top tm-middle">
<div uk-grid uk-grid> <div uk-grid 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="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div id="project" class="uk-container uk-margin-top project"> <div id="project" class="uk-container uk-margin-top project">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div> role="alert">{{warningMessage}}</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> <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>
<div *ngIf="projectInfo != null" uk-grid class="uk-grid-large"> <div *ngIf="projectInfo != null" uk-grid class="uk-grid-large">
<div class="uk-width-expand@m uk-width-1-1@s"> <helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
<schema2jsonld *ngIf="projectInfo" [data]=projectInfo [URL]="properties.baseLink+'/search/project?projectId='+projectId" type="project"></schema2jsonld> [texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="projectInfo" [data]=projectInfo
[URL]="properties.baseLink+'/search/project?projectId='+projectId"
type="project"></schema2jsonld>
<!--h3 *ngIf="projectInfo.acronym != undefined && projectInfo.acronym != ''">{{projectInfo.acronym}}</h3> <!--h3 *ngIf="projectInfo.acronym != undefined && projectInfo.acronym != ''">{{projectInfo.acronym}}</h3>
<h3 *ngIf="projectInfo.acronym == undefined || projectInfo.acronym == ''">{{projectInfo.title}}</h3--> <h3 *ngIf="projectInfo.acronym == undefined || projectInfo.acronym == ''">{{projectInfo.title}}</h3-->
<h2 class="projectIcon"> <h2 class="projectIcon">
@ -17,29 +25,43 @@
<!-- <span *ngIf="projectInfo.specialClause39==true" class="sc39">{{projectName}}</span> <!-- <span *ngIf="projectInfo.specialClause39==true" class="sc39">{{projectName}}</span>
<span *ngIf="projectInfo.specialClause39!=true">{{projectName}}</span> --> <span *ngIf="projectInfo.specialClause39!=true">{{projectName}}</span> -->
<span>{{projectName}}</span> <span>{{projectName}}</span>
<span *ngIf=" projectInfo.title == projectName ">({{projectInfo.contractNum}})</span> <span *ngIf=" projectInfo.title == projectName ">({{projectInfo.contractNum}})</span>
</h2> </h2>
<div class="uk-text-large " *ngIf="projectInfo.title && projectInfo.title != projectName ">{{projectInfo.title}} ({{projectInfo.contractNum}})</div> <div class="uk-text-large "
*ngIf="projectInfo.title && projectInfo.title != projectName ">{{projectInfo.title}}
({{projectInfo.contractNum}})
</div>
<div> <div>
<span class="uk-label custom-label label-blue label-project" title="Type">Project</span>{{" "}} <span class="uk-label custom-label label-blue label-project" title="Type">Project</span>{{" "}}
<span class="uk-label custom-label label-funder " title="Funder">{{projectInfo.funder}}</span>{{" "}} <span class="uk-label custom-label label-funder " title="Funder">{{projectInfo.funder}}</span>{{" "}}
<span *ngIf="projectInfo.openAccessMandatePublications != undefined && projectInfo.openAccessMandatePublications && projectInfo.openAccessMandateDatasets != undefined && projectInfo.openAccessMandateDatasets" <span
class="uk-label custom-label label-openaccessmandate " title="Open Access mandate for Publications and Research Data"> *ngIf="projectInfo.openAccessMandatePublications != undefined && projectInfo.openAccessMandatePublications && projectInfo.openAccessMandateDatasets != undefined && projectInfo.openAccessMandateDatasets"
class="uk-label custom-label label-openaccessmandate "
title="Open Access mandate for Publications and Research Data">
Open Access mandate for Publications and Research Data Open Access mandate for Publications and Research Data
</span>{{" "}} </span>{{" "}}
<span *ngIf="projectInfo.openAccessMandatePublications != undefined && projectInfo.openAccessMandatePublications && (projectInfo.openAccessMandateDatasets == undefined || !projectInfo.openAccessMandateDatasets)" <span
class="uk-label custom-label label-openaccessmandate " title="Open Access mandate for Publications">Open Access mandate for Publications</span>{{" "}} *ngIf="projectInfo.openAccessMandatePublications != undefined && projectInfo.openAccessMandatePublications && (projectInfo.openAccessMandateDatasets == undefined || !projectInfo.openAccessMandateDatasets)"
<span *ngIf="projectInfo.specialClause39" class="uk-label custom-label label-sc39 " title="Special Clause 39">Special Clause 39</span>{{" "}} class="uk-label custom-label label-openaccessmandate " title="Open Access mandate for Publications">Open Access mandate for Publications</span>{{" "}}
<span *ngIf="projectInfo.openAccessMandateDatasets != undefined && projectInfo.openAccessMandateDatasets && (projectInfo.openAccessMandatePublications == undefined || !projectInfo.openAccessMandatePublications)" <span *ngIf="projectInfo.specialClause39" class="uk-label custom-label label-sc39 "
class="uk-label custom-label label-openaccessmandate " title="Open Access mandate for Research Data">Open Access mandate for Research Data</span>{{" "}} title="Special Clause 39">Special Clause 39</span>{{" "}}
<span
*ngIf="projectInfo.openAccessMandateDatasets != undefined && projectInfo.openAccessMandateDatasets && (projectInfo.openAccessMandatePublications == undefined || !projectInfo.openAccessMandatePublications)"
class="uk-label custom-label label-openaccessmandate " title="Open Access mandate for Research Data">Open Access mandate for Research Data</span>{{" "}}
</div> </div>
<ul class="uk-list"> <ul class="uk-list">
<li *ngIf="projectInfo.funding"><span class="uk-text-bold">Funding:</span> {{projectInfo.funding}}</li> <li *ngIf="projectInfo.funding"><span class="uk-text-bold">Funding:</span> {{projectInfo.funding}}</li>
<li *ngIf="projectInfo.startDate"><span class="uk-text-bold">Start Date:</span> {{projectInfo.startDate}}</li> <li *ngIf="projectInfo.startDate"><span class="uk-text-bold">Start Date:</span> {{projectInfo.startDate}}
<li *ngIf="projectInfo.endDate"><span class="uk-text-bold">End Date:</span> {{projectInfo.endDate}}</li> </li>
<li *ngIf="projectInfo.openAccessMandatePublications != undefined && !projectInfo.openAccessMandatePublications "><span class="uk-text-bold">Open Access mandate for Publications:</span> no</li> <li *ngIf="projectInfo.endDate"><span class="uk-text-bold">End Date:</span> {{projectInfo.endDate}}</li>
<li *ngIf="projectInfo.openAccessMandateDatasets != undefined && !projectInfo.openAccessMandateDatasets "><span class="uk-text-bold">Open Access mandate for Research Data:</span> no</li> <li
*ngIf="projectInfo.openAccessMandatePublications != undefined && !projectInfo.openAccessMandatePublications ">
<span class="uk-text-bold">Open Access mandate for Publications:</span> no
</li>
<li *ngIf="projectInfo.openAccessMandateDatasets != undefined && !projectInfo.openAccessMandateDatasets ">
<span class="uk-text-bold">Open Access mandate for Research Data:</span> no
</li>
<li *ngIf="projectInfo.organizations && projectInfo.organizations.length > 0"><span class="uk-text-bold">Organization:</span> <li *ngIf="projectInfo.organizations && projectInfo.organizations.length > 0"><span class="uk-text-bold">Organization:</span>
<span class="list-horizontal-line"> <span class="list-horizontal-line">
@ -47,13 +69,14 @@
[attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'" [attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'"
[title]="organization.name"> [title]="organization.name">
<a *ngIf="organization.id" <a *ngIf="organization.id"
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization"> [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active"
{{(organization.acronym)?organization.acronym:''}} {{(!organization.acronym && organization.name)?organization.name:''}}</a> routerLink="/search/organization">
{{(organization.acronym) ? organization.acronym : ''}} {{(!organization.acronym && organization.name) ? organization.name : ''}}</a>
<span <span
*ngIf="!organization.id"> *ngIf="!organization.id">
<span *ngIf="organization.acronym">{{organization.acronym}}</span><span <span *ngIf="organization.acronym">{{organization.acronym}}</span><span
*ngIf="!organization.acronym && organization.name">{{organization.name}}</span></span> *ngIf="!organization.acronym && organization.name">{{organization.name}}</span></span>
</span> </span>
</span> </span>
</li> </li>
@ -90,147 +113,157 @@
<ul class="custom-accordion" uk-accordion> <ul class="custom-accordion" uk-accordion>
<li (click)="activeTab='Publications'; searchPublicationsInit()"> <li (click)="activeTab='Publications'; searchPublicationsInit()">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Publications Publications
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchPublications.searchUtils.totalResults | number}}) ({{fetchPublications.searchUtils.totalResults | number}})
<!-- </span> --> <!-- </span> -->
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'" tab_error_class=true></errorMessages> <errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'"
tab_error_class=true></errorMessages>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.DONE"> <div *ngIf="fetchPublications.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" > <div class="uk-text-right" *ngIf="fetchPublications.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])" <a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications" class="uk-button uk-button-text"> routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications"
View all {{fetchPublications.searchUtils.totalResults | number}} results class="uk-button uk-button-text">
</a> View all {{fetchPublications.searchUtils.totalResults | number}} results
</div>
<tab-result [(results)]="fetchPublications.results"
[(status)]= "fetchPublications.searchUtils.status"
type="publication" urlParam="articleId">
</tab-result>
</div>
</div>
</li>
<li (click)="activeTab='Research Data'; searchDatasetsInit()">
<a class="uk-accordion-title" href="#">
Research Data
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchDatasets.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<errorMessages [status]="[fetchDatasets.searchUtils.status]" [type]="'research data'" tab_error_class=true></errorMessages>
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchDatasets" class="uk-button uk-button-text">
View all {{fetchDatasets.searchUtils.totalResults | number}} results
</a>
</div>
<tab-result [(results)]="fetchDatasets.results"
[(status)]= "fetchDatasets.searchUtils.status"
type="dataset" urlParam="datasetId">
</tab-result>
</div>
</div>
</li>
<li (click)="activeTab='Software'; searchSoftwareInit()">
<a class="uk-accordion-title" href="#">
Software
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchSoftware.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<errorMessages [status]="[fetchSoftware.searchUtils.status]" [type]="'software'" tab_error_class=true></errorMessages>
<div *ngIf="fetchSoftware.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchSoftware.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchSoftware" class="uk-button uk-button-text">
View all {{fetchSoftware.searchUtils.totalResults | number}} results
</a>
</div>
<tab-result [(results)]="fetchSoftware.results"
[(status)]= "fetchSoftware.searchUtils.status"
type="software" urlParam="softwareId">
</tab-result>
</div>
</div>
</li>
<li (click)="activeTab='Other Research Products'; searchOrpsInit()">
<a class="uk-accordion-title" href="#">
Other Research Products
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchOrps.searchUtils.totalResults | number}})
<!-- </span> -->
</a> </a>
<div class="uk-accordion-content"> </div>
<errorMessages [status]="[fetchOrps.searchUtils.status]" [type]="'other research products'" tab_error_class=true></errorMessages> <tab-result [(results)]="fetchPublications.results"
[(status)]="fetchPublications.searchUtils.status"
type="publication" urlParam="articleId">
</tab-result>
</div>
</div>
</li>
<div *ngIf="fetchOrps.searchUtils.status == errorCodes.DONE"> <li (click)="activeTab='Research Data'; searchDatasetsInit()">
<a class="uk-accordion-title" href="#">
Research Data
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchDatasets.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<errorMessages [status]="[fetchDatasets.searchUtils.status]" [type]="'research data'"
tab_error_class=true></errorMessages>
<div class = "uk-text-right" *ngIf = "fetchOrps.searchUtils.totalResults > 10"> <div *ngIf="fetchDatasets.searchUtils.status == errorCodes.DONE">
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchOrps" class="uk-button uk-button-text">
View all {{fetchOrps.searchUtils.totalResults | number}} results
</a>
</div>
<tab-result [(results)]="fetchOrps.results"
[(status)]= "fetchOrps.searchUtils.status"
type="other" urlParam="orpId">
</tab-result>
</div>
</div>
</li>
<li (click)="activeTab='Statistics'; statsClicked=true"> <div class="uk-text-right" *ngIf="fetchDatasets.searchUtils.totalResults > 10">
<a class="uk-accordion-title" href="#"> <a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
Statistics routerLinkActive="router-link-active" [routerLink]="linkToSearchDatasets"
</a> class="uk-button uk-button-text">
<div class="uk-accordion-content"> View all {{fetchDatasets.searchUtils.totalResults | number}} results
<errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status]" [type]="'statistics'" tab_error_class=true></errorMessages> </a>
</div>
<tab-result [(results)]="fetchDatasets.results"
[(status)]="fetchDatasets.searchUtils.status"
type="dataset" urlParam="datasetId">
</tab-result>
</div>
</div>
</li>
<div *ngIf="statsClicked && (fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE)"> <li (click)="activeTab='Software'; searchSoftwareInit()">
<a class="uk-accordion-title" href="#">
Software
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchSoftware.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<errorMessages [status]="[fetchSoftware.searchUtils.status]" [type]="'software'"
tab_error_class=true></errorMessages>
<div> <div *ngIf="fetchSoftware.searchUtils.status == errorCodes.DONE">
<p class="uk-text-bold">Research Results</p>
<i-frame [url]=chartScientificResultsUrl width="100%" height="350"></i-frame>
<p class="uk-text-bold">Access Mode of Research Results</p>
<i-frame [url]=chartAccessModeUrl width="100%" height="350"></i-frame>
<p class="uk-text-bold">By Datasource of Research Results</p>
<i-frame [url]=chartDatasourcesUrl width="100%" height="350"></i-frame>
</div>
</div>
</div>
</li>
<li (click)="metricsClicked=true; activeTab='Metrics'"> <div class="uk-text-right" *ngIf="fetchSoftware.searchUtils.totalResults > 10">
<a class="uk-accordion-title" href="#"> <a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
Metrics routerLinkActive="router-link-active" [routerLink]="linkToSearchSoftware"
</a> class="uk-button uk-button-text">
<div class="uk-accordion-content"> View all {{fetchSoftware.searchUtils.totalResults | number}} results
<metrics [pageViews]="pageViews" </a>
</div>
<tab-result [(results)]="fetchSoftware.results"
[(status)]="fetchSoftware.searchUtils.status"
type="software" urlParam="softwareId">
</tab-result>
</div>
</div>
</li>
<li (click)="activeTab='Other Research Products'; searchOrpsInit()">
<a class="uk-accordion-title" href="#">
Other Research Products
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchOrps.searchUtils.totalResults | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<errorMessages [status]="[fetchOrps.searchUtils.status]" [type]="'other research products'"
tab_error_class=true></errorMessages>
<div *ngIf="fetchOrps.searchUtils.status == errorCodes.DONE">
<div class="uk-text-right" *ngIf="fetchOrps.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchOrps"
class="uk-button uk-button-text">
View all {{fetchOrps.searchUtils.totalResults | number}} results
</a>
</div>
<tab-result [(results)]="fetchOrps.results"
[(status)]="fetchOrps.searchUtils.status"
type="other" urlParam="orpId">
</tab-result>
</div>
</div>
</li>
<li (click)="activeTab='Statistics'; statsClicked=true">
<a class="uk-accordion-title" href="#">
Statistics
</a>
<div class="uk-accordion-content">
<errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status]"
[type]="'statistics'" tab_error_class=true></errorMessages>
<div
*ngIf="statsClicked && (fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE)">
<div>
<p class="uk-text-bold">Research Results</p>
<i-frame [url]=chartScientificResultsUrl width="100%" height="350"></i-frame>
<p class="uk-text-bold">Access Mode of Research Results</p>
<i-frame [url]=chartAccessModeUrl width="100%" height="350"></i-frame>
<p class="uk-text-bold">By Datasource of Research Results</p>
<i-frame [url]=chartDatasourcesUrl width="100%" height="350"></i-frame>
</div>
</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]="projectId" [entityType]="'projects'" [entity]="'Project'" [id]="projectId" [entityType]="'projects'" [entity]="'Project'"
(metricsResults)="metricsResults($event)" [(properties)] = properties> (metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics> </metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0" <i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250"> [url]=viewsFrameUrl width="100%" height="250">
</i-frame> </i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads > 0" <i-frame *ngIf="metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250"> [url]=downloadsFrameUrl width="100%" height="250">
</i-frame> </i-frame>
</div> </div>
</li> </li>
</ul> </ul>
@ -403,161 +436,235 @@
</i-frame> </i-frame>
</div> </div>
</div> --> </div> -->
</div>
<div class="uk-width-large@m uk-width-1-1@s">
<div class="uk-card uk-card-default uk-padding-small">
<div>
Share - Bookmark<addThis ></addThis>
</div> </div>
<div class="uk-margin-medium-top uk-margin-medium-bottom">
<div class="uk-text-center uk-text-large">
Application Box
</div>
<div class="app-box" >
<ul class="uk-tab" uk-tab="connect: #tab-app-box-project">
<li>
<a>Publications</a>
</li>
<li>
<a>Research Data</a>
</li>
</ul>
<ul id="tab-app-box-project" class="uk-switcher uk-margin uk-padding-small">
<li class="uk-animation-fade">
<!-- Publication box-->
<ul class="uk-list">
<li>
<a class="clickable" uk-toggle="target: #publications_dynamic; animation:uk-animation-fade"><span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="code" ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.01" points="13,4 19,10 13,16"></polyline><polyline fill="none" stroke="#000" stroke-width="1.01" points="7,4 1,10 7,16"></polyline></svg></span> Include in your site (HTML)</a>
<div hidden id="publications_dynamic" class="widget-box uk-padding-small uk-card uk-card-default ">
<div class=" uk-alert uk-alert-primary uk-padding-small uk-margin-remove-bottom uk-margin-right">
For further information please contact us <a href="mailto:helpdesk@openaire.eu">helpdesk@openaire.eu</a>
</div>
<div class="uk-grid">
<a class=" publ_clipboard_btn uk-padding-remove-left uk-margin-small-left uk-text-right uk-width-1-1 " data-clipboard-target="#publ_clipboard" title="Copy to clipboard">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</div>
<pre class="box-content uk-padding-remove-bottom uk-margin-remove-bottom"><code id="publ_clipboard">{{publications_dynamic}}</code></pre> <div class="uk-width-large@m uk-width-1-1@s">
</div> <div class="uk-card uk-card-default uk-padding-small">
</li> <div>
<li> Share - Bookmark
<a target="_blank" <addThis></addThis>
href="/project-report?projectId={{projectId}}&size={{fetchPublications.searchUtils.totalResults}}&type=publication"> </div>
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="table" ratio="1"><rect x="1" y="3" width="18" height="1"></rect><rect x="1" y="7" width="18" height="1"></rect><rect x="1" y="11" width="18" height="1"></rect><rect x="1" y="15" width="18" height="1"></rect></svg></span> Get {{projectInfo.funder}} report (HTML) <div class="uk-margin-medium-top uk-margin-medium-bottom">
</a> <div class="uk-text-center uk-text-large">
</li> Application Box
<li> </div>
<a class="clickable" (click)="downloadfile(downloadURLAPI+csvParams, 'funder-publications-report')"> <div class="app-box">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span> Get {{projectInfo.funder}} report (CSV) <ul class="uk-tab" uk-tab="connect: #tab-app-box-project">
</a> <li>
</li> <a>Publications</a>
<li *ngIf="isRouteAvailable('participate/deposit-publications') ">
<a routerLinkActive="router-link-active" routerLink="/participate/deposit-publications">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><polyline fill="none" stroke="#000" points="5 8 9.5 3.5 14 8 "></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5" y2="4"></line></svg>
</span> Deposit
</a>
</li>
</ul>
</li>
<li class="uk-animation-fade">
<!-- Dataset box-->
<ul class="uk-list">
<li>
<a class="clickable" uk-toggle="target: #datasets_dynamic; animation:uk-animation-fade"><span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="code" ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.01" points="13,4 19,10 13,16"></polyline><polyline fill="none" stroke="#000" stroke-width="1.01" points="7,4 1,10 7,16"></polyline></svg></span> Include in your site (HTML) </a>
<div hidden id="datasets_dynamic" class="widget-box uk-padding-small uk-card uk-card-default ">
<div class=" uk-alert uk-alert-primary uk-padding-small uk-margin-remove-bottom uk-margin-right">
For further information please contact us <a href="mailto:helpdesk@openaire.eu">helpdesk@openaire.eu</a>
</div>
<div class="uk-grid">
<a class=" datasets_clipboard_btn uk-padding-remove-left uk-margin-small-left uk-text-right uk-width-1-1 " data-clipboard-target="#datasets_clipboard" title="Copy to clipboard">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</div>
<pre class="box-content uk-padding-remove-bottom uk-margin-remove-bottom"><code id="datasets_clipboard">{{datasets_dynamic}}</code></pre>
</div>
</li> </li>
<li> <li>
<a target="_blank" <a>Research Data</a>
href="/project-report?projectId={{projectId}}&size={{fetchDatasets.searchUtils.totalResults}}&type=dataset">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="table" ratio="1"><rect x="1" y="3" width="18" height="1"></rect><rect x="1" y="7" width="18" height="1"></rect><rect x="1" y="11" width="18" height="1"></rect><rect x="1" y="15" width="18" height="1"></rect></svg></span> Get {{projectInfo.funder}} report (HTML)
</a>
</li>
<li>
<a class="clickable" (click)="downloadfile(downloadURLAPI+csvParamsDatasets, 'funder-research-data-report')">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span> Get {{projectInfo.funder}} report (CSV)
</a>
</li>
<li *ngIf="isRouteAvailable('participate/deposit-datasets') ">
<a routerLinkActive="router-link-active" routerLink="/participate/deposit-datasets">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><polyline fill="none" stroke="#000" points="5 8 9.5 3.5 14 8 "></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5" y2="4"></line></svg>
</span> Deposit
</a>
</li> </li>
</ul> </ul>
</li> <ul id="tab-app-box-project" class="uk-switcher uk-margin uk-padding-small">
</ul> <li class="uk-animation-fade">
<!-- Publication box-->
<ul class="uk-list">
<li>
<a class="clickable"
uk-toggle="target: #publications_dynamic; animation:uk-animation-fade"><span
class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" icon="code" ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.01" points="13,4 19,10 13,16"></polyline><polyline
fill="none" stroke="#000" stroke-width="1.01"
points="7,4 1,10 7,16"></polyline></svg></span> Include in your site (HTML)</a>
<div hidden id="publications_dynamic"
class="widget-box uk-padding-small uk-card uk-card-default ">
<div
class=" uk-alert uk-alert-primary uk-padding-small uk-margin-remove-bottom uk-margin-right">
For further information please contact us <a href="mailto:helpdesk@openaire.eu">helpdesk@openaire.eu</a>
</div>
<div class="uk-grid">
<a
class=" publ_clipboard_btn uk-padding-remove-left uk-margin-small-left uk-text-right uk-width-1-1 "
data-clipboard-target="#publ_clipboard" title="Copy to clipboard">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect
fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline
fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</div>
</div> <pre class="box-content uk-padding-remove-bottom uk-margin-remove-bottom"><code
<button *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-button portal-button uk-margin-small-top uk-width-1-1"> id="publ_clipboard">{{publications_dynamic}}</code></pre>
</div>
</li>
<li>
<a target="_blank"
href="/project-report?projectId={{projectId}}&size={{fetchPublications.searchUtils.totalResults}}&type=publication">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" icon="table" ratio="1"><rect
x="1" y="3" width="18" height="1"></rect><rect x="1" y="7" width="18" height="1"></rect><rect
x="1" y="11" width="18" height="1"></rect><rect x="1" y="15" width="18" height="1"></rect></svg></span>
Get {{projectInfo.funder}} report (HTML)
</a>
</li>
<li>
<a class="clickable"
(click)="downloadfile(downloadURLAPI+csvParams, 'funder-publications-report')">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline
fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17"
width="13"
height="1"></rect><line
fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span>
Get {{projectInfo.funder}} report (CSV)
</a>
</li>
<li *ngIf="isRouteAvailable('participate/deposit-publications') ">
<a routerLinkActive="router-link-active" routerLink="/participate/deposit-publications">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><polyline fill="none"
stroke="#000"
points="5 8 9.5 3.5 14 8 "></polyline><rect
x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5"
y2="4"></line></svg>
</span> Deposit
</a>
</li>
</ul>
</li>
<li class="uk-animation-fade">
<!-- Dataset box-->
<ul class="uk-list">
<li>
<a class="clickable" uk-toggle="target: #datasets_dynamic; animation:uk-animation-fade"><span
class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" icon="code" ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.01" points="13,4 19,10 13,16"></polyline><polyline
fill="none" stroke="#000" stroke-width="1.01"
points="7,4 1,10 7,16"></polyline></svg></span> Include in your site (HTML) </a>
<div hidden id="datasets_dynamic"
class="widget-box uk-padding-small uk-card uk-card-default ">
<div
class=" uk-alert uk-alert-primary uk-padding-small uk-margin-remove-bottom uk-margin-right">
For further information please contact us <a href="mailto:helpdesk@openaire.eu">helpdesk@openaire.eu</a>
</div>
<div class="uk-grid">
<a
class=" datasets_clipboard_btn uk-padding-remove-left uk-margin-small-left uk-text-right uk-width-1-1 "
data-clipboard-target="#datasets_clipboard" title="Copy to clipboard">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect
fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline
fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</div>
<pre class="box-content uk-padding-remove-bottom uk-margin-remove-bottom"><code
id="datasets_clipboard">{{datasets_dynamic}}</code></pre>
</div>
</li>
<li>
<a target="_blank"
href="/project-report?projectId={{projectId}}&size={{fetchDatasets.searchUtils.totalResults}}&type=dataset">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" icon="table" ratio="1"><rect
x="1" y="3" width="18" height="1"></rect><rect x="1" y="7" width="18" height="1"></rect><rect
x="1" y="11" width="18" height="1"></rect><rect x="1" y="15" width="18" height="1"></rect></svg></span>
Get {{projectInfo.funder}} report (HTML)
</a>
</li>
<li>
<a class="clickable"
(click)="downloadfile(downloadURLAPI+csvParamsDatasets, 'funder-research-data-report')">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline
fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17"
width="13"
height="1"></rect><line
fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span>
Get {{projectInfo.funder}} report (CSV)
</a>
</li>
<li *ngIf="isRouteAvailable('participate/deposit-datasets') ">
<a routerLinkActive="router-link-active" routerLink="/participate/deposit-datasets">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
ratio="1"><polyline fill="none" stroke="#000" points="5 8 9.5 3.5 14 8 "></polyline><rect
x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5"
y1="15" x2="9.5" y2="4"></line></svg>
</span> Deposit
</a>
</li>
</ul>
</li>
</ul>
</div>
<button *ngIf="isRouteAvailable('participate/direct-claim') "
class=" uk-button portal-button uk-margin-small-top uk-width-1-1">
<span class="uk-icon"> <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> <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 project to... </span> Link this project to...
</button> </button>
<div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;" class=" uk-margin-remove-top uk-padding-small"> <div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click"
<ul class="uk-iconnav uk-iconnav-vertical"> style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;"
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size uk-margin-small'>Research results</div>"> class=" uk-margin-remove-top uk-padding-small">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <ul class="uk-iconnav uk-iconnav-vertical">
<span class="uk-icon" > <li uk-tooltip="pos:right;"
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span> title="<div class='tooltip-custom-font-size uk-margin-small'>Research results</div>">
</a> <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
</li> [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy"
ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline
fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
</ul> </ul>
</div>
</div>
<!--metrics [pageViews]="pageViews" shortView=true
[id]="projectId" [entityType]="'projects'" [entity]="'Project'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics-->
</div>
</div> </div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
</div> [texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
<!--metrics [pageViews]="pageViews" shortView=true
[id]="projectId" [entityType]="'projects'" [entity]="'Project'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics-->
</div> </div>
<modal-loading></modal-loading>
<modal-alert #AlertModalCsvError></modal-alert>
<!-- Claiming FAB -->
<!--div class="uk-inline">
<div class=" uk-float-right " style="z-index: 200; bottom: 55px; position: fixed; right: 45%;">
< !--a style="padding: 30px; box-shadow: 0 1px 10px #444444" class=" uk-icon-button uk-button-primary shadowBox" uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Link this publication to</div>">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="40" viewBox="0 0 20 20" height="40"><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>
</a- ->
<button class=" uk-button uk-button-danger ">
<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 project to
</button>
<div uk-dropdown="pos: top-right; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light uk-margin-small'>Research results</div>">
<a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
</ul>
</div>
</div>
</div-->
</div> </div>
</div> </div>
<modal-loading></modal-loading> </div>
<modal-alert #AlertModalCsvError></modal-alert>
<!-- Claiming FAB -->
<!--div class="uk-inline">
<div class=" uk-float-right " style="z-index: 200; bottom: 55px; position: fixed; right: 45%;">
< !--a style="padding: 30px; box-shadow: 0 1px 10px #444444" class=" uk-icon-button uk-button-primary shadowBox" uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Link this publication to</div>">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="40" viewBox="0 0 20 20" height="40"><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>
</a- ->
<button class=" uk-button uk-button-danger ">
<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 project to
</button>
<div uk-dropdown="pos: top-right; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light uk-margin-small'>Research results</div>">
<a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
</ul>
</div>
</div>
</div-->
</div>
</div>
</div>
</div> </div>

View File

@ -1,43 +1,41 @@
import {Component, ViewChild} from '@angular/core'; import {Component, Input, ViewChild} from '@angular/core';
import {Input} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router';
import {ActivatedRoute, Router} from '@angular/router'; import {Meta, Title} from '@angular/platform-browser';
import {Params} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
import {Observable} from 'rxjs'; import {ProjectService} from './project.service';
import {ProjectInfo} from '../../utils/entities/projectInfo';
import {RouterHelper} from '../../utils/routerHelper.class';
import {ProjectService} from './project.service'; import {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class';
import {ProjectInfo} from '../../utils/entities/projectInfo'; import {SearchPublicationsService} from '../../services/searchPublications.service';
import {RouterHelper} from '../../utils/routerHelper.class'; import {FetchDatasets} from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
import {SearchDatasetsService} from '../../services/searchDatasets.service';
import {FetchSoftware} from '../../utils/fetchEntitiesClasses/fetchSoftware.class';
import {SearchSoftwareService} from '../../services/searchSoftware.service';
import {FetchOrps} from '../../utils/fetchEntitiesClasses/fetchOrps.class';
import {SearchOrpsService} from '../../services/searchOrps.service';
import {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class'; import {ModalLoading} from '../../utils/modal/loading.component';
import {SearchPublicationsService} from '../../services/searchPublications.service';
import {FetchDatasets} from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
import {SearchDatasetsService} from '../../services/searchDatasets.service';
import {FetchSoftware} from '../../utils/fetchEntitiesClasses/fetchSoftware.class';
import {SearchSoftwareService} from '../../services/searchSoftware.service';
import {FetchOrps} from '../../utils/fetchEntitiesClasses/fetchOrps.class';
import {SearchOrpsService} from '../../services/searchOrps.service';
import {ModalLoading} from '../../utils/modal/loading.component'; import {ReportsService} from '../../services/reports.service';
import {ErrorCodes} from '../../utils/properties/errorCodes'
import {ReportsService} from '../../services/reports.service'; import {PiwikService} from '../../utils/piwik/piwik.service';
import {ErrorCodes} from '../../utils/properties/errorCodes' import {EnvProperties} from '../../utils/properties/env-properties';
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
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 {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({ @Component({
selector: 'project', selector: 'project',
templateUrl: 'project.component.html', templateUrl: 'project.component.html',
}) })
export class ProjectComponent{ export class ProjectComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() communityId = null;
public projectInfo: ProjectInfo; public projectInfo: ProjectInfo;
public projectId : string ; public projectId: string;
public projectName: string; public projectName: string;
// Metrics tab variables // Metrics tab variables
@ -60,7 +58,7 @@ export class ProjectComponent{
public software_dynamic: string; public software_dynamic: string;
public orps_dynamic: string; public orps_dynamic: string;
public project ; public project;
// CSV variables // CSV variables
public downloadURLAPI: string; public downloadURLAPI: string;
@ -84,419 +82,457 @@ export class ProjectComponent{
private reloadOrps: boolean = true; private reloadOrps: boolean = true;
// Variables for publications, research data, software tabs // Variables for publications, research data, software tabs
public fetchPublications : FetchPublications; public fetchPublications: FetchPublications;
public linkToSearchPublications = ""; public linkToSearchPublications = "";
public fetchDatasets : FetchDatasets; public fetchDatasets: FetchDatasets;
public linkToSearchDatasets = ""; public linkToSearchDatasets = "";
public fetchSoftware: FetchSoftware; public fetchSoftware: FetchSoftware;
public linkToSearchSoftware = ""; public linkToSearchSoftware = "";
public fetchOrps: FetchOrps; public fetchOrps: FetchOrps;
public linkToSearchOrps = ""; public linkToSearchOrps = "";
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
public errorCodes:ErrorCodes = new ErrorCodes(); public errorCodes: ErrorCodes = new ErrorCodes();
public pageContents = null;
public divContents = null;
@ViewChild (ModalLoading) loading : ModalLoading ; @ViewChild(ModalLoading) loading: ModalLoading;
// Alert box when something is wrong with CSV requests // Alert box when something is wrong with CSV requests
@ViewChild('AlertModalCsvError') alertCsvError; @ViewChild('AlertModalCsvError') alertCsvError;
sub: any; piwiksub: any; infoSub: any; downloadFilePiwikSub: any; sub: any;
properties:EnvProperties; piwiksub: any;
constructor ( private _projectService: ProjectService, infoSub: any;
private _piwikService:PiwikService, downloadFilePiwikSub: any;
private route: ActivatedRoute, properties: EnvProperties;
private router: Router,
private _searchPublicationsService: SearchPublicationsService, constructor(private _projectService: ProjectService,
private _searchDatasetsService: SearchDatasetsService, private _piwikService: PiwikService,
private _searchSoftwareService: SearchSoftwareService, private route: ActivatedRoute,
private _searchOrpsService: SearchOrpsService, private router: Router,
private _reportsService: ReportsService, private _searchPublicationsService: SearchPublicationsService,
private _meta: Meta, private _searchDatasetsService: SearchDatasetsService,
private _title: Title, private _searchSoftwareService: SearchSoftwareService,
private _router: Router, private _searchOrpsService: SearchOrpsService,
private _reportsService: ReportsService,
private _meta: Meta,
private _title: Title,
private _router: Router,
private helper: HelperService,
private seoService: SEOService) { private seoService: SEOService) {
} }
ngOnInit() { ngOnInit() {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url); //this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
}); });
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
this.metricsClicked = false; this.metricsClicked = false;
this.statsClicked = false; this.statsClicked = false;
this.fetchPublications = new FetchPublications( this._searchPublicationsService); this.fetchPublications = new FetchPublications(this._searchPublicationsService);
this.fetchDatasets = new FetchDatasets(this._searchDatasetsService); this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
this.fetchSoftware = new FetchSoftware(this._searchSoftwareService); this.fetchSoftware = new FetchSoftware(this._searchSoftwareService);
this.fetchOrps = new FetchOrps(this._searchOrpsService); this.fetchOrps = new FetchOrps(this._searchOrpsService);
var title = "Project"; var title = "Project";
var description = ""; var description = "";
this.updateTitle(title); this.updateTitle(title);
this.updateDescription(description); this.updateDescription(description);
this.projectId = params['projectId']; this.projectId = params['projectId'];
var grantId = params['grantId']; var grantId = params['grantId'];
var funder = params['funder']; var funder = params['funder'];
if(this.projectId){ if (this.projectId) {
this.getProjectInfo(this.projectId); this.getProjectInfo(this.projectId);
this.actionsAfterLoadId(); this.actionsAfterLoadId();
}else if(grantId && funder){ } else if (grantId && funder) {
this.getProjectInfoByGrantId(grantId,funder); this.getProjectInfoByGrantId(grantId, funder);
}else{ } else {
this.showLoading = false; this.showLoading = false;
this.warningMessage="No valid project id"; this.warningMessage = "No valid project id";
} }
this.downloadURLAPI = this.properties.csvAPIURL; this.downloadURLAPI = this.properties.csvAPIURL;
this.createClipboard(); this.createClipboard();
this.csvParams = "?format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact \""+this.projectId+"\"))"; this.csvParams = "?format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact \"" + this.projectId + "\"))";
this.csvParamsDatasets = "?format=csv-special&type=datasets&fq=(((oaftype exact result) and (resulttypeid exact dataset)) and (relprojectid exact \""+this.projectId+"\"))"; this.csvParamsDatasets = "?format=csv-special&type=datasets&fq=(((oaftype exact result) and (resulttypeid exact dataset)) and (relprojectid exact \"" + this.projectId + "\"))";
this.csvParamsSoftware = "?format=csv-special&type=software&fq=(((oaftype exact result) and (resulttypeid exact software)) and (relprojectid exact \""+this.projectId+"\"))"; this.csvParamsSoftware = "?format=csv-special&type=software&fq=(((oaftype exact result) and (resulttypeid exact software)) and (relprojectid exact \"" + this.projectId + "\"))";
this.csvParamsOrps = "?format=csv-special&type=other&fq=(((oaftype exact result) and (resulttypeid exact other)) and (relprojectid exact \""+this.projectId+"\"))"; this.csvParamsOrps = "?format=csv-special&type=other&fq=(((oaftype exact result) and (resulttypeid exact other)) and (relprojectid exact \"" + this.projectId + "\"))";
HelperFunctions.scroll(); HelperFunctions.scroll();
}); });
} }
actionsAfterLoadId(){ private getPageContents() {
this.publications_dynamic = this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
"<script type=\"text/javascript\">" this.pageContents = contents;
+ "\n<!--" })
+ "\ndocument.write('<div id=\"oa_widget\"></div>');" }
+ "\ndocument.write('<script type=\"text/javascript\""
+ " src=\""+this.properties.widgetLink
+ this.projectId + "&type=publication\"></script>');"
+ "\n-->"
+ "\n</script>";
this.datasets_dynamic = private getDivContents() {
"<script type=\"text/javascript\">" this.helper.getDivHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
+ "\n<!--" this.divContents = contents;
+ "\ndocument.write('<div id=\"oa_widget\"></div>');" })
+ "\ndocument.write('<script type=\"text/javascript\"" }
+ " src=\""+this.properties.widgetLink
+ this.projectId + "&type=dataset\"></script>');"
+ "\n-->"
+ "\n</script>";
this.software_dynamic = actionsAfterLoadId() {
"<script type=\"text/javascript\">" this.publications_dynamic =
+ "\n<!--" "<script type=\"text/javascript\">"
+ "\ndocument.write('<div id=\"oa_widget\"></div>');" + "\n<!--"
+ "\ndocument.write('<script type=\"text/javascript\"" + "\ndocument.write('<div id=\"oa_widget\"></div>');"
+ "\nsrc=\""+this.properties.widgetLink + "\ndocument.write('<script type=\"text/javascript\""
+ this.projectId + "&type=software\"></script>');" + " src=\"" + this.properties.widgetLink
+ "\n-->" + this.projectId + "&type=publication\"></script>');"
+ "\n</script>"; + "\n-->"
+ "\n</script>";
this.orps_dynamic = this.datasets_dynamic =
"<script type=\"text/javascript\">" "<script type=\"text/javascript\">"
+ "\n<!--" + "\n<!--"
+ "\ndocument.write('<div id=\"oa_widget\"></div>');" + "\ndocument.write('<div id=\"oa_widget\"></div>');"
+ "\ndocument.write('<script type=\"text/javascript\"" + "\ndocument.write('<script type=\"text/javascript\""
+ "\nsrc=\""+this.properties.widgetLink + " src=\"" + this.properties.widgetLink
+ this.projectId + "&type=other\"></script>');" + this.projectId + "&type=dataset\"></script>');"
+ "\n-->" + "\n-->"
+ "\n</script>"; + "\n</script>";
this.software_dynamic =
"<script type=\"text/javascript\">"
+ "\n<!--"
+ "\ndocument.write('<div id=\"oa_widget\"></div>');"
+ "\ndocument.write('<script type=\"text/javascript\""
+ "\nsrc=\"" + this.properties.widgetLink
+ this.projectId + "&type=software\"></script>');"
+ "\n-->"
+ "\n</script>";
this.orps_dynamic =
"<script type=\"text/javascript\">"
+ "\n<!--"
+ "\ndocument.write('<div id=\"oa_widget\"></div>');"
+ "\ndocument.write('<script type=\"text/javascript\""
+ "\nsrc=\"" + this.properties.widgetLink
+ this.projectId + "&type=other\"></script>');"
+ "\n-->"
+ "\n</script>";
this.getProjectInfo(this.projectId);
//this.searchPublications();
this.fetchPublications.getNumForEntity("project", this.projectId, this.properties);
this.fetchDatasets.getNumForEntity("project", this.projectId, this.properties);
this.fetchSoftware.getNumForEntity("project", this.projectId, this.properties);
this.fetchOrps.getNumForEntity("project", this.projectId, this.properties);
}
this.getProjectInfo(this.projectId);
//this.searchPublications();
this.fetchPublications.getNumForEntity("project", this.projectId, this.properties);
this.fetchDatasets.getNumForEntity("project", this.projectId, this.properties);
this.fetchSoftware.getNumForEntity("project", this.projectId, this.properties);
this.fetchOrps.getNumForEntity("project", this.projectId, this.properties);
}
ngOnDestroy() { ngOnDestroy() {
if(this.sub){ if (this.sub) {
this.sub.unsubscribe(); this.sub.unsubscribe();
} }
if(this.piwiksub){ if (this.piwiksub) {
this.piwiksub.unsubscribe(); this.piwiksub.unsubscribe();
} }
if(this.infoSub) { if (this.infoSub) {
this.infoSub.unsubscribe(); this.infoSub.unsubscribe();
} }
if(this.downloadFilePiwikSub) { if (this.downloadFilePiwikSub) {
this.downloadFilePiwikSub.unsubscribe(); this.downloadFilePiwikSub.unsubscribe();
} }
} }
private createClipboard() { private createClipboard() {
if(typeof window !== 'undefined') { if (typeof window !== 'undefined') {
let publ_clipboard, datasets_clipboard, software_clipboard, orps_clipboard; let publ_clipboard, datasets_clipboard, software_clipboard, orps_clipboard;
let Clipboard; let Clipboard;
Clipboard = require('clipboard'); Clipboard = require('clipboard');
publ_clipboard = new Clipboard('.publ_clipboard_btn'); publ_clipboard = new Clipboard('.publ_clipboard_btn');
datasets_clipboard = new Clipboard('.datasets_clipboard_btn'); datasets_clipboard = new Clipboard('.datasets_clipboard_btn');
software_clipboard = new Clipboard('.software_clipboard_btn'); software_clipboard = new Clipboard('.software_clipboard_btn');
orps_clipboard = new Clipboard('.orps_clipboard_btn'); orps_clipboard = new Clipboard('.orps_clipboard_btn');
} }
} }
private searchPublications() { private searchPublications() {
this.fetchPublications.getResultsForEntity("project", this.projectId, 1, 10, this.properties); this.fetchPublications.getResultsForEntity("project", this.projectId, 1, 10, this.properties);
this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications;// + "?project=" + this.projectId+"&pr=and"; this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications;// + "?project=" + this.projectId+"&pr=and";
//if(this.fetchPublications.searchUtils.totalResults > 0) { //if(this.fetchPublications.searchUtils.totalResults > 0) {
//this.activeTab = "Publications"; //this.activeTab = "Publications";
//} else { //} else {
//this.searchDatasetsInit(); //this.searchDatasetsInit();
//} //}
this.reloadPublications = false; this.reloadPublications = false;
} }
private searchDatasets() { private searchDatasets() {
this.fetchDatasets.getResultsForEntity("project", this.projectId, 1, 10, this.properties); this.fetchDatasets.getResultsForEntity("project", this.projectId, 1, 10, this.properties);
this.linkToSearchDatasets = this.properties.searchLinkToAdvancedDatasets;// + "?project=" + this.projectId+"&pr=and"; this.linkToSearchDatasets = this.properties.searchLinkToAdvancedDatasets;// + "?project=" + this.projectId+"&pr=and";
this.reloadDatasets = false; this.reloadDatasets = false;
//this.activeTab = "Research Data"; //this.activeTab = "Research Data";
} }
private searchSoftware() { private searchSoftware() {
this.fetchSoftware.getResultsForEntity("project", this.projectId, 1, 10, this.properties); this.fetchSoftware.getResultsForEntity("project", this.projectId, 1, 10, this.properties);
this.linkToSearchSoftware = this.properties.searchLinkToAdvancedSoftware; this.linkToSearchSoftware = this.properties.searchLinkToAdvancedSoftware;
this.reloadSoftware = false; this.reloadSoftware = false;
} }
private searchOrps() { private searchOrps() {
this.fetchOrps.getResultsForEntity("project", this.projectId, 1, 10, this.properties); this.fetchOrps.getResultsForEntity("project", this.projectId, 1, 10, this.properties);
this.linkToSearchOrps = this.properties.searchLinkToAdvancedOrps; this.linkToSearchOrps = this.properties.searchLinkToAdvancedOrps;
this.reloadOrps = false; this.reloadOrps = false;
} }
public searchPublicationsInit() { public searchPublicationsInit() {
if(this.reloadPublications && this.fetchPublications.searchUtils.totalResults > 0) { if (this.reloadPublications && this.fetchPublications.searchUtils.totalResults > 0) {
this.searchPublications(); this.searchPublications();
} else if(this.fetchPublications.searchUtils.totalResults == 0) { } else if (this.fetchPublications.searchUtils.totalResults == 0) {
//this.statsClicked=true; //this.statsClicked=true;
//this.activeTab = "Statistics"; //this.activeTab = "Statistics";
} }
} }
public searchDatasetsInit() { public searchDatasetsInit() {
if(this.reloadDatasets && this.fetchDatasets.searchUtils.totalResults > 0) { if (this.reloadDatasets && this.fetchDatasets.searchUtils.totalResults > 0) {
this.searchDatasets(); this.searchDatasets();
} else if(this.fetchDatasets.searchUtils.totalResults == 0) { } else if (this.fetchDatasets.searchUtils.totalResults == 0) {
//this.statsClicked=true; //this.statsClicked=true;
//this.activeTab = "Statistics"; //this.activeTab = "Statistics";
} }
} }
public searchSoftwareInit() { public searchSoftwareInit() {
if(this.reloadSoftware && this.fetchSoftware.searchUtils.totalResults > 0) { if (this.reloadSoftware && this.fetchSoftware.searchUtils.totalResults > 0) {
this.searchSoftware(); this.searchSoftware();
} }
} }
public searchOrpsInit() { public searchOrpsInit() {
if(this.reloadOrps && this.fetchOrps.searchUtils.totalResults > 0) { if (this.reloadOrps && this.fetchOrps.searchUtils.totalResults > 0) {
this.searchOrps(); this.searchOrps();
} }
} }
private getProjectInfo (id:string) { private getProjectInfo(id: string) {
this.warningMessage = ''; this.warningMessage = '';
this.errorMessage="" this.errorMessage = ""
this.showLoading = true; this.showLoading = true;
this.projectInfo = null; this.projectInfo = null;
this.infoSub = this._projectService.getProjectInfo(id, this.properties).subscribe( this.infoSub = this._projectService.getProjectInfo(id, this.properties).subscribe(
data => { data => {
this.projectInfo = data; this.projectInfo = data;
this.actionsAfterGettingProjectInfo(); this.actionsAfterGettingProjectInfo();
}, },
err => { err => {
//console.log(err); //console.log(err);
this.handleError("Error getting project for id: "+this.projectId, err); this.handleError("Error getting project for id: " + this.projectId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToProjects); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToProjects);
this.errorMessage = 'No project found'; this.errorMessage = 'No project found';
this.showLoading = false; this.showLoading = false;
} }
); );
} }
private getProjectInfoByGrantId (grantId:string, funder:string) {
this.warningMessage = '';
this.errorMessage=""
this.showLoading = true;
this.projectInfo = null; private getProjectInfoByGrantId(grantId: string, funder: string) {
this.warningMessage = '';
this.errorMessage = ""
this.showLoading = true;
this._projectService.getProjectInfoByGrantId(grantId,funder,this.properties).subscribe( this.projectInfo = null;
data =>{
this.projectInfo = data; this._projectService.getProjectInfoByGrantId(grantId, funder, this.properties).subscribe(
data => {
this.actionsAfterGettingProjectInfo(); this.projectInfo = data;
this.projectId = this.projectInfo.id;
this.actionsAfterLoadId(); this.actionsAfterGettingProjectInfo();
}, this.projectId = this.projectInfo.id;
err => { this.actionsAfterLoadId();
//console.log(err); },
this.handleError("Error getting project for grant id: "+grantId+" and funder: "+funder, err); err => {
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToProjects); //console.log(err);
this.errorMessage = 'No project found'; this.handleError("Error getting project for grant id: " + grantId + " and funder: " + funder, err);
this.showLoading = false; this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToProjects);
} this.errorMessage = 'No project found';
); this.showLoading = false;
} }
actionsAfterGettingProjectInfo(){ );
this.projectName = this.projectInfo.acronym; }
if(this.projectName == undefined || this.projectName == '') {
actionsAfterGettingProjectInfo() {
this.projectName = this.projectInfo.acronym;
if (this.projectName == undefined || this.projectName == '') {
this.projectName = this.projectInfo.title; this.projectName = this.projectInfo.title;
} }
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url);
this.updateTitle(this.projectName); this.updateTitle(this.projectName);
this.updateDescription("project, "+this.projectName+ ","+this.projectInfo.funder+","+this.projectInfo.acronym); this.updateDescription("project, " + this.projectName + "," + this.projectInfo.funder + "," + this.projectInfo.acronym);
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.projectName, this.piwikSiteId).subscribe(); this.piwiksub = this._piwikService.trackView(this.properties, this.projectName, this.piwikSiteId).subscribe();
}
this.project = {
funderId: "",
funderName: this.projectInfo.funder,
projectId: this.projectId,
projectName: this.projectInfo.title,
projectAcronym: this.projectInfo.acronym,
startDate: this.projectInfo.startDate,
endDate: this.projectInfo.endDate
};
this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"projRepoViews","projTitle":"' + this.projectId + '","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":"","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&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":"projRepoDownloads","projTitle":"' + this.projectId + '","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":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&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';
//stats tab charts
this.chartScientificResultsUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"projScient","projTitle":"' + this.projectId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "spline", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [" "], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250';
this.chartAccessModeUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"projOA","projTitle":"' + this.projectId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [" "], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250';
this.chartDatasourcesUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"projPubsRepos","projTitle":"' + this.projectId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [" "], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250';
this.showLoading = false;
} }
this.project= { funderId: "", funderName: this.projectInfo.funder, projectId: this.projectId, projectName: this.projectInfo.title, projectAcronym: this.projectInfo.acronym, startDate: this.projectInfo.startDate, endDate: this.projectInfo.endDate }; public downloadfile(url: string, filename: string) {
this.openLoading();
this.setMessageLoading("Downloading CSV file");
this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"projRepoViews","projTitle":"'+this.projectId+'","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":"","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&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._reportsService.downloadCSVFile(url).subscribe(
data => {
this.closeLoading();
this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"projRepoDownloads","projTitle":"'+this.projectId+'","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":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&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'; var url = window.URL.createObjectURL(data);
var a = window.document.createElement('a');
window.document.body.appendChild(a);
a.setAttribute('style', 'display: none');
a.href = url;
a.download = filename + ".csv";
a.click();
window.URL.revokeObjectURL(url);
a.remove(); // remove the element
//stats tab charts //window.open(window.URL.createObjectURL(data));
this.chartScientificResultsUrl=this.properties.statisticsFrameAPIURL+'chart.php?com=query&persistent=false&data={"query":"projScient","projTitle":"'+this.projectId+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "spline", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [" "], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250'; if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.chartAccessModeUrl=this.properties.statisticsFrameAPIURL+'chart.php?com=query&persistent=false&data={"query":"projOA","projTitle":"'+this.projectId+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [" "], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250'; this.downloadFilePiwikSub = this._piwikService.trackDownload(this.properties, url).subscribe();
this.chartDatasourcesUrl= this.properties.statisticsFrameAPIURL+'chart.php?com=query&persistent=false&data={"query":"projPubsRepos","projTitle":"'+this.projectId+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [" "], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250'; }
},
error => {
//console.log("Error downloading the file.");
this.handleError("Error downloading file: " + filename, error);
this.showLoading = false; this.closeLoading();
} this.confirmOpenCsvError();
public downloadfile(url:string, filename: string){ }/*,
this.openLoading();
this.setMessageLoading("Downloading CSV file");
this._reportsService.downloadCSVFile(url).subscribe(
data => {
this.closeLoading();
var url = window.URL.createObjectURL(data);
var a = window.document.createElement('a');
window.document.body.appendChild(a);
a.setAttribute('style', 'display: none');
a.href = url;
a.download = filename+".csv";
a.click();
window.URL.revokeObjectURL(url);
a.remove(); // remove the element
//window.open(window.URL.createObjectURL(data));
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.downloadFilePiwikSub = this._piwikService.trackDownload(this.properties, url).subscribe();
}
},
error => {
//console.log("Error downloading the file.");
this.handleError("Error downloading file: "+filename, error);
this.closeLoading();
this.confirmOpenCsvError();
}/*,
() => console.log('Completed file download.')*/ () => console.log('Completed file download.')*/
); );
} }
/* /*
showHTML(){ showHTML(){
let info:string = "<h1>Publications of Project "; let info:string = "<h1>Publications of Project ";
if(this.projectInfo.title != undefined && this.projectInfo.title != "") { if(this.projectInfo.title != undefined && this.projectInfo.title != "") {
info += this.projectInfo.title; info += this.projectInfo.title;
} }
if((this.projectInfo.title != undefined && this.projectInfo.title != "") && if((this.projectInfo.title != undefined && this.projectInfo.title != "") &&
((this.projectInfo.acronym != undefined && this.projectInfo.acronym != "") || ((this.projectInfo.acronym != undefined && this.projectInfo.acronym != "") ||
(this.projectInfo.callIdentifier != undefined && this.projectInfo.callIdentifier != ""))) { (this.projectInfo.callIdentifier != undefined && this.projectInfo.callIdentifier != ""))) {
info += "("; info += "(";
} }
if(this.projectInfo.acronym != undefined && this.projectInfo.acronym != "") { if(this.projectInfo.acronym != undefined && this.projectInfo.acronym != "") {
info += this.projectInfo.acronym + " - "; info += this.projectInfo.acronym + " - ";
} }
if(this.projectInfo.callIdentifier != undefined && this.projectInfo.callIdentifier != "") { if(this.projectInfo.callIdentifier != undefined && this.projectInfo.callIdentifier != "") {
info += this.projectInfo.callIdentifier; info += this.projectInfo.callIdentifier;
} }
if((this.projectInfo.title != undefined && this.projectInfo.title != "") && if((this.projectInfo.title != undefined && this.projectInfo.title != "") &&
((this.projectInfo.acronym != undefined && this.projectInfo.acronym != "") || ((this.projectInfo.acronym != undefined && this.projectInfo.acronym != "") ||
(this.projectInfo.callIdentifier != undefined && this.projectInfo.callIdentifier != ""))) { (this.projectInfo.callIdentifier != undefined && this.projectInfo.callIdentifier != ""))) {
info += ")"; info += ")";
} }
info +="</h1>"; info +="</h1>";
info += "<h3>"+this.fetchPublications.searchUtils.totalResults+" publications</h3>"; info += "<h3>"+this.fetchPublications.searchUtils.totalResults+" publications</h3>";
let htmlParams = 'resources?format=html&page=0&size='+this.fetchPublications.searchUtils.totalResults+'&type=publications&query=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "'+this.projectId+'"))'; let htmlParams = 'resources?format=html&page=0&size='+this.fetchPublications.searchUtils.totalResults+'&type=publications&query=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "'+this.projectId+'"))';
this._reportsService.downloadHTMLFile(this.downloadURLAPI+htmlParams, info) this._reportsService.downloadHTMLFile(this.downloadURLAPI+htmlParams, info)
.subscribe(data => this.funct(data), .subscribe(data => this.funct(data),
error => console.log("Error downloading the file."), error => console.log("Error downloading the file."),
() => console.log('Completed file download.')); () => console.log('Completed file download.'));
} }
funct(data) { funct(data) {
var win = window.open(window.URL.createObjectURL(data)); var win = window.open(window.URL.createObjectURL(data));
} }
*/ */
public metricsResults($event) { public metricsResults($event) {
this.totalViews = $event.totalViews; this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads; this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews; this.pageViews = $event.pageViews;
} }
private updateDescription(description:string) { private updateDescription(description: string) {
this._meta.updateTag({content:description},"name='description'"); this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content:description},"property='og:description'"); this._meta.updateTag({content: description}, "property='og:description'");
} }
private updateTitle(title:string) {
var _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'");
}
private openLoading(){ private updateTitle(title: string) {
if(this.loading){ var _prefix = "OpenAIRE | ";
this.loading.open(); var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
} this._title.setTitle(_title);
} this._meta.updateTag({content: _title}, "property='og:title'");
private closeLoading(){ }
if(this.loading){
this.loading.close();
}
}
private setMessageLoading(message: string){
if(this.loading){
this.loading.message = message;
}
}
public confirmOpenCsvError(){ private updateUrl(url: string) {
this.alertCsvError.cancelButton = false; this._meta.updateTag({content: url}, "property='og:url'");
this.alertCsvError.okButton = true; }
this.alertCsvError.alertTitle = "ERROR DOWNLOADING CSV FILE";
this.alertCsvError.message = "There was an error in csv downloading. Please try again later.";
this.alertCsvError.okButtonText = "OK";
this.alertCsvError.open();
}
private handleError(message: string, error) { private openLoading() {
console.error("Project Landing Page: "+message, error); if (this.loading) {
this.loading.open();
} }
isRouteAvailable(routeToCheck:string){ }
private closeLoading() {
if (this.loading) {
this.loading.close();
}
}
private setMessageLoading(message: string) {
if (this.loading) {
this.loading.message = message;
}
}
public confirmOpenCsvError() {
this.alertCsvError.cancelButton = false;
this.alertCsvError.okButton = true;
this.alertCsvError.alertTitle = "ERROR DOWNLOADING CSV FILE";
this.alertCsvError.message = "There was an error in csv downloading. Please try again later.";
this.alertCsvError.okButtonText = "OK";
this.alertCsvError.open();
}
private handleError(message: string, error) {
console.error("Project Landing Page: " + message, error);
}
isRouteAvailable(routeToCheck: string) {
for (let i = 0; i < this.router.config.length; i++) { for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path; let routePath: string = this.router.config[i].path;
if(routePath == routeToCheck){ if (routePath == routeToCheck) {
return true; return true;
} }
} }

View File

@ -5,13 +5,11 @@ import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { ProjectServiceModule} from './projectService.module'; import { ProjectServiceModule} from './projectService.module';
// import {HtmlProgressReportService} from './htmlProgressReport.service'; import {LoadingModalModule} from '../../utils/modal/loadingModal.module';
import{LoadingModalModule} from '../../utils/modal/loadingModal.module';
import {AlertModalModule} from '../../utils/modal/alertModal.module'; import {AlertModalModule} from '../../utils/modal/alertModal.module';
import {ErrorMessagesModule} from '../../utils/errorMessages.module'; import {ErrorMessagesModule} from '../../utils/errorMessages.module';
import { ProjectComponent } from './project.component'; import { ProjectComponent } from './project.component';
// import { ProjectRoutingModule } from './project-routing.module';
import {IFrameModule} from '../../utils/iframe.module'; import {IFrameModule} from '../../utils/iframe.module';
import {MetricsModule} from '../landing-utils/metrics.module'; import {MetricsModule} from '../landing-utils/metrics.module';
import {ReportsServiceModule} from '../../services/reportsService.module'; import {ReportsServiceModule} from '../../services/reportsService.module';
@ -25,22 +23,21 @@ import {FreeGuard} from'../../login/freeGuard.guard';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {HelperModule} from "../../utils/helper/helper.module";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, RouterModule, LandingModule, CommonModule, FormsModule, RouterModule, LandingModule,
LoadingModalModule, AlertModalModule, ErrorMessagesModule, LoadingModalModule, AlertModalModule, ErrorMessagesModule,
TabResultModule, IFrameModule, MetricsModule, ReportsServiceModule, TabResultModule, IFrameModule, MetricsModule, ReportsServiceModule,
PublicationsServiceModule, DatasetsServiceModule, SoftwareServiceModule, OrpsServiceModule, ProjectServiceModule, PublicationsServiceModule, DatasetsServiceModule, SoftwareServiceModule, OrpsServiceModule, ProjectServiceModule,
Schema2jsonldModule, SEOServiceModule Schema2jsonldModule, SEOServiceModule, HelperModule
], ],
declarations: [ declarations: [
ProjectComponent ProjectComponent
], ],
providers:[ providers:[
// ProjectService,
// HtmlProgressReportService
FreeGuard, IsRouteEnabled FreeGuard, IsRouteEnabled
], ],
exports: [ exports: [

View File

@ -1,6 +1,6 @@
import { NgModule} from '@angular/core'; import {NgModule} from '@angular/core';
import { CommonModule } from '@angular/common'; import {CommonModule} from '@angular/common';
import { FormsModule } from '@angular/forms'; import {FormsModule} from '@angular/forms';
import {ProjectService} from './project.service'; import {ProjectService} from './project.service';
@ -9,12 +9,11 @@ import {ProjectService} from './project.service';
imports: [ imports: [
CommonModule, FormsModule CommonModule, FormsModule
], ],
declarations: [ declarations: [],
providers: [
ProjectService
], ],
providers:[ exports: []
ProjectService
],
exports: [
]
}) })
export class ProjectServiceModule { } export class ProjectServiceModule {
}

View File

@ -1,419 +1,474 @@
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" > <div id="tm-main" class=" uk-section uk-margin-small-top tm-middle">
<div uk-grid uk-grid> <div uk-grid 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="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container uk-margin-top publication"> <div class="uk-container uk-margin-top publication">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div> role="alert">{{warningMessage}}</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> <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>
<div *ngIf="publicationInfo != null" uk-grid class="uk-grid-large"> <div *ngIf="publicationInfo != null" uk-grid class="uk-grid-large">
<div class="uk-width-expand@m uk-width-1-1@s"> <helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
<schema2jsonld *ngIf="publicationInfo.record" [data]=publicationInfo.record [URL]="properties.baseLink+'/search/publication?articleId='+articleId"></schema2jsonld> [texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<showTitle [titleName]="publicationInfo.title"></showTitle> <div class="uk-width-expand@m uk-width-1-1@s">
<span *ngIf="publicationInfo.types && publicationInfo.types.length > 0"class="uk-label custom-label label-blue label-publication" title="Type">{{publicationInfo.types.join(", ")}}</span>{{" "}} <schema2jsonld *ngIf="publicationInfo.record" [data]=publicationInfo.record
<span *ngIf="publicationInfo.languages && publicationInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{publicationInfo.languages.join(", ")}}</span>{{" "}} [URL]="properties.baseLink+'/search/publication?articleId='+articleId"></schema2jsonld>
<span *ngIf="publicationInfo.countries && publicationInfo.countries.length > 0" class="uk-label custom-label label-country " title="Country">{{publicationInfo.countries.join(", ")}}</span>{{" "}} <showTitle [titleName]="publicationInfo.title"></showTitle>
<span *ngIf="publicationInfo.types && publicationInfo.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"
class="uk-label custom-label label-language "
title="Language">{{publicationInfo.languages.join(", ")}}</span>{{" "}}
<span *ngIf="publicationInfo.countries && publicationInfo.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.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>{{" "}} <span *ngIf="publicationInfo.accessMode"
[class]="'uk-label custom-label label-'+ publicationInfo.accessMode "
title="Access Mode">{{publicationInfo.accessMode}}</span>{{" "}}
<span *ngIf="publicationInfo.underCurationMessage" class="uk-label custom-label label-underCuration" > <span *ngIf="publicationInfo.underCurationMessage" class="uk-label custom-label label-underCuration">
<span uk-tooltip="pos:right; delay:10" <span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}"> title="{{buildCurationTooltip()}}">
<i>Record in preview</i> <i>Record in preview</i>
<i class="uk-icon-info-circle"></i> <i class="uk-icon-info-circle"></i>
</span></span>{{" "}} </span></span>{{" "}}
<div class=" uk-margin-top">
<div class= " uk-margin-top"> <showAuthors [authors]="publicationInfo.authors"></showAuthors>
<showAuthors [authors]="publicationInfo.authors"></showAuthors> <span *ngIf="publicationInfo.date != ''">({{publicationInfo.date}})</span>
<span *ngIf="publicationInfo.date != ''">({{publicationInfo.date}})</span>
</div> </div>
<ul class="uk-list"> <ul class="uk-list">
<showPublisher [publisher]="publicationInfo.publisher" <showPublisher [publisher]="publicationInfo.publisher"
[journal]="publicationInfo.journal" [properties]="properties"></showPublisher> [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.embargoEndDate"><span
<li *ngIf="publicationInfo.identifiers && publicationInfo.identifiers.size > 0"> class="uk-text-bold">Embargo end date:</span> {{publicationInfo.embargoEndDate}}</li>
<showIdentifiers [identifiers]="publicationInfo.identifiers"></showIdentifiers> <li *ngIf="publicationInfo.identifiers && publicationInfo.identifiers.size > 0">
</li> <showIdentifiers [identifiers]="publicationInfo.identifiers"></showIdentifiers>
<li *ngIf="publicationInfo.subjects || publicationInfo.otherSubjects || publicationInfo.classifiedSubjects"> </li>
<showSubjects [subjects]="publicationInfo.subjects" <li
[otherSubjects]="publicationInfo.otherSubjects" *ngIf="publicationInfo.subjects || publicationInfo.otherSubjects || publicationInfo.classifiedSubjects">
[classifiedSubjects]="publicationInfo.classifiedSubjects"> <showSubjects [subjects]="publicationInfo.subjects"
[otherSubjects]="publicationInfo.otherSubjects"
[classifiedSubjects]="publicationInfo.classifiedSubjects">
</showSubjects> </showSubjects>
</li> </li>
</ul> </ul>
<hr *ngIf="publicationInfo.description"> <hr *ngIf="publicationInfo.description">
<div *ngIf="publicationInfo.description" class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto"> <div *ngIf="publicationInfo.description"
class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<span>{{publicationInfo.description.substring(0, showNumDescription)}}</span <span>{{publicationInfo.description.substring(0, showNumDescription)}}</span
><!--span *ngIf="showNumDescription > thresholdDescription"> ><!--span *ngIf="showNumDescription > thresholdDescription">
<a (click)="showNumDescription = thresholdDescription; scroll()"> <a (click)="showNumDescription = thresholdDescription; scroll()">
View less View less
</a> </a>
</span </span
--><span *ngIf="showNumDescription == thresholdDescription && publicationInfo.description.length > thresholdDescription">...</span --><span
><span *ngIf="showNumDescription == thresholdDescription && publicationInfo.description.length > thresholdDescription" class="uk-text-right"> *ngIf="showNumDescription == thresholdDescription && publicationInfo.description.length > thresholdDescription">...</span
><span
*ngIf="showNumDescription == thresholdDescription && publicationInfo.description.length > thresholdDescription"
class="uk-text-right">
<a (click)="showNumDescription = publicationInfo.description.length;"> <a (click)="showNumDescription = publicationInfo.description.length;">
View more View more
</a> </a>
</span> </span>
</div> </div>
<div *ngIf="publicationInfo.description && showNumDescription > thresholdDescription" class="uk-width-1-1 uk-text-right"> <div *ngIf="publicationInfo.description && showNumDescription > thresholdDescription"
<!-- scroll() --> class="uk-width-1-1 uk-text-right">
<a (click)="showNumDescription = thresholdDescription;"> <!-- scroll() -->
View less <a (click)="showNumDescription = thresholdDescription;">
View less
</a>
</div>
<ul class="custom-accordion" uk-accordion>
<li *ngIf="publicationInfo.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> -->
</a> </a>
</div> <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}}
references, page {{referencesPage | number}}
of {{totalPages(publicationInfo.references.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="referencesPage"
[totalResults]="publicationInfo.references.length" [size]="pageSize"
(pageChange)="updateReferencesPage($event)"></paging-no-load>
</div>
<div
*ngFor="let item of publicationInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
<p *ngIf=" item && item['url']"
<ul class="custom-accordion" uk-accordion> class="custom-external custom-icon">
<a href="{{item['url']}}" target="_blank">
<li *ngIf="publicationInfo.references" (click)="activeTab='References'"> {{item['name']}}
<a class="uk-accordion-title" href="#"> </a>
References </p>
<!-- <span *ngIf="!publicationInfo.references" class="uk-badge uk-badge-notification">0</span> <p *ngIf="!item['url']" class="pseudo-external custom-icon">
<span *ngIf="publicationInfo.references" class="uk-badge uk-badge-notification"> {{item['name']}}
{{publicationInfo.references.length | number}} </p>
</span> --> </div>
<!-- <span class="uk-badge uk-badge-notification"> --> </div>
({{publicationInfo.references.length | number}}) </div>
<!-- </span> -->
</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}} references, page {{referencesPage | number}} of {{totalPages(publicationInfo.references.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="referencesPage" [totalResults]="publicationInfo.references.length" [size]="pageSize" (pageChange)="updateReferencesPage($event)"></paging-no-load>
</div>
<div *ngFor="let item of publicationInfo.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>
<li *ngIf="publicationInfo.relatedResearchResults" (click)="activeTab='Related Research Results'"> <li *ngIf="publicationInfo.relatedResearchResults" (click)="activeTab='Related Research Results'">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Related Research Results 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">0</span>
<span *ngIf="publicationInfo.relatedResearchResults" class="uk-badge uk-badge-notification"> <span *ngIf="publicationInfo.relatedResearchResults" class="uk-badge uk-badge-notification">
{{relatedResearchResultsNum | number}} {{relatedResearchResultsNum | number}}
</span> --> </span> -->
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{relatedResearchResultsNum | number}}) ({{relatedResearchResultsNum | number}})
<!-- </span> --> <!-- </span> -->
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<!-- <div *ngIf="!publicationInfo.relatedResearchResults" class = "uk-alert uk-alert-primary"> <!-- <div *ngIf="!publicationInfo.relatedResearchResults" class = "uk-alert uk-alert-primary">
No related research results available No related research results available
</div> </div>
<div *ngIf="publicationInfo.relatedResearchResults"> --> <div *ngIf="publicationInfo.relatedResearchResults"> -->
<div> <div>
<div *ngFor="let provenanceaction of getKeys(publicationInfo.relatedResearchResults)"> <div *ngFor="let provenanceaction of getKeys(publicationInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div> <div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [percentageName]="trust" [info]="publicationInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable> <tabTable [percentageName]="trust"
</div> [info]="publicationInfo.relatedResearchResults.get(provenanceaction)"
[(properties)]=properties></tabTable>
</div> </div>
</div> </div>
</li> </div>
</li>
<li *ngIf="publicationInfo.similarResearchResults" (click)="activeTab='Similar Research Results'"> <li *ngIf="publicationInfo.similarResearchResults" (click)="activeTab='Similar Research Results'">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Similar Research Results 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">0</span>
<span *ngIf="publicationInfo.similarResearchResults" class="uk-badge uk-badge-notification"> <span *ngIf="publicationInfo.similarResearchResults" class="uk-badge uk-badge-notification">
{{publicationInfo.similarResearchResults.length | number}} {{publicationInfo.similarResearchResults.length | number}}
</span> --> </span> -->
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{publicationInfo.similarResearchResults.length | number}}) ({{publicationInfo.similarResearchResults.length | number}})
<!-- </span> --> <!-- </span> -->
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<!-- <div *ngIf="!publicationInfo.similarResearchResults" class = "uk-alert uk-alert-primary" > <!-- <div *ngIf="!publicationInfo.similarResearchResults" class = "uk-alert uk-alert-primary" >
No similar research results available No similar research results available
</div> </div>
<div *ngIf="publicationInfo.similarResearchResults"> --> <div *ngIf="publicationInfo.similarResearchResults"> -->
<div> <div>
<tabTable [percentageName]="similarity" [info]="publicationInfo.similarResearchResults" [(properties)]=properties></tabTable> <tabTable [percentageName]="similarity" [info]="publicationInfo.similarResearchResults"
</div> [(properties)]=properties></tabTable>
</div> </div>
</li> </div>
</li>
<li *ngIf="publicationInfo.organizations" (click)="activeTab='Related Organizations'"> <li *ngIf="publicationInfo.organizations" (click)="activeTab='Related Organizations'">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Related Organizations Related Organizations
<!-- <span *ngIf="!publicationInfo.organizations" class="uk-badge uk-badge-notification">0</span> <!-- <span *ngIf="!publicationInfo.organizations" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.organizations" class="uk-badge uk-badge-notification"> <span *ngIf="publicationInfo.organizations" class="uk-badge uk-badge-notification">
{{publicationInfo.organizations.length | number}} {{publicationInfo.organizations.length | number}}
</span> --> </span> -->
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{publicationInfo.organizations.length | number}}) ({{publicationInfo.organizations.length | number}})
<!-- </span> --> <!-- </span> -->
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<!-- <div *ngIf="!publicationInfo.organizations" class = "uk-alert uk-alert-primary"> <!-- <div *ngIf="!publicationInfo.organizations" class = "uk-alert uk-alert-primary">
No related organizations available No related organizations available
</div> </div>
<div *ngIf="publicationInfo.organizations"> --> <div *ngIf="publicationInfo.organizations"> -->
<div> <div>
<div *ngIf="publicationInfo.organizations.length > pageSize" class="uk-margin-bottom"> <div *ngIf="publicationInfo.organizations.length > pageSize" class="uk-margin-bottom">
<span class="uk-text-bold">{{publicationInfo.organizations.length | number}} organizations, page {{organizationsPage | number}} of {{totalPages(publicationInfo.organizations.length) | number}}</span> <span class="uk-text-bold">{{publicationInfo.organizations.length | number}}
<paging-no-load class="uk-float-right" [currentPage]="organizationsPage" [totalResults]="publicationInfo.organizations.length" [size]="pageSize" (pageChange)="updateOrganizationsPage($event)"></paging-no-load> organizations, page {{organizationsPage | number}}
</div> of {{totalPages(publicationInfo.organizations.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="organizationsPage"
<table class="uk-table uk-table-small uk-table-divider uk-table-middle "> [totalResults]="publicationInfo.organizations.length" [size]="pageSize"
<tbody> (pageChange)="updateOrganizationsPage($event)"></paging-no-load>
<tr *ngFor="let organization of publicationInfo.organizations.slice((organizationsPage-1)*pageSize, organizationsPage*pageSize)">
<td>
<a *ngIf="(organization['id']) && ((organization['name']) || (organization['shortname']))"
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization">
{{organization['name']}}
<span *ngIf="organization.name && organization.shortname"> ( </span>
<span *ngIf="organization.shortname">{{organization.shortname}}</span>
<span *ngIf="organization.name && organization.shortname"> ) </span>
</a>
<p *ngIf="(!organization['id']) && ((organization['name']) || (organization['shortname']))">
{{organization['name']}}
<span *ngIf="organization.name && organization.shortname"> ( </span>
<span *ngIf="organization.shortname">{{organization.shortname}}</span>
<span *ngIf="organization.name && organization.shortname"> ) </span>
</p>
<div *ngIf="organization.country">{{organization.country}}</div>
<div *ngIf="organization.websiteUrl">Website url:
<a href="{{organization.websiteUrl}}" target="_blank">{{organization.websiteUrl}}</a>
</div>
</td>
<td>
<div *ngIf="organization['trust']" title="{{organization['trust']}}%" >
<div class="uk-text-center">{{organization['trust']}}%</div>
<progress class="uk-progress uk-margin-remove" value="{{organization['trust']}}" max="100"></progress>
</div>
<div *ngIf="!organization['trust']">
<p>no trust available</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div> </div>
</li>
<li *ngIf="publicationInfo.bioentities" (click)="activeTab='Bioentities'"> <table class="uk-table uk-table-small uk-table-divider uk-table-middle ">
<a class="uk-accordion-title" href="#"> <tbody>
Bioentities <tr
<!-- <span *ngIf="!publicationInfo.bioentities" class="uk-badge uk-badge-notification">0</span> *ngFor="let organization of publicationInfo.organizations.slice((organizationsPage-1)*pageSize, organizationsPage*pageSize)">
<span *ngIf="publicationInfo.bioentities" class="uk-badge uk-badge-notification"> <td>
{{publicationInfo.bioentitiesNum | number}} <a *ngIf="(organization['id']) && ((organization['name']) || (organization['shortname']))"
</span> --> [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active"
<!-- <span class="uk-badge uk-badge-notification"> --> routerLink="/search/organization">
({{bioentitiesNum | number}}) {{organization['name']}}
<!-- </span> --> <span *ngIf="organization.name && organization.shortname"> ( </span>
</a> <span *ngIf="organization.shortname">{{organization.shortname}}</span>
<div class="uk-accordion-content"> <span *ngIf="organization.name && organization.shortname"> ) </span>
<div *ngIf="publicationInfo.bioentities && bioentitiesNum > pageSize" class="uk-margin-bottom"> </a>
<span class="uk-text-bold"> {{bioentitiesNum | number}} bioentities, page {{bioentitiesPage | number}} of {{totalPages(bioentitiesNum) | number}}</span> <p *ngIf="(!organization['id']) && ((organization['name']) || (organization['shortname']))">
<paging-no-load class="uk-float-right" [currentPage]="bioentitiesPage" [totalResults]="bioentitiesNum" [size]="pageSize" (pageChange)="updateBioentitiesPage($event)"></paging-no-load> {{organization['name']}}
</div> <span *ngIf="organization.name && organization.shortname"> ( </span>
<span *ngIf="organization.shortname">{{organization.shortname}}</span>
<span *ngIf="organization.name && organization.shortname"> ) </span>
</p>
<div *ngIf="organization.country">{{organization.country}}</div>
<div *ngIf="organization.websiteUrl">Website url:
<a href="{{organization.websiteUrl}}" target="_blank">{{organization.websiteUrl}}</a>
</div>
</td>
<td>
<div *ngIf="organization['trust']" title="{{organization['trust']}}%">
<div class="uk-text-center">{{organization['trust']}}%</div>
<progress class="uk-progress uk-margin-remove" value="{{organization['trust']}}"
max="100"></progress>
</div>
<div *ngIf="!organization['trust']">
<p>no trust available</p>
</div>
</td>
</tr>
</tbody>
</table>
<table id="bioentitiesTable" class="uk-table "> </div>
<tbody> </div>
<ng-container *ngFor="let key of getKeys(publicationInfo.bioentities) let i=index"> </li>
<tr *ngFor="let keyIn of keysToArray(publicationInfo.bioentities.get(key)).slice((bioentitiesPage-1)*pageSize, bioentitiesPage*pageSize)">
<td class="uk-text-center" *ngIf="keyIn"> <li *ngIf="publicationInfo.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">
<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"
[totalResults]="bioentitiesNum" [size]="pageSize"
(pageChange)="updateBioentitiesPage($event)"></paging-no-load>
</div>
<table id="bioentitiesTable" class="uk-table ">
<tbody>
<ng-container *ngFor="let key of getKeys(publicationInfo.bioentities) let i=index">
<tr
*ngFor="let keyIn of keysToArray(publicationInfo.bioentities.get(key)).slice((bioentitiesPage-1)*pageSize, bioentitiesPage*pageSize)">
<td class="uk-text-center" *ngIf="keyIn">
<span class="custom-external custom-icon"> <span class="custom-external custom-icon">
<a href="{{publicationInfo.bioentities.get(key).get(keyIn)}}" <a href="{{publicationInfo.bioentities.get(key).get(keyIn)}}"
target="_blank"> target="_blank">
{{keyIn}} {{keyIn}}
</a> </a>
</span> </span>
</td> </td>
<td class="uk-text-center"> <td class="uk-text-center">
{{key}} {{key}}
</td> </td>
</tr> </tr>
</ng-container> </ng-container>
</tbody> </tbody>
</table> </table>
</div> </div>
</li> </li>
<li *ngIf="publicationInfo.software" (click)="activeTab='Software'"> <li *ngIf="publicationInfo.software" (click)="activeTab='Software'">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Software Software
<!-- <span *ngIf="!publicationInfo.software" class="uk-badge uk-badge-notification">0</span> <!-- <span *ngIf="!publicationInfo.software" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.software" class="uk-badge uk-badge-notification"> <span *ngIf="publicationInfo.software" class="uk-badge uk-badge-notification">
{{publicationInfo.software.length | number}} {{publicationInfo.software.length | number}}
</span> --> </span> -->
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{publicationInfo.software.length | number}}) ({{publicationInfo.software.length | number}})
<!-- </span> --> <!-- </span> -->
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<div *ngIf="publicationInfo.software && publicationInfo.software.length > pageSize" class="uk-margin-bottom"> <div *ngIf="publicationInfo.software && publicationInfo.software.length > pageSize"
<span class="uk-text-bold">{{publicationInfo.software.length | number}} software results, page {{softwarePage | number}} of {{totalPages(publicationInfo.software.length) | number}}</span> class="uk-margin-bottom">
<paging-no-load class="uk-float-right" [currentPage]="softwarePage" [totalResults]="publicationInfo.software.length" [size]="pageSize" (pageChange)="updateSoftwarePage($event)"></paging-no-load> <span class="uk-text-bold">{{publicationInfo.software.length | number}}
</div> software results, page {{softwarePage | number}}
of {{totalPages(publicationInfo.software.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="softwarePage"
[totalResults]="publicationInfo.software.length" [size]="pageSize"
(pageChange)="updateSoftwarePage($event)"></paging-no-load>
</div>
<table id="softwareTable" class="uk-table "> <table id="softwareTable" class="uk-table ">
<tbody> <tbody>
<tr *ngFor="let item of publicationInfo.software.slice((softwarePage-1)*pageSize, softwarePage*pageSize)" class="uk-text-center"> <tr
<td> *ngFor="let item of publicationInfo.software.slice((softwarePage-1)*pageSize, softwarePage*pageSize)"
class="uk-text-center">
<td>
<span class="custom-external custom-icon"> <span class="custom-external custom-icon">
<a href="{{item.url}}" target="_blank"> <a href="{{item.url}}" target="_blank">
{{item.name}} {{item.name}}
</a> </a>
</span> </span>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</li> </li>
<li (click)="activeTab='Other Citations'" *ngIf="publicationInfo.openCitations && publicationInfo.openCitations.length > 0"> <li (click)="activeTab='Other Citations'"
<a class="uk-accordion-title" href="#"> *ngIf="publicationInfo.openCitations && publicationInfo.openCitations.length > 0">
Open Citations <a class="uk-accordion-title" href="#">
({{publicationInfo.openCitations.length | number}}) Open Citations
</a> ({{publicationInfo.openCitations.length | number}})
<div class="uk-accordion-content"> </a>
<div *ngIf="publicationInfo.openCitations.length > pageSize" class="uk-margin-bottom"> <div class="uk-accordion-content">
<span class="uk-h6">{{publicationInfo.openCitations.length | number}} open citations, page {{openCitationsPage | number}} of {{totalPages(publicationInfo.openCitations.length) | number}}</span> <div *ngIf="publicationInfo.openCitations.length > pageSize" class="uk-margin-bottom">
<paging-no-load class="uk-float-right" [currentPage]="openCitationsPage" [totalResults]="publicationInfo.openCitations.length" [size]="pageSize" (pageChange)="updateOpenCitationsPage($event)"></paging-no-load> <span class="uk-h6">{{publicationInfo.openCitations.length | number}}
</div> open citations, page {{openCitationsPage | number}}
of {{totalPages(publicationInfo.openCitations.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="openCitationsPage"
[totalResults]="publicationInfo.openCitations.length" [size]="pageSize"
(pageChange)="updateOpenCitationsPage($event)"></paging-no-load>
</div>
<ul class="uk-list uk-list-divider uk-margin"> <ul class="uk-list uk-list-divider uk-margin">
<li *ngFor="let result of publicationInfo.openCitations.slice((openCitationsPage-1)*pageSize, openCitationsPage*pageSize)"> <li
<!-- <h5> *ngFor="let result of publicationInfo.openCitations.slice((openCitationsPage-1)*pageSize, openCitationsPage*pageSize)">
<span *ngIf="result.url" class="custom-external custom-icon" > <!-- <h5>
<a target="_blank" [href]="result.url" *ngIf="result['title']" [innerHTML]="result['title']"></a> <span *ngIf="result.url" class="custom-external custom-icon" >
<a target="_blank" [href]="result.url" *ngIf="!result['title']">[no title available]</a> <a target="_blank" [href]="result.url" *ngIf="result['title']" [innerHTML]="result['title']"></a>
</span> <a target="_blank" [href]="result.url" *ngIf="!result['title']">[no title available]</a>
<p *ngIf="!result.url && result['title']"><span [innerHTML]="result['title']"></span></p> </span>
<p *ngIf="!result.url && !result['title']">[no title available]</p> <p *ngIf="!result.url && result['title']"><span [innerHTML]="result['title']"></span></p>
</h5> --> <p *ngIf="!result.url && !result['title']">[no title available]</p>
</h5> -->
<h5 *ngIf="result.title"> <h5 *ngIf="result.title">
<span *ngIf="result.url" <span *ngIf="result.url"
class="custom-external"> class="custom-external">
<a *ngIf="result.title" href="{{result.url}}" target="_blank" <a *ngIf="result.title" href="{{result.url}}" target="_blank"
[innerHTML]="result.title"> [innerHTML]="result.title">
</a> </a>
<a *ngIf="!result.title" href="{{result.url}}" target="_blank"> <a *ngIf="!result.title" href="{{result.url}}" target="_blank">
[no title available] [no title available]
</a> </a>
</span> </span>
<span *ngIf="result.title && !result.url" [innerHTML]="result.title"></span> <span *ngIf="result.title && !result.url" [innerHTML]="result.title"></span>
<span *ngIf="!result.title && !result.url"> <span *ngIf="!result.title && !result.url">
[no title available] [no title available]
</span> </span>
</h5> </h5>
<div> <div>
<span *ngIf="result['authors']"> <span *ngIf="result['authors']">
<span *ngFor="let author of result['authors'].slice(0,15)"> <span *ngFor="let author of result['authors'].slice(0,15)">
{{author}}; {{author}};
</span> </span>
<span *ngIf="result['authors'].length > 15">...</span> <span *ngIf="result['authors'].length > 15">...</span>
</span> </span>
<span *ngIf="result.year"> <span *ngIf="result.year">
({{result.year}}) ({{result.year}})
</span> </span>
</div> </div>
<span *ngIf="result.doi">Identifier: <a *ngIf="result.doi" target="_blank" class="custom-external custom-icon" href="{{doiURL}}{{result.doi}}">doi: {{result.doi}}</a></span> <span *ngIf="result.doi">Identifier: <a *ngIf="result.doi" target="_blank"
</li> class="custom-external custom-icon"
</ul> href="{{doiURL}}{{result.doi}}">doi: {{result.doi}}</a></span>
</div> </li>
</li> </ul>
</div>
</li>
<li (click)="metricsClicked=true; activeTab='Metrics'"> <li (click)="metricsClicked=true; activeTab='Metrics'">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Metrics Metrics
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<metrics [pageViews]="pageViews" <metrics [pageViews]="pageViews"
[id]="articleId" [entityType]="'results'" [entity]="'Publication'" [id]="articleId" [entityType]="'results'" [entity]="'Publication'"
(metricsResults)="metricsResults($event)" [(properties)] = properties> (metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics> </metrics>
<!--i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="100%" height="250"></i-frame--> <!--i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="100%" height="250"></i-frame-->
<i-frame *ngIf="metricsClicked && totalViews>0" <i-frame *ngIf="metricsClicked && totalViews>0"
[url]=viewsFrameUrl width="100%" height="250"> [url]=viewsFrameUrl width="100%" height="250">
</i-frame> </i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads>0" <i-frame *ngIf="metricsClicked && totalDownloads>0"
[url]=downloadsFrameUrl width="100%" height="250"> [url]=downloadsFrameUrl width="100%" height="250">
</i-frame> </i-frame>
</div> </div>
</li> </li>
<li (click)="activeTab='Other Versions'" *ngIf="properties.environment == 'development' && publicationInfo.deletedByInferenceIds"> <li (click)="activeTab='Other Versions'"
<a class="uk-accordion-title" href="#"> *ngIf="properties.environment == 'development' && publicationInfo.deletedByInferenceIds">
Other Versions <a class="uk-accordion-title" href="#">
({{publicationInfo.deletedByInferenceIds.length | number}}) Other Versions
</a> ({{publicationInfo.deletedByInferenceIds.length | number}})
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content"> </a>
<deletedByInference [id]="articleId" [ids]="publicationInfo.deletedByInferenceIds" [type]="'publications'"></deletedByInference> <div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
</div> <deletedByInference [id]="articleId" [ids]="publicationInfo.deletedByInferenceIds"
</li> [type]="'publications'"></deletedByInference>
</div>
</li>
</ul> </ul>
</div>
<div class="uk-width-large@m uk-width-1-1@s">
<div class=" uk-padding-small">
<div >
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis></addThis>
</div> </div>
<altmetrics *ngIf="publicationInfo.identifiers && publicationInfo.identifiers.get('doi')"
id="{{publicationInfo.identifiers.get('doi')[0]}}" type="doi"> <div class="uk-width-large@m uk-width-1-1@s">
</altmetrics> <div class=" uk-padding-small">
<ul class="uk-list uk-margin-remove-bottom"> <div>
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis></addThis>
</div>
<altmetrics *ngIf="publicationInfo.identifiers && publicationInfo.identifiers.get('doi')"
id="{{publicationInfo.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"> <li *ngIf="publicationInfo.hostedBy_collectedFrom && publicationInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="publicationInfo.hostedBy_collectedFrom"></availableOn> <availableOn [availableOn]="publicationInfo.hostedBy_collectedFrom"></availableOn>
</li> </li>
<li *ngIf="publicationInfo.fundedByProjects != undefined && publicationInfo.fundedByProjects.length > 0"> <li
<fundedBy [fundedByProjects]="publicationInfo.fundedByProjects"></fundedBy> *ngIf="publicationInfo.fundedByProjects != undefined && publicationInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="publicationInfo.fundedByProjects"></fundedBy>
</li> </li>
<li *ngIf="publicationInfo.contexts && publicationInfo.contexts.length >0 "> <li *ngIf="publicationInfo.contexts && publicationInfo.contexts.length >0 ">
<dl class="uk-description-list-line" > <dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to</dt> <dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of publicationInfo.contexts"> <dd class="line" *ngFor="let item of publicationInfo.contexts">
<span *ngIf = "!item['inline']" > <span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span> <span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span> <span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span> </span>
<mark *ngIf = "item['inline']" > <mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span> <span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span> <span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark> </mark>
</dd> </dd>
</dl> </dl>
</li> </li>
<li> <li>
@ -424,51 +479,81 @@
</li> </li>
<li> <li>
<div class=" sideInfoTitle cite-this-button uk-width-1-1" type="button"> <div class=" sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this publication Cite this publication
</div> </div>
<div class=" "> <div class=" ">
<citeThis [result]="publicationInfo" [id]="articleId" type="publication"></citeThis> <citeThis [result]="publicationInfo" [id]="articleId" type="publication"></citeThis>
</div> </div>
</li> </li>
</ul>
<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 publication to...
</button>
<div *ngIf="isRouteAvailable('participate/direct-claim')" class=" uk-margin-remove-top uk-padding-small"
uk-dropdown="pos: bottom-left; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album" ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="users" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1" 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"></path><path fill="none" stroke="#000" stroke-width="1.1" 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"></path></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
</ul> </ul>
</div>
<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 publication to...
</button>
<div *ngIf="isRouteAvailable('participate/direct-claim')" class=" uk-margin-remove-top uk-padding-small"
uk-dropdown="pos: bottom-left; mode:click"
style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','project'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album"
ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14"
height="1"></rect><rect
fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','context'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
icon="users" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7"
cy="8.6" r="3.5"></circle><path fill="none" stroke="#000"
stroke-width="1.1"
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"></path><path
fill="none" stroke="#000" stroke-width="1.1"
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"></path></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;"
title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12"
height="16"></rect><polyline fill="none" stroke="#000"
points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</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> </div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,28 +1,27 @@
import {Component, ViewChild} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Input} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router';
import {ActivatedRoute, Router} from '@angular/router'; import {Meta, Title} from '@angular/platform-browser';
import {Title, Meta} from '@angular/platform-browser';
import {Observable} from 'rxjs'; import {EnvProperties} from '../../utils/properties/env-properties';
import {PublicationInfo} from '../../utils/entities/publicationInfo';
import {RouterHelper} from '../../utils/routerHelper.class';
import {EnvProperties} from '../../utils/properties/env-properties'; import {PiwikService} from '../../utils/piwik/piwik.service';
import {PublicationInfo} from '../../utils/entities/publicationInfo'; import {PublicationService} from './publication.service';
import {RouterHelper} from '../../utils/routerHelper.class'; import {SEOService} from '../../sharedComponents/SEO/SEO.service';
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 {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({ @Component({
selector: 'publication', selector: 'publication',
templateUrl: 'publication.component.html', templateUrl: 'publication.component.html',
}) })
export class PublicationComponent { export class PublicationComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() communityId = null;
public publicationInfo: PublicationInfo; public publicationInfo: PublicationInfo;
public articleId: string; public articleId: string;
@ -65,307 +64,339 @@ export class PublicationComponent {
public errorMessage = ""; public errorMessage = "";
public showLoading: boolean = true; public showLoading: boolean = true;
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
private doi: string; private doi: string;
public doiURL: string; public doiURL: string;
private result; private result;
sub: any; piwiksub: any; infoSub: any; sub: any;
properties:EnvProperties; piwiksub: any;
infoSub: any;
properties: EnvProperties;
public pageContents = null;
public divContents = null;
constructor ( private _publicationService: PublicationService, constructor(private _publicationService: PublicationService,
private _piwikService:PiwikService, private _piwikService: PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private _meta: Meta, private _meta: Meta,
private _title: Title, private _title: Title,
private _router: Router, private _router: Router,
private helper: HelperService,
private seoService: SEOService) { private seoService: SEOService) {
} }
ngOnInit() { ngOnInit() {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.doiURL = this.properties.doiURL; //this.getDivContents();
this.updateUrl(data.envSpecific.baseLink+this._router.url); this.getPageContents();
this.doiURL = this.properties.doiURL;
this.updateUrl(data.envSpecific.baseLink + this._router.url);
}); });
this.sub = this.route.queryParams.subscribe(data => { this.sub = this.route.queryParams.subscribe(data => {
this.publicationInfo = null; this.publicationInfo = null;
this.updateTitle("Publication"); this.updateTitle("Publication");
this.updateDescription(""); this.updateDescription("");
this.articleId = data['articleId']; this.articleId = data['articleId'];
this.metricsClicked = false; this.metricsClicked = false;
if(this.articleId){ if (this.articleId) {
this.getPublicationInfo(this.articleId); this.getPublicationInfo(this.articleId);
// if (typeof document !== 'undefined') { // if (typeof document !== 'undefined') {
// switcher(UIkit); // switcher(UIkit);
// } // }
}else{ } else {
this.showLoading = false; this.showLoading = false;
this.warningMessage="No valid publication id"; 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.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.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(); this.scroll();
}); });
} }
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.pageContents = contents;
})
}
ngOnDestroy() { private getDivContents() {
if(this.sub){ this.helper.getDivHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.sub.unsubscribe(); this.divContents = contents;
} })
if(this.piwiksub){ }
this.piwiksub.unsubscribe();
} ngOnDestroy() {
if(this.infoSub) { if (this.sub) {
this.infoSub.unsubscribe(); this.sub.unsubscribe();
}
} }
if (this.piwiksub) {
private getOpenCitations(id: string) { this.piwiksub.unsubscribe();
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);
}
);
} }
if (this.infoSub) {
private getPublicationInfo(id:string) { this.infoSub.unsubscribe();
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) { private getOpenCitations(id: string) {
this.totalViews = $event.totalViews; this._publicationService.getOpenCitations(this.articleId, this.properties).subscribe(
this.totalDownloads = $event.totalDownloads; data => {
this.pageViews = $event.pageViews; this.publicationInfo.openCitations = data[1];
} },
err => {
public buildCurationTooltip() { //console.log(err);
let tooltipContent: string = "<div class='uk-margin uk-padding-small'>"; this.handleError("Error getting open citation for publication with id: " + this.articleId, err);
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 ="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) { private getPublicationInfo(id: string) {
this.referencesPage = $event.value; this.warningMessage = '';
} this.errorMessage = ""
this.showLoading = true;
public updateOrganizationsPage($event) { this.publicationInfo = null;
this.organizationsPage = $event.value;
}
public updateSoftwarePage($event) { this.infoSub = this._publicationService.getPublicationInfo(this.articleId, this.properties).subscribe(
this.softwarePage = $event.value; 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);
}
public updateBioentitiesPage($event) { // this.result = []
this.bioentitiesPage = $event.value; // 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();
}
public updateOpenCitationsPage($event) { let bioentitiesNum = 0;
this.openCitationsPage = $event.value; if (this.publicationInfo.bioentities != undefined) {
} this.publicationInfo.bioentities.forEach(function (value, key, map) {
bioentitiesNum += value.size;
});
}
this.bioentitiesNum = bioentitiesNum;
public keysToArray(bioentities: Map<string, string>) : string[] { let relatedResearchResultsNum = 0;
let keys: string[] = []; if (this.publicationInfo.relatedResearchResults != undefined) {
bioentities.forEach(function (value, key, map) { this.publicationInfo.relatedResearchResults.forEach(function (value, key, map) {
keys.push(key); relatedResearchResultsNum += value.length;
}); });
return keys; }
} this.relatedResearchResultsNum = relatedResearchResultsNum;
public getKeys( map) {
return Array.from(map.keys());
}
public scroll() { this.result = {
HelperFunctions.scroll(); id: this.articleId,
} type: "publication",
/* source: "openaire",
start(i: number, bioentitiesPage: number) { title: this.publicationInfo.title,
let sum = 0; url: '',
let index=0; result: '',
let retValue = 0; accessRights: /*this.publicationInfo.title.accessMode*/this.publicationInfo.accessMode,
let valuesToPage = this.pageSize*bioentitiesPage; embargoEndDate: ''
let valuesToPreviousPage = valuesToPage - this.pageSize; };
// this.result.push(result_);
if(bioentitiesPage == 1) { if (this.publicationInfo.identifiers != undefined && this.publicationInfo.identifiers.has('doi')) {
return 0; 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);
} }
);
}
this.publicationInfo.bioentities.forEach(function (value, key, map) { public metricsResults($event) {
sum += map.get(key).size; this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
}
if(index == i) { public buildCurationTooltip() {
if(sum <= valuesToPreviousPage) { let tooltipContent: string = "<div class='uk-margin uk-padding-small'>";
retValue = 0;
} else if((sum-map.get(key).size) >= valuesToPage){ tooltipContent += "<h4>Record in preview</h4>";
retValue = 0; tooltipContent += "<p>Bibliographic record accepted by the system, but not yet processed by <br> OpenAIRE tools for information quality improvement and de-duplication</p>";
} else {
if(map.get(key).size < (sum - valuesToPreviousPage)) { 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 = "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; retValue = 0;
} else { } else {
retValue = map.get(key).size - (sum - valuesToPreviousPage); if(map.get(key).size < (sum - valuesToPreviousPage)) {
retValue = 0;
} else {
retValue = map.get(key).size - (sum - valuesToPreviousPage);
}
} }
} }
} index++;
index++; });
}); this.startt = retValue;
this.startt = retValue; return retValue;
return retValue; }
}
stop(i: number, bioentitiesPage: number) { stop(i: number, bioentitiesPage: number) {
let sum = 0; let sum = 0;
let index=0; let index=0;
let retValue = 0; let retValue = 0;
let valuesToPage = this.pageSize*bioentitiesPage; let valuesToPage = this.pageSize*bioentitiesPage;
let valuesToPreviousPage = valuesToPage - this.pageSize; let valuesToPreviousPage = valuesToPage - this.pageSize;
this.publicationInfo.bioentities.forEach(function (value, key, map) { this.publicationInfo.bioentities.forEach(function (value, key, map) {
sum += map.get(key).size; sum += map.get(key).size;
if(index == i) { if(index == i) {
if(sum <= valuesToPreviousPage) { if(sum <= valuesToPreviousPage) {
retValue = 0; retValue = 0;
} else if((sum - map.get(key).size) >= valuesToPage){ } else if((sum - map.get(key).size) >= valuesToPage){
retValue = 0; retValue = 0;
} else {
if(sum < valuesToPage) {
retValue = map.get(key).size;
} else { } else {
retValue = map.get(key).size - (sum - valuesToPage); if(sum < valuesToPage) {
retValue = map.get(key).size;
} else {
retValue = map.get(key).size - (sum - valuesToPage);
}
} }
} }
} index++;
index++; });
}); this.stopp = retValue;
this.stopp = retValue; return retValue;
return retValue; }
} */
*/
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Publication Landing Page: "+message, error); console.error("Publication Landing Page: " + message, error);
} }
isRouteAvailable(routeToCheck:string){
isRouteAvailable(routeToCheck: string) {
for (let i = 0; i < this.router.config.length; i++) { for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path; let routePath: string = this.router.config[i].path;
if(routePath == routeToCheck){ if (routePath == routeToCheck) {
return true; return true;
} }
} }

View File

@ -24,13 +24,14 @@ import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {DeletedByInferenceModule} from '../landing-utils/deletedByInference/deletedByInference.module'; import {DeletedByInferenceModule} from '../landing-utils/deletedByInference/deletedByInference.module';
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module"; import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
import {HelperModule} from "../../utils/helper/helper.module";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, LandingModule, SharedModule, RouterModule, CommonModule, FormsModule, LandingModule, SharedModule, RouterModule,
CiteThisModule, PagingModule, ResultLandingModule, IFrameModule, CiteThisModule, PagingModule, ResultLandingModule, IFrameModule,
MetricsModule, AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule, MetricsModule, AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule,
DeletedByInferenceModule, ShowAuthorsModule DeletedByInferenceModule, ShowAuthorsModule, HelperModule
], ],
declarations: [ declarations: [
PublicationComponent PublicationComponent

View File

@ -1,26 +1,42 @@
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" > <div id="tm-main" class=" uk-section uk-margin-small-top tm-middle">
<div uk-grid uk-grid> <div uk-grid 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="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container uk-margin-top software"> <div class="uk-container uk-margin-top software">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div> role="alert">{{warningMessage}}</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> <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>
<div *ngIf="softwareInfo != null" uk-grid class="uk-grid-large"> <div *ngIf="softwareInfo != null" uk-grid class="uk-grid-large">
<div class="uk-width-expand@m uk-width-1-1@s"> <helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
<schema2jsonld *ngIf="softwareInfo.record" [data]=softwareInfo.record [URL]="properties.baseLink+'/search/software?softwareId='+softwareId"></schema2jsonld> [texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<showTitle [titleName]="softwareInfo.title"></showTitle> <div class="uk-width-expand@m uk-width-1-1@s">
<span *ngIf="softwareInfo.types && softwareInfo.types.length > 0"class="uk-label custom-label label-software " title="Type">{{softwareInfo.types.join(", ")}}</span>{{" "}} <schema2jsonld *ngIf="softwareInfo.record" [data]=softwareInfo.record
<span *ngIf="softwareInfo.programmingLanguages && softwareInfo.programmingLanguages.length > 0" class="uk-label custom-label label-progrLanguage " title="Programming Language">{{softwareInfo.programmingLanguages.join(", ")}}</span>{{" "}} [URL]="properties.baseLink+'/search/software?softwareId='+softwareId"></schema2jsonld>
<span *ngIf="softwareInfo.languages && softwareInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{softwareInfo.languages.join(", ")}}</span>{{" "}} <showTitle [titleName]="softwareInfo.title"></showTitle>
<span *ngIf="softwareInfo.countries && softwareInfo.countries.length > 0" class="uk-label custom-label label-country " title="Country">{{softwareInfo.countries.join(", ")}}</span>{{" "}} <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.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.accessMode" [class]="'uk-label custom-label label-'+ softwareInfo.accessMode "
<span *ngIf="softwareInfo.underCurationMessage" class="uk-label custom-label label-underCuration " > title="Access Mode">{{softwareInfo.accessMode}}</span>{{" "}}
<span *ngIf="softwareInfo.underCurationMessage" class="uk-label custom-label label-underCuration ">
<span uk-tooltip="pos:right; delay:10" <span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}"> title="{{buildCurationTooltip()}}">
<i>Record in preview</i> <i>Record in preview</i>
<i class="uk-icon-info-circle"></i> <i class="uk-icon-info-circle"></i>
</span></span>{{" "}} </span></span>{{" "}}
@ -32,37 +48,43 @@
</span> </span>
</div--> </div-->
<div class= " uk-margin-top"> <div class=" uk-margin-top">
<showAuthors [authors]="softwareInfo.authors"></showAuthors> <showAuthors [authors]="softwareInfo.authors"></showAuthors>
<span *ngIf="softwareInfo.date != ''">({{softwareInfo.date}})</span> <span *ngIf="softwareInfo.date != ''">({{softwareInfo.date}})</span>
</div> </div>
<ul class="uk-list"> <ul class="uk-list">
<showPublisher [publisher]="softwareInfo.publisher" [properties]="properties" <showPublisher [publisher]="softwareInfo.publisher" [properties]="properties"
[journal]="softwareInfo.journal"></showPublisher> [journal]="softwareInfo.journal"></showPublisher>
<li *ngIf="softwareInfo.embargoEndDate"><span class="uk-text-bold">Embargo end date:</span> {{softwareInfo.embargoEndDate}}</li> <li *ngIf="softwareInfo.embargoEndDate"><span
<li *ngIf="softwareInfo.identifiers && softwareInfo.identifiers.size > 0"> class="uk-text-bold">Embargo end date:</span> {{softwareInfo.embargoEndDate}}</li>
<showIdentifiers [identifiers]="softwareInfo.identifiers"></showIdentifiers> <li *ngIf="softwareInfo.identifiers && softwareInfo.identifiers.size > 0">
</li> <showIdentifiers [identifiers]="softwareInfo.identifiers"></showIdentifiers>
<li *ngIf="softwareInfo.subjects ||softwareInfo.otherSubjects || softwareInfo.classifiedSubjects"> </li>
<showSubjects [subjects]="softwareInfo.subjects" <li *ngIf="softwareInfo.subjects ||softwareInfo.otherSubjects || softwareInfo.classifiedSubjects">
[otherSubjects]="softwareInfo.otherSubjects" <showSubjects [subjects]="softwareInfo.subjects"
[classifiedSubjects]="softwareInfo.classifiedSubjects"> [otherSubjects]="softwareInfo.otherSubjects"
[classifiedSubjects]="softwareInfo.classifiedSubjects">
</showSubjects> </showSubjects>
</li> </li>
</ul> </ul>
<hr *ngIf="softwareInfo.description" > <hr *ngIf="softwareInfo.description">
<div *ngIf="softwareInfo.description" class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto"> <div *ngIf="softwareInfo.description"
class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<span>{{softwareInfo.description.substring(0, showNumDescription)}}</span <span>{{softwareInfo.description.substring(0, showNumDescription)}}</span
><span *ngIf="showNumDescription == thresholdDescription && softwareInfo.description.length > thresholdDescription">...</span ><span
><span *ngIf="showNumDescription == thresholdDescription && softwareInfo.description.length > thresholdDescription" class="uk-text-right"> *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;"> <a (click)="showNumDescription = softwareInfo.description.length;">
View more View more
</a> </a>
</span> </span>
</div> </div>
<div *ngIf="softwareInfo.description && showNumDescription > thresholdDescription" class="uk-width-1-1 uk-text-right"> <div *ngIf="softwareInfo.description && showNumDescription > thresholdDescription"
class="uk-width-1-1 uk-text-right">
<a (click)="showNumDescription = thresholdDescription;"> <a (click)="showNumDescription = thresholdDescription;">
View less View less
</a> </a>
@ -95,121 +117,126 @@
<ul class="custom-accordion " uk-accordion> <ul class="custom-accordion " uk-accordion>
<li *ngIf="softwareInfo.relatedResearchResults" (click)="activeTab='Related Research Results'"> <li *ngIf="softwareInfo.relatedResearchResults" (click)="activeTab='Related Research Results'">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Related Research Results 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">0</span>
<span *ngIf="softwareInfo.relatedResearchResults" class="uk-badge uk-badge-notification"> <span *ngIf="softwareInfo.relatedResearchResults" class="uk-badge uk-badge-notification">
{{relatedResearchResultsNum | number}} {{relatedResearchResultsNum | number}}
</span> --> </span> -->
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{relatedResearchResultsNum | number}}) ({{relatedResearchResultsNum | number}})
<!-- </span> --> <!-- </span> -->
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<!-- <div *ngIf="!softwareInfo.relatedResearchResults" class = "uk-alert uk-alert-primary"> <!-- <div *ngIf="!softwareInfo.relatedResearchResults" class = "uk-alert uk-alert-primary">
No related research results available No related research results available
</div> </div>
<div *ngIf="softwareInfo.relatedResearchResults"> --> <div *ngIf="softwareInfo.relatedResearchResults"> -->
<div> <div>
<div *ngFor="let provenanceaction of getKeys(softwareInfo.relatedResearchResults)"> <div *ngFor="let provenanceaction of getKeys(softwareInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div> <div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [percentageName]="trust" [info]="softwareInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable> <tabTable [percentageName]="trust"
</div> [info]="softwareInfo.relatedResearchResults.get(provenanceaction)"
</div> [(properties)]=properties></tabTable>
</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> </div>
</li> </div>
</div>
</li>
<li (click)="metricsClicked=true; activeTab='Metrics'"> <li *ngIf="softwareInfo.similarResearchResults" (click)="activeTab='Similar Research Results'">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Metrics Similar Research Results
</a> <!-- <span *ngIf="!softwareInfo.similarResearchResults" class="uk-badge uk-badge-notification">0</span>
<div class="uk-accordion-content"> <span *ngIf="softwareInfo.similarResearchResults" class="uk-badge uk-badge-notification">
<metrics [pageViews]="pageViews" {{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'" [id]="softwareId" [entityType]="'results'" [entity]="'Software'"
(metricsResults)="metricsResults($event)" [(properties)] = properties> (metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics> </metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0" <i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250"> [url]=viewsFrameUrl width="100%" height="250">
</i-frame> </i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads > 0" <i-frame *ngIf="metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250"> [url]=downloadsFrameUrl width="100%" height="250">
</i-frame> </i-frame>
</div> </div>
</li> </li>
<li (click)="activeTab='Other Versions'" *ngIf="properties.environment == 'development' && softwareInfo.deletedByInferenceIds"> <li (click)="activeTab='Other Versions'"
<a class="uk-accordion-title" href="#"> *ngIf="properties.environment == 'development' && softwareInfo.deletedByInferenceIds">
Other Versions <a class="uk-accordion-title" href="#">
({{softwareInfo.deletedByInferenceIds.length | number}}) Other Versions
</a> ({{softwareInfo.deletedByInferenceIds.length | number}})
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content"> </a>
<deletedByInference [id]="softwareId" [ids]="softwareInfo.deletedByInferenceIds" [type]="'software'"></deletedByInference> <div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
</div> <deletedByInference [id]="softwareId" [ids]="softwareInfo.deletedByInferenceIds"
</li> [type]="'software'"></deletedByInference>
</div>
</li>
</ul> </ul>
</div>
<div class="uk-width-large@m uk-width-1-1@s">
<div class=" uk-padding-small">
<div >
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis></addThis>
</div> </div>
<altmetrics *ngIf="softwareInfo.identifiers && softwareInfo.identifiers.get('doi')"
id="{{softwareInfo.identifiers.get('doi')[0]}}" type="doi"> <div class="uk-width-large@m uk-width-1-1@s">
</altmetrics > <div class=" uk-padding-small">
<ul class="uk-list uk-margin-remove-bottom"> <div>
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis></addThis>
</div>
<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"> <li *ngIf="softwareInfo.hostedBy_collectedFrom && softwareInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="softwareInfo.hostedBy_collectedFrom"></availableOn> <availableOn [availableOn]="softwareInfo.hostedBy_collectedFrom"></availableOn>
</li> </li>
<li *ngIf="softwareInfo.fundedByProjects != undefined && softwareInfo.fundedByProjects.length > 0"> <li *ngIf="softwareInfo.fundedByProjects != undefined && softwareInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="softwareInfo.fundedByProjects"></fundedBy> <fundedBy [fundedByProjects]="softwareInfo.fundedByProjects"></fundedBy>
</li> </li>
<li *ngIf="softwareInfo.contexts && softwareInfo.contexts.length >0 "> <li *ngIf="softwareInfo.contexts && softwareInfo.contexts.length >0 ">
<dl class="uk-description-list-line" > <dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to </dt> <dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of softwareInfo.contexts"> <dd class="line" *ngFor="let item of softwareInfo.contexts">
<span *ngIf = "!item['inline']" > <span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span> <span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span> <span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span> </span>
<mark *ngIf = "item['inline']" > <mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span> <span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span> <span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark> </mark>
</dd> </dd>
</dl> </dl>
</li> </li>
@ -222,12 +249,12 @@
<li> <li>
<div class=" sideInfoTitle cite-this-button uk-width-1-1" type="button"> <div class=" sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this software Cite this software
</div> </div>
<div class=""> <div class="">
<citeThis [result]="softwareInfo" [id]="softwareId" type="software"></citeThis> <citeThis [result]="softwareInfo" [id]="softwareId" type="software"></citeThis>
</div> </div>
</li> </li>
<!--li> <!--li>
<ul uk-accordion class="uk-padding-remove"> <ul uk-accordion class="uk-padding-remove">
@ -251,80 +278,109 @@
</ul> </ul>
</li--> </li-->
</ul> </ul>
<button *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-button portal-button uk-width-1-1 "> <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 software to...
</button>
<div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click"
style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','project'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album"
ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14"
height="1"></rect><rect
fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','context'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
icon="users" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7"
cy="8.6" r="3.5"></circle><path fill="none" stroke="#000"
stroke-width="1.1"
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"></path><path
fill="none" stroke="#000" stroke-width="1.1"
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"></path></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;"
title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy"
ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline
fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
</ul>
</div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div>
<!-- Claiming FAB -->
<div class="uk-inline">
<div class=" uk-float-right " style="z-index: 200; bottom: 55px; position: fixed; right: 45%;">
<!--a style="padding: 30px; box-shadow: 0 1px 10px #444444" class=" uk-icon-button uk-button-primary shadowBox" uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Link this publication to</div>">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="40" viewBox="0 0 20 20" height="40"><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>
</a-->
<!-- <button class=" uk-button uk-button-danger ">
<span class="uk-icon"> <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> <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... </span> Link this software to
</button> </button>
<div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;"> <div uk-dropdown="pos: top-right; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical"> <ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>"> <li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Projects</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" > <span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album" ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album" ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
</a> </a>
</li> </li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>"> <li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Communities</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" > <span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="users" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1" 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"></path><path fill="none" stroke="#000" stroke-width="1.1" 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"></path></svg></span> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="users" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1" 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"></path><path fill="none" stroke="#000" stroke-width="1.1" 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"></path></svg></span>
</a> </a>
</li> </li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>"> <li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light uk-margin-small'>Other research results</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" > <span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a> </a>
</li> </li>
</ul> </ul>
</div> -->
</div> </div>
</div>
</div> </div>
</div>
<!-- Claiming FAB -->
<div class="uk-inline">
<div class=" uk-float-right " style="z-index: 200; bottom: 55px; position: fixed; right: 45%;">
<!--a style="padding: 30px; box-shadow: 0 1px 10px #444444" class=" uk-icon-button uk-button-primary shadowBox" uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Link this publication to</div>">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="40" viewBox="0 0 20 20" height="40"><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>
</a-->
<!-- <button class=" uk-button uk-button-danger ">
<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 uk-dropdown="pos: top-right; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Projects</div>">
<a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album" ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
</a>
</li>
<li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Communities</div>">
<a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="users" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1" 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"></path><path fill="none" stroke="#000" stroke-width="1.1" 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"></path></svg></span>
</a>
</li>
<li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light uk-margin-small'>Other research results</div>">
<a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
</ul>
</div> -->
</div> </div>
</div>
</div> </div>
</div>
</div>
</div>

View File

@ -1,212 +1,243 @@
import {Component, ViewChild} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Input} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router';
import {ActivatedRoute, Router} from '@angular/router'; import {Meta, Title} from '@angular/platform-browser';
import {Title, Meta} from '@angular/platform-browser';
import {Observable} from 'rxjs'; import {SoftwareService} from './software.service';
import {SoftwareInfo} from '../../utils/entities/softwareInfo';
import {SoftwareService} from './software.service'; import {RouterHelper} from '../../utils/routerHelper.class';
import {SoftwareInfo} from '../../utils/entities/softwareInfo'; import {PiwikService} from '../../utils/piwik/piwik.service';
import {EnvProperties} from '../../utils/properties/env-properties';
import {RouterHelper} from '../../utils/routerHelper.class'; import {SEOService} from '../../sharedComponents/SEO/SEO.service';
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 {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({ @Component({
selector: 'software', selector: 'software',
templateUrl: 'software.component.html', templateUrl: 'software.component.html',
}) })
export class SoftwareComponent { export class SoftwareComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
public softwareInfo: SoftwareInfo; @Input() communityId = null;
public softwareId : string ; public softwareInfo: SoftwareInfo;
public softwareId: string;
// APP BOX variables // APP BOX variables
public showAllCollectedFrom: boolean = false; public showAllCollectedFrom: boolean = false;
public showAllDownloadFrom: boolean = false; public showAllDownloadFrom: boolean = false;
public showAllPublishedIn: boolean = false; public showAllPublishedIn: boolean = false;
public thresholdDescription: number = 270; public thresholdDescription: number = 270;
public showNumDescription: number = 270; public showNumDescription: number = 270;
// Metrics tab variables // Metrics tab variables
public metricsClicked: boolean; public metricsClicked: boolean;
public viewsFrameUrl: string; public viewsFrameUrl: string;
public downloadsFrameUrl: string; public downloadsFrameUrl: string;
public totalViews: number; public totalViews: number;
public totalDownloads: number; public totalDownloads: number;
public pageViews: number; public pageViews: number;
// Active tab variable for responsiveness // Active tab variable for responsiveness
public activeTab: string = "Related Research Results"; public activeTab: string = "Related Research Results";
// Map counting variable // Map counting variable
public relatedResearchResultsNum: number = 0; public relatedResearchResultsNum: number = 0;
// Message variables // Message variables
public warningMessage = ""; public warningMessage = "";
public errorMessage = ""; public errorMessage = "";
public showLoading: boolean = true; public showLoading: boolean = true;
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
private result ; private result;
sub: any; piwiksub: any; infoSub: any; sub: any;
properties:EnvProperties; piwiksub: any;
infoSub: any;
properties: EnvProperties;
public pageContents = null;
public divContents = null;
constructor (private _softwareService: SoftwareService, constructor(private _softwareService: SoftwareService,
private _piwikService:PiwikService, private _piwikService: PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private _meta: Meta, private _meta: Meta,
private _title: Title, private _title: Title,
private _router: Router, private _router: Router,
private seoService: SEOService) { private helper: HelperService,
} private seoService: SEOService) {
}
ngOnInit() { ngOnInit() {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url); //this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
}); });
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
this.softwareInfo = null; this.softwareInfo = null;
this.updateTitle("Software"); this.updateTitle("Software");
this.updateDescription("Software, search, open access"); this.updateDescription("Software, search, open access");
this.softwareId = params['softwareId']; this.softwareId = params['softwareId'];
if(this.softwareId){ if (this.softwareId) {
this.getSoftwareInfo(this.softwareId); this.getSoftwareInfo(this.softwareId);
}else{ } else {
this.showLoading = false; this.showLoading = false;
this.warningMessage="No valid software id"; 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();
});
}
ngOnDestroy() {
if(this.sub){
this.sub.unsubscribe();
} }
if(this.piwiksub){
this.piwiksub.unsubscribe(); 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;
} }
if(this.infoSub) { );
this.infoSub.unsubscribe(); }
}
}
private getSoftwareInfo(id:string) { // showChange($event) {
this.warningMessage = ''; // this.showAllReferences=$event.value;
this.errorMessage="" // }
this.showLoading = true;
this.softwareInfo = null; public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
}
this.infoSub = this._softwareService.getSoftwareInfo(id, this.properties).subscribe( private updateDescription(description: string) {
data => { this._meta.updateTag({content: description}, "name='description'");
this.softwareInfo = data; this._meta.updateTag({content: description}, "property='og:description'");
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 = [] private updateTitle(title: string) {
this.result = {id: id, type :"software", source : "openaire", title: this.softwareInfo.title,url: '', result: '', accessRights: /*this.softwareInfo.title.accessMode*/this.softwareInfo.accessMode, embargoEndDate: ''}; var _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'");
}
let relatedResearchResultsNum = 0; private updateUrl(url: string) {
if(this.softwareInfo.relatedResearchResults != undefined) { this._meta.updateTag({content: url}, "property='og:url'");
this.softwareInfo.relatedResearchResults.forEach(function (value, key, map) { }
relatedResearchResultsNum += value.length;
});
}
this.relatedResearchResultsNum = relatedResearchResultsNum;
this.showLoading = false; public buildCurationTooltip() {
}, let tooltipContent: string = "<div class='uk-padding-small uk-light'>";
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) { tooltipContent += "<h4>Record in preview</h4>";
// this.showAllReferences=$event.value; 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>";
// }
public metricsResults($event) { return tooltipContent;
this.totalViews = $event.totalViews; }
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
}
private updateDescription(description:string) { public getKeys(map) {
this._meta.updateTag({content:description},"name='description'"); return Array.from(map.keys());
this._meta.updateTag({content:description},"property='og:description'"); }
}
private updateTitle(title:string) {
var _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() { public scroll() {
let tooltipContent: string = "<div class='uk-padding-small uk-light'>"; HelperFunctions.scroll();
}
tooltipContent += "<h4>Record in preview</h4>"; private handleError(message: string, error) {
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>"; console.error("Software Landing Page: " + message, error);
}
return tooltipContent; isRouteAvailable(routeToCheck: string) {
}
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++) { for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path; let routePath: string = this.router.config[i].path;
if(routePath == routeToCheck){ if (routePath == routeToCheck) {
return true; return true;
} }
} }

View File

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

View File

@ -45,8 +45,8 @@
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first "> <div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class=""> <div class="">
<div [class]="'uk-container' + (usedBy == 'deposit' ? ' uk-container-large' : '')"> <div [class]="'uk-container' + (usedBy == 'deposit' ? ' uk-container-large' : '')">
<helper position="top"></helper> <helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0" [texts]="pageContents['top']"></helper>
<div [class]="(showRefine)? 'uk-width-3-5@m uk-width-3-5@l uk-width-1-1@s' :'uk-width-1-1'"> <div [class]="(showRefine)? 'uk-width-4-5@m uk-width-4-5@l uk-width-1-1@s' :'uk-width-1-1'">
<div *ngIf="showRefine" class="uk-offcanvas-content uk-hidden@m"> <div *ngIf="showRefine" class="uk-offcanvas-content uk-hidden@m">
<a href="#offcanvas-usage" uk-toggle><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="6" y="4" width="12" height="1"></rect><rect x="6" y="9" width="12" height="1"></rect><rect x="6" y="14" width="12" height="1"></rect><rect x="2" y="4" width="2" height="1"></rect><rect x="2" y="9" width="2" height="1"></rect><rect x="2" y="14" width="2" height="1"></rect></svg></a> <a href="#offcanvas-usage" uk-toggle><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="6" y="4" width="12" height="1"></rect><rect x="6" y="9" width="12" height="1"></rect><rect x="6" y="14" width="12" height="1"></rect><rect x="2" y="4" width="2" height="1"></rect><rect x="2" y="9" width="2" height="1"></rect><rect x="2" y="14" width="2" height="1"></rect></svg></a>
@ -111,14 +111,10 @@
</div> </div>
</div> </div>
<!-- uk-sticky="offset: 120" -->
<!-- <div *ngIf="showRefine" class="uk-width-1-5 uk-margin-top helper-left-right search-filters uk-visible@m"> -->
<div class="uk-grid uk-width-1-1"> <div class="uk-grid uk-width-1-1">
<div *ngIf="showRefine" class="uk-margin-top helper-left-right search-filters uk-visible@m"> <div *ngIf="showRefine" class="uk-margin-top uk-width-1-4@m search-filters uk-visible@m">
<!-- top: #container-1; bottom: #true; --> <!-- top: #container-1; bottom: #true; -->
<!-- <div id="container-1" style="z-index: -1;" uk-sticky="top: #container-1; offset: 120; "> --> <!-- <div id="container-1" style="z-index: -1;" uk-sticky="top: #container-1; offset: 120; "> -->
<helper position="left" before="true"></helper>
<span *ngIf="tableViewLink || mapUrl" class="uk-width-expand"> <span *ngIf="tableViewLink || mapUrl" class="uk-width-expand">
<span *ngIf="tableViewLink"> <span *ngIf="tableViewLink">
<a uk-tooltip="title: Table view" routerLinkActive="router-link-active" [class]="(disableForms)?'uk-disabled uk-link-muted':''" [routerLink]=tableViewLink > <a uk-tooltip="title: Table view" routerLinkActive="router-link-active" [class]="(disableForms)?'uk-disabled uk-link-muted':''" [routerLink]=tableViewLink >
@ -168,11 +164,8 @@
</div> </div>
</div> </div>
<search-filter *ngFor="let filter of filters " [filterValuesNum]="filterValuesNum" [showMoreInline]="showMoreFilterValuesInline" [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (onFilterChange)="filterChanged($event)" ></search-filter> <search-filter *ngFor="let filter of filters " [filterValuesNum]="filterValuesNum" [showMoreInline]="showMoreFilterValuesInline" [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (onFilterChange)="filterChanged($event)" ></search-filter>
<helper position="left" before="false"></helper>
</div> </div>
<!-- </div> --> <!-- </div> -->
<helper *ngIf="!showRefine" class="uk-margin-top helper-left-right uk-visible@m" position="left"></helper>
<div class="uk-width-expand@m uk-width-1-1@s uk-first-column"> <div class="uk-width-expand@m uk-width-1-1@s uk-first-column">
<!-- <div [class]="(showRefine)?'uk-width-expand@m uk-first-column':''" > --> <!-- <div [class]="(showRefine)?'uk-width-expand@m uk-first-column':''" > -->
<div *ngIf="openaireLink"> <a class="uk-margin-top uk-button uk-button-text" [href]=openaireLink target="_blank" >Results in OpenAIRE</a></div> <div *ngIf="openaireLink"> <a class="uk-margin-top uk-button uk-button-text" [href]=openaireLink target="_blank" >Results in OpenAIRE</a></div>
@ -228,32 +221,12 @@
[href]="properties.lastIndexInformationLink" target="_blank"> [href]="properties.lastIndexInformationLink" target="_blank">
Last index information Last index information
</a> </a>
<helper class="uk-hidden@m" position="left" styleName="uk-width-1-1@s"></helper>
<helper class="uk-hidden@m" position="right" styleName="uk-width-1-1@s"></helper>
</div> </div>
<div class="uk-margin-top helper-left-right uk-visible@m">
<helper position="right" before="true"></helper>
<!-- <div>
<span *ngIf="tableViewLink" class="uk-margin-medium-right">
<a routerLinkActive="router-link-active" [class]="(disableForms)?'uk-disabled uk-link-muted':''" [routerLink]=tableViewLink >
<span class="uk-margin-small-right uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="2" y="2" width="3" height="3"></rect><rect x="8" y="2" width="3" height="3"></rect><rect x="14" y="2" width="3" height="3"></rect><rect x="2" y="8" width="3" height="3"></rect><rect x="8" y="8" width="3" height="3"></rect><rect x="14" y="8" width="3" height="3"></rect><rect x="2" y="14" width="3" height="3"></rect><rect x="8" y="14" width="3" height="3"></rect><rect x="14" y="14" width="3" height="3"></rect></svg></span>
</a>
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="table" ratio="1"><rect x="1" y="3" width="18" height="1"></rect><rect x="1" y="7" width="18" height="1"></rect><rect x="1" y="11" width="18" height="1"></rect><rect x="1" y="15" width="18" height="1"></rect></svg></span>
</span>
<search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults"></search-download>
</div> -->
<helper position="right" before="false"></helper>
</div> </div>
<!-- <helper *ngIf="!tableViewLink && searchUtils.totalResults > csvLimit" class="helper-left-right uk-visible@m" position="right"></helper> -->
</div>
<!-- <div [class]="(showRefine)? 'uk-width-3-5@m uk-width-3-5@l uk-width-1-1@s uk-align-center uk-margin-remove-bottom' : 'uk-width-1-1'"> <!-- <div [class]="(showRefine)? 'uk-width-3-5@m uk-width-3-5@l uk-width-1-1@s uk-align-center uk-margin-remove-bottom' : 'uk-width-1-1'">
<search-paging [loadPaging]="loadPaging" [type]="type" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-paging> <search-paging [loadPaging]="loadPaging" [type]="type" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-paging>
</div> --> </div> -->
<div class="uk-width-1-1"> <helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0" [texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
<helper position="bottom"></helper>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -17,6 +17,7 @@ import {EnvProperties} from '../../utils/properties/env-propertie
import { SEOService } from '../../sharedComponents/SEO/SEO.service'; import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {ZenodoInformationClass} from "../../deposit/utils/zenodoInformation.class"; import {ZenodoInformationClass} from "../../deposit/utils/zenodoInformation.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({ @Component({
selector: 'search-page', selector: 'search-page',
@ -77,6 +78,8 @@ export class SearchPageComponent {
public pagingLimit: number = 0; public pagingLimit: number = 0;
public resultsPerPage: number = 10; public resultsPerPage: number = 10;
public isPiwikEnabled; public isPiwikEnabled;
public pageContents = null;
public divContents = null;
properties:EnvProperties; properties:EnvProperties;
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper:RouterHelper = new RouterHelper();
public errorCodes:ErrorCodes = new ErrorCodes(); public errorCodes:ErrorCodes = new ErrorCodes();
@ -87,7 +90,8 @@ export class SearchPageComponent {
private _title: Title, private _title: Title,
private _piwikService:PiwikService, private _piwikService:PiwikService,
private router: Router, private router: Router,
private seoService: SEOService) { private seoService: SEOService,
private helper: HelperService) {
} }
ngOnInit() { ngOnInit() {
@ -95,7 +99,10 @@ export class SearchPageComponent {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
//this.getDivContents();
this.getPageContents();
this.pagingLimit = data.envSpecific.pagingLimit; this.pagingLimit = data.envSpecific.pagingLimit;
HelperFunctions.scroll();
this.csvLimit = data.envSpecific.csvLimit; this.csvLimit = data.envSpecific.csvLimit;
this.isPiwikEnabled = data.envSpecific.enablePiwikTrack; this.isPiwikEnabled = data.envSpecific.enablePiwikTrack;
if(typeof window !== 'undefined') { if(typeof window !== 'undefined') {
@ -105,7 +112,6 @@ export class SearchPageComponent {
this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, this.piwikSiteId).subscribe(); this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, this.piwikSiteId).subscribe();
} }
}); });
HelperFunctions.scroll();
// this.updateBaseUrlWithParameters(this.filters); // this.updateBaseUrlWithParameters(this.filters);
this.updateTitle(this.pageTitle); this.updateTitle(this.pageTitle);
@ -114,6 +120,19 @@ export class SearchPageComponent {
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this.router.url,false); this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this.router.url,false);
} }
public getPageContents() {
this.helper.getPageHelpContents(this.router.url, this.properties, (this.customFilter)?this.customFilter.valueId:null).subscribe(contents => {
this.pageContents = contents;
})
}
public getDivContents() {
this.helper.getDivHelpContents(this.router.url, this.properties, (this.customFilter)?this.customFilter.valueId:null).subscribe(contents => {
this.divContents = contents;
})
}
ngOnDestroy() { ngOnDestroy() {
if(this.piwiksub){ if(this.piwiksub){
this.piwiksub.unsubscribe(); this.piwiksub.unsubscribe();

View File

@ -28,12 +28,20 @@ export class HelperService {
} }
getPageHelpContents(router: string, properties:EnvProperties, communityId:string ):any { getPageHelpContents(router: string, properties:EnvProperties, communityId:string ):any {
if(!communityId) {
communityId = 'openaire';
}
router = router.split('?')[0].substring(0);
let url = properties.adminToolsAPIURL; let url = properties.adminToolsAPIURL;
url += '/community/' + communityId + '/pagehelpcontent?active=true&page='+router; url += '/community/' + communityId + '/pagehelpcontent?active=true&page='+router;
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url); return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url);
} }
getDivHelpContents(router: string, properties:EnvProperties, communityId:string ):any { getDivHelpContents(router: string, properties:EnvProperties, communityId:string ):any {
if(!communityId) {
communityId = 'openaire';
}
router = router.split('?')[0].substring(0);
let url = properties.adminToolsAPIURL; let url = properties.adminToolsAPIURL;
url += '/community/' + communityId + '/divhelpcontent?active=true&page='+router; url += '/community/' + communityId + '/divhelpcontent?active=true&page='+router;
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url); return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url);