[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 {ZenodoInformationClass} from './utils/zenodoInformation.class';
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 {HelperService} from "../utils/helper/helper.service";
@Component({
selector: 'deposit-first-page',
@ -134,11 +135,11 @@ import {PiwikService} from "../utils/piwik/piwik.service";
<!– grey-background–>
<div class="uk-margin-top uk-padding-small">
<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>-->
<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;
piwiksub:any;
@Input() pageContents = null;
@Input() divContents = null;
@Input() communityId = null;
public pageContents = null;
public divContents = null;
public keyword: string;
public depositRoute = "/search-deposit";
public searchPlaceHolder = "Search for repositories by title, country, organization, subject...";
properties:EnvProperties;
constructor (private route: ActivatedRoute, private _piwikService:PiwikService) {}
constructor (private route: ActivatedRoute, private _piwikService:PiwikService,
private helper: HelperService,
private _router: Router) {}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
//this.getDivContents();
this.getPageContents();
if (!this.zenodoInformation) {
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() {
if(this.piwiksub){
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 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 *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div>
<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="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 class="uk-width-expand@m uk-width-1-1@s">
<div *ngIf="dataProviderInfo != 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">
<!--h3 *ngIf="dataProviderInfo.title != null">
<a *ngIf="dataProviderInfo.title['url'] != undefined && dataProviderInfo.title['url'] != null"
href="{{dataProviderInfo.title['url']}}" target="_blank" class="custom-external">
@ -19,24 +24,30 @@
{{dataProviderInfo.title['name']}}
</p>
</h3-->
<schema2jsonld *ngIf="dataProviderInfo" [data]=dataProviderInfo [URL]="properties.baseLink+'/search/dataprovider?datasourceId='+datasourceId"
type="datasource" [otherURL]="(dataProviderInfo.openDoarId)?(properties.openDoarURL+dataProviderInfo.openDoarId):((dataProviderInfo.r3DataId)?properties.r3DataURL+dataProviderInfo.r3DataId:nul)"></schema2jsonld>
<schema2jsonld *ngIf="dataProviderInfo" [data]=dataProviderInfo
[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>
<div class="uk-text-large " *ngIf="dataProviderInfo.officialName && this.dataProviderInfo.title.name != dataProviderInfo.officialName ">{{dataProviderInfo.officialName}}</div>
<showTitle [title]="dataProviderInfo.title"></showTitle>
<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 "
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"
[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}}
</a>
<span *ngIf="dataProviderInfo.compatibility.name || !dataProviderInfo.compatibility.id">
{{dataProviderInfo.compatibility.info}}
</span>
<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}}
</a>
<span *ngIf="dataProviderInfo.compatibility.name && !dataProviderInfo.compatibility.id">
@ -47,225 +58,242 @@
<ul class="uk-list">
<showPublisher [properties]="properties"
[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>
{{dataProviderInfo.aggregationStatus.fundedContent | number}}
</li>
<li *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fulltexts && dataProviderInfo.aggregationStatus.fulltexts != -1"><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">
<li
*ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fundedContent && dataProviderInfo.aggregationStatus.fundedContent != -1">
<span class="uk-text-bold">Results with funding information: </span>
{{dataProviderInfo.aggregationStatus.fundedContent | number}}
</li>
<li
*ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fulltexts && dataProviderInfo.aggregationStatus.fulltexts != -1">
<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}}">
{{dataProviderInfo.oaiPmhURL}}
</a>
</span>
</li>
<li *ngIf="dataProviderInfo.openDoarId">
</li>
<li *ngIf="dataProviderInfo.openDoarId">
<span class="uk-button-text">
<a target="_blank" href="{{properties.openDoarURL+dataProviderInfo.openDoarId}}">
Detailed content provider information (OpenDOAR)
</a>
</span>
</li>
<li *ngIf="dataProviderInfo.r3DataId">
</li>
<li *ngIf="dataProviderInfo.r3DataId">
<span class="uk-button-text">
<a target="_blank" href="{{properties.r3DataURL+dataProviderInfo.r3DataId}}">
Detailed content provider information (Re3data)
</a>
</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>
<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>
</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 *ngIf="fetchPublications.searchUtils.totalResults > 0 ">
<p class="uk-text-bold">Projects with most Publications</p>
<i-frame [url]=pubsProjectsUrl width="100%" height="350"></i-frame>
</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>
<div *ngIf="(fetchDatasets.searchUtils.totalResults > 0)">
<div>
<p class="uk-text-bold">Projects with most Research Data</p>
<i-frame [url]=dataProjectsUrl width="100%" height="350"></i-frame>
</div>
<div *ngIf="fetchPublications.searchUtils.totalResults > 0 ">
<p class="uk-text-bold">Projects with most Publications</p>
<i-frame [url]=pubsProjectsUrl width="100%" height="350"></i-frame>
</div>
<div *ngIf="(fetchDatasets.searchUtils.totalResults > 0)">
<div>
<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>
</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'">
<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>
</ul>
</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 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>

View File

@ -1,44 +1,41 @@
import {merge as observableMerge, Observable} from 'rxjs';
import {Component, ViewChild} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
import {merge as observableMerge} from 'rxjs';
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser';
import {EnvProperties} from '../../utils/properties/env-properties';
import {EnvProperties} from '../../utils/properties/env-properties';
import {DataProviderInfo} from '../../utils/entities/dataProviderInfo';
import {DataProviderService} from './dataProvider.service';
import {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class';
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 {FetchProjects} from '../../utils/fetchEntitiesClasses/fetchProjects.class';
import {SearchProjectsService} from '../../services/searchProjects.service';
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
import {RelatedDatasourcesTabComponent} from './relatedDatasourcesTab.component';
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 {DataProviderInfo} from '../../utils/entities/dataProviderInfo';
import {DataProviderService} from './dataProvider.service';
import {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class';
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 {FetchProjects} from '../../utils/fetchEntitiesClasses/fetchProjects.class';
import {SearchProjectsService} from '../../services/searchProjects.service';
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
import {SearchDataprovidersService} from '../../services/searchDataproviders.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 {HelperService} from "../../utils/helper/helper.service";
@Component({
selector: 'dataprovider',
templateUrl: 'dataProvider.component.html',
})
selector: 'dataprovider',
templateUrl: 'dataProvider.component.html',
})
export class DataProviderComponent {
@Input() piwikSiteId = null;
@Input() communityId = null;
public dataProviderInfo: DataProviderInfo;
public datasourceId: string;
@ -61,13 +58,13 @@ export class DataProviderComponent {
// Statistics tab variables
public statsClicked: boolean = false;
public docsTimelineUrl: string;
public docsTypesUrl:string;
public docsFunderUrl:string;
public dataProjectsUrl:string ;
public pubsProjectsUrl:string;
public docsTypesUrl: string;
public docsFunderUrl: string;
public dataProjectsUrl: string;
public pubsProjectsUrl: string;
// Variables for publications, research data, projects, content providers, related content providers tabs
public fetchPublications : FetchPublications;
public fetchPublications: FetchPublications;
public fetchDatasets: FetchDatasets;
public fetchSoftware: FetchSoftware;
public fetchOrps: FetchOrps;
@ -82,10 +79,12 @@ export class DataProviderComponent {
// Active tab variable for responsiveness - show tabs only if main request is completed
public activeTab: string = "";
public showTabs:boolean = false;
public showTabs: boolean = false;
public routerHelper:RouterHelper = new RouterHelper();
public errorCodes:ErrorCodes = new ErrorCodes();
public routerHelper: RouterHelper = new RouterHelper();
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)
private reloadPublications: boolean = true;
@ -100,401 +99,447 @@ export class DataProviderComponent {
piwiksub: any;
subInfo: any;
relatedDatasourcesSub: any;
properties:EnvProperties;
properties: EnvProperties;
constructor (private _dataproviderService: DataProviderService,
private _piwikService:PiwikService,
private route: ActivatedRoute,
private _meta: Meta,
private _title: Title,
private _router: Router,
private _searchPublicationsService: SearchPublicationsService,
private _searchDatasetsService: SearchDatasetsService,
private _searchSoftwareService: SearchSoftwareService,
private _searchOrpsService: SearchOrpsService,
private _searchProjectsService: SearchProjectsService,
private _searchDataprovidersService: SearchDataprovidersService,
private seoService: SEOService) {
this.fetchPublications = new FetchPublications(this._searchPublicationsService);
this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
this.fetchSoftware = new FetchSoftware(this._searchSoftwareService);
this.fetchOrps = new FetchOrps(this._searchOrpsService);
this.fetchProjects = new FetchProjects(this._searchProjectsService);
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
constructor(private _dataproviderService: DataProviderService,
private _piwikService: PiwikService,
private route: ActivatedRoute,
private _meta: Meta,
private _title: Title,
private _router: Router,
private _searchPublicationsService: SearchPublicationsService,
private _searchDatasetsService: SearchDatasetsService,
private _searchSoftwareService: SearchSoftwareService,
private _searchOrpsService: SearchOrpsService,
private _searchProjectsService: SearchProjectsService,
private _searchDataprovidersService: SearchDataprovidersService,
private seoService: SEOService,
private helper: HelperService) {
this.fetchPublications = new FetchPublications(this._searchPublicationsService);
this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
this.fetchSoftware = new FetchSoftware(this._searchSoftwareService);
this.fetchOrps = new FetchOrps(this._searchOrpsService);
this.fetchProjects = new FetchProjects(this._searchProjectsService);
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
}
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
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.updateDescription("");
this.datasourceId = data['datasourceId'];
if(this.datasourceId){
this.getDataProviderInfo(this.datasourceId);
if (this.datasourceId) {
this.getDataProviderInfo(this.datasourceId);
}
HelperFunctions.scroll();
});
}
});
}
ngOnDestroy() {
if(this.sub){
this.sub.unsubscribe();
}
if(this.piwiksub){
this.piwiksub.unsubscribe();
}
if(this.subInfo) {
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.subInfo) {
this.subInfo.unsubscribe();
}
}
if(this.relatedDatasourcesSub) {
this.relatedDatasourcesSub.unsubscribe();
}
}
private getDataProviderInfo(id:string) {
if (this.relatedDatasourcesSub) {
this.relatedDatasourcesSub.unsubscribe();
}
}
private getDataProviderInfo(id: string) {
this.warningMessage = '';
this.errorMessage=""
this.errorMessage = ""
this.showLoading = true;
this.dataProviderInfo = null;
this.showTabs = false ;
if(this.datasourceId==null || this.datasourceId==''){
this.showTabs = false;
if (this.datasourceId == null || this.datasourceId == '') {
this.showLoading = false;
this.warningMessage="No valid datasource id";
}else{
this.warningMessage = "No valid datasource id";
} else {
this.subInfo = this._dataproviderService.getDataproviderInfo(this.datasourceId, this.properties).subscribe(
data => {
this.dataProviderInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url);
if (typeof document !== 'undefined') {
this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId);
}
this.initTabs();
this.showTabs = true ;
this.updateTitle(this.dataProviderInfo.title.name);
this.updateDescription("Content provider, "+this.dataProviderInfo.title.name);
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, this.dataProviderInfo.title.name, this.piwikSiteId).subscribe();
}
this.dataProviderInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url);
if (typeof document !== 'undefined') {
this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId);
}
this.initTabs();
this.showTabs = true;
this.updateTitle(this.dataProviderInfo.title.name);
this.updateDescription("Content provider, " + this.dataProviderInfo.title.name);
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
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) {
this.activeTab = this.dataProviderInfo.tabs[0].name;
}
if (this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) {
this.activeTab = this.dataProviderInfo.tabs[0].name;
}
},
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.showLoading = false;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDataProviders);
}
);
}
}
}
private getDataProviderAggregationStatus(originalId: string) {
this.subInfo = this._dataproviderService.getDataproviderAggregationStatus(originalId, this.properties).subscribe(
data => {
this.dataProviderInfo.aggregationStatus = data;
},
err => {
//console.log(err);
this.handleError("Error getting content provider aggregation status for id: "+this.datasourceId, err);
}
);
}
private getDataProviderAggregationStatus(originalId: string) {
this.subInfo = this._dataproviderService.getDataproviderAggregationStatus(originalId, this.properties).subscribe(
data => {
this.dataProviderInfo.aggregationStatus = data;
},
err => {
//console.log(err);
this.handleError("Error getting content provider aggregation status for id: " + this.datasourceId, err);
}
);
}
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 updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
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) {
this.reloadPublications = true;
this.reloadDatasets = true;
this.reloadSoftware = true;
this.reloadOrps = true;
this.reloadProjects = true;
this.reloadDataproviders = true;
this.reloadRelatedDatasources = true;
this.statsClicked = false;
private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
//this.search(this.dataProviderInfo.tabs[0].content, 1, 10);
this.count(1, 0);
private initTabs() {
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.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.search(this.dataProviderInfo.tabs[0].content, 1, 10);
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.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.metricsClicked = false;
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';
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.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';
*/
//if({"name": "Publications", "content": "publicationsTab"} in this.dataProviderInfo.tabs) {
//if(this.dataProviderInfo.tabs.some(function (tab) {
// return tab.name === 'Publications';
//})) {
// 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.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.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.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) {
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.reloadPublications = false;
//if({"name": "Publications", "content": "publicationsTab"} in this.dataProviderInfo.tabs) {
//if(this.dataProviderInfo.tabs.some(function (tab) {
// return tab.name === 'Publications';
//})) {
// 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']);
}
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.reloadPublications = false;
}
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.reloadDatasets = false;
}
private countPublications(page: number, size: number) {
this.fetchPublications.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
}
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.reloadDatasets = false;
}
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.reloadSoftware = false;
}
private countDatasets(page: number, size: number) {
this.fetchDatasets.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
}
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.reloadSoftware = false;
}
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.reloadOrps = false;
}
private countSoftware(page: number, size: number) {
this.fetchSoftware.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
}
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.reloadOrps = false;
}
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.reloadProjects = false;
}
private countOrps(page: number, size: number) {
this.fetchOrps.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
}
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.reloadProjects = false;
}
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.reloadDataproviders = false;
}
private countProjects(page: number, size: number) {
this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
}
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.reloadDataproviders = false;
}
private searchRelatedDatasources(page: number, size: number) {
// Currently no counting is done for this tab. Following condition is always false
private countDatasources(page: number, size: number) {
this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
}
if( this.reloadRelatedDatasources &&
( this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.LOADING ||
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(); }
)
private searchRelatedDatasources(page: number, size: number) {
// Currently no counting is done for this tab. Following condition is always false
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);
} else {
this.loadingRelatedDatasources = false;
}
if (this.reloadRelatedDatasources &&
(this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.LOADING ||
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.reloadRelatedDatasources = false;
}
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)+"";
}
}
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)+"";
}
}
} else {
this.loadingRelatedDatasources = false;
}
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
this.reloadRelatedDatasources = false;
}
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) {
console.error("Content Provider Landing Page: "+message, error);
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;
}
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 {OrpsServiceModule} from '../../services/orpsService.module';
// import { DataProviderRoutingModule } from './dataProvider-routing.module';
import {FreeGuard} from'../../login/freeGuard.guard';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {ShowPublisherModule} from "../landing-utils/showPublisher.module";
import {HelperModule} from "../../utils/helper/helper.module";
@NgModule({
imports:
[CommonModule, FormsModule, RouterModule,
TabResultModule, IFrameModule, ErrorMessagesModule, MetricsModule, LandingModule,
DataProvidersServiceModule, DatasetsServiceModule, ProjectsServiceModule, PublicationsServiceModule,
SoftwareServiceModule, OrpsServiceModule, PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule],
[CommonModule, FormsModule, RouterModule,
TabResultModule, IFrameModule, ErrorMessagesModule, MetricsModule, LandingModule,
DataProvidersServiceModule, DatasetsServiceModule, ProjectsServiceModule, PublicationsServiceModule,
SoftwareServiceModule, OrpsServiceModule, PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule, HelperModule],
declarations:
[PublicationsTabComponent, DatasetsTabComponent, StatisticsTabComponent, ProjectsTabComponent, DatasourcesTabComponent, OrganizationsTabComponent,
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 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 *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div>
<div *ngIf="datasetInfo != null" uk-grid class="uk-grid-large">
<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>
<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 *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
<div *ngIf="datasetInfo != null" uk-grid>
<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">
<schema2jsonld *ngIf="datasetInfo.record" [data]=datasetInfo.record
[URL]="properties.baseLink+'/search/dataset?datasetId='+datasetId"></schema2jsonld>
<showTitle [titleName]="datasetInfo.title"></showTitle>
<p class="uk-text-large" *ngIf="datasetInfo.subtitle">
<span [innerHTML]="datasetInfo.subtitle"></span>
</p>
<span *ngIf="datasetInfo.types && datasetInfo.types.length > 0"class="uk-label custom-label label-dataset " title="Type">{{datasetInfo.types.join(", ")}}</span>{{" "}}
<span *ngIf="datasetInfo.languages && datasetInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{datasetInfo.languages.join(", ")}}</span>{{" "}}
<span *ngIf="datasetInfo.countries && datasetInfo.countries.length > 0" class="uk-label custom-label label-country " title="Country">{{datasetInfo.countries.join(", ")}}</span>{{" "}}
<span *ngIf="datasetInfo.types && datasetInfo.types.length > 0" class="uk-label custom-label label-dataset "
title="Type">{{datasetInfo.types.join(", ")}}</span>{{" "}}
<span *ngIf="datasetInfo.languages && datasetInfo.languages.length > 0"
class="uk-label custom-label label-language "
title="Language">{{datasetInfo.languages.join(", ")}}</span>{{" "}}
<span *ngIf="datasetInfo.countries && datasetInfo.countries.length > 0"
class="uk-label custom-label label-country "
title="Country">{{datasetInfo.countries.join(", ")}}</span>{{" "}}
<!-- <span *ngIf="datasetInfo.title && datasetInfo.title.accessMode" [class]="'uk-label custom-label label-'+ datasetInfo.title.accessMode " title="Access Mode">{{datasetInfo.title.accessMode}}</span> -->
<span *ngIf="datasetInfo.accessMode" [class]="'uk-label custom-label label-'+ datasetInfo.accessMode " title="Access Mode">{{datasetInfo.accessMode}}</span>{{" "}}
<span *ngIf="datasetInfo.underCurationMessage" class="uk-label custom-label label-underCuration " >{{" "}}
<span *ngIf="datasetInfo.accessMode" [class]="'uk-label custom-label label-'+ datasetInfo.accessMode "
title="Access Mode">{{datasetInfo.accessMode}}</span>{{" "}}
<span *ngIf="datasetInfo.underCurationMessage" class="uk-label custom-label label-underCuration ">{{" "}}
<span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}">
title="{{buildCurationTooltip()}}">
<i>Record in preview</i>
<i class="uk-icon-info-circle"></i>
</span></span>
@ -35,36 +45,42 @@
</span>
</div-->
<div class= " uk-margin-top">
<showAuthors [authors]="datasetInfo.authors"></showAuthors>
<span *ngIf="datasetInfo.date != ''">({{datasetInfo.date}})</span>
<div class=" uk-margin-top">
<showAuthors [authors]="datasetInfo.authors"></showAuthors>
<span *ngIf="datasetInfo.date != ''">({{datasetInfo.date}})</span>
</div>
<ul class="uk-list">
<showPublisher [publisher]="datasetInfo.publisher"
[journal]="datasetInfo.journal" [properties]="properties"></showPublisher>
<li *ngIf="datasetInfo.embargoEndDate"><span class="uk-text-bold">Embargo end date:</span> {{datasetInfo.embargoEndDate}}</li>
<li *ngIf="datasetInfo.identifiers && datasetInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="datasetInfo.identifiers"></showIdentifiers>
</li>
<li *ngIf="datasetInfo.subjects ||datasetInfo.otherSubjects || datasetInfo.classifiedSubjects">
<showSubjects [subjects]="datasetInfo.subjects"
[otherSubjects]="datasetInfo.otherSubjects"
[classifiedSubjects]="datasetInfo.classifiedSubjects">
<li *ngIf="datasetInfo.embargoEndDate"><span
class="uk-text-bold">Embargo end date:</span> {{datasetInfo.embargoEndDate}}</li>
<li *ngIf="datasetInfo.identifiers && datasetInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="datasetInfo.identifiers"></showIdentifiers>
</li>
<li *ngIf="datasetInfo.subjects ||datasetInfo.otherSubjects || datasetInfo.classifiedSubjects">
<showSubjects [subjects]="datasetInfo.subjects"
[otherSubjects]="datasetInfo.otherSubjects"
[classifiedSubjects]="datasetInfo.classifiedSubjects">
</showSubjects>
</li>
</li>
</ul>
<hr *ngIf="datasetInfo.description" >
<div *ngIf="datasetInfo.description" class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<hr *ngIf="datasetInfo.description">
<div *ngIf="datasetInfo.description"
class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<span>{{datasetInfo.description.substring(0, showNumDescription)}}</span
><span *ngIf="showNumDescription == thresholdDescription && datasetInfo.description.length > thresholdDescription">...</span
><span *ngIf="showNumDescription == thresholdDescription && datasetInfo.description.length > thresholdDescription" class="uk-text-right">
><span
*ngIf="showNumDescription == thresholdDescription && datasetInfo.description.length > thresholdDescription">...</span
><span
*ngIf="showNumDescription == thresholdDescription && datasetInfo.description.length > thresholdDescription"
class="uk-text-right">
<a (click)="showNumDescription = datasetInfo.description.length;">
View more
</a>
</span>
</div>
<div *ngIf="datasetInfo.description && showNumDescription > thresholdDescription" class="uk-width-1-1 uk-text-right">
<div *ngIf="datasetInfo.description && showNumDescription > thresholdDescription"
class="uk-width-1-1 uk-text-right">
<a (click)="showNumDescription = thresholdDescription;">
View less
</a>
@ -94,146 +110,156 @@
<ul class="custom-accordion" uk-accordion>
<li *ngIf="datasetInfo.references" (click)="activeTab='References'">
<a class="uk-accordion-title" href="#">
References ({{datasetInfo.references.length | number}})
</a>
<div class="uk-accordion-content">
<div>
<div *ngIf="datasetInfo.references.length > pageSize" class="uk-margin-bottom">
<span class="uk-h6">{{datasetInfo.references.length | number}} references, page {{referencesPage | number}} of {{totalPages(datasetInfo.references.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="referencesPage" [totalResults]="datasetInfo.references.length" [size]="pageSize" (pageChange)="updateReferencesPage($event)"></paging-no-load>
</div>
<a class="uk-accordion-title" href="#">
References ({{datasetInfo.references.length | number}})
</a>
<div class="uk-accordion-content">
<div>
<div *ngIf="datasetInfo.references.length > pageSize" class="uk-margin-bottom">
<span class="uk-h6">{{datasetInfo.references.length | number}}
references, page {{referencesPage | number}}
of {{totalPages(datasetInfo.references.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="referencesPage"
[totalResults]="datasetInfo.references.length" [size]="pageSize"
(pageChange)="updateReferencesPage($event)"></paging-no-load>
</div>
<div *ngFor="let item of datasetInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
<p *ngIf=" item && item['url']"
class="custom-external custom-icon">
<a href="{{item['url']}}" target="_blank">
{{item['name']}}
</a>
</p>
<p *ngIf="!item['url']" class="pseudo-external custom-icon">
{{item['name']}}
</p>
</div>
<div
*ngFor="let item of datasetInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
<p *ngIf=" item && item['url']"
class="custom-external custom-icon">
<a href="{{item['url']}}" target="_blank">
{{item['name']}}
</a>
</p>
<p *ngIf="!item['url']" class="pseudo-external custom-icon">
{{item['name']}}
</p>
</div>
</div>
</li>
</div>
</li>
<li *ngIf="datasetInfo.relatedResearchResults" (click)="activeTab='Related Research Results'">
<a class="uk-accordion-title" href="#">
Related Research Results
<!-- <span *ngIf="!datasetInfo.relatedResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="datasetInfo.relatedResearchResults" class="uk-badge uk-badge-notification">
{{relatedResearchResultsNum | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{relatedResearchResultsNum | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!datasetInfo.relatedResearchResults" class = "uk-alert uk-alert-primary">
No related research results available
</div>
<div *ngIf="datasetInfo.relatedResearchResults"> -->
<div>
<div *ngFor="let provenanceaction of getKeys(datasetInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div>
<li *ngIf="datasetInfo.relatedResearchResults" (click)="activeTab='Related Research Results'">
<a class="uk-accordion-title" href="#">
Related Research Results
<!-- <span *ngIf="!datasetInfo.relatedResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="datasetInfo.relatedResearchResults" class="uk-badge uk-badge-notification">
{{relatedResearchResultsNum | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{relatedResearchResultsNum | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!datasetInfo.relatedResearchResults" class = "uk-alert uk-alert-primary">
No related research results available
</div>
<div *ngIf="datasetInfo.relatedResearchResults"> -->
<div>
<div *ngFor="let provenanceaction of getKeys(datasetInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [percentageName]="trust" [info]="datasetInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable>
</div>
</div>
</div>
</li>
<li *ngIf="datasetInfo.similarResearchResults" (click)="activeTab='Similar Research Results'">
<a class="uk-accordion-title" href="#">
Similar Research Results
<!-- <span *ngIf="!datasetInfo.similarResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="datasetInfo.similarResearchResults" class="uk-badge uk-badge-notification">
{{datasetInfo.similarResearchResults.length | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{datasetInfo.similarResearchResults.length | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!datasetInfo.similarResearchResults" class = "uk-alert uk-alert-primary" >
No similar research results available
</div>
<div *ngIf="datasetInfo.similarResearchResults"> -->
<div>
<tabTable [percentageName]="similarity" [info]="datasetInfo.similarResearchResults" [(properties)]=properties></tabTable>
</div>
<tabTable [percentageName]="trust"
[info]="datasetInfo.relatedResearchResults.get(provenanceaction)"
[(properties)]=properties></tabTable>
</div>
</li>
</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"
<li *ngIf="datasetInfo.similarResearchResults" (click)="activeTab='Similar Research Results'">
<a class="uk-accordion-title" href="#">
Similar Research Results
<!-- <span *ngIf="!datasetInfo.similarResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="datasetInfo.similarResearchResults" class="uk-badge uk-badge-notification">
{{datasetInfo.similarResearchResults.length | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{datasetInfo.similarResearchResults.length | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!datasetInfo.similarResearchResults" class = "uk-alert uk-alert-primary" >
No similar research results available
</div>
<div *ngIf="datasetInfo.similarResearchResults"> -->
<div>
<tabTable [percentageName]="similarity" [info]="datasetInfo.similarResearchResults"
[(properties)]=properties></tabTable>
</div>
</div>
</li>
<li (click)="metricsClicked=true; activeTab='Metrics'">
<a class="uk-accordion-title" href="#">
Metrics
</a>
<div class="uk-accordion-content">
<metrics [pageViews]="pageViews"
[id]="datasetId" [entityType]="'results'" [entity]="'Research Data'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0"
(metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads > 0"
</i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250">
</i-frame>
</div>
</li>
</i-frame>
</div>
</li>
<li (click)="activeTab='Other Versions'" *ngIf="properties.environment == 'development' && datasetInfo.deletedByInferenceIds">
<a class="uk-accordion-title" href="#">
Other Versions
({{datasetInfo.deletedByInferenceIds.length | number}})
</a>
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
<deletedByInference [id]="datasetId" [ids]="datasetInfo.deletedByInferenceIds" [type]="'research data'"></deletedByInference>
</div>
</li>
<li (click)="activeTab='Other Versions'"
*ngIf="properties.environment == 'development' && datasetInfo.deletedByInferenceIds">
<a class="uk-accordion-title" href="#">
Other Versions
({{datasetInfo.deletedByInferenceIds.length | number}})
</a>
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
<deletedByInference [id]="datasetId" [ids]="datasetInfo.deletedByInferenceIds"
[type]="'research data'"></deletedByInference>
</div>
</li>
</ul>
</div>
<div class="uk-width-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>
<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 ">
<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>
<altmetrics *ngIf="datasetInfo.identifiers && datasetInfo.identifiers.get('doi')"
id="{{datasetInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics>
<ul class="uk-list uk-margin-remove-bottom ">
<li *ngIf="datasetInfo.hostedBy_collectedFrom && datasetInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="datasetInfo.hostedBy_collectedFrom"></availableOn>
<availableOn [availableOn]="datasetInfo.hostedBy_collectedFrom"></availableOn>
</li>
<li *ngIf="datasetInfo.fundedByProjects != undefined && datasetInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="datasetInfo.fundedByProjects"></fundedBy>
<fundedBy [fundedByProjects]="datasetInfo.fundedByProjects"></fundedBy>
</li>
<li *ngIf="datasetInfo.contexts && datasetInfo.contexts.length >0 ">
<dl class="uk-description-list-line" >
<dt class="sideInfoTitle">Related to </dt>
<dd class="line" *ngFor="let item of datasetInfo.contexts">
<span *ngIf = "!item['inline']" >
<li *ngIf="datasetInfo.contexts && datasetInfo.contexts.length >0 ">
<dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of datasetInfo.contexts">
<span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span>
<mark *ngIf = "item['inline']" >
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
<mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
</dl>
</dl>
</li>
@ -255,41 +281,71 @@
</li>
</ul>
<button *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-button portal-button uk-width-1-1 ">
</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>
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
height="25"><path
d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path
d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975"
fill="none" stroke="#000"
stroke-width="1.1"></path></svg>
</span> Link this dataset to...
</button>
</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'],[datasetId,'dataset','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'],[datasetId,'dataset','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'],[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>
<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'],[datasetId,'dataset','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'],[datasetId,'dataset','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'],[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>
<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>

View File

@ -1,231 +1,262 @@
import {Component, ViewChild} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} 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 {EnvProperties} from '../../utils/properties/env-properties';
import {RouterHelper} from '../../utils/routerHelper.class';
import {DatasetService} from './dataset.service';
import {PiwikService} from '../../utils/piwik/piwik.service';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {DatasetService} from './dataset.service';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({
selector: 'dataset',
templateUrl: 'dataset.component.html',
selector: 'dataset',
templateUrl: 'dataset.component.html',
})
export class DatasetComponent {
@Input() piwikSiteId = null;
public datasetInfo: DatasetInfo;
public datasetId : string ;
@Input() piwikSiteId = null;
@Input() communityId = null;
public datasetInfo: DatasetInfo;
public datasetId: string;
// APP BOX variables
public showAllCollectedFrom: boolean = false;
public showAllDownloadFrom: boolean = false;
public showAllPublishedIn: boolean = false;
// APP BOX variables
public showAllCollectedFrom: boolean = false;
public showAllDownloadFrom: boolean = false;
public showAllPublishedIn: boolean = false;
public thresholdDescription: number = 270;
public showNumDescription: number = 270;
// Metrics tab variables
public metricsClicked: boolean;
public viewsFrameUrl: string;
public downloadsFrameUrl: string;
public totalViews: number;
public totalDownloads: number;
public pageViews: number;
public thresholdDescription: number = 270;
public showNumDescription: number = 270;
// Custom tab paging variables
public referencesPage: number = 1;
public pageSize: number = 10;
// Metrics tab variables
public metricsClicked: boolean;
public viewsFrameUrl: string;
public downloadsFrameUrl: string;
public totalViews: number;
public totalDownloads: number;
public pageViews: number;
// Active tab variable for responsiveness
public activeTab: string = "References";
// Custom tab paging variables
public referencesPage: number = 1;
public pageSize: number = 10;
// Map counting variable
public relatedResearchResultsNum: number = 0;
// Active tab variable for responsiveness
public activeTab: string = "References";
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
// Map counting variable
public relatedResearchResultsNum: number = 0;
public routerHelper:RouterHelper = new RouterHelper();
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
public pageContents = null;
public divContents = null;
private result ;
sub: any; piwiksub: any; infoSub: any;
properties:EnvProperties;
public routerHelper: RouterHelper = new RouterHelper();
constructor (private _datasetService: DatasetService,
private _piwikService:PiwikService,
private route: ActivatedRoute,
private router: Router,
private _meta: Meta,
private _title: Title,
private _router: Router,
private seoService: SEOService) {
}
private result;
sub: any;
piwiksub: any;
infoSub: any;
properties: EnvProperties;
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url);
constructor(private _datasetService: DatasetService,
private _piwikService: PiwikService,
private route: ActivatedRoute,
private router: Router,
private _meta: Meta,
private _title: Title,
private _router: Router,
private seoService: SEOService,
private helper: HelperService) {
}
});
this.sub = this.route.queryParams.subscribe(params => {
this.datasetInfo = null;
this.updateTitle("Dataset");
this.updateDescription("");
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
//this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
this.datasetId = params['datasetId'];
});
this.sub = this.route.queryParams.subscribe(params => {
this.datasetInfo = null;
this.updateTitle("Dataset");
this.updateDescription("");
if(this.datasetId){
this.getDatasetInfo(this.datasetId);
}else{
this.showLoading = false;
this.warningMessage="No valid research data id";
}
this.datasetId = params['datasetId'];
this.metricsClicked = false;
this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
/*this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resViewsTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
*/
this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
/*this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
*/
this.scroll();
});
}
ngOnDestroy() {
if(this.sub){
this.sub.unsubscribe();
if (this.datasetId) {
this.getDatasetInfo(this.datasetId);
} else {
this.showLoading = false;
this.warningMessage = "No valid research data id";
}
if(this.piwiksub){
this.piwiksub.unsubscribe();
}
if(this.infoSub) {
this.infoSub.unsubscribe();
this.metricsClicked = false;
this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this.datasetId + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
/*this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resViewsTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
*/
this.downloadsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"' + this.datasetId + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
/*this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
*/
this.scroll();
});
}
private getPageContents() {
this.helper.getPageHelpContents(this.router.url, this.properties, this.communityId).subscribe(contents => {
this.pageContents = contents;
})
}
private getDivContents() {
this.helper.getDivHelpContents(this.router.url, this.properties, this.communityId).subscribe(contents => {
this.divContents = contents;
})
}
ngOnDestroy() {
if (this.sub) {
this.sub.unsubscribe();
}
if (this.piwiksub) {
this.piwiksub.unsubscribe();
}
if (this.infoSub) {
this.infoSub.unsubscribe();
}
}
private getDatasetInfo(id: string) {
this.warningMessage = '';
this.errorMessage = ""
this.showLoading = true;
this.datasetInfo = null;
this.infoSub = this._datasetService.getDatasetInfo(id, this.properties).subscribe(
data => {
this.datasetInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDataset + this.datasetInfo.record["result"]["header"]["dri:objIdentifier"]);
/*
if(this.datasetInfo.title.name != undefined && this.datasetInfo.title.name!= ''){
this.updateTitle(this.datasetInfo.title.name);
this.updateDescription("Dataset, search, repositories, open access,"+this.datasetInfo.title.name);
}
*/
if (this.datasetInfo.title) {
this.updateTitle(this.datasetInfo.title);
this.updateDescription((this.datasetInfo.description ? (this.datasetInfo.description) : ("," + this.datasetInfo.title)));
}
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.datasetInfo.title/*.name*/, this.piwikSiteId).subscribe();
}
this.result = []
this.result = {
id: id,
type: "dataset",
source: "openaire",
title: this.datasetInfo.title,
url: '',
result: '',
accessRights: /*this.datasetInfo.title.accessMode*/ this.datasetInfo.accessMode,
embargoEndDate: ''
};
let relatedResearchResultsNum = 0;
if (this.datasetInfo.relatedResearchResults != undefined) {
this.datasetInfo.relatedResearchResults.forEach(function (value, key, map) {
relatedResearchResultsNum += value.length;
});
}
this.relatedResearchResultsNum = relatedResearchResultsNum;
this.showLoading = false;
},
err => {
//console.log(err)
this.handleError("Error getting research data for id: " + this.datasetId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDatasets);
this.errorMessage = 'No research data found';
this.showLoading = false;
}
);
}
// showChange($event) {
// this.showAllReferences=$event.value;
// }
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _prefix = "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) {
this.warningMessage = '';
this.errorMessage=""
this.showLoading = true;
public scroll() {
HelperFunctions.scroll();
}
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;
}
public scroll() {
HelperFunctions.scroll();
}
isRouteAvailable(routeToCheck:string){
isRouteAvailable(routeToCheck: string) {
for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path;
if(routePath == routeToCheck){
let routePath: string = this.router.config[i].path;
if (routePath == routeToCheck) {
return true;
}
}

View File

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

View File

@ -1,278 +1,305 @@
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Params, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
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 {PiwikService} from '../../utils/piwik/piwik.service';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {HtmlProjectReportService} from './htmlProjectReport.service';
import {ProjectService} from '../project/project.service';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperService} from "../../utils/helper/helper.service";
declare var UIkit: any;
@Component({
selector: 'htmlProjectReport',
template: `
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" >
<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 ">
selector: 'htmlProjectReport',
template: `
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle">
<div uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<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="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 *ngIf="!showLoading && !warningMessage">
<h1 *ngIf="header1">{{header1}}</h1>
<h2 *ngIf="header1 || htmlResult">{{header2}}</h2>
<div *ngIf="!showLoading && !warningMessage">
<h1 *ngIf="header1">{{header1}}</h1>
<h2 *ngIf="header1 || htmlResult">{{header2}}</h2>
<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()">
<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
</button>
</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>
</button>
</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 *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>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div>
</div>
</div>
</div>
`
})
export class HtmlProjectReportComponent{
`
})
export class HtmlProjectReportComponent {
@Input() piwikSiteId = null;
private projectId: string;
private totalResults: number = 10;
private resultsType: string = "publication";
@Input() communityId = null;
private projectId: string;
private totalResults: number = 10;
private resultsType: string = "publication";
public header1: string = "";
public header2: string = "";
public htmlResult: string = "";
public header1: string = "";
public header2: string = "";
public htmlResult: string = "";
public sub: any; piwiksub: any;
public subHTML: any;
public subHTMLInfo: any;
public sub: any;
piwiksub: any;
public subHTML: any;
public subHTMLInfo: any;
public warningMessage: string = "";
public errorMessage: string = "";
public showLoading: boolean = true;
properties:EnvProperties;
public warningMessage: string = "";
public errorMessage: string = "";
public showLoading: boolean = true;
properties: EnvProperties;
public pageContents = null;
public divContents = null;
constructor ( private route: ActivatedRoute,
private htmlService: HtmlProjectReportService,
private _piwikService:PiwikService,
private _projectService: ProjectService,
private _meta: Meta,
private _title: Title,
private _router: Router,
private seoService: SEOService) {
}
constructor(private route: ActivatedRoute,
private htmlService: HtmlProjectReportService,
private _piwikService: PiwikService,
private _projectService: ProjectService,
private _meta: Meta,
private _title: Title,
private _router: Router,
private helper: HelperService,
private seoService: SEOService) {
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url);
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
//this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
this.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){
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'");
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 += ")";
}
}
private handleError(message: string, error) {
console.error("Html Project Report Page: "+message, error);
}
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'
});
}
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 {PiwikServiceModule} from '../../utils/piwik/piwikService.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {HelperModule} from "../../utils/helper/helper.module";
import {RouterModule} from '@angular/router';
@NgModule({
imports: [
CommonModule, FormsModule, ProjectServiceModule,PiwikServiceModule, SEOServiceModule
CommonModule, FormsModule, ProjectServiceModule, PiwikServiceModule, SEOServiceModule, HelperModule,
RouterModule
],
declarations: [
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 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 *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'"class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div>
<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="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 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>
<div *ngIf="organizationInfo != 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">
<schema2jsonld *ngIf="organizationInfo" [data]=organizationInfo
[URL]="properties.baseLink+'/search/organization?organizationId='+organizationId"
type="organization"></schema2jsonld>
<showTitle [title]="organizationInfo.title"></showTitle>
<div class="uk-text-large " *ngIf="organizationInfo.title.name && organizationInfo.title.name != organizationInfo.name ">{{organizationInfo.name}}</div>
<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>{{" "}}
<showTitle [title]="organizationInfo.title"></showTitle>
<div class="uk-text-large "
*ngIf="organizationInfo.title.name && organizationInfo.title.name != organizationInfo.name ">{{organizationInfo.name}}</div>
<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>
<li *ngIf="fetchPublications.searchUtils.totalResults > 0" (click)="activeTab='Publications'; searchPublicationsInit()">
<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">
<errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'" tab_error_class=true></errorMessages>
<li *ngIf="fetchPublications.searchUtils.totalResults > 0"
(click)="activeTab='Publications'; searchPublicationsInit()">
<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">
<errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'"
tab_error_class=true></errorMessages>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications" class="uk-button uk-button-text">
View all {{fetchPublications.searchUtils.totalResults | number}} results
</a>
</div>
<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 *ngIf="fetchPublications.searchUtils.status == errorCodes.DONE">
<div class="uk-text-right" *ngIf="fetchPublications.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications"
class="uk-button uk-button-text">
View all {{fetchPublications.searchUtils.totalResults | number}} results
</a>
</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;">
<a class="uk-accordion-title" href="#">
Projects
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchProjects.searchUtils.totalResultsNoFilters | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<searchingProjectsTab *ngIf="projectsClicked" [(fetchProjects)]="fetchProjects" [organizationId]="organizationId" [(properties)]=properties></searchingProjectsTab>
<!-- <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>
</li>
</div>
</li> -->
<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>
<li (click)="activeTab='Projects'; projectsClicked=true;">
<a class="uk-accordion-title" href="#">
Projects
<!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchProjects.searchUtils.totalResultsNoFilters | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<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">
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchDataproviders" class="uk-button uk-button-text">
View all {{fetchDataproviders.searchUtils.totalResults | number}} results
</a>
</div>
<tab-result [(results)]="fetchDataproviders.results"
[(status)]= "fetchDataproviders.status"
type="dataprovider" urlParam="datasourceId">
</tab-result>
</div>
</div>
</li>
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.DONE">
<div class="uk-text-right" *ngIf="fetchDataproviders.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchDataproviders"
class="uk-button uk-button-text">
View all {{fetchDataproviders.searchUtils.totalResults | number}} results
</a>
</div>
<tab-result [(results)]="fetchDataproviders.results"
[(status)]="fetchDataproviders.status"
type="dataprovider" urlParam="datasourceId">
</tab-result>
</div>
</div>
</li>
</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 *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 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 class="app-box app-box uk-padding-small" >
<ul class="uk-list">
<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">
Application Box
</div>
<div class="app-box app-box uk-padding-small">
<ul class="uk-list">
<ng-container *ngIf="fetchProjects && fetchProjects.funders.length > 0">
<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}}">
Download projects report (CSV) for {{key}}
</a-->
<a class="clickable" (click)="downloadFile(downloadURLAPI+'?'+csvProjectParamsHead+encodeURI(funder.id)+csvParamsTail, 'funder-projects-report')">
<!--span class="clickable" (click)="downloadProjectsFile(downloadURLAPI+'organizations/'+organizationId+'/projects?fq=(funderid exact '+funder.id+')&size='+funder.number)"-->
<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="uk-icon-download"> Project list for {{funder.name}} (CSV)</span>
</a>
</li>
<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}}">
Download projects report (CSV) for {{key}}
</a-->
<a class="clickable"
(click)="downloadFile(downloadURLAPI+'?'+csvProjectParamsHead+encodeURI(funder.id)+csvParamsTail, 'funder-projects-report')">
<!--span class="clickable" (click)="downloadProjectsFile(downloadURLAPI+'organizations/'+organizationId+'/projects?fq=(funderid exact '+funder.id+')&size='+funder.number)"-->
<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="uk-icon-download"> Project list for {{funder.name}} (CSV)</span>
</a>
</li>
<li *ngFor="let funder of fetchProjects.funders">
<a class="clickable" (click)="confirmOpenApplyAll(funder.name,encodeURI(funder.id), funder.number)">
<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="uk-icon-download"> Project Publications for {{funder.name}} (CSV)</span>
</a>
</li>
<li *ngFor="let funder of fetchProjects.funders">
<a class="clickable"
(click)="confirmOpenApplyAll(funder.name,encodeURI(funder.id), funder.number)">
<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="uk-icon-download"> Project Publications for {{funder.name}} (CSV)</span>
</a>
</li>
</ng-container>
<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(csvAffiliatedPublications, 'organization-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>
<span class="uk-icon-download"> Publications of organization (CSV) - based on the affiliation information.</span>
</a>
<!-- <a class="clickable" (click)="downloadFile(downloadURLAPI+'/organizations/'+organizationId+'?type=publications&format=csv')"> -->
<a class="clickable"
(click)="downloadFile(csvAffiliatedPublications, 'organization-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>
<span class="uk-icon-download"> Publications of organization (CSV) - based on the affiliation information.</span>
</a>
</li>
</ul>
</ul>
</div>
</div>
</div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div>
<modal-loading></modal-loading>
<modal-alert #AlertModalApplyAll (alertOutput)="confirmCloseApplyAll($event)"></modal-alert>
<modal-alert #AlertModalCsvError></modal-alert>
</div>
</div>
<modal-loading></modal-loading>
<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 { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
import {LoadingModalModule} from '../../utils/modal/loadingModal.module';
import {AlertModalModule} from '../../utils/modal/alertModal.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 { 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 {OrganizationComponent} from './organization.component';
import {LandingModule} from '../landing-utils/landing.module';
import {TabResultModule} from '../../searchPages/searchUtils/tabResult.module';
import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
import {ReportsServiceModule} from '../../services/reportsService.module';
import {PublicationsServiceModule} from '../../services/publicationsService.module';
// import {DatasetsServiceModule} from '../../services/datasetsService.module';
import {ProjectsServiceModule} from '../../services/projectsService.module';
import { SearchingProjectsTabModule} from '../landing-utils/searchingProjectsInTab.module';
import {FreeGuard} from'../../login/freeGuard.guard';
import {SearchingProjectsTabModule} from '../landing-utils/searchingProjectsInTab.module';
import {FreeGuard} from '../../login/freeGuard.guard';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module';
import {HelperModule} from "../../utils/helper/helper.module";
@NgModule({
imports: [
@ -38,19 +38,19 @@ import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
SearchingProjectsTabModule,
OrganizationServiceModule,
PublicationsServiceModule,
// DatasetsServiceModule,
ProjectsServiceModule,
Schema2jsonldModule, SEOServiceModule
Schema2jsonldModule, SEOServiceModule, HelperModule
],
declarations: [
OrganizationComponent,
OrganizationComponent,
],
providers:[
providers: [
FreeGuard, IsRouteEnabled
],
],
exports: [
OrganizationComponent
]
OrganizationComponent
]
})
export class OrganizationModule { }
export class OrganizationModule {
}

View File

@ -2,18 +2,31 @@
<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="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="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="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
<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">
<schema2jsonld *ngIf="orpInfo.record" [data]=orpInfo.record [URL]="properties.baseLink+'/search/orp?orpId='+orpId"></schema2jsonld>
<showTitle [titleName]="orpInfo.title"></showTitle>
<span *ngIf="orpInfo.types && orpInfo.types.length > 0"class="uk-label custom-label label-orp " title="Type">{{orpInfo.types.join(", ")}}</span>{{" "}}
<span *ngIf="orpInfo.languages && orpInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{orpInfo.languages.join(", ")}}</span>{{" "}}
<span *ngIf="orpInfo.countries && orpInfo.countries.length > 0" class="uk-label custom-label label-country " title="Country">{{orpInfo.countries.join(", ")}}</span>{{" "}}
<span *ngIf="orpInfo.accessMode" [class]="'uk-label custom-label label-'+ orpInfo.accessMode " title="Access Mode">{{orpInfo.accessMode}}</span>{{" "}}
<schema2jsonld *ngIf="orpInfo.record" [data]=orpInfo.record
[URL]="properties.baseLink+'/search/orp?orpId='+orpId"></schema2jsonld>
<showTitle [titleName]="orpInfo.title"></showTitle>
<span *ngIf="orpInfo.types && orpInfo.types.length > 0" class="uk-label custom-label label-orp "
title="Type">{{orpInfo.types.join(", ")}}</span>{{" "}}
<span *ngIf="orpInfo.languages && orpInfo.languages.length > 0"
class="uk-label custom-label label-language "
title="Language">{{orpInfo.languages.join(", ")}}</span>{{" "}}
<span *ngIf="orpInfo.countries && orpInfo.countries.length > 0"
class="uk-label custom-label label-country "
title="Country">{{orpInfo.countries.join(", ")}}</span>{{" "}}
<span *ngIf="orpInfo.accessMode" [class]="'uk-label custom-label label-'+ orpInfo.accessMode "
title="Access Mode">{{orpInfo.accessMode}}</span>{{" "}}
<span *ngIf="orpInfo.underCurationMessage" class="uk-label custom-label label-underCuration">
<span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}">
@ -22,7 +35,7 @@
</span>
</span>{{" "}}
<div class= " uk-margin-top">
<div class=" uk-margin-top">
<showAuthors [authors]="orpInfo.authors"></showAuthors>
<span *ngIf="orpInfo.date != ''">({{orpInfo.date}})</span>
</div>
@ -30,7 +43,8 @@
<ul class="uk-list">
<showPublisher [publisher]="orpInfo.publisher"
[journal]="orpInfo.journal" [properties]="properties"></showPublisher>
<li *ngIf="orpInfo.embargoEndDate"><span class="uk-text-bold">Embargo end date:</span> {{orpInfo.embargoEndDate}}</li>
<li *ngIf="orpInfo.embargoEndDate"><span
class="uk-text-bold">Embargo end date:</span> {{orpInfo.embargoEndDate}}</li>
<li *ngIf="orpInfo.identifiers && orpInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="orpInfo.identifiers"></showIdentifiers>
</li>
@ -42,16 +56,21 @@
</li>
</ul>
<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 *ngIf="showNumDescription == thresholdDescription && orpInfo.description.length > thresholdDescription">...</span
><span *ngIf="showNumDescription == thresholdDescription && orpInfo.description.length > thresholdDescription" class="uk-text-right">
><span
*ngIf="showNumDescription == thresholdDescription && orpInfo.description.length > thresholdDescription">...</span
><span
*ngIf="showNumDescription == thresholdDescription && orpInfo.description.length > thresholdDescription"
class="uk-text-right">
<a (click)="showNumDescription = orpInfo.description.length;">
View more
</a>
</span>
</div>
<div *ngIf="orpInfo.description && showNumDescription > thresholdDescription" class="uk-width-1-1 uk-text-right">
<div *ngIf="orpInfo.description && showNumDescription > thresholdDescription"
class="uk-width-1-1 uk-text-right">
<a (click)="showNumDescription = thresholdDescription;">
View less
</a>
@ -59,43 +78,49 @@
<ul class="custom-accordion" uk-accordion>
<li *ngIf="orpInfo.references" (click)="activeTab='References'">
<a class="uk-accordion-title" href="#">
References ({{orpInfo.references.length | number}})
</a>
<div class="uk-accordion-content">
<div>
<div *ngIf="orpInfo.references.length > pageSize" class="uk-margin-bottom">
<span class="uk-h6">{{orpInfo.references.length | number}} references, page {{referencesPage | number}} of {{totalPages(orpInfo.references.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="referencesPage" [totalResults]="orpInfo.references.length" [size]="pageSize" (pageChange)="updateReferencesPage($event)"></paging-no-load>
</div>
<a class="uk-accordion-title" href="#">
References ({{orpInfo.references.length | number}})
</a>
<div class="uk-accordion-content">
<div>
<div *ngIf="orpInfo.references.length > pageSize" class="uk-margin-bottom">
<span class="uk-h6">{{orpInfo.references.length | number}}
references, page {{referencesPage | number}}
of {{totalPages(orpInfo.references.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="referencesPage"
[totalResults]="orpInfo.references.length" [size]="pageSize"
(pageChange)="updateReferencesPage($event)"></paging-no-load>
</div>
<div *ngFor="let item of orpInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
<p *ngIf=" item && item['url']"
class="custom-external custom-icon">
<a href="{{item['url']}}" target="_blank">
{{item['name']}}
</a>
</p>
<p *ngIf="!item['url']" class="pseudo-external custom-icon">
{{item['name']}}
</p>
</div>
<div
*ngFor="let item of orpInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
<p *ngIf=" item && item['url']"
class="custom-external custom-icon">
<a href="{{item['url']}}" target="_blank">
{{item['name']}}
</a>
</p>
<p *ngIf="!item['url']" class="pseudo-external custom-icon">
{{item['name']}}
</p>
</div>
</div>
</li>
</div>
</li>
<li *ngIf="orpInfo.relatedResearchResults" (click)="activeTab='Related Research Results'">
<a class="uk-accordion-title" href="#">
Related Research Results
<!-- <span class="uk-badge uk-badge-notification"> -->
({{relatedResearchResultsNum | number}})
({{relatedResearchResultsNum | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<div>
<div *ngFor="let provenanceaction of getKeys(orpInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [percentageName]="trust" [info]="orpInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable>
<tabTable [percentageName]="trust" [info]="orpInfo.relatedResearchResults.get(provenanceaction)"
[(properties)]=properties></tabTable>
</div>
</div>
</div>
@ -105,12 +130,13 @@
<a class="uk-accordion-title" href="#">
Similar Research Results
<!-- <span class="uk-badge uk-badge-notification"> -->
({{orpInfo.similarResearchResults.length | number}})
({{orpInfo.similarResearchResults.length | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<div>
<tabTable [percentageName]="similarity" [info]="orpInfo.similarResearchResults" [(properties)]=properties></tabTable>
<tabTable [percentageName]="similarity" [info]="orpInfo.similarResearchResults"
[(properties)]=properties></tabTable>
</div>
</div>
</li>
@ -120,25 +146,27 @@
Metrics
</a>
<div class="uk-accordion-content">
<metrics [pageViews]="pageViews"
[id]="orpId" [entityType]="'results'" [entity]="'Other Research Product'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
<metrics [pageViews]="pageViews"
[id]="orpId" [entityType]="'results'" [entity]="'Other Research Product'"
(metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250">
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250">
</i-frame>
</div>
</li>
<li (click)="activeTab='Other Versions'" *ngIf="properties.environment == 'development' && orpInfo.deletedByInferenceIds">
<li (click)="activeTab='Other Versions'"
*ngIf="properties.environment == 'development' && orpInfo.deletedByInferenceIds">
<a class="uk-accordion-title" href="#">
Other Versions
({{orpInfo.deletedByInferenceIds.length | number}})
</a>
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
<deletedByInference [id]="orpId" [ids]="orpInfo.deletedByInferenceIds" [type]="'other research products'"></deletedByInference>
<deletedByInference [id]="orpId" [ids]="orpInfo.deletedByInferenceIds"
[type]="'other research products'"></deletedByInference>
</div>
</li>
</ul>
@ -147,7 +175,7 @@
<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>
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis></addThis>
</div>
<altmetrics *ngIf="orpInfo.identifiers && orpInfo.identifiers.get('doi')"
@ -160,101 +188,129 @@
<li *ngIf="orpInfo.fundedByProjects != undefined && orpInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="orpInfo.fundedByProjects"></fundedBy>
</li>
<li *ngIf="orpInfo.contexts && orpInfo.contexts.length >0 ">
<dl class="uk-description-list-line" >
<dt class="sideInfoTitle">Related to </dt>
<dd class="line" *ngFor="let item of orpInfo.contexts">
<span *ngIf = "!item['inline']" >
<li *ngIf="orpInfo.contexts && orpInfo.contexts.length >0 ">
<dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of orpInfo.contexts">
<span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span>
<mark *ngIf = "item['inline']" >
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
<mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
</dl>
</li>
<li>
</li>
<li>
<div class="sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this research product
</div>
<div class="">
<citeThis [result]="orpInfo" [id]="orpId" type="other research product"></citeThis>
</div>
<div class="sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this research product
</div>
<div class="">
<citeThis [result]="orpInfo" [id]="orpId" type="other research product"></citeThis>
</div>
</li>
</ul>
<button *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-button portal-button uk-width-1-1 ">
</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 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">
<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>
<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">
<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" >
<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: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" >
<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: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" >
<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>
<!-- 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">
<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>
</div>

View File

@ -1,217 +1,248 @@
import {Component, ViewChild} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} 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 {EnvProperties} from '../../utils/properties/env-properties';
import {RouterHelper} from '../../utils/routerHelper.class';
import {OrpService} from './orp.service';
import {PiwikService} from '../../utils/piwik/piwik.service';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {OrpService} from './orp.service';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({
selector: 'orp',
templateUrl: 'orp.component.html',
selector: 'orp',
templateUrl: 'orp.component.html',
})
export class OrpComponent {
@Input() piwikSiteId = null;
public orpInfo: OrpInfo;
public orpId : string ;
@Input() piwikSiteId = null;
@Input() communityId = null;
public orpInfo: OrpInfo;
public orpId: string;
// APP BOX variables
public showAllCollectedFrom: boolean = false;
public showAllDownloadFrom: boolean = false;
public showAllPublishedIn: boolean = false;
// APP BOX variables
public showAllCollectedFrom: boolean = false;
public showAllDownloadFrom: boolean = false;
public showAllPublishedIn: boolean = false;
public thresholdDescription: number = 270;
public showNumDescription: number = 270;
// Metrics tab variables
public metricsClicked: boolean;
public viewsFrameUrl: string;
public downloadsFrameUrl: string;
public totalViews: number;
public totalDownloads: number;
public pageViews: number;
public thresholdDescription: number = 270;
public showNumDescription: number = 270;
// Custom tab paging variables
public referencesPage: number = 1;
public pageSize: number = 10;
// Metrics tab variables
public metricsClicked: boolean;
public viewsFrameUrl: string;
public downloadsFrameUrl: string;
public totalViews: number;
public totalDownloads: number;
public pageViews: number;
// Active tab variable for responsiveness
public activeTab: string = "References";
// Custom tab paging variables
public referencesPage: number = 1;
public pageSize: number = 10;
// Map counting variable
public relatedResearchResultsNum: number = 0;
// Active tab variable for responsiveness
public activeTab: string = "References";
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
// Map counting variable
public relatedResearchResultsNum: number = 0;
public routerHelper:RouterHelper = new RouterHelper();
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
public pageContents = null;
public divContents = null;
private result ;
sub: any; piwiksub: any; infoSub: any;
properties:EnvProperties;
public routerHelper: RouterHelper = new RouterHelper();
constructor (private _orpService: OrpService,
private _piwikService:PiwikService,
private route: ActivatedRoute,
private router: Router,
private _meta: Meta,
private _title: Title,
private _router: Router,
private seoService: SEOService) {
}
private result;
sub: any;
piwiksub: any;
infoSub: any;
properties: EnvProperties;
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url);
constructor(private _orpService: OrpService,
private _piwikService: PiwikService,
private route: ActivatedRoute,
private router: Router,
private _meta: Meta,
private _title: Title,
private _router: Router,
private helper: HelperService,
private seoService: SEOService) {
}
});
this.sub = this.route.queryParams.subscribe(params => {
this.orpInfo = null;
this.updateTitle("Other Research Product");
this.updateDescription("");
this.orpId = params['orpId'];
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
//this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
if(this.orpId){
this.getOrpInfo(this.orpId);
}else{
this.showLoading = false;
this.warningMessage="No valid research product id";
}
});
this.sub = this.route.queryParams.subscribe(params => {
this.orpInfo = null;
this.updateTitle("Other Research Product");
this.updateDescription("");
this.orpId = params['orpId'];
this.metricsClicked = false;
this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"'+this.orpId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"'+this.orpId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
this.scroll();
});
}
ngOnDestroy() {
if(this.sub){
this.sub.unsubscribe();
if (this.orpId) {
this.getOrpInfo(this.orpId);
} else {
this.showLoading = false;
this.warningMessage = "No valid research product id";
}
if(this.piwiksub){
this.piwiksub.unsubscribe();
}
if(this.infoSub) {
this.infoSub.unsubscribe();
this.metricsClicked = false;
this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this.orpId + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
this.downloadsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"' + this.orpId + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
this.scroll();
});
}
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.pageContents = contents;
})
}
private getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.divContents = contents;
})
}
ngOnDestroy() {
if (this.sub) {
this.sub.unsubscribe();
}
if (this.piwiksub) {
this.piwiksub.unsubscribe();
}
if (this.infoSub) {
this.infoSub.unsubscribe();
}
}
private getOrpInfo(id: string) {
this.warningMessage = '';
this.errorMessage = ""
this.showLoading = true;
this.orpInfo = null;
this.infoSub = this._orpService.getOrpInfo(id, this.properties).subscribe(
data => {
this.orpInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrp + this.orpInfo.record["result"]["header"]["dri:objIdentifier"]);
if (this.orpInfo.title) {
this.updateTitle(this.orpInfo.title);
this.updateDescription((this.orpInfo.description ? (this.orpInfo.description) : ("," + this.orpInfo.title)));
}
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.orpInfo.title, this.piwikSiteId).subscribe();
}
this.result = []
this.result = {
id: id,
type: "orp",
source: "openaire",
title: this.orpInfo.title,
url: '',
result: '',
accessRights: this.orpInfo.accessMode,
embargoEndDate: ''
};
let relatedResearchResultsNum = 0;
if (this.orpInfo.relatedResearchResults != undefined) {
this.orpInfo.relatedResearchResults.forEach(function (value, key, map) {
relatedResearchResultsNum += value.length;
});
}
this.relatedResearchResultsNum = relatedResearchResultsNum;
this.showLoading = false;
},
err => {
//console.log(err)
this.handleError("Error getting other research product for id: " + this.orpId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrps);
this.errorMessage = 'No research product found';
this.showLoading = false;
}
);
}
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _prefix = "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) {
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){
isRouteAvailable(routeToCheck: string) {
for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path;
if(routePath == routeToCheck){
let routePath: string = this.router.config[i].path;
if (routePath == routeToCheck) {
return true;
}
}

View File

@ -1,29 +1,29 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
import {SharedModule} from '../../shared/shared.module';
import {SharedModule} from '../../shared/shared.module';
import {OrpComponent} from './orp.component';
import {OrpComponent} from './orp.component';
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
import {LandingModule} from '../landing-utils/landing.module';
import {ResultLandingModule} from '../landing-utils/resultLanding.module';
import {MetricsModule} from '../landing-utils/metrics.module';
import {AltMetricsModule} from '../../utils/altmetrics.module';
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
import {LandingModule} from '../landing-utils/landing.module';
import {ResultLandingModule} from '../landing-utils/resultLanding.module';
import {MetricsModule} from '../landing-utils/metrics.module';
import {AltMetricsModule} from '../../utils/altmetrics.module';
import {ConfigurationServiceModule} from '../../utils/configuration/configurationService.module';
import {IFrameModule} from '../../utils/iframe.module';
import {PagingModule} from '../../utils/paging.module';
import {IFrameModule} from '../../utils/iframe.module';
import {PagingModule} from '../../utils/paging.module';
import {OrpService} from './orp.service';
import {OrpService} from './orp.service';
import {FreeGuard} from'../../login/freeGuard.guard';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
import {FreeGuard} from '../../login/freeGuard.guard';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module';
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
import {DeletedByInferenceModule} from "../landing-utils/deletedByInference/deletedByInference.module";
import {HelperModule} from "../../utils/helper/helper.module";
@NgModule({
@ -31,17 +31,18 @@ import {DeletedByInferenceModule} from "../landing-utils/deletedByInference/dele
CommonModule, FormsModule, SharedModule, RouterModule, LandingModule,
CiteThisModule, ResultLandingModule, MetricsModule, IFrameModule, PagingModule,
AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule,
ShowAuthorsModule, DeletedByInferenceModule
ShowAuthorsModule, DeletedByInferenceModule, HelperModule
],
declarations: [
OrpComponent
],
providers:[
OrpService, FreeGuard, IsRouteEnabled
providers: [
OrpService, FreeGuard
],
exports: [
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 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 *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div>
<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="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 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>
<div *ngIf="projectInfo != 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">
<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.title}}</h3-->
<h2 class="projectIcon">
@ -17,29 +25,43 @@
<!-- <span *ngIf="projectInfo.specialClause39==true" class="sc39">{{projectName}}</span>
<span *ngIf="projectInfo.specialClause39!=true">{{projectName}}</span> -->
<span>{{projectName}}</span>
<span *ngIf=" projectInfo.title == projectName ">({{projectInfo.contractNum}})</span>
<span *ngIf=" projectInfo.title == projectName ">({{projectInfo.contractNum}})</span>
</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>
<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 *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">
<span
*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
</span>{{" "}}
<span *ngIf="projectInfo.openAccessMandatePublications != undefined && projectInfo.openAccessMandatePublications && (projectInfo.openAccessMandateDatasets == undefined || !projectInfo.openAccessMandateDatasets)"
class="uk-label custom-label label-openaccessmandate " title="Open Access mandate for Publications">Open Access mandate for Publications</span>{{" "}}
<span *ngIf="projectInfo.specialClause39" class="uk-label custom-label label-sc39 " 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>{{" "}}
<span
*ngIf="projectInfo.openAccessMandatePublications != undefined && projectInfo.openAccessMandatePublications && (projectInfo.openAccessMandateDatasets == undefined || !projectInfo.openAccessMandateDatasets)"
class="uk-label custom-label label-openaccessmandate " title="Open Access mandate for Publications">Open Access mandate for Publications</span>{{" "}}
<span *ngIf="projectInfo.specialClause39" class="uk-label custom-label label-sc39 "
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>
<ul class="uk-list">
<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.endDate"><span class="uk-text-bold">End Date:</span> {{projectInfo.endDate}}</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.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.endDate"><span class="uk-text-bold">End Date:</span> {{projectInfo.endDate}}</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>
<span class="list-horizontal-line">
@ -47,13 +69,14 @@
[attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'"
[title]="organization.name">
<a *ngIf="organization.id"
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization">
{{(organization.acronym)?organization.acronym:''}} {{(!organization.acronym && organization.name)?organization.name:''}}</a>
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active"
routerLink="/search/organization">
{{(organization.acronym) ? organization.acronym : ''}} {{(!organization.acronym && organization.name) ? organization.name : ''}}</a>
<span
*ngIf="!organization.id">
*ngIf="!organization.id">
<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>
</li>
@ -90,147 +113,157 @@
<ul class="custom-accordion" uk-accordion>
<li (click)="activeTab='Publications'; searchPublicationsInit()">
<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">
<errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'" tab_error_class=true></errorMessages>
<li (click)="activeTab='Publications'; searchPublicationsInit()">
<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">
<errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'"
tab_error_class=true></errorMessages>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" >
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications" class="uk-button uk-button-text">
View all {{fetchPublications.searchUtils.totalResults | number}} results
</a>
</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> -->
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.DONE">
<div class="uk-text-right" *ngIf="fetchPublications.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications"
class="uk-button uk-button-text">
View all {{fetchPublications.searchUtils.totalResults | number}} results
</a>
<div class="uk-accordion-content">
<errorMessages [status]="[fetchOrps.searchUtils.status]" [type]="'other research products'" tab_error_class=true></errorMessages>
</div>
<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">
<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>
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.DONE">
<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 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>
<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>
<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>
<div *ngIf="fetchSoftware.searchUtils.status == errorCodes.DONE">
<li (click)="metricsClicked=true; activeTab='Metrics'">
<a class="uk-accordion-title" href="#">
Metrics
</a>
<div class="uk-accordion-content">
<metrics [pageViews]="pageViews"
<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>
<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'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0"
(metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads > 0"
</i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250">
</i-frame>
</div>
</li>
</i-frame>
</div>
</li>
</ul>
@ -403,161 +436,235 @@
</i-frame>
</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 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>
</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>
<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 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 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>
<a>Research Data</a>
</li>
</ul>
</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>
</div>
<button *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-button portal-button uk-margin-small-top uk-width-1-1">
<pre class="box-content uk-padding-remove-bottom uk-margin-remove-bottom"><code
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">
<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...
</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">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size uk-margin-small'>Research results</div>">
<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" >
<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>
<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">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;"
title="<div class='tooltip-custom-font-size uk-margin-small'>Research results</div>">
<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">
<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>
<!--metrics [pageViews]="pageViews" shortView=true
[id]="projectId" [entityType]="'projects'" [entity]="'Project'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics-->
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</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>
<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>
</div>

View File

@ -1,43 +1,41 @@
import {Component, ViewChild} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Params} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
import {Component, Input, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} 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 {ProjectInfo} from '../../utils/entities/projectInfo';
import {RouterHelper} from '../../utils/routerHelper.class';
import {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class';
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 {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class';
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 {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 {ErrorCodes} from '../../utils/properties/errorCodes'
import {PiwikService} from '../../utils/piwik/piwik.service';
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 {HelperService} from "../../utils/helper/helper.service";
@Component({
selector: 'project',
templateUrl: 'project.component.html',
})
selector: 'project',
templateUrl: 'project.component.html',
})
export class ProjectComponent{
export class ProjectComponent {
@Input() piwikSiteId = null;
@Input() communityId = null;
public projectInfo: ProjectInfo;
public projectId : string ;
public projectId: string;
public projectName: string;
// Metrics tab variables
@ -60,7 +58,7 @@ export class ProjectComponent{
public software_dynamic: string;
public orps_dynamic: string;
public project ;
public project;
// CSV variables
public downloadURLAPI: string;
@ -84,419 +82,457 @@ export class ProjectComponent{
private reloadOrps: boolean = true;
// Variables for publications, research data, software tabs
public fetchPublications : FetchPublications;
public fetchPublications: FetchPublications;
public linkToSearchPublications = "";
public fetchDatasets : FetchDatasets;
public fetchDatasets: FetchDatasets;
public linkToSearchDatasets = "";
public fetchSoftware: FetchSoftware;
public linkToSearchSoftware = "";
public fetchOrps: FetchOrps;
public linkToSearchOrps = "";
public routerHelper:RouterHelper = new RouterHelper();
public errorCodes:ErrorCodes = new ErrorCodes();
public routerHelper: RouterHelper = new RouterHelper();
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
@ViewChild('AlertModalCsvError') alertCsvError;
sub: any; piwiksub: any; infoSub: any; downloadFilePiwikSub: any;
properties:EnvProperties;
constructor ( private _projectService: ProjectService,
private _piwikService:PiwikService,
private route: ActivatedRoute,
private router: Router,
private _searchPublicationsService: SearchPublicationsService,
private _searchDatasetsService: SearchDatasetsService,
private _searchSoftwareService: SearchSoftwareService,
private _searchOrpsService: SearchOrpsService,
private _reportsService: ReportsService,
private _meta: Meta,
private _title: Title,
private _router: Router,
sub: any;
piwiksub: any;
infoSub: any;
downloadFilePiwikSub: any;
properties: EnvProperties;
constructor(private _projectService: ProjectService,
private _piwikService: PiwikService,
private route: ActivatedRoute,
private router: Router,
private _searchPublicationsService: SearchPublicationsService,
private _searchDatasetsService: SearchDatasetsService,
private _searchSoftwareService: SearchSoftwareService,
private _searchOrpsService: SearchOrpsService,
private _reportsService: ReportsService,
private _meta: Meta,
private _title: Title,
private _router: Router,
private helper: HelperService,
private seoService: SEOService) {
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url);
this.properties = data.envSpecific;
//this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
});
this.sub = this.route.queryParams.subscribe(params => {
this.metricsClicked = false;
this.statsClicked = false;
this.fetchPublications = new FetchPublications( this._searchPublicationsService);
this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
this.fetchSoftware = new FetchSoftware(this._searchSoftwareService);
this.fetchOrps = new FetchOrps(this._searchOrpsService);
this.sub = this.route.queryParams.subscribe(params => {
this.metricsClicked = false;
this.statsClicked = false;
this.fetchPublications = new FetchPublications(this._searchPublicationsService);
this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
this.fetchSoftware = new FetchSoftware(this._searchSoftwareService);
this.fetchOrps = new FetchOrps(this._searchOrpsService);
var title = "Project";
var description = "";
var title = "Project";
var description = "";
this.updateTitle(title);
this.updateDescription(description);
this.updateTitle(title);
this.updateDescription(description);
this.projectId = params['projectId'];
var grantId = params['grantId'];
var funder = params['funder'];
if(this.projectId){
this.getProjectInfo(this.projectId);
this.actionsAfterLoadId();
}else if(grantId && funder){
this.getProjectInfoByGrantId(grantId,funder);
}else{
if (this.projectId) {
this.getProjectInfo(this.projectId);
this.actionsAfterLoadId();
} else if (grantId && funder) {
this.getProjectInfoByGrantId(grantId, funder);
} else {
this.showLoading = false;
this.warningMessage="No valid project id";
this.showLoading = false;
this.warningMessage = "No valid project id";
}
this.downloadURLAPI = this.properties.csvAPIURL;
this.createClipboard();
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.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.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.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 + "\"))";
HelperFunctions.scroll();
});
}
});
}
actionsAfterLoadId(){
this.publications_dynamic =
"<script type=\"text/javascript\">"
+ "\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>";
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.pageContents = contents;
})
}
this.datasets_dynamic =
"<script type=\"text/javascript\">"
+ "\n<!--"
+ "\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>";
private getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.divContents = contents;
})
}
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>";
actionsAfterLoadId() {
this.publications_dynamic =
"<script type=\"text/javascript\">"
+ "\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.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.datasets_dynamic =
"<script type=\"text/javascript\">"
+ "\n<!--"
+ "\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 =
"<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() {
if(this.sub){
if (this.sub) {
this.sub.unsubscribe();
}
if(this.piwiksub){
if (this.piwiksub) {
this.piwiksub.unsubscribe();
}
if(this.infoSub) {
if (this.infoSub) {
this.infoSub.unsubscribe();
}
if(this.downloadFilePiwikSub) {
if (this.downloadFilePiwikSub) {
this.downloadFilePiwikSub.unsubscribe();
}
}
private createClipboard() {
if(typeof window !== 'undefined') {
if (typeof window !== 'undefined') {
let publ_clipboard, datasets_clipboard, software_clipboard, orps_clipboard;
let Clipboard;
Clipboard = require('clipboard');
publ_clipboard = new Clipboard('.publ_clipboard_btn');
datasets_clipboard = new Clipboard('.datasets_clipboard_btn');
software_clipboard = new Clipboard('.software_clipboard_btn');
orps_clipboard = new Clipboard('.orps_clipboard_btn');
}
let publ_clipboard, datasets_clipboard, software_clipboard, orps_clipboard;
let Clipboard;
Clipboard = require('clipboard');
publ_clipboard = new Clipboard('.publ_clipboard_btn');
datasets_clipboard = new Clipboard('.datasets_clipboard_btn');
software_clipboard = new Clipboard('.software_clipboard_btn');
orps_clipboard = new Clipboard('.orps_clipboard_btn');
}
}
private searchPublications() {
this.fetchPublications.getResultsForEntity("project", this.projectId, 1, 10, this.properties);
this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications;// + "?project=" + this.projectId+"&pr=and";
//if(this.fetchPublications.searchUtils.totalResults > 0) {
//this.activeTab = "Publications";
//this.activeTab = "Publications";
//} else {
//this.searchDatasetsInit();
//this.searchDatasetsInit();
//}
this.reloadPublications = false;
}
private searchDatasets() {
this.fetchDatasets.getResultsForEntity("project", this.projectId, 1, 10, this.properties);
this.linkToSearchDatasets = this.properties.searchLinkToAdvancedDatasets;// + "?project=" + this.projectId+"&pr=and";
this.fetchDatasets.getResultsForEntity("project", this.projectId, 1, 10, this.properties);
this.linkToSearchDatasets = this.properties.searchLinkToAdvancedDatasets;// + "?project=" + this.projectId+"&pr=and";
this.reloadDatasets = false;
//this.activeTab = "Research Data";
this.reloadDatasets = false;
//this.activeTab = "Research Data";
}
private searchSoftware() {
this.fetchSoftware.getResultsForEntity("project", this.projectId, 1, 10, this.properties);
this.linkToSearchSoftware = this.properties.searchLinkToAdvancedSoftware;
this.reloadSoftware = false;
this.fetchSoftware.getResultsForEntity("project", this.projectId, 1, 10, this.properties);
this.linkToSearchSoftware = this.properties.searchLinkToAdvancedSoftware;
this.reloadSoftware = false;
}
private searchOrps() {
this.fetchOrps.getResultsForEntity("project", this.projectId, 1, 10, this.properties);
this.linkToSearchOrps = this.properties.searchLinkToAdvancedOrps;
this.reloadOrps = false;
this.fetchOrps.getResultsForEntity("project", this.projectId, 1, 10, this.properties);
this.linkToSearchOrps = this.properties.searchLinkToAdvancedOrps;
this.reloadOrps = false;
}
public searchPublicationsInit() {
if(this.reloadPublications && this.fetchPublications.searchUtils.totalResults > 0) {
this.searchPublications();
} else if(this.fetchPublications.searchUtils.totalResults == 0) {
//this.statsClicked=true;
//this.activeTab = "Statistics";
}
if (this.reloadPublications && this.fetchPublications.searchUtils.totalResults > 0) {
this.searchPublications();
} else if (this.fetchPublications.searchUtils.totalResults == 0) {
//this.statsClicked=true;
//this.activeTab = "Statistics";
}
}
public searchDatasetsInit() {
if(this.reloadDatasets && this.fetchDatasets.searchUtils.totalResults > 0) {
this.searchDatasets();
} else if(this.fetchDatasets.searchUtils.totalResults == 0) {
//this.statsClicked=true;
//this.activeTab = "Statistics";
}
if (this.reloadDatasets && this.fetchDatasets.searchUtils.totalResults > 0) {
this.searchDatasets();
} else if (this.fetchDatasets.searchUtils.totalResults == 0) {
//this.statsClicked=true;
//this.activeTab = "Statistics";
}
}
public searchSoftwareInit() {
if(this.reloadSoftware && this.fetchSoftware.searchUtils.totalResults > 0) {
this.searchSoftware();
}
if (this.reloadSoftware && this.fetchSoftware.searchUtils.totalResults > 0) {
this.searchSoftware();
}
}
public searchOrpsInit() {
if(this.reloadOrps && this.fetchOrps.searchUtils.totalResults > 0) {
this.searchOrps();
}
if (this.reloadOrps && this.fetchOrps.searchUtils.totalResults > 0) {
this.searchOrps();
}
}
private getProjectInfo (id:string) {
this.warningMessage = '';
this.errorMessage=""
private getProjectInfo(id: string) {
this.warningMessage = '';
this.errorMessage = ""
this.showLoading = true;
this.projectInfo = null;
this.infoSub = this._projectService.getProjectInfo(id, this.properties).subscribe(
data => {
this.projectInfo = data;
this.projectInfo = data;
this.actionsAfterGettingProjectInfo();
this.actionsAfterGettingProjectInfo();
},
err => {
//console.log(err);
this.handleError("Error getting project for id: "+this.projectId, err);
//console.log(err);
this.handleError("Error getting project for id: " + this.projectId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToProjects);
this.errorMessage = 'No project found';
this.showLoading = false;
}
this.errorMessage = 'No project found';
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(
data =>{
this.projectInfo = null;
this.projectInfo = data;
this._projectService.getProjectInfoByGrantId(grantId, funder, this.properties).subscribe(
data => {
this.actionsAfterGettingProjectInfo();
this.projectId = this.projectInfo.id;
this.actionsAfterLoadId();
},
err => {
//console.log(err);
this.handleError("Error getting project for grant id: "+grantId+" and funder: "+funder, err);
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 == '') {
this.projectInfo = data;
this.actionsAfterGettingProjectInfo();
this.projectId = this.projectInfo.id;
this.actionsAfterLoadId();
},
err => {
//console.log(err);
this.handleError("Error getting project for grant id: " + grantId + " and funder: " + funder, err);
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 == '') {
this.projectName = this.projectInfo.title;
}
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url);
this.updateTitle(this.projectName);
this.updateDescription("project, "+this.projectName+ ","+this.projectInfo.funder+","+this.projectInfo.acronym);
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, this.projectName, this.piwikSiteId).subscribe();
}
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url);
this.updateTitle(this.projectName);
this.updateDescription("project, " + this.projectName + "," + this.projectInfo.funder + "," + this.projectInfo.acronym);
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
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
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';
//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.showLoading = false;
}
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();
}/*,
this.closeLoading();
this.confirmOpenCsvError();
}/*,
() => console.log('Completed file download.')*/
);
}
);
}
/*
showHTML(){
let info:string = "<h1>Publications of Project ";
/*
showHTML(){
let info:string = "<h1>Publications of Project ";
if(this.projectInfo.title != undefined && this.projectInfo.title != "") {
info += this.projectInfo.title;
}
if((this.projectInfo.title != undefined && this.projectInfo.title != "") &&
((this.projectInfo.acronym != undefined && this.projectInfo.acronym != "") ||
(this.projectInfo.callIdentifier != undefined && this.projectInfo.callIdentifier != ""))) {
info += "(";
}
if(this.projectInfo.acronym != undefined && this.projectInfo.acronym != "") {
info += this.projectInfo.acronym + " - ";
}
if(this.projectInfo.callIdentifier != undefined && this.projectInfo.callIdentifier != "") {
info += this.projectInfo.callIdentifier;
}
if((this.projectInfo.title != undefined && this.projectInfo.title != "") &&
((this.projectInfo.acronym != undefined && this.projectInfo.acronym != "") ||
(this.projectInfo.callIdentifier != undefined && this.projectInfo.callIdentifier != ""))) {
info += ")";
}
info +="</h1>";
info += "<h3>"+this.fetchPublications.searchUtils.totalResults+" publications</h3>";
if(this.projectInfo.title != undefined && this.projectInfo.title != "") {
info += this.projectInfo.title;
}
if((this.projectInfo.title != undefined && this.projectInfo.title != "") &&
((this.projectInfo.acronym != undefined && this.projectInfo.acronym != "") ||
(this.projectInfo.callIdentifier != undefined && this.projectInfo.callIdentifier != ""))) {
info += "(";
}
if(this.projectInfo.acronym != undefined && this.projectInfo.acronym != "") {
info += this.projectInfo.acronym + " - ";
}
if(this.projectInfo.callIdentifier != undefined && this.projectInfo.callIdentifier != "") {
info += this.projectInfo.callIdentifier;
}
if((this.projectInfo.title != undefined && this.projectInfo.title != "") &&
((this.projectInfo.acronym != undefined && this.projectInfo.acronym != "") ||
(this.projectInfo.callIdentifier != undefined && this.projectInfo.callIdentifier != ""))) {
info += ")";
}
info +="</h1>";
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+'"))';
this._reportsService.downloadHTMLFile(this.downloadURLAPI+htmlParams, info)
.subscribe(data => this.funct(data),
error => console.log("Error downloading the file."),
() => console.log('Completed file download.'));
}
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)
.subscribe(data => this.funct(data),
error => console.log("Error downloading the file."),
() => console.log('Completed file download.'));
}
funct(data) {
var win = window.open(window.URL.createObjectURL(data));
}
*/
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
}
funct(data) {
var win = window.open(window.URL.createObjectURL(data));
}
*/
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'");
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private openLoading(){
if(this.loading){
this.loading.open();
}
}
private closeLoading(){
if(this.loading){
this.loading.close();
}
}
private setMessageLoading(message: string){
if(this.loading){
this.loading.message = message;
}
}
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'");
}
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 updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
private handleError(message: string, error) {
console.error("Project Landing Page: "+message, error);
private openLoading() {
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++) {
let routePath:string = this.router.config[i].path;
if(routePath == routeToCheck){
let routePath: string = this.router.config[i].path;
if (routePath == routeToCheck) {
return true;
}
}

View File

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

View File

@ -1,6 +1,6 @@
import { NgModule} from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {ProjectService} from './project.service';
@ -9,12 +9,11 @@ import {ProjectService} from './project.service';
imports: [
CommonModule, FormsModule
],
declarations: [
declarations: [],
providers: [
ProjectService
],
providers:[
ProjectService
],
exports: [
]
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 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 *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div>
<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="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 class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="publicationInfo.record" [data]=publicationInfo.record [URL]="properties.baseLink+'/search/publication?articleId='+articleId"></schema2jsonld>
<showTitle [titleName]="publicationInfo.title"></showTitle>
<span *ngIf="publicationInfo.types && publicationInfo.types.length > 0"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>{{" "}}
<div *ngIf="publicationInfo != 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">
<schema2jsonld *ngIf="publicationInfo.record" [data]=publicationInfo.record
[URL]="properties.baseLink+'/search/publication?articleId='+articleId"></schema2jsonld>
<showTitle [titleName]="publicationInfo.title"></showTitle>
<span *ngIf="publicationInfo.types && publicationInfo.types.length > 0"
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.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"
title="{{buildCurationTooltip()}}">
title="{{buildCurationTooltip()}}">
<i>Record in preview</i>
<i class="uk-icon-info-circle"></i>
</span></span>{{" "}}
<div class= " uk-margin-top">
<showAuthors [authors]="publicationInfo.authors"></showAuthors>
<span *ngIf="publicationInfo.date != ''">({{publicationInfo.date}})</span>
<div class=" uk-margin-top">
<showAuthors [authors]="publicationInfo.authors"></showAuthors>
<span *ngIf="publicationInfo.date != ''">({{publicationInfo.date}})</span>
</div>
<ul class="uk-list">
<showPublisher [publisher]="publicationInfo.publisher"
[journal]="publicationInfo.journal" [properties]="properties"></showPublisher>
<li *ngIf="publicationInfo.embargoEndDate"><span class="uk-text-bold">Embargo end date:</span> {{publicationInfo.embargoEndDate}}</li>
<li *ngIf="publicationInfo.identifiers && publicationInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="publicationInfo.identifiers"></showIdentifiers>
</li>
<li *ngIf="publicationInfo.subjects || publicationInfo.otherSubjects || publicationInfo.classifiedSubjects">
<showSubjects [subjects]="publicationInfo.subjects"
[otherSubjects]="publicationInfo.otherSubjects"
[classifiedSubjects]="publicationInfo.classifiedSubjects">
<li *ngIf="publicationInfo.embargoEndDate"><span
class="uk-text-bold">Embargo end date:</span> {{publicationInfo.embargoEndDate}}</li>
<li *ngIf="publicationInfo.identifiers && publicationInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="publicationInfo.identifiers"></showIdentifiers>
</li>
<li
*ngIf="publicationInfo.subjects || publicationInfo.otherSubjects || publicationInfo.classifiedSubjects">
<showSubjects [subjects]="publicationInfo.subjects"
[otherSubjects]="publicationInfo.otherSubjects"
[classifiedSubjects]="publicationInfo.classifiedSubjects">
</showSubjects>
</li>
</ul>
<hr *ngIf="publicationInfo.description">
<div *ngIf="publicationInfo.description" class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
</li>
</ul>
<hr *ngIf="publicationInfo.description">
<div *ngIf="publicationInfo.description"
class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<span>{{publicationInfo.description.substring(0, showNumDescription)}}</span
><!--span *ngIf="showNumDescription > thresholdDescription">
<a (click)="showNumDescription = thresholdDescription; scroll()">
View less
</a>
</span
--><span *ngIf="showNumDescription == thresholdDescription && publicationInfo.description.length > thresholdDescription">...</span
><span *ngIf="showNumDescription == thresholdDescription && publicationInfo.description.length > thresholdDescription" class="uk-text-right">
--><span
*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;">
View more
</a>
</span>
</div>
<div *ngIf="publicationInfo.description && showNumDescription > thresholdDescription" class="uk-width-1-1 uk-text-right">
<!-- scroll() -->
<a (click)="showNumDescription = thresholdDescription;">
View less
</div>
<div *ngIf="publicationInfo.description && showNumDescription > thresholdDescription"
class="uk-width-1-1 uk-text-right">
<!-- scroll() -->
<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>
</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>
<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>
<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>
<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 *ngIf="publicationInfo.relatedResearchResults" (click)="activeTab='Related Research Results'">
<a class="uk-accordion-title" href="#">
Related Research Results
<!-- <span *ngIf="!publicationInfo.relatedResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.relatedResearchResults" class="uk-badge uk-badge-notification">
{{relatedResearchResultsNum | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{relatedResearchResultsNum | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!publicationInfo.relatedResearchResults" class = "uk-alert uk-alert-primary">
No related research results available
</div>
<div *ngIf="publicationInfo.relatedResearchResults"> -->
<div>
<div *ngFor="let provenanceaction of getKeys(publicationInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div>
<a class="uk-accordion-title" href="#">
Related Research Results
<!-- <span *ngIf="!publicationInfo.relatedResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.relatedResearchResults" class="uk-badge uk-badge-notification">
{{relatedResearchResultsNum | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{relatedResearchResultsNum | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!publicationInfo.relatedResearchResults" class = "uk-alert uk-alert-primary">
No related research results available
</div>
<div *ngIf="publicationInfo.relatedResearchResults"> -->
<div>
<div *ngFor="let provenanceaction of getKeys(publicationInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [percentageName]="trust" [info]="publicationInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable>
</div>
<tabTable [percentageName]="trust"
[info]="publicationInfo.relatedResearchResults.get(provenanceaction)"
[(properties)]=properties></tabTable>
</div>
</div>
</li>
</div>
</li>
<li *ngIf="publicationInfo.similarResearchResults" (click)="activeTab='Similar Research Results'">
<a class="uk-accordion-title" href="#">
Similar Research Results
<!-- <span *ngIf="!publicationInfo.similarResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.similarResearchResults" class="uk-badge uk-badge-notification">
{{publicationInfo.similarResearchResults.length | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{publicationInfo.similarResearchResults.length | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!publicationInfo.similarResearchResults" class = "uk-alert uk-alert-primary" >
No similar research results available
</div>
<li *ngIf="publicationInfo.similarResearchResults" (click)="activeTab='Similar Research Results'">
<a class="uk-accordion-title" href="#">
Similar Research Results
<!-- <span *ngIf="!publicationInfo.similarResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.similarResearchResults" class="uk-badge uk-badge-notification">
{{publicationInfo.similarResearchResults.length | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{publicationInfo.similarResearchResults.length | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!publicationInfo.similarResearchResults" class = "uk-alert uk-alert-primary" >
No similar research results available
</div>
<div *ngIf="publicationInfo.similarResearchResults"> -->
<div>
<tabTable [percentageName]="similarity" [info]="publicationInfo.similarResearchResults" [(properties)]=properties></tabTable>
</div>
</div>
</li>
<div *ngIf="publicationInfo.similarResearchResults"> -->
<div>
<tabTable [percentageName]="similarity" [info]="publicationInfo.similarResearchResults"
[(properties)]=properties></tabTable>
</div>
</div>
</li>
<li *ngIf="publicationInfo.organizations" (click)="activeTab='Related Organizations'">
<a class="uk-accordion-title" href="#">
Related Organizations
<!-- <span *ngIf="!publicationInfo.organizations" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.organizations" class="uk-badge uk-badge-notification">
{{publicationInfo.organizations.length | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{publicationInfo.organizations.length | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!publicationInfo.organizations" class = "uk-alert uk-alert-primary">
No related organizations available
</div>
<div *ngIf="publicationInfo.organizations"> -->
<div>
<div *ngIf="publicationInfo.organizations.length > pageSize" class="uk-margin-bottom">
<span class="uk-text-bold">{{publicationInfo.organizations.length | number}} organizations, page {{organizationsPage | number}} of {{totalPages(publicationInfo.organizations.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="organizationsPage" [totalResults]="publicationInfo.organizations.length" [size]="pageSize" (pageChange)="updateOrganizationsPage($event)"></paging-no-load>
</div>
<table class="uk-table uk-table-small uk-table-divider uk-table-middle ">
<tbody>
<tr *ngFor="let organization of publicationInfo.organizations.slice((organizationsPage-1)*pageSize, organizationsPage*pageSize)">
<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>
<li *ngIf="publicationInfo.organizations" (click)="activeTab='Related Organizations'">
<a class="uk-accordion-title" href="#">
Related Organizations
<!-- <span *ngIf="!publicationInfo.organizations" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.organizations" class="uk-badge uk-badge-notification">
{{publicationInfo.organizations.length | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{publicationInfo.organizations.length | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!publicationInfo.organizations" class = "uk-alert uk-alert-primary">
No related organizations available
</div>
<div *ngIf="publicationInfo.organizations"> -->
<div>
<div *ngIf="publicationInfo.organizations.length > pageSize" class="uk-margin-bottom">
<span class="uk-text-bold">{{publicationInfo.organizations.length | number}}
organizations, page {{organizationsPage | number}}
of {{totalPages(publicationInfo.organizations.length) | number}}</span>
<paging-no-load class="uk-float-right" [currentPage]="organizationsPage"
[totalResults]="publicationInfo.organizations.length" [size]="pageSize"
(pageChange)="updateOrganizationsPage($event)"></paging-no-load>
</div>
</li>
<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 class="uk-table uk-table-small uk-table-divider uk-table-middle ">
<tbody>
<tr
*ngFor="let organization of publicationInfo.organizations.slice((organizationsPage-1)*pageSize, organizationsPage*pageSize)">
<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>
<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">
</div>
</div>
</li>
<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">
<a href="{{publicationInfo.bioentities.get(key).get(keyIn)}}"
target="_blank">
target="_blank">
{{keyIn}}
</a>
</span>
</td>
<td class="uk-text-center">
{{key}}
</td>
</tr>
</ng-container>
</tbody>
</table>
</div>
</li>
</td>
<td class="uk-text-center">
{{key}}
</td>
</tr>
</ng-container>
</tbody>
</table>
</div>
</li>
<li *ngIf="publicationInfo.software" (click)="activeTab='Software'">
<a class="uk-accordion-title" href="#">
Software
<!-- <span *ngIf="!publicationInfo.software" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.software" class="uk-badge uk-badge-notification">
{{publicationInfo.software.length | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{publicationInfo.software.length | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<div *ngIf="publicationInfo.software && publicationInfo.software.length > pageSize" class="uk-margin-bottom">
<span class="uk-text-bold">{{publicationInfo.software.length | number}} 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>
<li *ngIf="publicationInfo.software" (click)="activeTab='Software'">
<a class="uk-accordion-title" href="#">
Software
<!-- <span *ngIf="!publicationInfo.software" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="publicationInfo.software" class="uk-badge uk-badge-notification">
{{publicationInfo.software.length | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{publicationInfo.software.length | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<div *ngIf="publicationInfo.software && publicationInfo.software.length > pageSize"
class="uk-margin-bottom">
<span class="uk-text-bold">{{publicationInfo.software.length | number}}
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 ">
<tbody>
<tr *ngFor="let item of publicationInfo.software.slice((softwarePage-1)*pageSize, softwarePage*pageSize)" class="uk-text-center">
<td>
<table id="softwareTable" class="uk-table ">
<tbody>
<tr
*ngFor="let item of publicationInfo.software.slice((softwarePage-1)*pageSize, softwarePage*pageSize)"
class="uk-text-center">
<td>
<span class="custom-external custom-icon">
<a href="{{item.url}}" target="_blank">
{{item.name}}
</a>
</span>
</td>
</tr>
</tbody>
</table>
</div>
</li>
</td>
</tr>
</tbody>
</table>
</div>
</li>
<li (click)="activeTab='Other Citations'" *ngIf="publicationInfo.openCitations && publicationInfo.openCitations.length > 0">
<a class="uk-accordion-title" href="#">
Open Citations
({{publicationInfo.openCitations.length | number}})
</a>
<div class="uk-accordion-content">
<div *ngIf="publicationInfo.openCitations.length > pageSize" class="uk-margin-bottom">
<span class="uk-h6">{{publicationInfo.openCitations.length | number}} 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>
<li (click)="activeTab='Other Citations'"
*ngIf="publicationInfo.openCitations && publicationInfo.openCitations.length > 0">
<a class="uk-accordion-title" href="#">
Open Citations
({{publicationInfo.openCitations.length | number}})
</a>
<div class="uk-accordion-content">
<div *ngIf="publicationInfo.openCitations.length > pageSize" class="uk-margin-bottom">
<span class="uk-h6">{{publicationInfo.openCitations.length | number}}
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">
<li *ngFor="let result of publicationInfo.openCitations.slice((openCitationsPage-1)*pageSize, openCitationsPage*pageSize)">
<!-- <h5>
<span *ngIf="result.url" class="custom-external custom-icon" >
<a target="_blank" [href]="result.url" *ngIf="result['title']" [innerHTML]="result['title']"></a>
<a target="_blank" [href]="result.url" *ngIf="!result['title']">[no title available]</a>
</span>
<p *ngIf="!result.url && result['title']"><span [innerHTML]="result['title']"></span></p>
<p *ngIf="!result.url && !result['title']">[no title available]</p>
</h5> -->
<ul class="uk-list uk-list-divider uk-margin">
<li
*ngFor="let result of publicationInfo.openCitations.slice((openCitationsPage-1)*pageSize, openCitationsPage*pageSize)">
<!-- <h5>
<span *ngIf="result.url" class="custom-external custom-icon" >
<a target="_blank" [href]="result.url" *ngIf="result['title']" [innerHTML]="result['title']"></a>
<a target="_blank" [href]="result.url" *ngIf="!result['title']">[no title available]</a>
</span>
<p *ngIf="!result.url && result['title']"><span [innerHTML]="result['title']"></span></p>
<p *ngIf="!result.url && !result['title']">[no title available]</p>
</h5> -->
<h5 *ngIf="result.title">
<span *ngIf="result.url"
class="custom-external">
<h5 *ngIf="result.title">
<span *ngIf="result.url"
class="custom-external">
<a *ngIf="result.title" href="{{result.url}}" target="_blank"
[innerHTML]="result.title">
[innerHTML]="result.title">
</a>
<a *ngIf="!result.title" href="{{result.url}}" target="_blank">
[no title available]
</a>
</span>
<span *ngIf="result.title && !result.url" [innerHTML]="result.title"></span>
<span *ngIf="!result.title && !result.url">
<span *ngIf="result.title && !result.url" [innerHTML]="result.title"></span>
<span *ngIf="!result.title && !result.url">
[no title available]
</span>
</h5>
</h5>
<div>
<div>
<span *ngIf="result['authors']">
<span *ngFor="let author of result['authors'].slice(0,15)">
{{author}};
</span>
<span *ngIf="result['authors'].length > 15">...</span>
</span>
<span *ngIf="result.year">
<span *ngIf="result.year">
({{result.year}})
</span>
</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>
</li>
</ul>
</div>
</li>
</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>
</li>
</ul>
</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]="articleId" [entityType]="'results'" [entity]="'Publication'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics>
<!--i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="100%" height="250"></i-frame-->
<i-frame *ngIf="metricsClicked && totalViews>0"
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads>0"
[url]=downloadsFrameUrl width="100%" height="250">
</i-frame>
</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]="articleId" [entityType]="'results'" [entity]="'Publication'"
(metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics>
<!--i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="100%" height="250"></i-frame-->
<i-frame *ngIf="metricsClicked && totalViews>0"
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads>0"
[url]=downloadsFrameUrl width="100%" height="250">
</i-frame>
</div>
</li>
<li (click)="activeTab='Other Versions'" *ngIf="properties.environment == 'development' && publicationInfo.deletedByInferenceIds">
<a class="uk-accordion-title" href="#">
Other Versions
({{publicationInfo.deletedByInferenceIds.length | number}})
</a>
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
<deletedByInference [id]="articleId" [ids]="publicationInfo.deletedByInferenceIds" [type]="'publications'"></deletedByInference>
</div>
</li>
<li (click)="activeTab='Other Versions'"
*ngIf="properties.environment == 'development' && publicationInfo.deletedByInferenceIds">
<a class="uk-accordion-title" href="#">
Other Versions
({{publicationInfo.deletedByInferenceIds.length | number}})
</a>
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
<deletedByInference [id]="articleId" [ids]="publicationInfo.deletedByInferenceIds"
[type]="'publications'"></deletedByInference>
</div>
</li>
</ul>
</div>
<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>
<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">
<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>
<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">
<availableOn [availableOn]="publicationInfo.hostedBy_collectedFrom"></availableOn>
<availableOn [availableOn]="publicationInfo.hostedBy_collectedFrom"></availableOn>
</li>
<li *ngIf="publicationInfo.fundedByProjects != undefined && publicationInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="publicationInfo.fundedByProjects"></fundedBy>
<li
*ngIf="publicationInfo.fundedByProjects != undefined && publicationInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="publicationInfo.fundedByProjects"></fundedBy>
</li>
<li *ngIf="publicationInfo.contexts && publicationInfo.contexts.length >0 ">
<dl class="uk-description-list-line" >
<dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of publicationInfo.contexts">
<span *ngIf = "!item['inline']" >
<dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of publicationInfo.contexts">
<span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span>
<mark *ngIf = "item['inline']" >
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
</dl>
<mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
</dl>
</li>
<li>
@ -424,51 +479,81 @@
</li>
<li>
<div class=" sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this publication
</div>
<div class=" ">
<citeThis [result]="publicationInfo" [id]="articleId" type="publication"></citeThis>
</div>
<div class=" sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this publication
</div>
<div class=" ">
<citeThis [result]="publicationInfo" [id]="articleId" type="publication"></citeThis>
</div>
</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>
</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>
<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>

View File

@ -1,28 +1,27 @@
import {Component, ViewChild} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} 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 {PublicationInfo} from '../../utils/entities/publicationInfo';
import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {PublicationService} from './publication.service';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {PublicationService} from './publication.service';
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({
selector: 'publication',
templateUrl: 'publication.component.html',
selector: 'publication',
templateUrl: 'publication.component.html',
})
export class PublicationComponent {
@Input() piwikSiteId = null;
@Input() communityId = null;
public publicationInfo: PublicationInfo;
public articleId: string;
@ -65,307 +64,339 @@ export class PublicationComponent {
public errorMessage = "";
public showLoading: boolean = true;
public routerHelper:RouterHelper = new RouterHelper();
public routerHelper: RouterHelper = new RouterHelper();
private doi: string;
public doiURL: string;
private result;
sub: any; piwiksub: any; infoSub: any;
properties:EnvProperties;
sub: any;
piwiksub: any;
infoSub: any;
properties: EnvProperties;
public pageContents = null;
public divContents = null;
constructor ( private _publicationService: PublicationService,
private _piwikService:PiwikService,
private route: ActivatedRoute,
private router: Router,
private _meta: Meta,
private _title: Title,
private _router: Router,
constructor(private _publicationService: PublicationService,
private _piwikService: PiwikService,
private route: ActivatedRoute,
private router: Router,
private _meta: Meta,
private _title: Title,
private _router: Router,
private helper: HelperService,
private seoService: SEOService) {
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.doiURL = this.properties.doiURL;
this.updateUrl(data.envSpecific.baseLink+this._router.url);
this.properties = data.envSpecific;
//this.getDivContents();
this.getPageContents();
this.doiURL = this.properties.doiURL;
this.updateUrl(data.envSpecific.baseLink + this._router.url);
});
this.sub = this.route.queryParams.subscribe(data => {
this.publicationInfo = null;
this.updateTitle("Publication");
this.updateDescription("");
this.articleId = data['articleId'];
this.sub = this.route.queryParams.subscribe(data => {
this.publicationInfo = null;
this.updateTitle("Publication");
this.updateDescription("");
this.articleId = data['articleId'];
this.metricsClicked = false;
this.metricsClicked = false;
if(this.articleId){
if (this.articleId) {
this.getPublicationInfo(this.articleId);
// if (typeof document !== 'undefined') {
// switcher(UIkit);
// }
}else{
this.showLoading = false;
this.warningMessage="No valid publication id";
}
this.getPublicationInfo(this.articleId);
// if (typeof document !== 'undefined') {
// switcher(UIkit);
// }
} else {
this.showLoading = false;
this.warningMessage = "No valid publication id";
}
this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
this.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() {
if(this.sub){
this.sub.unsubscribe();
}
if(this.piwiksub){
this.piwiksub.unsubscribe();
}
if(this.infoSub) {
this.infoSub.unsubscribe();
}
private getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.divContents = contents;
})
}
ngOnDestroy() {
if (this.sub) {
this.sub.unsubscribe();
}
private getOpenCitations(id: string) {
this._publicationService.getOpenCitations(this.articleId, this.properties).subscribe(
data => {
this.publicationInfo.openCitations = data[1];
},
err => {
//console.log(err);
this.handleError("Error getting open citation for publication with id: "+this.articleId, err);
}
);
if (this.piwiksub) {
this.piwiksub.unsubscribe();
}
private getPublicationInfo(id:string) {
this.warningMessage = '';
this.errorMessage=""
this.showLoading = true;
this.publicationInfo = null;
this.infoSub = this._publicationService.getPublicationInfo(this.articleId, this.properties).subscribe(
data => {
this.publicationInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToPublication + this.publicationInfo.record["result"]["header"]["dri:objIdentifier"]);
if((this.properties.environment == "beta" || this.properties.environment == "development") && (typeof document !== 'undefined')) {
this.getOpenCitations(this.articleId);
}
// this.result = []
// this.result = {id: id, type :"dataset", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.bestaccessright, embargoEndDate: ''};
/*if(this.publicationInfo.title.name != undefined && this.publicationInfo.title.name!= ''){
this.updateTitle(this.publicationInfo.title.name);
this.updateDescription("Dataset, search, repositories, open access,"+this.publicationInfo.title.name);
}*/
if(this.publicationInfo.title){
this.updateTitle(this.publicationInfo.title);
this.updateDescription((this.publicationInfo.description?(this.publicationInfo.description):(","+this.publicationInfo.title)));
}
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, this.publicationInfo.title/*.name*/, this.piwikSiteId).subscribe();
}
let bioentitiesNum = 0;
if(this.publicationInfo.bioentities != undefined) {
this.publicationInfo.bioentities.forEach(function (value, key, map) {
bioentitiesNum += value.size;
});
}
this.bioentitiesNum = bioentitiesNum;
let relatedResearchResultsNum = 0;
if(this.publicationInfo.relatedResearchResults != undefined) {
this.publicationInfo.relatedResearchResults.forEach(function (value, key, map) {
relatedResearchResultsNum += value.length;
});
}
this.relatedResearchResultsNum = relatedResearchResultsNum;
this.result = {id: this.articleId, type :"publication", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: /*this.publicationInfo.title.accessMode*/this.publicationInfo.accessMode, embargoEndDate: ''};
// this.result.push(result_);
if(this.publicationInfo.identifiers != undefined && this.publicationInfo.identifiers.has('doi')) {
this.doi = this.publicationInfo.identifiers.get('doi')[0];
}
this.showLoading = false;
if(this.publicationInfo.references) {
this.activeTab = "References";
} else if(this.publicationInfo.relatedResearchResults) {
this.activeTab = "Related Research Results";
} else if(this.publicationInfo.similarResearchResults) {
this.activeTab = "Similar Research Results";
} else if(this.publicationInfo.organizations) {
this.activeTab = "Related Organizations";
} else if(this.publicationInfo.bioentities) {
this.activeTab = "bioentities";
} else if(this.publicationInfo.software) {
this.activeTab = "Software";
} else {
this.activeTab = "Metrics";
this.metricsClicked = true;
}
},
err => {
//console.log(err);
this.handleError("Error getting publication for id: "+this.articleId, err);
this.errorMessage = 'No publication found';
this.showLoading = false;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToPublications);
}
);
if (this.infoSub) {
this.infoSub.unsubscribe();
}
}
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
}
public buildCurationTooltip() {
let tooltipContent: string = "<div class='uk-margin uk-padding-small'>";
tooltipContent += "<h4>Record in preview</h4>";
tooltipContent += "<p>Bibliographic record accepted by the system, but not yet processed by <br> OpenAIRE tools for information quality improvement and de-duplication</p>";
return tooltipContent+= "</div>";
}
private updateDescription(description:string){
this._meta.updateTag({content:description},"name='description'");
this._meta.updateTag({content:description},"property='og:description'");
}
private updateTitle(title:string){
var _prefix ="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);
private getOpenCitations(id: string) {
this._publicationService.getOpenCitations(this.articleId, this.properties).subscribe(
data => {
this.publicationInfo.openCitations = data[1];
},
err => {
//console.log(err);
this.handleError("Error getting open citation for publication with id: " + this.articleId, err);
}
return totalPages;
}
);
}
public updateReferencesPage($event) {
this.referencesPage = $event.value;
}
private getPublicationInfo(id: string) {
this.warningMessage = '';
this.errorMessage = ""
this.showLoading = true;
public updateOrganizationsPage($event) {
this.organizationsPage = $event.value;
}
this.publicationInfo = null;
public updateSoftwarePage($event) {
this.softwarePage = $event.value;
}
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);
}
public updateBioentitiesPage($event) {
this.bioentitiesPage = $event.value;
}
// 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();
}
public updateOpenCitationsPage($event) {
this.openCitationsPage = $event.value;
}
let bioentitiesNum = 0;
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 keys: string[] = [];
bioentities.forEach(function (value, key, map) {
keys.push(key);
});
return keys;
}
public getKeys( map) {
return Array.from(map.keys());
}
let relatedResearchResultsNum = 0;
if (this.publicationInfo.relatedResearchResults != undefined) {
this.publicationInfo.relatedResearchResults.forEach(function (value, key, map) {
relatedResearchResultsNum += value.length;
});
}
this.relatedResearchResultsNum = relatedResearchResultsNum;
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;
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(bioentitiesPage == 1) {
return 0;
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);
}
);
}
this.publicationInfo.bioentities.forEach(function (value, key, map) {
sum += map.get(key).size;
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
}
if(index == i) {
if(sum <= valuesToPreviousPage) {
retValue = 0;
} else if((sum-map.get(key).size) >= valuesToPage){
retValue = 0;
} else {
if(map.get(key).size < (sum - valuesToPreviousPage)) {
public buildCurationTooltip() {
let tooltipContent: string = "<div class='uk-margin uk-padding-small'>";
tooltipContent += "<h4>Record in preview</h4>";
tooltipContent += "<p>Bibliographic record accepted by the system, but not yet processed by <br> OpenAIRE tools for information quality improvement and de-duplication</p>";
return tooltipContent += "</div>";
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _prefix = "OpenAIRE | ";
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(title);
this._meta.updateTag({content: title}, "property='og:title'");
}
private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
public totalPages(totalResults: number): number {
let totalPages: any = totalResults / this.pageSize;
if (!(Number.isInteger(totalPages))) {
totalPages = (parseInt(totalPages, this.pageSize) + 1);
}
return totalPages;
}
public updateReferencesPage($event) {
this.referencesPage = $event.value;
}
public updateOrganizationsPage($event) {
this.organizationsPage = $event.value;
}
public updateSoftwarePage($event) {
this.softwarePage = $event.value;
}
public updateBioentitiesPage($event) {
this.bioentitiesPage = $event.value;
}
public updateOpenCitationsPage($event) {
this.openCitationsPage = $event.value;
}
public keysToArray(bioentities: Map<string, string>): string[] {
let keys: string[] = [];
bioentities.forEach(function (value, key, map) {
keys.push(key);
});
return keys;
}
public getKeys(map) {
return Array.from(map.keys());
}
public scroll() {
HelperFunctions.scroll();
}
/*
start(i: number, bioentitiesPage: number) {
let sum = 0;
let index=0;
let retValue = 0;
let valuesToPage = this.pageSize*bioentitiesPage;
let valuesToPreviousPage = valuesToPage - this.pageSize;
if(bioentitiesPage == 1) {
return 0;
}
this.publicationInfo.bioentities.forEach(function (value, key, map) {
sum += map.get(key).size;
if(index == i) {
if(sum <= valuesToPreviousPage) {
retValue = 0;
} else if((sum-map.get(key).size) >= valuesToPage){
retValue = 0;
} else {
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++;
});
this.startt = retValue;
return retValue;
}
index++;
});
this.startt = retValue;
return retValue;
}
stop(i: number, bioentitiesPage: number) {
let sum = 0;
let index=0;
let retValue = 0;
let valuesToPage = this.pageSize*bioentitiesPage;
let valuesToPreviousPage = valuesToPage - this.pageSize;
stop(i: number, bioentitiesPage: number) {
let sum = 0;
let index=0;
let retValue = 0;
let valuesToPage = this.pageSize*bioentitiesPage;
let valuesToPreviousPage = valuesToPage - this.pageSize;
this.publicationInfo.bioentities.forEach(function (value, key, map) {
sum += map.get(key).size;
if(index == i) {
if(sum <= valuesToPreviousPage) {
retValue = 0;
} else if((sum - map.get(key).size) >= valuesToPage){
retValue = 0;
} else {
if(sum < valuesToPage) {
retValue = map.get(key).size;
this.publicationInfo.bioentities.forEach(function (value, key, map) {
sum += map.get(key).size;
if(index == i) {
if(sum <= valuesToPreviousPage) {
retValue = 0;
} else if((sum - map.get(key).size) >= valuesToPage){
retValue = 0;
} else {
retValue = map.get(key).size - (sum - valuesToPage);
if(sum < valuesToPage) {
retValue = map.get(key).size;
} else {
retValue = map.get(key).size - (sum - valuesToPage);
}
}
}
}
index++;
});
this.stopp = retValue;
return retValue;
}
*/
index++;
});
this.stopp = retValue;
return retValue;
}
*/
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++) {
let routePath:string = this.router.config[i].path;
if(routePath == routeToCheck){
let routePath: string = this.router.config[i].path;
if (routePath == routeToCheck) {
return true;
}
}

View File

@ -24,13 +24,14 @@ import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {DeletedByInferenceModule} from '../landing-utils/deletedByInference/deletedByInference.module';
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
import {HelperModule} from "../../utils/helper/helper.module";
@NgModule({
imports: [
CommonModule, FormsModule, LandingModule, SharedModule, RouterModule,
CiteThisModule, PagingModule, ResultLandingModule, IFrameModule,
MetricsModule, AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule,
DeletedByInferenceModule, ShowAuthorsModule
DeletedByInferenceModule, ShowAuthorsModule, HelperModule
],
declarations: [
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 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="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="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
<div *ngIf="softwareInfo != null" uk-grid class="uk-grid-large">
<div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="softwareInfo.record" [data]=softwareInfo.record [URL]="properties.baseLink+'/search/software?softwareId='+softwareId"></schema2jsonld>
<showTitle [titleName]="softwareInfo.title"></showTitle>
<span *ngIf="softwareInfo.types && softwareInfo.types.length > 0"class="uk-label custom-label label-software " title="Type">{{softwareInfo.types.join(", ")}}</span>{{" "}}
<span *ngIf="softwareInfo.programmingLanguages && softwareInfo.programmingLanguages.length > 0" class="uk-label custom-label label-progrLanguage " title="Programming Language">{{softwareInfo.programmingLanguages.join(", ")}}</span>{{" "}}
<span *ngIf="softwareInfo.languages && softwareInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{softwareInfo.languages.join(", ")}}</span>{{" "}}
<span *ngIf="softwareInfo.countries && softwareInfo.countries.length > 0" class="uk-label custom-label label-country " title="Country">{{softwareInfo.countries.join(", ")}}</span>{{" "}}
<div *ngIf="softwareInfo != 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">
<schema2jsonld *ngIf="softwareInfo.record" [data]=softwareInfo.record
[URL]="properties.baseLink+'/search/software?softwareId='+softwareId"></schema2jsonld>
<showTitle [titleName]="softwareInfo.title"></showTitle>
<span *ngIf="softwareInfo.types && softwareInfo.types.length > 0"
class="uk-label custom-label label-software "
title="Type">{{softwareInfo.types.join(", ")}}</span>{{" "}}
<span *ngIf="softwareInfo.programmingLanguages && softwareInfo.programmingLanguages.length > 0"
class="uk-label custom-label label-progrLanguage "
title="Programming Language">{{softwareInfo.programmingLanguages.join(", ")}}</span>{{" "}}
<span *ngIf="softwareInfo.languages && softwareInfo.languages.length > 0"
class="uk-label custom-label label-language "
title="Language">{{softwareInfo.languages.join(", ")}}</span>{{" "}}
<span *ngIf="softwareInfo.countries && softwareInfo.countries.length > 0"
class="uk-label custom-label label-country "
title="Country">{{softwareInfo.countries.join(", ")}}</span>{{" "}}
<!-- <span *ngIf="softwareInfo.title && softwareInfo.title.accessMode" [class]="'uk-label custom-label label-'+ softwareInfo.title.accessMode " title="Access Mode">{{softwareInfo.title.accessMode}}</span> -->
<span *ngIf="softwareInfo.accessMode" [class]="'uk-label custom-label label-'+ softwareInfo.accessMode " title="Access Mode">{{softwareInfo.accessMode}}</span>{{" "}}
<span *ngIf="softwareInfo.underCurationMessage" class="uk-label custom-label label-underCuration " >
<span *ngIf="softwareInfo.accessMode" [class]="'uk-label custom-label label-'+ softwareInfo.accessMode "
title="Access Mode">{{softwareInfo.accessMode}}</span>{{" "}}
<span *ngIf="softwareInfo.underCurationMessage" class="uk-label custom-label label-underCuration ">
<span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}">
title="{{buildCurationTooltip()}}">
<i>Record in preview</i>
<i class="uk-icon-info-circle"></i>
</span></span>{{" "}}
@ -32,37 +48,43 @@
</span>
</div-->
<div class= " uk-margin-top">
<showAuthors [authors]="softwareInfo.authors"></showAuthors>
<span *ngIf="softwareInfo.date != ''">({{softwareInfo.date}})</span>
<div class=" uk-margin-top">
<showAuthors [authors]="softwareInfo.authors"></showAuthors>
<span *ngIf="softwareInfo.date != ''">({{softwareInfo.date}})</span>
</div>
<ul class="uk-list">
<showPublisher [publisher]="softwareInfo.publisher" [properties]="properties"
[journal]="softwareInfo.journal"></showPublisher>
<li *ngIf="softwareInfo.embargoEndDate"><span class="uk-text-bold">Embargo end date:</span> {{softwareInfo.embargoEndDate}}</li>
<li *ngIf="softwareInfo.identifiers && softwareInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="softwareInfo.identifiers"></showIdentifiers>
</li>
<li *ngIf="softwareInfo.subjects ||softwareInfo.otherSubjects || softwareInfo.classifiedSubjects">
<showSubjects [subjects]="softwareInfo.subjects"
[otherSubjects]="softwareInfo.otherSubjects"
[classifiedSubjects]="softwareInfo.classifiedSubjects">
<li *ngIf="softwareInfo.embargoEndDate"><span
class="uk-text-bold">Embargo end date:</span> {{softwareInfo.embargoEndDate}}</li>
<li *ngIf="softwareInfo.identifiers && softwareInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="softwareInfo.identifiers"></showIdentifiers>
</li>
<li *ngIf="softwareInfo.subjects ||softwareInfo.otherSubjects || softwareInfo.classifiedSubjects">
<showSubjects [subjects]="softwareInfo.subjects"
[otherSubjects]="softwareInfo.otherSubjects"
[classifiedSubjects]="softwareInfo.classifiedSubjects">
</showSubjects>
</li>
</li>
</ul>
<hr *ngIf="softwareInfo.description" >
<div *ngIf="softwareInfo.description" class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<hr *ngIf="softwareInfo.description">
<div *ngIf="softwareInfo.description"
class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<span>{{softwareInfo.description.substring(0, showNumDescription)}}</span
><span *ngIf="showNumDescription == thresholdDescription && softwareInfo.description.length > thresholdDescription">...</span
><span *ngIf="showNumDescription == thresholdDescription && softwareInfo.description.length > thresholdDescription" class="uk-text-right">
><span
*ngIf="showNumDescription == thresholdDescription && softwareInfo.description.length > thresholdDescription">...</span
><span
*ngIf="showNumDescription == thresholdDescription && softwareInfo.description.length > thresholdDescription"
class="uk-text-right">
<a (click)="showNumDescription = softwareInfo.description.length;">
View more
</a>
</span>
</div>
<div *ngIf="softwareInfo.description && showNumDescription > thresholdDescription" class="uk-width-1-1 uk-text-right">
<div *ngIf="softwareInfo.description && showNumDescription > thresholdDescription"
class="uk-width-1-1 uk-text-right">
<a (click)="showNumDescription = thresholdDescription;">
View less
</a>
@ -95,121 +117,126 @@
<ul class="custom-accordion " uk-accordion>
<li *ngIf="softwareInfo.relatedResearchResults" (click)="activeTab='Related Research Results'">
<a class="uk-accordion-title" href="#">
Related Research Results
<!-- <span *ngIf="!softwareInfo.relatedResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="softwareInfo.relatedResearchResults" class="uk-badge uk-badge-notification">
{{relatedResearchResultsNum | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{relatedResearchResultsNum | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!softwareInfo.relatedResearchResults" class = "uk-alert uk-alert-primary">
No related research results available
</div>
<div *ngIf="softwareInfo.relatedResearchResults"> -->
<div>
<div *ngFor="let provenanceaction of getKeys(softwareInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div>
<li *ngIf="softwareInfo.relatedResearchResults" (click)="activeTab='Related Research Results'">
<a class="uk-accordion-title" href="#">
Related Research Results
<!-- <span *ngIf="!softwareInfo.relatedResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="softwareInfo.relatedResearchResults" class="uk-badge uk-badge-notification">
{{relatedResearchResultsNum | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{relatedResearchResultsNum | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!softwareInfo.relatedResearchResults" class = "uk-alert uk-alert-primary">
No related research results available
</div>
<div *ngIf="softwareInfo.relatedResearchResults"> -->
<div>
<div *ngFor="let provenanceaction of getKeys(softwareInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [percentageName]="trust" [info]="softwareInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable>
</div>
</div>
</div>
</li>
<li *ngIf="softwareInfo.similarResearchResults" (click)="activeTab='Similar Research Results'">
<a class="uk-accordion-title" href="#">
Similar Research Results
<!-- <span *ngIf="!softwareInfo.similarResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="softwareInfo.similarResearchResults" class="uk-badge uk-badge-notification">
{{softwareInfo.similarResearchResults.length | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{softwareInfo.similarResearchResults.length | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!softwareInfo.similarResearchResults" class = "uk-alert uk-alert-primary" >
No similar research results available
</div>
<div *ngIf="softwareInfo.similarResearchResults"> -->
<div>
<tabTable [percentageName]="similarity" [info]="softwareInfo.similarResearchResults" [(properties)]=properties></tabTable>
</div>
<tabTable [percentageName]="trust"
[info]="softwareInfo.relatedResearchResults.get(provenanceaction)"
[(properties)]=properties></tabTable>
</div>
</li>
</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"
<li *ngIf="softwareInfo.similarResearchResults" (click)="activeTab='Similar Research Results'">
<a class="uk-accordion-title" href="#">
Similar Research Results
<!-- <span *ngIf="!softwareInfo.similarResearchResults" class="uk-badge uk-badge-notification">0</span>
<span *ngIf="softwareInfo.similarResearchResults" class="uk-badge uk-badge-notification">
{{softwareInfo.similarResearchResults.length | number}}
</span> -->
<!-- <span class="uk-badge uk-badge-notification"> -->
({{softwareInfo.similarResearchResults.length | number}})
<!-- </span> -->
</a>
<div class="uk-accordion-content">
<!-- <div *ngIf="!softwareInfo.similarResearchResults" class = "uk-alert uk-alert-primary" >
No similar research results available
</div>
<div *ngIf="softwareInfo.similarResearchResults"> -->
<div>
<tabTable [percentageName]="similarity" [info]="softwareInfo.similarResearchResults"
[(properties)]=properties></tabTable>
</div>
</div>
</li>
<li (click)="metricsClicked=true; activeTab='Metrics'">
<a class="uk-accordion-title" href="#">
Metrics
</a>
<div class="uk-accordion-content">
<metrics [pageViews]="pageViews"
[id]="softwareId" [entityType]="'results'" [entity]="'Software'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0"
(metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads > 0"
</i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250">
</i-frame>
</div>
</li>
</i-frame>
</div>
</li>
<li (click)="activeTab='Other Versions'" *ngIf="properties.environment == 'development' && softwareInfo.deletedByInferenceIds">
<a class="uk-accordion-title" href="#">
Other Versions
({{softwareInfo.deletedByInferenceIds.length | number}})
</a>
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
<deletedByInference [id]="softwareId" [ids]="softwareInfo.deletedByInferenceIds" [type]="'software'"></deletedByInference>
</div>
</li>
<li (click)="activeTab='Other Versions'"
*ngIf="properties.environment == 'development' && softwareInfo.deletedByInferenceIds">
<a class="uk-accordion-title" href="#">
Other Versions
({{softwareInfo.deletedByInferenceIds.length | number}})
</a>
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
<deletedByInference [id]="softwareId" [ids]="softwareInfo.deletedByInferenceIds"
[type]="'software'"></deletedByInference>
</div>
</li>
</ul>
</div>
<div class="uk-width-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>
<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">
<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>
<altmetrics *ngIf="softwareInfo.identifiers && softwareInfo.identifiers.get('doi')"
id="{{softwareInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics>
<ul class="uk-list uk-margin-remove-bottom">
<li *ngIf="softwareInfo.hostedBy_collectedFrom && softwareInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="softwareInfo.hostedBy_collectedFrom"></availableOn>
<availableOn [availableOn]="softwareInfo.hostedBy_collectedFrom"></availableOn>
</li>
<li *ngIf="softwareInfo.fundedByProjects != undefined && softwareInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="softwareInfo.fundedByProjects"></fundedBy>
</li>
<li *ngIf="softwareInfo.contexts && softwareInfo.contexts.length >0 ">
<dl class="uk-description-list-line" >
<dt class="sideInfoTitle">Related to </dt>
<dd class="line" *ngFor="let item of softwareInfo.contexts">
<span *ngIf = "!item['inline']" >
<li *ngIf="softwareInfo.contexts && softwareInfo.contexts.length >0 ">
<dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of softwareInfo.contexts">
<span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span>
<mark *ngIf = "item['inline']" >
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
<mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
</dl>
</dl>
</li>
@ -222,12 +249,12 @@
<li>
<div class=" sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this software
</div>
<div class="">
<citeThis [result]="softwareInfo" [id]="softwareId" type="software"></citeThis>
</div>
<div class=" sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this software
</div>
<div class="">
<citeThis [result]="softwareInfo" [id]="softwareId" type="software"></citeThis>
</div>
</li>
<!--li>
<ul uk-accordion class="uk-padding-remove">
@ -251,80 +278,109 @@
</ul>
</li-->
</ul>
<button *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-button portal-button uk-width-1-1 ">
</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 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">
<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>
<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">
<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" >
<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: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" >
<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: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" >
<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>
<!-- 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>

View File

@ -1,212 +1,243 @@
import {Component, ViewChild} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} 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 {SoftwareInfo} from '../../utils/entities/softwareInfo';
import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {EnvProperties} from '../../utils/properties/env-properties';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {EnvProperties} from '../../utils/properties/env-properties';
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({
selector: 'software',
templateUrl: 'software.component.html',
selector: 'software',
templateUrl: 'software.component.html',
})
export class SoftwareComponent {
@Input() piwikSiteId = null;
public softwareInfo: SoftwareInfo;
public softwareId : string ;
@Input() communityId = null;
public softwareInfo: SoftwareInfo;
public softwareId: string;
// APP BOX variables
public showAllCollectedFrom: boolean = false;
public showAllDownloadFrom: boolean = false;
public showAllPublishedIn: boolean = false;
// APP BOX variables
public showAllCollectedFrom: boolean = false;
public showAllDownloadFrom: boolean = false;
public showAllPublishedIn: boolean = false;
public thresholdDescription: number = 270;
public showNumDescription: number = 270;
public thresholdDescription: number = 270;
public showNumDescription: number = 270;
// Metrics tab variables
public metricsClicked: boolean;
public viewsFrameUrl: string;
public downloadsFrameUrl: string;
public totalViews: number;
public totalDownloads: number;
public pageViews: number;
// Metrics tab variables
public metricsClicked: boolean;
public viewsFrameUrl: string;
public downloadsFrameUrl: string;
public totalViews: number;
public totalDownloads: number;
public pageViews: number;
// Active tab variable for responsiveness
public activeTab: string = "Related Research Results";
// Active tab variable for responsiveness
public activeTab: string = "Related Research Results";
// Map counting variable
public relatedResearchResultsNum: number = 0;
// Map counting variable
public relatedResearchResultsNum: number = 0;
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
public routerHelper:RouterHelper = new RouterHelper();
public routerHelper: RouterHelper = new RouterHelper();
private result ;
sub: any; piwiksub: any; infoSub: any;
properties:EnvProperties;
private result;
sub: any;
piwiksub: any;
infoSub: any;
properties: EnvProperties;
public pageContents = null;
public divContents = null;
constructor (private _softwareService: SoftwareService,
private _piwikService:PiwikService,
private route: ActivatedRoute,
private router: Router,
private _meta: Meta,
private _title: Title,
private _router: Router,
private seoService: SEOService) {
}
constructor(private _softwareService: SoftwareService,
private _piwikService: PiwikService,
private route: ActivatedRoute,
private router: Router,
private _meta: Meta,
private _title: Title,
private _router: Router,
private helper: HelperService,
private seoService: SEOService) {
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url);
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
//this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
});
this.sub = this.route.queryParams.subscribe(params => {
this.softwareInfo = null;
this.updateTitle("Software");
this.updateDescription("Software, search, open access");
});
this.sub = this.route.queryParams.subscribe(params => {
this.softwareInfo = null;
this.updateTitle("Software");
this.updateDescription("Software, search, open access");
this.softwareId = params['softwareId'];
this.softwareId = params['softwareId'];
if(this.softwareId){
this.getSoftwareInfo(this.softwareId);
}else{
this.showLoading = false;
this.warningMessage="No valid software id";
}
this.metricsClicked = false;
this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"'+this.softwareId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
/*this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resViewsTimeline", "resTitle":"'+this.softwareId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
*/
this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"'+this.softwareId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
/*this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.softwareId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
*/
this.scroll();
});
}
ngOnDestroy() {
if(this.sub){
this.sub.unsubscribe();
if (this.softwareId) {
this.getSoftwareInfo(this.softwareId);
} else {
this.showLoading = false;
this.warningMessage = "No valid software id";
}
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) {
this.warningMessage = '';
this.errorMessage=""
this.showLoading = true;
// showChange($event) {
// this.showAllReferences=$event.value;
// }
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(
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();
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
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: ''};
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'");
}
let relatedResearchResultsNum = 0;
if(this.softwareInfo.relatedResearchResults != undefined) {
this.softwareInfo.relatedResearchResults.forEach(function (value, key, map) {
relatedResearchResultsNum += value.length;
});
}
this.relatedResearchResultsNum = relatedResearchResultsNum;
private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
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;
}
);
}
public buildCurationTooltip() {
let tooltipContent: string = "<div class='uk-padding-small uk-light'>";
// showChange($event) {
// this.showAllReferences=$event.value;
// }
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>";
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
}
return tooltipContent;
}
private updateDescription(description:string) {
this._meta.updateTag({content:description},"name='description'");
this._meta.updateTag({content:description},"property='og:description'");
}
private updateTitle(title:string) {
var _prefix ="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 getKeys(map) {
return Array.from(map.keys());
}
public buildCurationTooltip() {
let tooltipContent: string = "<div class='uk-padding-small uk-light'>";
public scroll() {
HelperFunctions.scroll();
}
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>";
private handleError(message: string, error) {
console.error("Software Landing Page: " + message, error);
}
return tooltipContent;
}
public getKeys( map) {
return Array.from(map.keys());
}
public scroll() {
HelperFunctions.scroll();
}
private handleError(message: string, error) {
console.error("Software Landing Page: "+message, error);
}
isRouteAvailable(routeToCheck:string){
isRouteAvailable(routeToCheck: string) {
for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path;
if(routePath == routeToCheck){
let routePath: string = this.router.config[i].path;
if (routePath == routeToCheck) {
return true;
}
}

View File

@ -1,32 +1,33 @@
//import {MaterialModule} from '@angular/material';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import { RouterModule } from '@angular/router';
import {RouterModule} from '@angular/router';
import { SoftwareService } from './software.service';
import { SoftwareComponent } from './software.component';
import {SoftwareService} from './software.service';
import {SoftwareComponent} from './software.component';
// import { SoftwareRoutingModule } from './software-routing.module';
import { MetricsModule } from '../landing-utils/metrics.module';
import { IFrameModule } from '../../utils/iframe.module';
import { AltMetricsModule } from '../../utils/altmetrics.module';
import { CiteThisModule } from '../landing-utils/citeThis/citeThis.module';
import { PagingModule } from '../../utils/paging.module';
import {MetricsModule} from '../landing-utils/metrics.module';
import {IFrameModule} from '../../utils/iframe.module';
import {AltMetricsModule} from '../../utils/altmetrics.module';
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
import {PagingModule} from '../../utils/paging.module';
import { ResultLandingModule } from '../landing-utils/resultLanding.module';
import { LandingModule } from '../landing-utils/landing.module';
import { FreeGuard } from'../../login/freeGuard.guard';
import {ResultLandingModule} from '../landing-utils/resultLanding.module';
import {LandingModule} from '../landing-utils/landing.module';
import {FreeGuard} from '../../login/freeGuard.guard';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module';
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
import {DeletedByInferenceModule} from "../landing-utils/deletedByInference/deletedByInference.module";
import {HelperModule} from "../../utils/helper/helper.module";
@NgModule({
imports: [
CommonModule, FormsModule, LandingModule, RouterModule, CiteThisModule, PagingModule,
ResultLandingModule, IFrameModule, MetricsModule, AltMetricsModule, Schema2jsonldModule, SEOServiceModule,
ShowAuthorsModule, DeletedByInferenceModule
ShowAuthorsModule, DeletedByInferenceModule, HelperModule
],
declarations: [
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="">
<div [class]="'uk-container' + (usedBy == 'deposit' ? ' uk-container-large' : '')">
<helper position="top"></helper>
<div [class]="(showRefine)? 'uk-width-3-5@m uk-width-3-5@l uk-width-1-1@s' :'uk-width-1-1'">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0" [texts]="pageContents['top']"></helper>
<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">
<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>
<!-- 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 *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; -->
<!-- <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">
<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>
<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> -->
<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]="(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>
@ -228,32 +221,12 @@
[href]="properties.lastIndexInformationLink" target="_blank">
Last index information
</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 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>
<!-- <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'">
<search-paging [loadPaging]="loadPaging" [type]="type" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-paging>
</div> -->
<div class="uk-width-1-1">
<helper position="bottom"></helper>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0" [texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div>
</div>
</div>

View File

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

View File

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