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

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

View File

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

View File

@ -1,14 +1,19 @@
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" > <div id="tm-main" class=" uk-section uk-margin-small-top tm-middle">
<div uk-grid uk-grid> <div uk-grid uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first "> <div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container uk-margin-top datasource"> <div class="uk-container uk-margin-top datasource">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div> role="alert">{{warningMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div> <div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
<div *ngIf="dataProviderInfo != null" uk-grid class="uk-grid-large"> <div *ngIf="dataProviderInfo != null" uk-grid class="uk-grid-large">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div class="uk-width-expand@m uk-width-1-1@s"> <div class="uk-width-expand@m uk-width-1-1@s">
<!--h3 *ngIf="dataProviderInfo.title != null"> <!--h3 *ngIf="dataProviderInfo.title != null">
<a *ngIf="dataProviderInfo.title['url'] != undefined && dataProviderInfo.title['url'] != null" <a *ngIf="dataProviderInfo.title['url'] != undefined && dataProviderInfo.title['url'] != null"
@ -19,24 +24,30 @@
{{dataProviderInfo.title['name']}} {{dataProviderInfo.title['name']}}
</p> </p>
</h3--> </h3-->
<schema2jsonld *ngIf="dataProviderInfo" [data]=dataProviderInfo [URL]="properties.baseLink+'/search/dataprovider?datasourceId='+datasourceId" <schema2jsonld *ngIf="dataProviderInfo" [data]=dataProviderInfo
type="datasource" [otherURL]="(dataProviderInfo.openDoarId)?(properties.openDoarURL+dataProviderInfo.openDoarId):((dataProviderInfo.r3DataId)?properties.r3DataURL+dataProviderInfo.r3DataId:nul)"></schema2jsonld> [URL]="properties.baseLink+'/search/dataprovider?datasourceId='+datasourceId"
type="datasource"
[otherURL]="(dataProviderInfo.openDoarId)?(properties.openDoarURL+dataProviderInfo.openDoarId):((dataProviderInfo.r3DataId)?properties.r3DataURL+dataProviderInfo.r3DataId:nul)"></schema2jsonld>
<showTitle [title]="dataProviderInfo.title"></showTitle> <showTitle [title]="dataProviderInfo.title"></showTitle>
<div class="uk-text-large " *ngIf="dataProviderInfo.officialName && this.dataProviderInfo.title.name != dataProviderInfo.officialName ">{{dataProviderInfo.officialName}}</div> <div class="uk-text-large "
*ngIf="dataProviderInfo.officialName && this.dataProviderInfo.title.name != dataProviderInfo.officialName ">{{dataProviderInfo.officialName}}</div>
<span *ngIf="dataProviderInfo.type" class="uk-label custom-label label-type label-dataprovider " <span *ngIf="dataProviderInfo.type" class="uk-label custom-label label-type label-dataprovider "
title="Type">{{dataProviderInfo.type}}</span>{{" "}} title="Type">{{dataProviderInfo.type}}</span>{{" "}}
<span *ngIf="dataProviderInfo.compatibility" class="uk-label custom-label label-compatibility " title="Compatibility"> <span *ngIf="dataProviderInfo.compatibility" class="uk-label custom-label label-compatibility "
title="Compatibility">
<a *ngIf="!dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id" <a *ngIf="!dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id"
[queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider"> [queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active"
routerLink="/search/dataprovider">
{{dataProviderInfo.compatibility.info}} {{dataProviderInfo.compatibility.info}}
</a> </a>
<span *ngIf="dataProviderInfo.compatibility.name || !dataProviderInfo.compatibility.id"> <span *ngIf="dataProviderInfo.compatibility.name || !dataProviderInfo.compatibility.id">
{{dataProviderInfo.compatibility.info}} {{dataProviderInfo.compatibility.info}}
</span> </span>
<a *ngIf="dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id" <a *ngIf="dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id"
[queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider"> [queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active"
routerLink="/search/dataprovider">
{{dataProviderInfo.compatibility.name}} {{dataProviderInfo.compatibility.name}}
</a> </a>
<span *ngIf="dataProviderInfo.compatibility.name && !dataProviderInfo.compatibility.id"> <span *ngIf="dataProviderInfo.compatibility.name && !dataProviderInfo.compatibility.id">
@ -47,10 +58,14 @@
<ul class="uk-list"> <ul class="uk-list">
<showPublisher [properties]="properties" <showPublisher [properties]="properties"
[journal]="dataProviderInfo.journal"></showPublisher> [journal]="dataProviderInfo.journal"></showPublisher>
<li *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fundedContent && dataProviderInfo.aggregationStatus.fundedContent != -1"><span class="uk-text-bold">Results with funding information: </span> <li
*ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fundedContent && dataProviderInfo.aggregationStatus.fundedContent != -1">
<span class="uk-text-bold">Results with funding information: </span>
{{dataProviderInfo.aggregationStatus.fundedContent | number}} {{dataProviderInfo.aggregationStatus.fundedContent | number}}
</li> </li>
<li *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fulltexts && dataProviderInfo.aggregationStatus.fulltexts != -1"><span class="uk-text-bold">Collected full-texts: </span> <li
*ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fulltexts && dataProviderInfo.aggregationStatus.fulltexts != -1">
<span class="uk-text-bold">Collected full-texts: </span>
{{dataProviderInfo.aggregationStatus.fulltexts | number}} {{dataProviderInfo.aggregationStatus.fulltexts | number}}
</li> </li>
<li *ngIf="dataProviderInfo.oaiPmhURL"><span class="uk-text-bold">OAI-PMH: </span> <li *ngIf="dataProviderInfo.oaiPmhURL"><span class="uk-text-bold">OAI-PMH: </span>
@ -78,13 +93,15 @@
</li> </li>
<li *ngIf="dataProviderInfo.countries != undefined && dataProviderInfo.countries.length > 0"><span class="uk-text-bold">Countries: </span>{{dataProviderInfo.countries.join(", ")}}</li> <li *ngIf="dataProviderInfo.countries != undefined && dataProviderInfo.countries.length > 0"><span
class="uk-text-bold">Countries: </span>{{dataProviderInfo.countries.join(", ")}}</li>
</ul> </ul>
<div *ngIf="showTabs"> <div *ngIf="showTabs">
<ul class="custom-accordion" uk-accordion *ngIf="dataProviderInfo.tabs2 != undefined"> <ul class="custom-accordion" uk-accordion *ngIf="dataProviderInfo.tabs2 != undefined">
<li *ngIf="dataProviderInfo.tabs2.indexOf('Publications') != -1" (click)="search('publicationsTab', 1, 10); activeTab='Publications'"> <li *ngIf="dataProviderInfo.tabs2.indexOf('Publications') != -1"
(click)="search('publicationsTab', 1, 10); activeTab='Publications'">
<a class="uk-accordion-title" href="#">Publications <a class="uk-accordion-title" href="#">Publications
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchPublications.searchUtils.totalResults | number}}) ({{fetchPublications.searchUtils.totalResults | number}})
@ -93,11 +110,12 @@
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<publicationsTab *ngIf="activeTab=='Publications'" <publicationsTab *ngIf="activeTab=='Publications'"
[paramsForSearchLink]="paramsForSearchLink" [paramsForSearchLink]="paramsForSearchLink"
[fetchPublications] = "fetchPublications" [(properties)]=properties> [fetchPublications]="fetchPublications" [(properties)]=properties>
</publicationsTab> </publicationsTab>
</div> </div>
</li> </li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Research Data') != -1" (click)="search('datasetsTab', 1, 10); activeTab='Research Data'"> <li *ngIf="dataProviderInfo.tabs2.indexOf('Research Data') != -1"
(click)="search('datasetsTab', 1, 10); activeTab='Research Data'">
<a class="uk-accordion-title" href="#">Research Data <a class="uk-accordion-title" href="#">Research Data
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchDatasets.searchUtils.totalResults | number}}) ({{fetchDatasets.searchUtils.totalResults | number}})
@ -113,7 +131,8 @@
</div> </div>
</li> </li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Software') != -1" (click)="search('softwareTab', 1, 10); activeTab='Software'"> <li *ngIf="dataProviderInfo.tabs2.indexOf('Software') != -1"
(click)="search('softwareTab', 1, 10); activeTab='Software'">
<a class="uk-accordion-title" href="#">Software <a class="uk-accordion-title" href="#">Software
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchSoftware.searchUtils.totalResults | number}}) ({{fetchSoftware.searchUtils.totalResults | number}})
@ -127,7 +146,8 @@
</div> </div>
</li> </li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Other Research Products') != -1" (click)="search('orpsTab', 1, 10); activeTab='Other Research Products'"> <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 <a class="uk-accordion-title" href="#">Other Research Products
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchOrps.searchUtils.totalResults | number}}) ({{fetchOrps.searchUtils.totalResults | number}})
@ -141,7 +161,8 @@
</div> </div>
</li> </li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Projects') != -1" (click)="search('projectsTab', 1, 10); activeTab='Projects'"> <li *ngIf="dataProviderInfo.tabs2.indexOf('Projects') != -1"
(click)="search('projectsTab', 1, 10); activeTab='Projects'">
<a class="uk-accordion-title" href="#">Projects <a class="uk-accordion-title" href="#">Projects
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchProjects.searchUtils.totalResults | number}}) ({{fetchProjects.searchUtils.totalResults | number}})
@ -154,7 +175,8 @@
</projectsTab> </projectsTab>
</div> </div>
</li> </li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Content Providers') != -1" (click)="search('datasourcesTab', 1, 10); activeTab='Content Providers'"> <li *ngIf="dataProviderInfo.tabs2.indexOf('Content Providers') != -1"
(click)="search('datasourcesTab', 1, 10); activeTab='Content Providers'">
<a class="uk-accordion-title" href="#">Content Providers <a class="uk-accordion-title" href="#">Content Providers
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{fetchDataproviders.searchUtils.totalResults | number}}) ({{fetchDataproviders.searchUtils.totalResults | number}})
@ -167,7 +189,8 @@
</datasourcesTab> </datasourcesTab>
</div> </div>
</li> </li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Organizations') != -1" (click)="search('organizationsTab', 1, 10); activeTab='Organizations'"> <li *ngIf="dataProviderInfo.tabs2.indexOf('Organizations') != -1"
(click)="search('organizationsTab', 1, 10); activeTab='Organizations'">
<a class="uk-accordion-title" href="#">Organizations <a class="uk-accordion-title" href="#">Organizations
<!-- <span class="uk-badge uk-badge-notification"> --> <!-- <span class="uk-badge uk-badge-notification"> -->
({{dataProviderInfo.organizations.length | number}}) ({{dataProviderInfo.organizations.length | number}})
@ -179,7 +202,8 @@
</organizationsTab> </organizationsTab>
</div> </div>
</li> </li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Related Content Providers') != -1" (click)="search('relatedDatasourcesTab', 1, 10); activeTab='Related Content Providers'"> <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> <a class="uk-accordion-title" href="#">Related Content Providers</a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<relatedDatasourcesTab *ngIf="activeTab=='Related Content Providers'" <relatedDatasourcesTab *ngIf="activeTab=='Related Content Providers'"
@ -194,7 +218,8 @@
</relatedDatasourcesTab> </relatedDatasourcesTab>
</div> </div>
</li> </li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Statistics') != -1" (click)="search('statisticsTab', 1, 10); activeTab='Statistics'"> <li *ngIf="dataProviderInfo.tabs2.indexOf('Statistics') != -1"
(click)="search('statisticsTab', 1, 10); activeTab='Statistics'">
<a class="uk-accordion-title" href="#">Statistics</a> <a class="uk-accordion-title" href="#">Statistics</a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<div *ngIf="activeTab=='Statistics' && statsClicked"> <div *ngIf="activeTab=='Statistics' && statsClicked">
@ -225,19 +250,20 @@
<i-frame [url]=dataProjectsUrl width="100%" height="350"></i-frame> <i-frame [url]=dataProjectsUrl width="100%" height="350"></i-frame>
</div> </div>
</div> --> </div> -->
<statisticsTab [fetchPublications]="fetchPublications" [fetchDatasets]="fetchDatasets" [datasourceId]="datasourceId"></statisticsTab> <statisticsTab [fetchPublications]="fetchPublications" [fetchDatasets]="fetchDatasets"
[datasourceId]="datasourceId"></statisticsTab>
</div> </div>
</div> </div>
</li> </li>
<li *ngIf="dataProviderInfo.tabs2.indexOf('Metrics') != -1"
<li *ngIf="dataProviderInfo.tabs2.indexOf('Metrics') != -1" (click)="search('metricsTab', 1, 10); activeTab='Metrics'"> (click)="search('metricsTab', 1, 10); activeTab='Metrics'">
<a class="uk-accordion-title" href="#">Metrics</a> <a class="uk-accordion-title" href="#">Metrics</a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<metrics *ngIf="activeTab=='Metrics'" [pageViews]="pageViews" <metrics *ngIf="activeTab=='Metrics'" [pageViews]="pageViews"
[id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'" [id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'"
(metricsResults)="metricsResults($event)" [(properties)] = properties> (metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics> </metrics>
<i-frame *ngIf="activeTab=='Metrics' && metricsClicked && totalViews > 0" <i-frame *ngIf="activeTab=='Metrics' && metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250"> [url]=viewsFrameUrl width="100%" height="250">
@ -255,17 +281,19 @@
<div class="uk-width-large@m uk-width-1-1@s"> <div class="uk-width-large@m uk-width-1-1@s">
<div class="uk-card uk-card-default uk-padding-small"> <div class="uk-card uk-card-default uk-padding-small">
<div> <div>
Share - Bookmark<addThis ></addThis> Share - Bookmark
<addThis></addThis>
</div> </div>
<metrics [pageViews]="pageViews" shortView=true <metrics [pageViews]="pageViews" shortView=true
[id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'" [id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'"
(metricsResults)="metricsResults($event)" [(properties)] = properties> (metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics> </metrics>
</div> </div>
</div> </div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,11 +1,7 @@
import {merge as observableMerge} from 'rxjs';
import {merge as observableMerge, Observable} from 'rxjs'; import {Component, Input} from '@angular/core';
import {Component, ViewChild} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser'; import {Meta, Title} from '@angular/platform-browser';
import {EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
@ -24,21 +20,22 @@ import {FetchProjects} from '../../utils/fetchEntitiesClass
import {SearchProjectsService} from '../../services/searchProjects.service'; import {SearchProjectsService} from '../../services/searchProjects.service';
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class'; import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
import {SearchDataprovidersService} from '../../services/searchDataproviders.service'; import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
import {RelatedDatasourcesTabComponent} from './relatedDatasourcesTab.component';
import {ErrorCodes} from '../../utils/properties/errorCodes'; import {ErrorCodes} from '../../utils/properties/errorCodes';
import {RouterHelper} from '../../utils/routerHelper.class'; import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service'; import {PiwikService} from '../../utils/piwik/piwik.service';
import { SEOService } from '../../sharedComponents/SEO/SEO.service'; import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({ @Component({
selector: 'dataprovider', selector: 'dataprovider',
templateUrl: 'dataProvider.component.html', templateUrl: 'dataProvider.component.html',
}) })
export class DataProviderComponent { export class DataProviderComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() communityId = null;
public dataProviderInfo: DataProviderInfo; public dataProviderInfo: DataProviderInfo;
public datasourceId: string; public datasourceId: string;
@ -61,13 +58,13 @@ export class DataProviderComponent {
// Statistics tab variables // Statistics tab variables
public statsClicked: boolean = false; public statsClicked: boolean = false;
public docsTimelineUrl: string; public docsTimelineUrl: string;
public docsTypesUrl:string; public docsTypesUrl: string;
public docsFunderUrl:string; public docsFunderUrl: string;
public dataProjectsUrl:string ; public dataProjectsUrl: string;
public pubsProjectsUrl:string; public pubsProjectsUrl: string;
// Variables for publications, research data, projects, content providers, related content providers tabs // Variables for publications, research data, projects, content providers, related content providers tabs
public fetchPublications : FetchPublications; public fetchPublications: FetchPublications;
public fetchDatasets: FetchDatasets; public fetchDatasets: FetchDatasets;
public fetchSoftware: FetchSoftware; public fetchSoftware: FetchSoftware;
public fetchOrps: FetchOrps; public fetchOrps: FetchOrps;
@ -82,10 +79,12 @@ export class DataProviderComponent {
// Active tab variable for responsiveness - show tabs only if main request is completed // Active tab variable for responsiveness - show tabs only if main request is completed
public activeTab: string = ""; public activeTab: string = "";
public showTabs:boolean = false; public showTabs: boolean = false;
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
public errorCodes:ErrorCodes = new ErrorCodes(); public errorCodes: ErrorCodes = new ErrorCodes();
public pageContents = null;
public divContents = null;
// Request results of each tab only the one time (first time tab is clicked) // Request results of each tab only the one time (first time tab is clicked)
private reloadPublications: boolean = true; private reloadPublications: boolean = true;
@ -100,10 +99,10 @@ export class DataProviderComponent {
piwiksub: any; piwiksub: any;
subInfo: any; subInfo: any;
relatedDatasourcesSub: any; relatedDatasourcesSub: any;
properties:EnvProperties; properties: EnvProperties;
constructor (private _dataproviderService: DataProviderService, constructor(private _dataproviderService: DataProviderService,
private _piwikService:PiwikService, private _piwikService: PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
private _meta: Meta, private _meta: Meta,
private _title: Title, private _title: Title,
@ -114,7 +113,8 @@ export class DataProviderComponent {
private _searchOrpsService: SearchOrpsService, private _searchOrpsService: SearchOrpsService,
private _searchProjectsService: SearchProjectsService, private _searchProjectsService: SearchProjectsService,
private _searchDataprovidersService: SearchDataprovidersService, private _searchDataprovidersService: SearchDataprovidersService,
private seoService: SEOService) { private seoService: SEOService,
private helper: HelperService) {
this.fetchPublications = new FetchPublications(this._searchPublicationsService); this.fetchPublications = new FetchPublications(this._searchPublicationsService);
this.fetchDatasets = new FetchDatasets(this._searchDatasetsService); this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
this.fetchSoftware = new FetchSoftware(this._searchSoftwareService); this.fetchSoftware = new FetchSoftware(this._searchSoftwareService);
@ -128,14 +128,16 @@ export class DataProviderComponent {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url); //this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
}); });
this.sub = this.route.queryParams.subscribe(data => { this.sub = this.route.queryParams.subscribe(data => {
this.updateTitle("Content provider"); this.updateTitle("Content provider");
this.updateDescription(""); this.updateDescription("");
this.datasourceId = data['datasourceId']; this.datasourceId = data['datasourceId'];
if(this.datasourceId){ if (this.datasourceId) {
this.getDataProviderInfo(this.datasourceId); this.getDataProviderInfo(this.datasourceId);
} }
@ -143,57 +145,70 @@ export class DataProviderComponent {
}); });
} }
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() { ngOnDestroy() {
if(this.sub){ if (this.sub) {
this.sub.unsubscribe(); this.sub.unsubscribe();
} }
if(this.piwiksub){ if (this.piwiksub) {
this.piwiksub.unsubscribe(); this.piwiksub.unsubscribe();
} }
if(this.subInfo) { if (this.subInfo) {
this.subInfo.unsubscribe(); this.subInfo.unsubscribe();
} }
if(this.relatedDatasourcesSub) { if (this.relatedDatasourcesSub) {
this.relatedDatasourcesSub.unsubscribe(); this.relatedDatasourcesSub.unsubscribe();
} }
} }
private getDataProviderInfo(id:string) {
private getDataProviderInfo(id: string) {
this.warningMessage = ''; this.warningMessage = '';
this.errorMessage="" this.errorMessage = ""
this.showLoading = true; this.showLoading = true;
this.dataProviderInfo = null; this.dataProviderInfo = null;
this.showTabs = false ; this.showTabs = false;
if(this.datasourceId==null || this.datasourceId==''){ if (this.datasourceId == null || this.datasourceId == '') {
this.showLoading = false; this.showLoading = false;
this.warningMessage="No valid datasource id"; this.warningMessage = "No valid datasource id";
}else{ } else {
this.subInfo = this._dataproviderService.getDataproviderInfo(this.datasourceId, this.properties).subscribe( this.subInfo = this._dataproviderService.getDataproviderInfo(this.datasourceId, this.properties).subscribe(
data => { data => {
this.dataProviderInfo = data; this.dataProviderInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url);
if (typeof document !== 'undefined') { if (typeof document !== 'undefined') {
this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId); this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId);
} }
this.initTabs(); this.initTabs();
this.showTabs = true ; this.showTabs = true;
this.updateTitle(this.dataProviderInfo.title.name); this.updateTitle(this.dataProviderInfo.title.name);
this.updateDescription("Content provider, "+this.dataProviderInfo.title.name); this.updateDescription("Content provider, " + this.dataProviderInfo.title.name);
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.dataProviderInfo.title.name, this.piwikSiteId).subscribe(); this.piwiksub = this._piwikService.trackView(this.properties, this.dataProviderInfo.title.name, this.piwikSiteId).subscribe();
} }
this.showLoading = false; this.showLoading = false;
if(this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) { if (this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) {
this.activeTab = this.dataProviderInfo.tabs[0].name; this.activeTab = this.dataProviderInfo.tabs[0].name;
} }
}, },
err => { err => {
//console.log(err); //console.log(err);
this.handleError("Error getting content provider for id: "+this.datasourceId, err); this.handleError("Error getting content provider for id: " + this.datasourceId, err);
this.errorMessage = 'No dataProvider found'; this.errorMessage = 'No dataProvider found';
this.showLoading = false; this.showLoading = false;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDataProviders); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDataProviders);
@ -209,28 +224,30 @@ export class DataProviderComponent {
}, },
err => { err => {
//console.log(err); //console.log(err);
this.handleError("Error getting content provider aggregation status for id: "+this.datasourceId, err); this.handleError("Error getting content provider aggregation status for id: " + this.datasourceId, err);
} }
); );
} }
private updateDescription(description:string) { private updateDescription(description: string) {
this._meta.updateTag({content:description},"name='description'"); this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content:description},"property='og:description'"); this._meta.updateTag({content: description}, "property='og:description'");
} }
private updateTitle(title:string) {
var _prefix ="OpenAIRE | "; private updateTitle(title: string) {
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _prefix = "OpenAIRE | ";
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title); this._title.setTitle(_title);
this._meta.updateTag({content:_title},"property='og:title'"); this._meta.updateTag({content: _title}, "property='og:title'");
}
private updateUrl(url:string) {
this._meta.updateTag({content:url},"property='og:url'");
} }
private initTabs(){ private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
if(this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) { private initTabs() {
if (this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) {
this.reloadPublications = true; this.reloadPublications = true;
this.reloadDatasets = true; this.reloadDatasets = true;
this.reloadSoftware = true; this.reloadSoftware = true;
@ -245,20 +262,20 @@ export class DataProviderComponent {
this.metricsClicked = false; this.metricsClicked = 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":"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.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.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":"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.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.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.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.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.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.pubsProjectsUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"dtsrcProjPubs","dtsrcName":"' + this.datasourceId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Publications"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250';
//if({"name": "Publications", "content": "publicationsTab"} in this.dataProviderInfo.tabs) { //if({"name": "Publications", "content": "publicationsTab"} in this.dataProviderInfo.tabs) {
//if(this.dataProviderInfo.tabs.some(function (tab) { //if(this.dataProviderInfo.tabs.some(function (tab) {
@ -273,7 +290,7 @@ export class DataProviderComponent {
this.fetchAggregatorsSoftware = new FetchSoftware(this._searchSoftwareService); this.fetchAggregatorsSoftware = new FetchSoftware(this._searchSoftwareService);
this.fetchAggregatorsOrps = new FetchOrps(this._searchOrpsService); this.fetchAggregatorsOrps = new FetchOrps(this._searchOrpsService);
} }
if(this.dataProviderInfo.resultsBy == "collectedFrom") { if (this.dataProviderInfo.resultsBy == "collectedFrom") {
//this.paramsForSearchLink = "?collectedFrom="+this.datasourceId+"&co=and"; //this.paramsForSearchLink = "?collectedFrom="+this.datasourceId+"&co=and";
this.paramsForSearchLink = this.routerHelper.createQueryParams(['collectedFrom', 'cl'], [this.datasourceId, 'and']); this.paramsForSearchLink = this.routerHelper.createQueryParams(['collectedFrom', 'cl'], [this.datasourceId, 'and']);
} else if (this.dataProviderInfo.resultsBy == "hostedBy") { } else if (this.dataProviderInfo.resultsBy == "hostedBy") {
@ -284,20 +301,20 @@ export class DataProviderComponent {
} }
private count(page: number, size: number) { private count(page: number, size: number) {
for(let i=0; i<this.dataProviderInfo.tabs.length; i++) { for (let i = 0; i < this.dataProviderInfo.tabs.length; i++) {
let content: string = this.dataProviderInfo.tabs[i].content; let content: string = this.dataProviderInfo.tabs[i].content;
if(content=='publicationsTab') { if (content == 'publicationsTab') {
this.countPublications(page, size); this.countPublications(page, size);
} else if(content=='datasetsTab') { } else if (content == 'datasetsTab') {
this.countDatasets(page, size); this.countDatasets(page, size);
} else if(content=='softwareTab') { } else if (content == 'softwareTab') {
this.countSoftware(page, size); this.countSoftware(page, size);
} else if(content=='orpsTab') { } else if (content == 'orpsTab') {
this.countOrps(page, size); this.countOrps(page, size);
} else if(content=='projectsTab') { } else if (content == 'projectsTab') {
this.countProjects(page, size); this.countProjects(page, size);
} else if(content=='datasourcesTab') { } else if (content == 'datasourcesTab') {
this.countDatasources(page, size); this.countDatasources(page, size);
}// else if(content=='relatedDatasourcesTab') { }// else if(content=='relatedDatasourcesTab') {
// this.countRelatedDatasources(page, size); // this.countRelatedDatasources(page, size);
@ -306,31 +323,31 @@ export class DataProviderComponent {
} }
public search(content: string, page: number, size: number) { public search(content: string, page: number, size: number) {
if(content=='publicationsTab') { if (content == 'publicationsTab') {
this.searchPublications(page, size); this.searchPublications(page, size);
} else if(content=='datasetsTab') { } else if (content == 'datasetsTab') {
this.searchDatasets(page, size); this.searchDatasets(page, size);
} else if(content=='softwareTab') { } else if (content == 'softwareTab') {
this.searchSoftware(page, size); this.searchSoftware(page, size);
} else if(content=='orpsTab') { } else if (content == 'orpsTab') {
this.searchOrps(page, size); this.searchOrps(page, size);
} else if(content=='projectsTab') { } else if (content == 'projectsTab') {
this.searchProjects(page, size); this.searchProjects(page, size);
} else if(content=='datasourcesTab') { } else if (content == 'datasourcesTab') {
this.searchDatasources(page, size); this.searchDatasources(page, size);
} else if(content=='relatedDatasourcesTab') { } else if (content == 'relatedDatasourcesTab') {
this.searchRelatedDatasources(1, 0); this.searchRelatedDatasources(1, 0);
} else if(content=='metricsTab') { } else if (content == 'metricsTab') {
this.metricsClicked = true; this.metricsClicked = true;
} else if(content=='statisticsTab') { } else if (content == 'statisticsTab') {
this.statsClicked = !this.statsClicked; this.statsClicked = !this.statsClicked;
} }
} }
private searchPublications(page: number, size: number) { private searchPublications(page: number, size: number) {
if( this.reloadPublications && if (this.reloadPublications &&
( this.fetchPublications.searchUtils.status == this.errorCodes.LOADING || (this.fetchPublications.searchUtils.status == this.errorCodes.LOADING ||
this.fetchPublications.searchUtils.status == this.errorCodes.DONE ) ) { this.fetchPublications.searchUtils.status == this.errorCodes.DONE)) {
this.fetchPublications.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties); this.fetchPublications.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
} }
this.reloadPublications = false; this.reloadPublications = false;
@ -341,9 +358,9 @@ export class DataProviderComponent {
} }
private searchDatasets(page: number, size: number) { private searchDatasets(page: number, size: number) {
if( this.reloadDatasets && if (this.reloadDatasets &&
( this.fetchDatasets.searchUtils.status == this.errorCodes.LOADING || (this.fetchDatasets.searchUtils.status == this.errorCodes.LOADING ||
this.fetchDatasets.searchUtils.status == this.errorCodes.DONE ) ) { this.fetchDatasets.searchUtils.status == this.errorCodes.DONE)) {
this.fetchDatasets.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties); this.fetchDatasets.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
} }
this.reloadDatasets = false; this.reloadDatasets = false;
@ -354,9 +371,9 @@ export class DataProviderComponent {
} }
private searchSoftware(page: number, size: number) { private searchSoftware(page: number, size: number) {
if( this.reloadSoftware && if (this.reloadSoftware &&
( this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING || (this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING ||
this.fetchSoftware.searchUtils.status == this.errorCodes.DONE ) ) { this.fetchSoftware.searchUtils.status == this.errorCodes.DONE)) {
this.fetchSoftware.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties); this.fetchSoftware.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
} }
this.reloadSoftware = false; this.reloadSoftware = false;
@ -367,9 +384,9 @@ export class DataProviderComponent {
} }
private searchOrps(page: number, size: number) { private searchOrps(page: number, size: number) {
if( this.reloadOrps && if (this.reloadOrps &&
( this.fetchOrps.searchUtils.status == this.errorCodes.LOADING || (this.fetchOrps.searchUtils.status == this.errorCodes.LOADING ||
this.fetchOrps.searchUtils.status == this.errorCodes.DONE ) ) { this.fetchOrps.searchUtils.status == this.errorCodes.DONE)) {
this.fetchOrps.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties); this.fetchOrps.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
} }
this.reloadOrps = false; this.reloadOrps = false;
@ -380,9 +397,9 @@ export class DataProviderComponent {
} }
private searchProjects(page: number, size: number) { private searchProjects(page: number, size: number) {
if( this.reloadProjects && if (this.reloadProjects &&
( this.fetchProjects.searchUtils.status == this.errorCodes.LOADING || (this.fetchProjects.searchUtils.status == this.errorCodes.LOADING ||
this.fetchProjects.searchUtils.status == this.errorCodes.DONE ) ) { this.fetchProjects.searchUtils.status == this.errorCodes.DONE)) {
this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size, this.properties); this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
} }
this.reloadProjects = false; this.reloadProjects = false;
@ -393,9 +410,9 @@ export class DataProviderComponent {
} }
private searchDatasources(page: number, size: number) { private searchDatasources(page: number, size: number) {
if( this.reloadDataproviders && if (this.reloadDataproviders &&
( this.fetchDataproviders.searchUtils.status == this.errorCodes.LOADING || (this.fetchDataproviders.searchUtils.status == this.errorCodes.LOADING ||
this.fetchDataproviders.searchUtils.status == this.errorCodes.DONE ) ) { this.fetchDataproviders.searchUtils.status == this.errorCodes.DONE)) {
this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size, this.properties); this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
} }
this.reloadDataproviders = false; this.reloadDataproviders = false;
@ -408,23 +425,27 @@ export class DataProviderComponent {
private searchRelatedDatasources(page: number, size: number) { private searchRelatedDatasources(page: number, size: number) {
// Currently no counting is done for this tab. Following condition is always false // Currently no counting is done for this tab. Following condition is always false
if( this.reloadRelatedDatasources && if (this.reloadRelatedDatasources &&
( this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.LOADING || (this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.LOADING ||
this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE ) this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE)
&& &&
( this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.LOADING || (this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.LOADING ||
this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE ) this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE)
&& &&
( this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.LOADING || (this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.LOADING ||
this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.DONE ) this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.DONE)
&& &&
( this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.LOADING || (this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.LOADING ||
this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.DONE )) { this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.DONE)) {
this.relatedDatasourcesSub = observableMerge(this.fetchAggregatorsPublications.requestComplete, this.fetchAggregatorsDatasets.requestComplete, this.fetchAggregatorsSoftware.requestComplete, this.fetchAggregatorsOrps.requestComplete) this.relatedDatasourcesSub = observableMerge(this.fetchAggregatorsPublications.requestComplete, this.fetchAggregatorsDatasets.requestComplete, this.fetchAggregatorsSoftware.requestComplete, this.fetchAggregatorsOrps.requestComplete)
.subscribe( .subscribe(
data => {}, data => {
err => {}, },
() => { this.preprocessRelatedDatasources(); } err => {
},
() => {
this.preprocessRelatedDatasources();
}
) )
this.fetchAggregatorsPublications.getAggregatorResults(this.datasourceId, page, size, this.properties); this.fetchAggregatorsPublications.getAggregatorResults(this.datasourceId, page, size, this.properties);
@ -448,41 +469,65 @@ export class DataProviderComponent {
private preprocessRelatedDatasources() { private preprocessRelatedDatasources() {
if( this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE || if (this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE ||
this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE || this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE ||
this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.DONE || this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.DONE ||
this.fetchAggregatorsOrps.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}>(); this.dataProviderInfo.relatedDatasources = new Map<string, { "name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string }>();
} }
for(let result of this.fetchAggregatorsPublications.results) { for (let result of this.fetchAggregatorsPublications.results) {
if(!this.dataProviderInfo.relatedDatasources.has(result.id)) { 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"}); this.dataProviderInfo.relatedDatasources.set(result.id, {
"name": result.name,
"countPublications": result.count,
"countDatasets": "0",
"countSoftware": "0",
"countOrps": "0"
});
} else { } else {
this.dataProviderInfo.relatedDatasources.get(result.id).countPublications = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countPublications + result.count)+""; this.dataProviderInfo.relatedDatasources.get(result.id).countPublications = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countPublications + result.count) + "";
} }
} }
for(let result of this.fetchAggregatorsDatasets.results) { for (let result of this.fetchAggregatorsDatasets.results) {
if(!this.dataProviderInfo.relatedDatasources.has(result.id)) { 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"}); this.dataProviderInfo.relatedDatasources.set(result.id, {
"name": result.name,
"countPublications": "0",
"countDatasets": result.count,
"countSoftware": "0",
"countOrps": "0"
});
} else { } else {
this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets + result.count)+""; this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets + result.count) + "";
} }
} }
for(let result of this.fetchAggregatorsSoftware.results) { for (let result of this.fetchAggregatorsSoftware.results) {
if(!this.dataProviderInfo.relatedDatasources.has(result.id)) { 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"}); this.dataProviderInfo.relatedDatasources.set(result.id, {
"name": result.name,
"countPublications": "0",
"countDatasets": "0",
"countSoftware": result.count,
"countOrps": "0"
});
} else { } else {
this.dataProviderInfo.relatedDatasources.get(result.id).countSoftware = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countSoftware + result.count)+""; this.dataProviderInfo.relatedDatasources.get(result.id).countSoftware = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countSoftware + result.count) + "";
} }
} }
for(let result of this.fetchAggregatorsOrps.results) { for (let result of this.fetchAggregatorsOrps.results) {
if(!this.dataProviderInfo.relatedDatasources.has(result.id)) { 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}); this.dataProviderInfo.relatedDatasources.set(result.id, {
"name": result.name,
"countPublications": "0",
"countDatasets": "0",
"countSoftware": "0",
"countOrps": result.count
});
} else { } else {
this.dataProviderInfo.relatedDatasources.get(result.id).countOrps = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countOrps + result.count)+""; this.dataProviderInfo.relatedDatasources.get(result.id).countOrps = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countOrps + result.count) + "";
} }
} }
this.loadingRelatedDatasources = false; this.loadingRelatedDatasources = false;
@ -495,6 +540,6 @@ export class DataProviderComponent {
} }
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Content Provider Landing Page: "+message, error); console.error("Content Provider Landing Page: " + message, error);
} }
} }

View File

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

View File

@ -1,27 +1,37 @@
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" > <div id="tm-main" class=" uk-section uk-margin-small-top tm-middle">
<div uk-grid uk-grid> <div uk-grid uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first "> <div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container uk-margin-top dataset">
<div class="uk-container uk-margin-top dataset"> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
role="alert">{{warningMessage}}</div>
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div> <div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div> role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div> <div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
<div *ngIf="datasetInfo != null" uk-grid class="uk-grid-large"> class="loading-gif uk-align-center"></span></div>
<div *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"> <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> <schema2jsonld *ngIf="datasetInfo.record" [data]=datasetInfo.record
[URL]="properties.baseLink+'/search/dataset?datasetId='+datasetId"></schema2jsonld>
<showTitle [titleName]="datasetInfo.title"></showTitle> <showTitle [titleName]="datasetInfo.title"></showTitle>
<p class="uk-text-large" *ngIf="datasetInfo.subtitle"> <p class="uk-text-large" *ngIf="datasetInfo.subtitle">
<span [innerHTML]="datasetInfo.subtitle"></span> <span [innerHTML]="datasetInfo.subtitle"></span>
</p> </p>
<span *ngIf="datasetInfo.types && datasetInfo.types.length > 0"class="uk-label custom-label label-dataset " title="Type">{{datasetInfo.types.join(", ")}}</span>{{" "}} <span *ngIf="datasetInfo.types && datasetInfo.types.length > 0" class="uk-label custom-label label-dataset "
<span *ngIf="datasetInfo.languages && datasetInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{datasetInfo.languages.join(", ")}}</span>{{" "}} title="Type">{{datasetInfo.types.join(", ")}}</span>{{" "}}
<span *ngIf="datasetInfo.countries && datasetInfo.countries.length > 0" class="uk-label custom-label label-country " title="Country">{{datasetInfo.countries.join(", ")}}</span>{{" "}} <span *ngIf="datasetInfo.languages && datasetInfo.languages.length > 0"
class="uk-label custom-label label-language "
title="Language">{{datasetInfo.languages.join(", ")}}</span>{{" "}}
<span *ngIf="datasetInfo.countries && datasetInfo.countries.length > 0"
class="uk-label custom-label label-country "
title="Country">{{datasetInfo.countries.join(", ")}}</span>{{" "}}
<!-- <span *ngIf="datasetInfo.title && datasetInfo.title.accessMode" [class]="'uk-label custom-label label-'+ datasetInfo.title.accessMode " title="Access Mode">{{datasetInfo.title.accessMode}}</span> --> <!-- <span *ngIf="datasetInfo.title && datasetInfo.title.accessMode" [class]="'uk-label custom-label label-'+ datasetInfo.title.accessMode " title="Access Mode">{{datasetInfo.title.accessMode}}</span> -->
<span *ngIf="datasetInfo.accessMode" [class]="'uk-label custom-label label-'+ datasetInfo.accessMode " title="Access Mode">{{datasetInfo.accessMode}}</span>{{" "}} <span *ngIf="datasetInfo.accessMode" [class]="'uk-label custom-label label-'+ datasetInfo.accessMode "
<span *ngIf="datasetInfo.underCurationMessage" class="uk-label custom-label label-underCuration " >{{" "}} title="Access Mode">{{datasetInfo.accessMode}}</span>{{" "}}
<span *ngIf="datasetInfo.underCurationMessage" class="uk-label custom-label label-underCuration ">{{" "}}
<span uk-tooltip="pos:right; delay:10" <span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}"> title="{{buildCurationTooltip()}}">
<i>Record in preview</i> <i>Record in preview</i>
@ -35,7 +45,7 @@
</span> </span>
</div--> </div-->
<div class= " uk-margin-top"> <div class=" uk-margin-top">
<showAuthors [authors]="datasetInfo.authors"></showAuthors> <showAuthors [authors]="datasetInfo.authors"></showAuthors>
<span *ngIf="datasetInfo.date != ''">({{datasetInfo.date}})</span> <span *ngIf="datasetInfo.date != ''">({{datasetInfo.date}})</span>
</div> </div>
@ -43,7 +53,8 @@
<ul class="uk-list"> <ul class="uk-list">
<showPublisher [publisher]="datasetInfo.publisher" <showPublisher [publisher]="datasetInfo.publisher"
[journal]="datasetInfo.journal" [properties]="properties"></showPublisher> [journal]="datasetInfo.journal" [properties]="properties"></showPublisher>
<li *ngIf="datasetInfo.embargoEndDate"><span class="uk-text-bold">Embargo end date:</span> {{datasetInfo.embargoEndDate}}</li> <li *ngIf="datasetInfo.embargoEndDate"><span
class="uk-text-bold">Embargo end date:</span> {{datasetInfo.embargoEndDate}}</li>
<li *ngIf="datasetInfo.identifiers && datasetInfo.identifiers.size > 0"> <li *ngIf="datasetInfo.identifiers && datasetInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="datasetInfo.identifiers"></showIdentifiers> <showIdentifiers [identifiers]="datasetInfo.identifiers"></showIdentifiers>
</li> </li>
@ -54,17 +65,22 @@
</showSubjects> </showSubjects>
</li> </li>
</ul> </ul>
<hr *ngIf="datasetInfo.description" > <hr *ngIf="datasetInfo.description">
<div *ngIf="datasetInfo.description" class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto"> <div *ngIf="datasetInfo.description"
class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<span>{{datasetInfo.description.substring(0, showNumDescription)}}</span <span>{{datasetInfo.description.substring(0, showNumDescription)}}</span
><span *ngIf="showNumDescription == thresholdDescription && datasetInfo.description.length > thresholdDescription">...</span ><span
><span *ngIf="showNumDescription == thresholdDescription && datasetInfo.description.length > thresholdDescription" class="uk-text-right"> *ngIf="showNumDescription == thresholdDescription && datasetInfo.description.length > thresholdDescription">...</span
><span
*ngIf="showNumDescription == thresholdDescription && datasetInfo.description.length > thresholdDescription"
class="uk-text-right">
<a (click)="showNumDescription = datasetInfo.description.length;"> <a (click)="showNumDescription = datasetInfo.description.length;">
View more View more
</a> </a>
</span> </span>
</div> </div>
<div *ngIf="datasetInfo.description && showNumDescription > thresholdDescription" class="uk-width-1-1 uk-text-right"> <div *ngIf="datasetInfo.description && showNumDescription > thresholdDescription"
class="uk-width-1-1 uk-text-right">
<a (click)="showNumDescription = thresholdDescription;"> <a (click)="showNumDescription = thresholdDescription;">
View less View less
</a> </a>
@ -100,11 +116,16 @@
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<div> <div>
<div *ngIf="datasetInfo.references.length > pageSize" class="uk-margin-bottom"> <div *ngIf="datasetInfo.references.length > pageSize" class="uk-margin-bottom">
<span class="uk-h6">{{datasetInfo.references.length | number}} references, page {{referencesPage | number}} of {{totalPages(datasetInfo.references.length) | number}}</span> <span class="uk-h6">{{datasetInfo.references.length | number}}
<paging-no-load class="uk-float-right" [currentPage]="referencesPage" [totalResults]="datasetInfo.references.length" [size]="pageSize" (pageChange)="updateReferencesPage($event)"></paging-no-load> references, page {{referencesPage | number}}
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>
<div *ngFor="let item of datasetInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)"> <div
*ngFor="let item of datasetInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
<p *ngIf=" item && item['url']" <p *ngIf=" item && item['url']"
class="custom-external custom-icon"> class="custom-external custom-icon">
<a href="{{item['url']}}" target="_blank"> <a href="{{item['url']}}" target="_blank">
@ -139,7 +160,9 @@
<div *ngFor="let provenanceaction of getKeys(datasetInfo.relatedResearchResults)"> <div *ngFor="let provenanceaction of getKeys(datasetInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div> <div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [percentageName]="trust" [info]="datasetInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable> <tabTable [percentageName]="trust"
[info]="datasetInfo.relatedResearchResults.get(provenanceaction)"
[(properties)]=properties></tabTable>
</div> </div>
</div> </div>
</div> </div>
@ -163,7 +186,8 @@
<div *ngIf="datasetInfo.similarResearchResults"> --> <div *ngIf="datasetInfo.similarResearchResults"> -->
<div> <div>
<tabTable [percentageName]="similarity" [info]="datasetInfo.similarResearchResults" [(properties)]=properties></tabTable> <tabTable [percentageName]="similarity" [info]="datasetInfo.similarResearchResults"
[(properties)]=properties></tabTable>
</div> </div>
</div> </div>
</li> </li>
@ -175,7 +199,7 @@
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<metrics [pageViews]="pageViews" <metrics [pageViews]="pageViews"
[id]="datasetId" [entityType]="'results'" [entity]="'Research Data'" [id]="datasetId" [entityType]="'results'" [entity]="'Research Data'"
(metricsResults)="metricsResults($event)" [(properties)] = properties> (metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics> </metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0" <i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250"> [url]=viewsFrameUrl width="100%" height="250">
@ -186,13 +210,15 @@
</div> </div>
</li> </li>
<li (click)="activeTab='Other Versions'" *ngIf="properties.environment == 'development' && datasetInfo.deletedByInferenceIds"> <li (click)="activeTab='Other Versions'"
*ngIf="properties.environment == 'development' && datasetInfo.deletedByInferenceIds">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Other Versions Other Versions
({{datasetInfo.deletedByInferenceIds.length | number}}) ({{datasetInfo.deletedByInferenceIds.length | number}})
</a> </a>
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content"> <div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
<deletedByInference [id]="datasetId" [ids]="datasetInfo.deletedByInferenceIds" [type]="'research data'"></deletedByInference> <deletedByInference [id]="datasetId" [ids]="datasetInfo.deletedByInferenceIds"
[type]="'research data'"></deletedByInference>
</div> </div>
</li> </li>
</ul> </ul>
@ -201,13 +227,13 @@
<div class="uk-width-large@m uk-width-1-1@s"> <div class="uk-width-large@m uk-width-1-1@s">
<div class=" uk-padding-small"> <div class=" uk-padding-small">
<div > <div>
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div> <div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis></addThis> <addThis></addThis>
</div> </div>
<altmetrics *ngIf="datasetInfo.identifiers && datasetInfo.identifiers.get('doi')" <altmetrics *ngIf="datasetInfo.identifiers && datasetInfo.identifiers.get('doi')"
id="{{datasetInfo.identifiers.get('doi')[0]}}" type="doi"> id="{{datasetInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics > </altmetrics>
<ul class="uk-list uk-margin-remove-bottom "> <ul class="uk-list uk-margin-remove-bottom ">
<li *ngIf="datasetInfo.hostedBy_collectedFrom && datasetInfo.hostedBy_collectedFrom.length > 0"> <li *ngIf="datasetInfo.hostedBy_collectedFrom && datasetInfo.hostedBy_collectedFrom.length > 0">
@ -218,15 +244,15 @@
</li> </li>
<li *ngIf="datasetInfo.contexts && datasetInfo.contexts.length >0 "> <li *ngIf="datasetInfo.contexts && datasetInfo.contexts.length >0 ">
<dl class="uk-description-list-line" > <dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to </dt> <dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of datasetInfo.contexts"> <dd class="line" *ngFor="let item of datasetInfo.contexts">
<span *ngIf = "!item['inline']" > <span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span> <span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span> <span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span> </span>
<mark *ngIf = "item['inline']" > <mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span> <span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span> <span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
@ -256,30 +282,57 @@
</li> </li>
</ul> </ul>
<button *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-button portal-button uk-width-1-1 "> <button *ngIf="isRouteAvailable('participate/direct-claim') "
class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon"> <span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg> <svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
height="25"><path
d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path
d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975"
fill="none" stroke="#000"
stroke-width="1.1"></path></svg>
</span> Link this dataset to... </span> Link this dataset to...
</button> </button>
<div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;"> <div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click"
style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical"> <ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>"> <li uk-tooltip="pos: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" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
<span class="uk-icon" > [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','project'])"
<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> 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> </a>
</li> </li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>"> <li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
<span class="uk-icon" > [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','context'])"
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="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> 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> </a>
</li> </li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>"> <li uk-tooltip="pos:right;"
<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" > title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>">
<span class="uk-icon" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="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> [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> </a>
</li> </li>
@ -288,8 +341,11 @@
</div> </div>
</div> </div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>

View File

@ -1,9 +1,6 @@
import {Component, ViewChild} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser'; import {Meta, Title} from '@angular/platform-browser';
import {Observable} from 'rxjs';
import {DatasetInfo} from '../../utils/entities/datasetInfo'; import {DatasetInfo} from '../../utils/entities/datasetInfo';
import {EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
@ -11,8 +8,9 @@ import {RouterHelper} from '../../utils/routerHelper.class';
import {DatasetService} from './dataset.service'; import {DatasetService} from './dataset.service';
import {PiwikService} from '../../utils/piwik/piwik.service'; import {PiwikService} from '../../utils/piwik/piwik.service';
import { SEOService } from '../../sharedComponents/SEO/SEO.service'; import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({ @Component({
@ -22,8 +20,9 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class";
export class DatasetComponent { export class DatasetComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() communityId = null;
public datasetInfo: DatasetInfo; public datasetInfo: DatasetInfo;
public datasetId : string ; public datasetId: string;
// APP BOX variables // APP BOX variables
public showAllCollectedFrom: boolean = false; public showAllCollectedFrom: boolean = false;
@ -55,28 +54,35 @@ export class DatasetComponent {
public warningMessage = ""; public warningMessage = "";
public errorMessage = ""; public errorMessage = "";
public showLoading: boolean = true; public showLoading: boolean = true;
public pageContents = null;
public divContents = null;
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
private result ; private result;
sub: any; piwiksub: any; infoSub: any; sub: any;
properties:EnvProperties; piwiksub: any;
infoSub: any;
properties: EnvProperties;
constructor (private _datasetService: DatasetService, constructor(private _datasetService: DatasetService,
private _piwikService:PiwikService, private _piwikService: PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private _meta: Meta, private _meta: Meta,
private _title: Title, private _title: Title,
private _router: Router, private _router: Router,
private seoService: SEOService) { private seoService: SEOService,
private helper: HelperService) {
} }
ngOnInit() { ngOnInit() {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url); //this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
}); });
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
@ -86,20 +92,20 @@ export class DatasetComponent {
this.datasetId = params['datasetId']; this.datasetId = params['datasetId'];
if(this.datasetId){ if (this.datasetId) {
this.getDatasetInfo(this.datasetId); this.getDatasetInfo(this.datasetId);
}else{ } else {
this.showLoading = false; this.showLoading = false;
this.warningMessage="No valid research data id"; this.warningMessage = "No valid research data id";
} }
this.metricsClicked = false; 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":"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.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":"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.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(); this.scroll();
@ -107,26 +113,38 @@ export class DatasetComponent {
} }
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() { ngOnDestroy() {
if(this.sub){ if (this.sub) {
this.sub.unsubscribe(); this.sub.unsubscribe();
} }
if(this.piwiksub){ if (this.piwiksub) {
this.piwiksub.unsubscribe(); this.piwiksub.unsubscribe();
} }
if(this.infoSub) { if (this.infoSub) {
this.infoSub.unsubscribe(); this.infoSub.unsubscribe();
} }
} }
private getDatasetInfo(id:string) { private getDatasetInfo(id: string) {
this.warningMessage = ''; this.warningMessage = '';
this.errorMessage="" this.errorMessage = ""
this.showLoading = true; this.showLoading = true;
this.datasetInfo = null; this.datasetInfo = null;
this.infoSub = this._datasetService.getDatasetInfo(id, this. properties).subscribe( this.infoSub = this._datasetService.getDatasetInfo(id, this.properties).subscribe(
data => { data => {
this.datasetInfo = data; this.datasetInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDataset + this.datasetInfo.record["result"]["header"]["dri:objIdentifier"]); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDataset + this.datasetInfo.record["result"]["header"]["dri:objIdentifier"]);
@ -136,19 +154,28 @@ export class DatasetComponent {
this.updateDescription("Dataset, search, repositories, open access,"+this.datasetInfo.title.name); this.updateDescription("Dataset, search, repositories, open access,"+this.datasetInfo.title.name);
} }
*/ */
if(this.datasetInfo.title){ if (this.datasetInfo.title) {
this.updateTitle(this.datasetInfo.title); this.updateTitle(this.datasetInfo.title);
this.updateDescription((this.datasetInfo.description?(this.datasetInfo.description):(","+this.datasetInfo.title))); this.updateDescription((this.datasetInfo.description ? (this.datasetInfo.description) : ("," + this.datasetInfo.title)));
} }
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.datasetInfo.title/*.name*/, this.piwikSiteId).subscribe(); this.piwiksub = this._piwikService.trackView(this.properties, this.datasetInfo.title/*.name*/, this.piwikSiteId).subscribe();
} }
this.result = [] 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: ''}; 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; let relatedResearchResultsNum = 0;
if(this.datasetInfo.relatedResearchResults != undefined) { if (this.datasetInfo.relatedResearchResults != undefined) {
this.datasetInfo.relatedResearchResults.forEach(function (value, key, map) { this.datasetInfo.relatedResearchResults.forEach(function (value, key, map) {
relatedResearchResultsNum += value.length; relatedResearchResultsNum += value.length;
}); });
@ -159,7 +186,7 @@ export class DatasetComponent {
}, },
err => { err => {
//console.log(err) //console.log(err)
this.handleError("Error getting research data for id: "+this.datasetId, err); this.handleError("Error getting research data for id: " + this.datasetId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDatasets); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDatasets);
this.errorMessage = 'No research data found'; this.errorMessage = 'No research data found';
this.showLoading = false; this.showLoading = false;
@ -177,18 +204,20 @@ export class DatasetComponent {
this.pageViews = $event.pageViews; this.pageViews = $event.pageViews;
} }
private updateDescription(description:string){ private updateDescription(description: string) {
this._meta.updateTag({content:description},"name='description'"); this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content:description},"property='og:description'"); this._meta.updateTag({content: description}, "property='og:description'");
} }
private updateTitle(title:string){
var _prefix ="OpenAIRE | "; private updateTitle(title: string) {
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _prefix = "OpenAIRE | ";
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title); this._title.setTitle(_title);
this._meta.updateTag({content:_title},"property='og:title'"); this._meta.updateTag({content: _title}, "property='og:title'");
} }
private updateUrl(url:string){
this._meta.updateTag({content:url},"property='og:url'"); private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
} }
public buildCurationTooltip() { public buildCurationTooltip() {
@ -199,12 +228,13 @@ export class DatasetComponent {
return tooltipContent; return tooltipContent;
} }
public getKeys( map) {
public getKeys(map) {
return Array.from(map.keys()); return Array.from(map.keys());
} }
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Research Data Landing Page: "+message, error); console.error("Research Data Landing Page: " + message, error);
} }
public updateReferencesPage($event) { public updateReferencesPage($event) {
@ -212,8 +242,8 @@ export class DatasetComponent {
} }
public totalPages(totalResults: number): number { public totalPages(totalResults: number): number {
let totalPages:any = totalResults/this.pageSize; let totalPages: any = totalResults / this.pageSize;
if(!(Number.isInteger(totalPages))) { if (!(Number.isInteger(totalPages))) {
totalPages = (parseInt(totalPages, this.pageSize) + 1); totalPages = (parseInt(totalPages, this.pageSize) + 1);
} }
return totalPages; return totalPages;
@ -222,10 +252,11 @@ export class DatasetComponent {
public scroll() { public scroll() {
HelperFunctions.scroll(); HelperFunctions.scroll();
} }
isRouteAvailable(routeToCheck:string){
isRouteAvailable(routeToCheck: string) {
for (let i = 0; i < this.router.config.length; i++) { for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path; let routePath: string = this.router.config[i].path;
if(routePath == routeToCheck){ if (routePath == routeToCheck) {
return true; return true;
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -1,9 +1,6 @@
import {Component, ViewChild} from '@angular/core'; import {Component, ElementRef, Input, ViewChild} from '@angular/core';
import {ElementRef, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser'; import {Meta, Title} from '@angular/platform-browser';
import {Observable, Subject} from 'rxjs';
import {OrganizationService} from '../../services/organization.service'; import {OrganizationService} from '../../services/organization.service';
import {OrganizationInfo} from '../../utils/entities/organizationInfo'; import {OrganizationInfo} from '../../utils/entities/organizationInfo';
@ -21,12 +18,12 @@ import {SearchingProjectsTabComponent} from '../landing-utils/searchingProjects
import {RouterHelper} from '../../utils/routerHelper.class'; import {RouterHelper} from '../../utils/routerHelper.class';
import {ModalLoading} from '../../utils/modal/loading.component'; import {ModalLoading} from '../../utils/modal/loading.component';
import {AlertModal} from '../../utils/modal/alert';
import {PiwikService} from '../../utils/piwik/piwik.service'; import {PiwikService} from '../../utils/piwik/piwik.service';
import {StringUtils} from '../../utils/string-utils.class'; import {StringUtils} from '../../utils/string-utils.class';
import {EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
import { SEOService } from '../../sharedComponents/SEO/SEO.service'; import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({ @Component({
selector: 'organization', selector: 'organization',
@ -35,6 +32,8 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class";
export class OrganizationComponent { export class OrganizationComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() communityId = null;
public organizationInfo: OrganizationInfo; public organizationInfo: OrganizationInfo;
public organizationId: string; public organizationId: string;
@ -59,22 +58,24 @@ export class OrganizationComponent {
// public fetchDatasets: FetchDatasets; // public fetchDatasets: FetchDatasets;
// public linkToSearchDatasets: string = ""; // public linkToSearchDatasets: string = "";
public fetchProjects: FetchProjects; public fetchProjects: FetchProjects;
public fetchDataproviders : FetchDataproviders; public fetchDataproviders: FetchDataproviders;
public linkToSearchDataproviders:string = ""; public linkToSearchDataproviders: string = "";
//public projectFunders:string[] = []; //public projectFunders:string[] = [];
// Variables for projects query (query results only if projects tab is clicked) // Variables for projects query (query results only if projects tab is clicked)
public projectsClicked: boolean = false; public projectsClicked: boolean = false;
@ViewChild (SearchingProjectsTabComponent) searchingProjectsTabComponent : SearchingProjectsTabComponent ; @ViewChild(SearchingProjectsTabComponent) searchingProjectsTabComponent: SearchingProjectsTabComponent;
@ViewChild (ModalLoading) loading : ModalLoading ; @ViewChild(ModalLoading) loading: ModalLoading;
// Alert box when CSV: Project Publications for a funder is requested // Alert box when CSV: Project Publications for a funder is requested
@ViewChild('AlertModalApplyAll') alertApplyAll; @ViewChild('AlertModalApplyAll') alertApplyAll;
// Alert box when something is wrong with CSV requests // Alert box when something is wrong with CSV requests
@ViewChild('AlertModalCsvError') alertCsvError; @ViewChild('AlertModalCsvError') alertCsvError;
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
public errorCodes:ErrorCodes = new ErrorCodes(); public errorCodes: ErrorCodes = new ErrorCodes();
public pageContents = null;
public divContents = null;
//private projectsNum: number = 0; //private projectsNum: number = 0;
//private fundersSet: Set<string>; //private fundersSet: Set<string>;
@ -97,12 +98,13 @@ export class OrganizationComponent {
countProjectsSub: any; countProjectsSub: any;
countPublSub: any; countPublSub: any;
downloadProjectPublSub: any; downloadProjectPublSub: any;
properties:EnvProperties; properties: EnvProperties;
//private ngUnsubscribe: Subject<void> = new Subject<void>(); //private ngUnsubscribe: Subject<void> = new Subject<void>();
constructor (private element: ElementRef, constructor(private element: ElementRef,
private _organizationService: OrganizationService, private _organizationService: OrganizationService,
private _piwikService:PiwikService, private _piwikService: PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
private _searchDataprovidersService: SearchDataprovidersService, private _searchDataprovidersService: SearchDataprovidersService,
private _reportsService: ReportsService, private _reportsService: ReportsService,
@ -112,6 +114,7 @@ export class OrganizationComponent {
private _meta: Meta, private _meta: Meta,
private _title: Title, private _title: Title,
private _router: Router, private _router: Router,
private helper: HelperService,
private seoService: SEOService) { private seoService: SEOService) {
this.fetchPublications = new FetchPublications(this._searchPublicationsService); this.fetchPublications = new FetchPublications(this._searchPublicationsService);
@ -124,59 +127,73 @@ export class OrganizationComponent {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url); //this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
}); });
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
this.organizationInfo=null; this.organizationInfo = null;
this.updateTitle("Organization"); this.updateTitle("Organization");
this.updateDescription(""); this.updateDescription("");
this.projectsClicked = false; this.projectsClicked = false;
this.organizationId = params['organizationId']; this.organizationId = params['organizationId'];
if(this.organizationId){ if (this.organizationId) {
this.getOrganizationInfo(); this.getOrganizationInfo();
}else{ } else {
this.showLoading = false; this.showLoading = false;
this.warningMessage="No valid organization id"; this.warningMessage = "No valid organization id";
} }
HelperFunctions.scroll(); HelperFunctions.scroll();
this.csvParamsTail = '" and relorganizationid exact "'+this.organizationId+'" ))'; this.csvParamsTail = '" and relorganizationid exact "' + this.organizationId + '" ))';
}); });
this.downloadURLAPI =this.properties.csvAPIURL; this.downloadURLAPI = this.properties.csvAPIURL;
this.csvAffiliatedPublications = this.downloadURLAPI+"?format=csv&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relorganizationid exact \""+this.organizationId+"\"))"; this.csvAffiliatedPublications = this.downloadURLAPI + "?format=csv&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relorganizationid exact \"" + this.organizationId + "\"))";
this.csvProjectParamsHead = 'format=csv&type=projects&fq=( (oaftype exact project)and (funder exact "'; this.csvProjectParamsHead = 'format=csv&type=projects&fq=( (oaftype exact project)and (funder exact "';
//this.csvPublicationParamsHead = 'format=csv-special&type=publications&page=0&query=((((oaftype exact result) and (resulttypeid exact publication)) and (funderid exact '; //this.csvPublicationParamsHead = 'format=csv-special&type=publications&page=0&query=((((oaftype exact result) and (resulttypeid exact publication)) and (funderid exact ';
} }
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() { ngOnDestroy() {
if(this.sub){ if (this.sub) {
this.sub.unsubscribe(); this.sub.unsubscribe();
} }
if(this.piwiksub){ if (this.piwiksub) {
this.piwiksub.unsubscribe(); this.piwiksub.unsubscribe();
} }
if(this.infoSub) { if (this.infoSub) {
this.infoSub.unsubscribe(); this.infoSub.unsubscribe();
} }
if(this.downloadFileSub) { if (this.downloadFileSub) {
this.downloadFileSub.unsubscribe(); this.downloadFileSub.unsubscribe();
} }
if(this.downloadFilePiwikSub) { if (this.downloadFilePiwikSub) {
this.downloadFilePiwikSub.unsubscribe(); this.downloadFilePiwikSub.unsubscribe();
} }
if(this.countProjectsSub) { if (this.countProjectsSub) {
this.countProjectsSub.unsubscribe(); this.countProjectsSub.unsubscribe();
} }
if(this.countPublSub) { if (this.countPublSub) {
this.countPublSub.unsubscribe(); this.countPublSub.unsubscribe();
} }
if(this.downloadProjectPublSub) { if (this.downloadProjectPublSub) {
this.downloadProjectPublSub.unsubscribe(); this.downloadProjectPublSub.unsubscribe();
} }
@ -186,35 +203,35 @@ export class OrganizationComponent {
*/ */
} }
private getOrganizationInfo () { private getOrganizationInfo() {
this.warningMessage = ''; this.warningMessage = '';
this.errorMessage="" this.errorMessage = ""
this.showLoading = true; this.showLoading = true;
this.organizationInfo = null; this.organizationInfo = null;
this.infoSub = this._organizationService.getOrganizationInfo(this.organizationId, this.properties).subscribe( this.infoSub = this._organizationService.getOrganizationInfo(this.organizationId, this.properties).subscribe(
data => { data => {
if(data == null) { if (data == null) {
this.showLoading = false; this.showLoading = false;
this.errorMessage = 'No organization found'; this.errorMessage = 'No organization found';
} else { } else {
this.organizationInfo = data; this.organizationInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this.properties.searchLinkToOrganization + this.organizationInfo.objIdentifier); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrganization + this.organizationInfo.objIdentifier);
this.updateTitle(this.organizationInfo.title.name); this.updateTitle(this.organizationInfo.title.name);
this.updateDescription("Organization, country, "+this.organizationInfo.title.name +((this.organizationInfo.title.name && this.organizationInfo.title.name != this.organizationInfo.name)?(", "+this.organizationInfo.name):"") ); this.updateDescription("Organization, country, " + this.organizationInfo.title.name + ((this.organizationInfo.title.name && this.organizationInfo.title.name != this.organizationInfo.name) ? (", " + this.organizationInfo.name) : ""));
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.organizationInfo.title.name, this.piwikSiteId).subscribe(); this.piwiksub = this._piwikService.trackView(this.properties, this.organizationInfo.title.name, this.piwikSiteId).subscribe();
} }
var refineFields:string [] = ["funder"]; var refineFields: string [] = ["funder"];
//this.searchPublications(); //this.searchPublications();
this.fetchPublications.getNumForEntity("organization", this.organizationId, this.properties); this.fetchPublications.getNumForEntity("organization", this.organizationId, this.properties);
// this.fetchDatasets.getNumForEntity("organization", this.organizationId, this.properties); // this.fetchDatasets.getNumForEntity("organization", this.organizationId, this.properties);
this.fetchProjects.getResultsForOrganizations(this.organizationId, "", 1, 0,refineFields,this.properties); this.fetchProjects.getResultsForOrganizations(this.organizationId, "", 1, 0, refineFields, this.properties);
this.fetchDataproviders.getNumForEntity("organization", this.organizationId,this.properties); this.fetchDataproviders.getNumForEntity("organization", this.organizationId, this.properties);
this.showLoading = false; this.showLoading = false;
@ -233,7 +250,7 @@ export class OrganizationComponent {
}, },
err => { err => {
//console.log(err) //console.log(err)
this.handleError("Error getting organization for id: "+this.organizationId, err); this.handleError("Error getting organization for id: " + this.organizationId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrganizations); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrganizations);
this.errorMessage = 'No organization found'; this.errorMessage = 'No organization found';
this.showLoading = false; this.showLoading = false;
@ -241,7 +258,7 @@ export class OrganizationComponent {
); );
} }
/* /*
private handleClick(funder: string) { private handleClick(funder: string) {
if(this.emptyFundersSet) { if(this.emptyFundersSet) {
this.fundersSet.clear(); this.fundersSet.clear();
@ -263,13 +280,13 @@ export class OrganizationComponent {
console.info(funder+" funder added"); console.info(funder+" funder added");
} }
} }
*/ */
//private getProjectsData(key: string): any { //private getProjectsData(key: string): any {
//return this.projectsData; //return this.projectsData;
//} //}
private searchPublications() { private searchPublications() {
this.fetchPublications.getResultsForEntity("organization", this.organizationId, 1, 10,this.properties); this.fetchPublications.getResultsForEntity("organization", this.organizationId, 1, 10, this.properties);
this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications; this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications;
//if(this.fetchPublications.searchUtils.totalResults > 0) { //if(this.fetchPublications.searchUtils.totalResults > 0) {
this.reloadPublications = false; this.reloadPublications = false;
@ -286,7 +303,7 @@ export class OrganizationComponent {
// } // }
private searchDataproviders() { private searchDataproviders() {
this.fetchDataproviders.getResultsForEntity("organization", this.organizationId, 1, 10,this.properties); this.fetchDataproviders.getResultsForEntity("organization", this.organizationId, 1, 10, this.properties);
this.linkToSearchDataproviders = this.properties.searchLinkToAdvancedDataProviders; this.linkToSearchDataproviders = this.properties.searchLinkToAdvancedDataProviders;
//if(this.fetchDataproviders.searchUtils.totalResults > 0) { //if(this.fetchDataproviders.searchUtils.totalResults > 0) {
@ -298,7 +315,7 @@ export class OrganizationComponent {
} }
public searchPublicationsInit() { public searchPublicationsInit() {
if(this.reloadPublications && this.fetchPublications.searchUtils.totalResults > 0) { if (this.reloadPublications && this.fetchPublications.searchUtils.totalResults > 0) {
this.searchPublications(); this.searchPublications();
} }
} }
@ -310,12 +327,12 @@ export class OrganizationComponent {
// } // }
public searchDataprovidersInit() { public searchDataprovidersInit() {
if(this.reloadDataproviders && this.fetchDataproviders.searchUtils.totalResults > 0) { if (this.reloadDataproviders && this.fetchDataproviders.searchUtils.totalResults > 0) {
this.searchDataproviders(); this.searchDataproviders();
} }
} }
public downloadFile(url:string, filename: string){ public downloadFile(url: string, filename: string) {
this.openLoading(); this.openLoading();
this.setMessageLoading("Downloading CSV file"); this.setMessageLoading("Downloading CSV file");
@ -329,19 +346,19 @@ export class OrganizationComponent {
window.document.body.appendChild(a); window.document.body.appendChild(a);
a.setAttribute('style', 'display: none'); a.setAttribute('style', 'display: none');
a.href = url; a.href = url;
a.download = filename+".csv"; a.download = filename + ".csv";
a.click(); a.click();
window.URL.revokeObjectURL(url); window.URL.revokeObjectURL(url);
a.remove(); // remove the element a.remove(); // remove the element
//window.open(window.URL.createObjectURL(data)); //window.open(window.URL.createObjectURL(data));
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.downloadFilePiwikSub = this._piwikService.trackDownload(this.properties, url, this.piwikSiteId).subscribe(); this.downloadFilePiwikSub = this._piwikService.trackDownload(this.properties, url, this.piwikSiteId).subscribe();
} }
}, },
err => { err => {
//console.log("Error downloading the file."); //console.log("Error downloading the file.");
this.handleError("Error downloading file: "+filename+".csv", err); this.handleError("Error downloading file: " + filename + ".csv", err);
this.closeLoading(); this.closeLoading();
this.confirmOpenCsvError(); this.confirmOpenCsvError();
@ -350,7 +367,7 @@ export class OrganizationComponent {
); );
} }
private downloadPublicationsFile(funder: string, funderId:string, count:number){ private downloadPublicationsFile(funder: string, funderId: string, count: number) {
this.openLoading(); this.openLoading();
this.setMessageLoading("Downloading CSV file"); this.setMessageLoading("Downloading CSV file");
@ -364,26 +381,24 @@ export class OrganizationComponent {
let filename: string = 'funder-project-publications-report'; let filename: string = 'funder-project-publications-report';
this.countProjectsSub = this._searchProjectsService.getProjectsForOrganizations(this.organizationId,' and (funder exact "'+ funderId + '" ) ',1,count,[], this.properties).subscribe( this.countProjectsSub = this._searchProjectsService.getProjectsForOrganizations(this.organizationId, ' and (funder exact "' + funderId + '" ) ', 1, count, [], this.properties).subscribe(
data => data => {
{
projects = data[1]; projects = data[1];
for(let index=0; index < projects.length; index++) { for (let index = 0; index < projects.length; index++) {
this.countPublSub = this._searchPublicationsService.numOfEntityPublications(projects[index].id, "project", this.properties).subscribe( this.countPublSub = this._searchPublicationsService.numOfEntityPublications(projects[index].id, "project", this.properties).subscribe(
data => data => {
{
//if(data == 0 && title) { // if no publications for this project //if(data == 0 && title) { // if no publications for this project
if(data == 0 && (counter > 1 || title)) { // if no publications for this project if (data == 0 && (counter > 1 || title)) { // if no publications for this project
counter--; counter--;
response[index] = ""; response[index] = "";
//console.info("index: "+index, "counter: "+counter, "id:"+projects[index].id, response[index]); //console.info("index: "+index, "counter: "+counter, "id:"+projects[index].id, response[index]);
if(counter == 0) { if (counter == 0) {
//for(let i=count-1; i>=0; i--) { //for(let i=count-1; i>=0; i--) {
for(let i=0; i < projects.length; i++) { for (let i = 0; i < projects.length; i++) {
if(response[i] != "") { if (response[i] != "") {
if(i == title_index) { if (i == title_index) {
totalResponse = response[i]+totalResponse; totalResponse = response[i] + totalResponse;
} else { } else {
totalResponse += response[i]; totalResponse += response[i];
} }
@ -391,40 +406,39 @@ export class OrganizationComponent {
} }
this.closeLoading(); this.closeLoading();
var csvurl = window.URL.createObjectURL(new Blob([totalResponse], { type: 'text/csv' })); var csvurl = window.URL.createObjectURL(new Blob([totalResponse], {type: 'text/csv'}));
var a = window.document.createElement('a'); var a = window.document.createElement('a');
window.document.body.appendChild(a); window.document.body.appendChild(a);
a.setAttribute('style', 'display: none'); a.setAttribute('style', 'display: none');
a.href = csvurl; a.href = csvurl;
a.download = filename+".csv"; a.download = filename + ".csv";
a.click(); a.click();
window.URL.revokeObjectURL(csvurl); window.URL.revokeObjectURL(csvurl);
a.remove(); // remove the element a.remove(); // remove the element
} }
} else { } else {
let url: string; let url: string;
if(!title) { if (!title) {
title_index = index; title_index = index;
//console.info(title_index); //console.info(title_index);
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 + "\"))"
} else { } else {
url = this.downloadURLAPI+"?format=csv-special-notitle&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact \""+projects[index].id+"\"))" url = this.downloadURLAPI + "?format=csv-special-notitle&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact \"" + projects[index].id + "\"))"
} }
title = true; title = true;
this.downloadProjectPublSub = this._reportsService.getCSVResponse(url).subscribe( this.downloadProjectPublSub = this._reportsService.getCSVResponse(url).subscribe(
data => data => {
{
counter--; counter--;
response[index] = data; response[index] = data;
//console.info("index: "+index, "counter: "+counter, "id:"+projects[index].id, response[index]); //console.info("index: "+index, "counter: "+counter, "id:"+projects[index].id, response[index]);
if(counter == 0) { if (counter == 0) {
//for(let i=count-1; i>=0; i--) { //for(let i=count-1; i>=0; i--) {
for(let i=0; i < projects.length; i++) { for (let i = 0; i < projects.length; i++) {
if(response[i] != "") { if (response[i] != "") {
if(i == title_index) { if (i == title_index) {
totalResponse = response[i]+totalResponse; totalResponse = response[i] + totalResponse;
} else { } else {
totalResponse += response[i]; totalResponse += response[i];
} }
@ -432,19 +446,19 @@ export class OrganizationComponent {
} }
this.closeLoading(); this.closeLoading();
var csvurl = window.URL.createObjectURL(new Blob([totalResponse], { type: 'text/csv' })); var csvurl = window.URL.createObjectURL(new Blob([totalResponse], {type: 'text/csv'}));
var a = window.document.createElement('a'); var a = window.document.createElement('a');
window.document.body.appendChild(a); window.document.body.appendChild(a);
a.setAttribute('style', 'display: none'); a.setAttribute('style', 'display: none');
a.href = csvurl; a.href = csvurl;
a.download = filename+".csv"; a.download = filename + ".csv";
a.click(); a.click();
window.URL.revokeObjectURL(csvurl); window.URL.revokeObjectURL(csvurl);
a.remove(); // remove the element a.remove(); // remove the element
} }
}, },
err => { err => {
this.handleError("Error downloading file: "+filename, err); this.handleError("Error downloading file: " + filename, err);
this.closeLoading(); this.closeLoading();
this.confirmOpenCsvError(); this.confirmOpenCsvError();
@ -454,12 +468,12 @@ export class OrganizationComponent {
} }
}, },
err => { err => {
this.handleError("Error getting number of publications for project with id: "+projects[index].id, err); this.handleError("Error getting number of publications for project with id: " + projects[index].id, err);
}); });
} }
}, },
err => { err => {
this.handleError("Error getting projects for organization with id: "+this.organizationId, err); this.handleError("Error getting projects for organization with id: " + this.organizationId, err);
this.closeLoading(); this.closeLoading();
this.confirmOpenCsvError(); this.confirmOpenCsvError();
@ -467,37 +481,41 @@ export class OrganizationComponent {
); );
} }
private updateDescription(description:string) { private updateDescription(description: string) {
this._meta.updateTag({content:description},"name='description'"); this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content:description},"property='og:description'"); this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title:string){
var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._title.setTitle(_title);
this._meta.updateTag({content:_title},"property='og:title'");
}
private updateUrl(url:string){
this._meta.updateTag({content:url},"property='og:url'");
} }
private openLoading(){ private updateTitle(title: string) {
if(this.loading){ var _prefix = "OpenAIRE | ";
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title);
this._meta.updateTag({content: _title}, "property='og:title'");
}
private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
private openLoading() {
if (this.loading) {
this.loading.open(); this.loading.open();
} }
} }
private closeLoading(){
if(this.loading){ private closeLoading() {
if (this.loading) {
this.loading.close(); this.loading.close();
} }
} }
private setMessageLoading(message: string){
if(this.loading){ private setMessageLoading(message: string) {
if (this.loading) {
this.loading.message = message; this.loading.message = message;
} }
} }
public confirmOpenApplyAll(funder: string, funderId:string, funderCountPublications:number){ public confirmOpenApplyAll(funder: string, funderId: string, funderCountPublications: number) {
this.alertApplyAll.cancelButton = true; this.alertApplyAll.cancelButton = true;
this.alertApplyAll.okButton = true; this.alertApplyAll.okButton = true;
this.alertApplyAll.alertTitle = "CSV FILE"; this.alertApplyAll.alertTitle = "CSV FILE";
@ -510,11 +528,12 @@ export class OrganizationComponent {
this.funderId = funderId; this.funderId = funderId;
this.funderCountPublications = funderCountPublications; this.funderCountPublications = funderCountPublications;
} }
public confirmCloseApplyAll(data){
public confirmCloseApplyAll(data) {
this.downloadPublicationsFile(this.funder, this.funderId, this.funderCountPublications); this.downloadPublicationsFile(this.funder, this.funderId, this.funderCountPublications);
} }
public confirmOpenCsvError(){ public confirmOpenCsvError() {
this.alertCsvError.cancelButton = false; this.alertCsvError.cancelButton = false;
this.alertCsvError.okButton = true; this.alertCsvError.okButton = true;
this.alertCsvError.alertTitle = "ERROR DOWNLOADING CSV FILE"; this.alertCsvError.alertTitle = "ERROR DOWNLOADING CSV FILE";
@ -528,6 +547,6 @@ export class OrganizationComponent {
} }
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Organizaton Landing Page: "+message, error); console.error("Organizaton Landing Page: " + message, error);
} }
} }

View File

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

View File

@ -2,18 +2,31 @@
<div uk-grid uk-grid> <div uk-grid uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first"> <div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first">
<div class="uk-container uk-margin-top orp"> <div class="uk-container uk-margin-top orp">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div> role="alert">{{warningMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div> <div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
<div *ngIf="orpInfo != null" uk-grid class="uk-grid-large"> <div *ngIf="orpInfo != null" uk-grid class="uk-grid-large">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div class="uk-width-expand@m uk-width-1-1@s"> <div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="orpInfo.record" [data]=orpInfo.record [URL]="properties.baseLink+'/search/orp?orpId='+orpId"></schema2jsonld> <schema2jsonld *ngIf="orpInfo.record" [data]=orpInfo.record
[URL]="properties.baseLink+'/search/orp?orpId='+orpId"></schema2jsonld>
<showTitle [titleName]="orpInfo.title"></showTitle> <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.types && orpInfo.types.length > 0" class="uk-label custom-label label-orp "
<span *ngIf="orpInfo.languages && orpInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{orpInfo.languages.join(", ")}}</span>{{" "}} title="Type">{{orpInfo.types.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.languages && orpInfo.languages.length > 0"
<span *ngIf="orpInfo.accessMode" [class]="'uk-label custom-label label-'+ orpInfo.accessMode " title="Access Mode">{{orpInfo.accessMode}}</span>{{" "}} class="uk-label custom-label label-language "
title="Language">{{orpInfo.languages.join(", ")}}</span>{{" "}}
<span *ngIf="orpInfo.countries && orpInfo.countries.length > 0"
class="uk-label custom-label label-country "
title="Country">{{orpInfo.countries.join(", ")}}</span>{{" "}}
<span *ngIf="orpInfo.accessMode" [class]="'uk-label custom-label label-'+ orpInfo.accessMode "
title="Access Mode">{{orpInfo.accessMode}}</span>{{" "}}
<span *ngIf="orpInfo.underCurationMessage" class="uk-label custom-label label-underCuration"> <span *ngIf="orpInfo.underCurationMessage" class="uk-label custom-label label-underCuration">
<span uk-tooltip="pos:right; delay:10" <span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}"> title="{{buildCurationTooltip()}}">
@ -22,7 +35,7 @@
</span> </span>
</span>{{" "}} </span>{{" "}}
<div class= " uk-margin-top"> <div class=" uk-margin-top">
<showAuthors [authors]="orpInfo.authors"></showAuthors> <showAuthors [authors]="orpInfo.authors"></showAuthors>
<span *ngIf="orpInfo.date != ''">({{orpInfo.date}})</span> <span *ngIf="orpInfo.date != ''">({{orpInfo.date}})</span>
</div> </div>
@ -30,7 +43,8 @@
<ul class="uk-list"> <ul class="uk-list">
<showPublisher [publisher]="orpInfo.publisher" <showPublisher [publisher]="orpInfo.publisher"
[journal]="orpInfo.journal" [properties]="properties"></showPublisher> [journal]="orpInfo.journal" [properties]="properties"></showPublisher>
<li *ngIf="orpInfo.embargoEndDate"><span class="uk-text-bold">Embargo end date:</span> {{orpInfo.embargoEndDate}}</li> <li *ngIf="orpInfo.embargoEndDate"><span
class="uk-text-bold">Embargo end date:</span> {{orpInfo.embargoEndDate}}</li>
<li *ngIf="orpInfo.identifiers && orpInfo.identifiers.size > 0"> <li *ngIf="orpInfo.identifiers && orpInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="orpInfo.identifiers"></showIdentifiers> <showIdentifiers [identifiers]="orpInfo.identifiers"></showIdentifiers>
</li> </li>
@ -42,16 +56,21 @@
</li> </li>
</ul> </ul>
<hr *ngIf="orpInfo.description"> <hr *ngIf="orpInfo.description">
<div *ngIf="orpInfo.description" class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto"> <div *ngIf="orpInfo.description"
class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<span>{{orpInfo.description.substring(0, showNumDescription)}}</span <span>{{orpInfo.description.substring(0, showNumDescription)}}</span
><span *ngIf="showNumDescription == thresholdDescription && orpInfo.description.length > thresholdDescription">...</span ><span
><span *ngIf="showNumDescription == thresholdDescription && orpInfo.description.length > thresholdDescription" class="uk-text-right"> *ngIf="showNumDescription == thresholdDescription && orpInfo.description.length > thresholdDescription">...</span
><span
*ngIf="showNumDescription == thresholdDescription && orpInfo.description.length > thresholdDescription"
class="uk-text-right">
<a (click)="showNumDescription = orpInfo.description.length;"> <a (click)="showNumDescription = orpInfo.description.length;">
View more View more
</a> </a>
</span> </span>
</div> </div>
<div *ngIf="orpInfo.description && showNumDescription > thresholdDescription" class="uk-width-1-1 uk-text-right"> <div *ngIf="orpInfo.description && showNumDescription > thresholdDescription"
class="uk-width-1-1 uk-text-right">
<a (click)="showNumDescription = thresholdDescription;"> <a (click)="showNumDescription = thresholdDescription;">
View less View less
</a> </a>
@ -65,11 +84,16 @@
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<div> <div>
<div *ngIf="orpInfo.references.length > pageSize" class="uk-margin-bottom"> <div *ngIf="orpInfo.references.length > pageSize" class="uk-margin-bottom">
<span class="uk-h6">{{orpInfo.references.length | number}} references, page {{referencesPage | number}} of {{totalPages(orpInfo.references.length) | number}}</span> <span class="uk-h6">{{orpInfo.references.length | number}}
<paging-no-load class="uk-float-right" [currentPage]="referencesPage" [totalResults]="orpInfo.references.length" [size]="pageSize" (pageChange)="updateReferencesPage($event)"></paging-no-load> references, page {{referencesPage | number}}
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>
<div *ngFor="let item of orpInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)"> <div
*ngFor="let item of orpInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
<p *ngIf=" item && item['url']" <p *ngIf=" item && item['url']"
class="custom-external custom-icon"> class="custom-external custom-icon">
<a href="{{item['url']}}" target="_blank"> <a href="{{item['url']}}" target="_blank">
@ -95,7 +119,8 @@
<div> <div>
<div *ngFor="let provenanceaction of getKeys(orpInfo.relatedResearchResults)"> <div *ngFor="let provenanceaction of getKeys(orpInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div> <div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [percentageName]="trust" [info]="orpInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable> <tabTable [percentageName]="trust" [info]="orpInfo.relatedResearchResults.get(provenanceaction)"
[(properties)]=properties></tabTable>
</div> </div>
</div> </div>
</div> </div>
@ -110,7 +135,8 @@
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<div> <div>
<tabTable [percentageName]="similarity" [info]="orpInfo.similarResearchResults" [(properties)]=properties></tabTable> <tabTable [percentageName]="similarity" [info]="orpInfo.similarResearchResults"
[(properties)]=properties></tabTable>
</div> </div>
</div> </div>
</li> </li>
@ -122,7 +148,7 @@
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<metrics [pageViews]="pageViews" <metrics [pageViews]="pageViews"
[id]="orpId" [entityType]="'results'" [entity]="'Other Research Product'" [id]="orpId" [entityType]="'results'" [entity]="'Other Research Product'"
(metricsResults)="metricsResults($event)" [(properties)] = properties> (metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics> </metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0" <i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250"> [url]=viewsFrameUrl width="100%" height="250">
@ -132,13 +158,15 @@
</i-frame> </i-frame>
</div> </div>
</li> </li>
<li (click)="activeTab='Other Versions'" *ngIf="properties.environment == 'development' && orpInfo.deletedByInferenceIds"> <li (click)="activeTab='Other Versions'"
*ngIf="properties.environment == 'development' && orpInfo.deletedByInferenceIds">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Other Versions Other Versions
({{orpInfo.deletedByInferenceIds.length | number}}) ({{orpInfo.deletedByInferenceIds.length | number}})
</a> </a>
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content"> <div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
<deletedByInference [id]="orpId" [ids]="orpInfo.deletedByInferenceIds" [type]="'other research products'"></deletedByInference> <deletedByInference [id]="orpId" [ids]="orpInfo.deletedByInferenceIds"
[type]="'other research products'"></deletedByInference>
</div> </div>
</li> </li>
</ul> </ul>
@ -161,15 +189,15 @@
<fundedBy [fundedByProjects]="orpInfo.fundedByProjects"></fundedBy> <fundedBy [fundedByProjects]="orpInfo.fundedByProjects"></fundedBy>
</li> </li>
<li *ngIf="orpInfo.contexts && orpInfo.contexts.length >0 "> <li *ngIf="orpInfo.contexts && orpInfo.contexts.length >0 ">
<dl class="uk-description-list-line" > <dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to </dt> <dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of orpInfo.contexts"> <dd class="line" *ngFor="let item of orpInfo.contexts">
<span *ngIf = "!item['inline']" > <span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span> <span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span> <span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span> </span>
<mark *ngIf = "item['inline']" > <mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span> <span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span> <span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
@ -188,37 +216,65 @@
</li> </li>
</ul> </ul>
<button *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-button portal-button uk-width-1-1 "> <button *ngIf="isRouteAvailable('participate/direct-claim') "
class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon"> <span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg> <svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
height="25"><path
d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path
d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none"
stroke="#000"
stroke-width="1.1"></path></svg>
</span> Link this product to... </span> Link this product to...
</button> </button>
<div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click" style="background: transparent <div *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;"> !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical"> <ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>"> <li uk-tooltip="pos: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" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
<span class="uk-icon" > [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','project'])"
<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> 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> </a>
</li> </li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>"> <li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
<span class="uk-icon" > [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','context'])"
<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> 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> </a>
</li> </li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>"> <li uk-tooltip="pos:right;"
<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" > title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>">
<span class="uk-icon" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="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> [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> </a>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div> </div>
<!-- Claiming FAB --> <!-- Claiming FAB -->
<!--div class="uk-inline"> <!--div class="uk-inline">

View File

@ -1,9 +1,6 @@
import {Component, ViewChild} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser'; import {Meta, Title} from '@angular/platform-browser';
import {Observable} from 'rxjs';
import {OrpInfo} from '../../utils/entities/orpInfo'; import {OrpInfo} from '../../utils/entities/orpInfo';
import {EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
@ -11,8 +8,9 @@ import {RouterHelper} from '../../utils/routerHelper.class';
import {OrpService} from './orp.service'; import {OrpService} from './orp.service';
import {PiwikService} from '../../utils/piwik/piwik.service'; import {PiwikService} from '../../utils/piwik/piwik.service';
import { SEOService } from '../../sharedComponents/SEO/SEO.service'; import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({ @Component({
@ -22,8 +20,9 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class";
export class OrpComponent { export class OrpComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() communityId = null;
public orpInfo: OrpInfo; public orpInfo: OrpInfo;
public orpId : string ; public orpId: string;
// APP BOX variables // APP BOX variables
public showAllCollectedFrom: boolean = false; public showAllCollectedFrom: boolean = false;
@ -55,20 +54,25 @@ export class OrpComponent {
public warningMessage = ""; public warningMessage = "";
public errorMessage = ""; public errorMessage = "";
public showLoading: boolean = true; public showLoading: boolean = true;
public pageContents = null;
public divContents = null;
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
private result ; private result;
sub: any; piwiksub: any; infoSub: any; sub: any;
properties:EnvProperties; piwiksub: any;
infoSub: any;
properties: EnvProperties;
constructor (private _orpService: OrpService, constructor(private _orpService: OrpService,
private _piwikService:PiwikService, private _piwikService: PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private _meta: Meta, private _meta: Meta,
private _title: Title, private _title: Title,
private _router: Router, private _router: Router,
private helper: HelperService,
private seoService: SEOService) { private seoService: SEOService) {
} }
@ -76,7 +80,9 @@ export class OrpComponent {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url); //this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
}); });
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
@ -85,60 +91,81 @@ export class OrpComponent {
this.updateDescription(""); this.updateDescription("");
this.orpId = params['orpId']; this.orpId = params['orpId'];
if(this.orpId){ if (this.orpId) {
this.getOrpInfo(this.orpId); this.getOrpInfo(this.orpId);
}else{ } else {
this.showLoading = false; this.showLoading = false;
this.warningMessage="No valid research product id"; this.warningMessage = "No valid research product id";
} }
this.metricsClicked = false; 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.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.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(); 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() { ngOnDestroy() {
if(this.sub){ if (this.sub) {
this.sub.unsubscribe(); this.sub.unsubscribe();
} }
if(this.piwiksub){ if (this.piwiksub) {
this.piwiksub.unsubscribe(); this.piwiksub.unsubscribe();
} }
if(this.infoSub) { if (this.infoSub) {
this.infoSub.unsubscribe(); this.infoSub.unsubscribe();
} }
} }
private getOrpInfo(id:string) { private getOrpInfo(id: string) {
this.warningMessage = ''; this.warningMessage = '';
this.errorMessage="" this.errorMessage = ""
this.showLoading = true; this.showLoading = true;
this.orpInfo = null; this.orpInfo = null;
this.infoSub = this._orpService.getOrpInfo(id, this. properties).subscribe( this.infoSub = this._orpService.getOrpInfo(id, this.properties).subscribe(
data => { data => {
this.orpInfo = data; this.orpInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrp + this.orpInfo.record["result"]["header"]["dri:objIdentifier"]); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrp + this.orpInfo.record["result"]["header"]["dri:objIdentifier"]);
if(this.orpInfo.title){ if (this.orpInfo.title) {
this.updateTitle(this.orpInfo.title); this.updateTitle(this.orpInfo.title);
this.updateDescription((this.orpInfo.description?(this.orpInfo.description):(","+this.orpInfo.title))); this.updateDescription((this.orpInfo.description ? (this.orpInfo.description) : ("," + this.orpInfo.title)));
} }
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.orpInfo.title, this.piwikSiteId).subscribe(); this.piwiksub = this._piwikService.trackView(this.properties, this.orpInfo.title, this.piwikSiteId).subscribe();
} }
this.result = [] this.result = []
this.result = {id: id, type :"orp", source : "openaire", title: this.orpInfo.title,url: '', result: '', accessRights: this.orpInfo.accessMode, embargoEndDate: ''}; this.result = {
id: id,
type: "orp",
source: "openaire",
title: this.orpInfo.title,
url: '',
result: '',
accessRights: this.orpInfo.accessMode,
embargoEndDate: ''
};
let relatedResearchResultsNum = 0; let relatedResearchResultsNum = 0;
if(this.orpInfo.relatedResearchResults != undefined) { if (this.orpInfo.relatedResearchResults != undefined) {
this.orpInfo.relatedResearchResults.forEach(function (value, key, map) { this.orpInfo.relatedResearchResults.forEach(function (value, key, map) {
relatedResearchResultsNum += value.length; relatedResearchResultsNum += value.length;
}); });
@ -149,7 +176,7 @@ export class OrpComponent {
}, },
err => { err => {
//console.log(err) //console.log(err)
this.handleError("Error getting other research product for id: "+this.orpId, err); this.handleError("Error getting other research product for id: " + this.orpId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrps); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrps);
this.errorMessage = 'No research product found'; this.errorMessage = 'No research product found';
this.showLoading = false; this.showLoading = false;
@ -163,18 +190,20 @@ export class OrpComponent {
this.pageViews = $event.pageViews; this.pageViews = $event.pageViews;
} }
private updateDescription(description:string){ private updateDescription(description: string) {
this._meta.updateTag({content:description},"name='description'"); this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content:description},"property='og:description'"); this._meta.updateTag({content: description}, "property='og:description'");
} }
private updateTitle(title:string){
var _prefix ="OpenAIRE | "; private updateTitle(title: string) {
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _prefix = "OpenAIRE | ";
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title); this._title.setTitle(_title);
this._meta.updateTag({content:_title},"property='og:title'"); this._meta.updateTag({content: _title}, "property='og:title'");
} }
private updateUrl(url:string){
this._meta.updateTag({content:url},"property='og:url'"); private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
} }
public buildCurationTooltip() { public buildCurationTooltip() {
@ -185,7 +214,8 @@ export class OrpComponent {
return tooltipContent; return tooltipContent;
} }
public getKeys( map) {
public getKeys(map) {
return Array.from(map.keys()); return Array.from(map.keys());
} }
@ -194,7 +224,7 @@ export class OrpComponent {
} }
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Other Research Product Landing Page: "+message, error); console.error("Other Research Product Landing Page: " + message, error);
} }
public updateReferencesPage($event) { public updateReferencesPage($event) {
@ -202,16 +232,17 @@ export class OrpComponent {
} }
public totalPages(totalResults: number): number { public totalPages(totalResults: number): number {
let totalPages:any = totalResults/this.pageSize; let totalPages: any = totalResults / this.pageSize;
if(!(Number.isInteger(totalPages))) { if (!(Number.isInteger(totalPages))) {
totalPages = (parseInt(totalPages, this.pageSize) + 1); totalPages = (parseInt(totalPages, this.pageSize) + 1);
} }
return totalPages; return totalPages;
} }
isRouteAvailable(routeToCheck:string){
isRouteAvailable(routeToCheck: string) {
for (let i = 0; i < this.router.config.length; i++) { for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path; let routePath: string = this.router.config[i].path;
if(routePath == routeToCheck){ if (routePath == routeToCheck) {
return true; return true;
} }
} }

View File

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

View File

@ -1,15 +1,23 @@
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" > <div id="tm-main" class=" uk-section uk-margin-small-top tm-middle">
<div uk-grid uk-grid> <div uk-grid uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first "> <div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div id="project" class="uk-container uk-margin-top project"> <div id="project" class="uk-container uk-margin-top project">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div> role="alert">{{warningMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div> <div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
<div *ngIf="projectInfo != null" uk-grid class="uk-grid-large"> <div *ngIf="projectInfo != null" uk-grid class="uk-grid-large">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div class="uk-width-expand@m uk-width-1-1@s"> <div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="projectInfo" [data]=projectInfo [URL]="properties.baseLink+'/search/project?projectId='+projectId" type="project"></schema2jsonld> <schema2jsonld *ngIf="projectInfo" [data]=projectInfo
[URL]="properties.baseLink+'/search/project?projectId='+projectId"
type="project"></schema2jsonld>
<!--h3 *ngIf="projectInfo.acronym != undefined && projectInfo.acronym != ''">{{projectInfo.acronym}}</h3> <!--h3 *ngIf="projectInfo.acronym != undefined && projectInfo.acronym != ''">{{projectInfo.acronym}}</h3>
<h3 *ngIf="projectInfo.acronym == undefined || projectInfo.acronym == ''">{{projectInfo.title}}</h3--> <h3 *ngIf="projectInfo.acronym == undefined || projectInfo.acronym == ''">{{projectInfo.title}}</h3-->
<h2 class="projectIcon"> <h2 class="projectIcon">
@ -19,27 +27,41 @@
<span>{{projectName}}</span> <span>{{projectName}}</span>
<span *ngIf=" projectInfo.title == projectName ">({{projectInfo.contractNum}})</span> <span *ngIf=" projectInfo.title == projectName ">({{projectInfo.contractNum}})</span>
</h2> </h2>
<div class="uk-text-large " *ngIf="projectInfo.title && projectInfo.title != projectName ">{{projectInfo.title}} ({{projectInfo.contractNum}})</div> <div class="uk-text-large "
*ngIf="projectInfo.title && projectInfo.title != projectName ">{{projectInfo.title}}
({{projectInfo.contractNum}})
</div>
<div> <div>
<span class="uk-label custom-label label-blue label-project" title="Type">Project</span>{{" "}} <span class="uk-label custom-label label-blue label-project" title="Type">Project</span>{{" "}}
<span class="uk-label custom-label label-funder " title="Funder">{{projectInfo.funder}}</span>{{" "}} <span class="uk-label custom-label label-funder " title="Funder">{{projectInfo.funder}}</span>{{" "}}
<span *ngIf="projectInfo.openAccessMandatePublications != undefined && projectInfo.openAccessMandatePublications && projectInfo.openAccessMandateDatasets != undefined && projectInfo.openAccessMandateDatasets" <span
class="uk-label custom-label label-openaccessmandate " title="Open Access mandate for Publications and Research Data"> *ngIf="projectInfo.openAccessMandatePublications != undefined && projectInfo.openAccessMandatePublications && projectInfo.openAccessMandateDatasets != undefined && projectInfo.openAccessMandateDatasets"
class="uk-label custom-label label-openaccessmandate "
title="Open Access mandate for Publications and Research Data">
Open Access mandate for Publications and Research Data Open Access mandate for Publications and Research Data
</span>{{" "}} </span>{{" "}}
<span *ngIf="projectInfo.openAccessMandatePublications != undefined && projectInfo.openAccessMandatePublications && (projectInfo.openAccessMandateDatasets == undefined || !projectInfo.openAccessMandateDatasets)" <span
*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>{{" "}} 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.specialClause39" class="uk-label custom-label label-sc39 "
<span *ngIf="projectInfo.openAccessMandateDatasets != undefined && projectInfo.openAccessMandateDatasets && (projectInfo.openAccessMandatePublications == undefined || !projectInfo.openAccessMandatePublications)" 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>{{" "}} class="uk-label custom-label label-openaccessmandate " title="Open Access mandate for Research Data">Open Access mandate for Research Data</span>{{" "}}
</div> </div>
<ul class="uk-list"> <ul class="uk-list">
<li *ngIf="projectInfo.funding"><span class="uk-text-bold">Funding:</span> {{projectInfo.funding}}</li> <li *ngIf="projectInfo.funding"><span class="uk-text-bold">Funding:</span> {{projectInfo.funding}}</li>
<li *ngIf="projectInfo.startDate"><span class="uk-text-bold">Start Date:</span> {{projectInfo.startDate}}</li> <li *ngIf="projectInfo.startDate"><span class="uk-text-bold">Start Date:</span> {{projectInfo.startDate}}
</li>
<li *ngIf="projectInfo.endDate"><span class="uk-text-bold">End Date:</span> {{projectInfo.endDate}}</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
<li *ngIf="projectInfo.openAccessMandateDatasets != undefined && !projectInfo.openAccessMandateDatasets "><span class="uk-text-bold">Open Access mandate for Research Data:</span> no</li> *ngIf="projectInfo.openAccessMandatePublications != undefined && !projectInfo.openAccessMandatePublications ">
<span class="uk-text-bold">Open Access mandate for Publications:</span> no
</li>
<li *ngIf="projectInfo.openAccessMandateDatasets != undefined && !projectInfo.openAccessMandateDatasets ">
<span class="uk-text-bold">Open Access mandate for Research Data:</span> no
</li>
<li *ngIf="projectInfo.organizations && projectInfo.organizations.length > 0"><span class="uk-text-bold">Organization:</span> <li *ngIf="projectInfo.organizations && projectInfo.organizations.length > 0"><span class="uk-text-bold">Organization:</span>
<span class="list-horizontal-line"> <span class="list-horizontal-line">
@ -47,8 +69,9 @@
[attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'" [attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'"
[title]="organization.name"> [title]="organization.name">
<a *ngIf="organization.id" <a *ngIf="organization.id"
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization"> [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active"
{{(organization.acronym)?organization.acronym:''}} {{(!organization.acronym && organization.name)?organization.name:''}}</a> routerLink="/search/organization">
{{(organization.acronym) ? organization.acronym : ''}} {{(!organization.acronym && organization.name) ? organization.name : ''}}</a>
<span <span
*ngIf="!organization.id"> *ngIf="!organization.id">
@ -98,17 +121,19 @@
<!-- </span> --> <!-- </span> -->
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'" tab_error_class=true></errorMessages> <errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'"
tab_error_class=true></errorMessages>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.DONE"> <div *ngIf="fetchPublications.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" > <div class="uk-text-right" *ngIf="fetchPublications.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])" <a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications" class="uk-button uk-button-text"> routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications"
class="uk-button uk-button-text">
View all {{fetchPublications.searchUtils.totalResults | number}} results View all {{fetchPublications.searchUtils.totalResults | number}} results
</a> </a>
</div> </div>
<tab-result [(results)]="fetchPublications.results" <tab-result [(results)]="fetchPublications.results"
[(status)]= "fetchPublications.searchUtils.status" [(status)]="fetchPublications.searchUtils.status"
type="publication" urlParam="articleId"> type="publication" urlParam="articleId">
</tab-result> </tab-result>
</div> </div>
@ -123,18 +148,20 @@
<!-- </span> --> <!-- </span> -->
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<errorMessages [status]="[fetchDatasets.searchUtils.status]" [type]="'research data'" tab_error_class=true></errorMessages> <errorMessages [status]="[fetchDatasets.searchUtils.status]" [type]="'research data'"
tab_error_class=true></errorMessages>
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.DONE"> <div *ngIf="fetchDatasets.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10"> <div class="uk-text-right" *ngIf="fetchDatasets.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])" <a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchDatasets" class="uk-button uk-button-text"> routerLinkActive="router-link-active" [routerLink]="linkToSearchDatasets"
class="uk-button uk-button-text">
View all {{fetchDatasets.searchUtils.totalResults | number}} results View all {{fetchDatasets.searchUtils.totalResults | number}} results
</a> </a>
</div> </div>
<tab-result [(results)]="fetchDatasets.results" <tab-result [(results)]="fetchDatasets.results"
[(status)]= "fetchDatasets.searchUtils.status" [(status)]="fetchDatasets.searchUtils.status"
type="dataset" urlParam="datasetId"> type="dataset" urlParam="datasetId">
</tab-result> </tab-result>
</div> </div>
@ -149,18 +176,20 @@
<!-- </span> --> <!-- </span> -->
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<errorMessages [status]="[fetchSoftware.searchUtils.status]" [type]="'software'" tab_error_class=true></errorMessages> <errorMessages [status]="[fetchSoftware.searchUtils.status]" [type]="'software'"
tab_error_class=true></errorMessages>
<div *ngIf="fetchSoftware.searchUtils.status == errorCodes.DONE"> <div *ngIf="fetchSoftware.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchSoftware.searchUtils.totalResults > 10"> <div class="uk-text-right" *ngIf="fetchSoftware.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])" <a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchSoftware" class="uk-button uk-button-text"> routerLinkActive="router-link-active" [routerLink]="linkToSearchSoftware"
class="uk-button uk-button-text">
View all {{fetchSoftware.searchUtils.totalResults | number}} results View all {{fetchSoftware.searchUtils.totalResults | number}} results
</a> </a>
</div> </div>
<tab-result [(results)]="fetchSoftware.results" <tab-result [(results)]="fetchSoftware.results"
[(status)]= "fetchSoftware.searchUtils.status" [(status)]="fetchSoftware.searchUtils.status"
type="software" urlParam="softwareId"> type="software" urlParam="softwareId">
</tab-result> </tab-result>
</div> </div>
@ -175,18 +204,20 @@
<!-- </span> --> <!-- </span> -->
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<errorMessages [status]="[fetchOrps.searchUtils.status]" [type]="'other research products'" tab_error_class=true></errorMessages> <errorMessages [status]="[fetchOrps.searchUtils.status]" [type]="'other research products'"
tab_error_class=true></errorMessages>
<div *ngIf="fetchOrps.searchUtils.status == errorCodes.DONE"> <div *ngIf="fetchOrps.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchOrps.searchUtils.totalResults > 10"> <div class="uk-text-right" *ngIf="fetchOrps.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])" <a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchOrps" class="uk-button uk-button-text"> routerLinkActive="router-link-active" [routerLink]="linkToSearchOrps"
class="uk-button uk-button-text">
View all {{fetchOrps.searchUtils.totalResults | number}} results View all {{fetchOrps.searchUtils.totalResults | number}} results
</a> </a>
</div> </div>
<tab-result [(results)]="fetchOrps.results" <tab-result [(results)]="fetchOrps.results"
[(status)]= "fetchOrps.searchUtils.status" [(status)]="fetchOrps.searchUtils.status"
type="other" urlParam="orpId"> type="other" urlParam="orpId">
</tab-result> </tab-result>
</div> </div>
@ -198,9 +229,11 @@
Statistics Statistics
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status]" [type]="'statistics'" tab_error_class=true></errorMessages> <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
*ngIf="statsClicked && (fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE)">
<div> <div>
<p class="uk-text-bold">Research Results</p> <p class="uk-text-bold">Research Results</p>
@ -221,7 +254,7 @@
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<metrics [pageViews]="pageViews" <metrics [pageViews]="pageViews"
[id]="projectId" [entityType]="'projects'" [entity]="'Project'" [id]="projectId" [entityType]="'projects'" [entity]="'Project'"
(metricsResults)="metricsResults($event)" [(properties)] = properties> (metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics> </metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0" <i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250"> [url]=viewsFrameUrl width="100%" height="250">
@ -408,13 +441,14 @@
<div class="uk-width-large@m uk-width-1-1@s"> <div class="uk-width-large@m uk-width-1-1@s">
<div class="uk-card uk-card-default uk-padding-small"> <div class="uk-card uk-card-default uk-padding-small">
<div> <div>
Share - Bookmark<addThis ></addThis> Share - Bookmark
<addThis></addThis>
</div> </div>
<div class="uk-margin-medium-top uk-margin-medium-bottom"> <div class="uk-margin-medium-top uk-margin-medium-bottom">
<div class="uk-text-center uk-text-large"> <div class="uk-text-center uk-text-large">
Application Box Application Box
</div> </div>
<div class="app-box" > <div class="app-box">
<ul class="uk-tab" uk-tab="connect: #tab-app-box-project"> <ul class="uk-tab" uk-tab="connect: #tab-app-box-project">
<li> <li>
<a>Publications</a> <a>Publications</a>
@ -428,35 +462,64 @@
<!-- Publication box--> <!-- Publication box-->
<ul class="uk-list"> <ul class="uk-list">
<li> <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> <a class="clickable"
<div hidden id="publications_dynamic" class="widget-box uk-padding-small uk-card uk-card-default "> uk-toggle="target: #publications_dynamic; animation:uk-animation-fade"><span
<div class=" uk-alert uk-alert-primary uk-padding-small uk-margin-remove-bottom uk-margin-right"> 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> For further information please contact us <a href="mailto:helpdesk@openaire.eu">helpdesk@openaire.eu</a>
</div> </div>
<div class="uk-grid"> <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"> <a
<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> 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> </a>
</div> </div>
<pre class="box-content uk-padding-remove-bottom uk-margin-remove-bottom"><code id="publ_clipboard">{{publications_dynamic}}</code></pre> <pre class="box-content uk-padding-remove-bottom uk-margin-remove-bottom"><code
id="publ_clipboard">{{publications_dynamic}}</code></pre>
</div> </div>
</li> </li>
<li> <li>
<a target="_blank" <a target="_blank"
href="/project-report?projectId={{projectId}}&size={{fetchPublications.searchUtils.totalResults}}&type=publication"> 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) <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> </a>
</li> </li>
<li> <li>
<a class="clickable" (click)="downloadfile(downloadURLAPI+csvParams, 'funder-publications-report')"> <a class="clickable"
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span> Get {{projectInfo.funder}} report (CSV) (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> </a>
</li> </li>
<li *ngIf="isRouteAvailable('participate/deposit-publications') "> <li *ngIf="isRouteAvailable('participate/deposit-publications') ">
<a routerLinkActive="router-link-active" routerLink="/participate/deposit-publications"> <a routerLinkActive="router-link-active" routerLink="/participate/deposit-publications">
<span class="uk-icon"> <span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" 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> <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 </span> Deposit
</a> </a>
</li> </li>
@ -466,34 +529,61 @@
<!-- Dataset box--> <!-- Dataset box-->
<ul class="uk-list"> <ul class="uk-list">
<li> <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> <a class="clickable" uk-toggle="target: #datasets_dynamic; animation:uk-animation-fade"><span
<div hidden id="datasets_dynamic" class="widget-box uk-padding-small uk-card uk-card-default "> class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
<div class=" uk-alert uk-alert-primary uk-padding-small uk-margin-remove-bottom uk-margin-right"> 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> For further information please contact us <a href="mailto:helpdesk@openaire.eu">helpdesk@openaire.eu</a>
</div> </div>
<div class="uk-grid"> <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"> <a
<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> 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> </a>
</div> </div>
<pre class="box-content uk-padding-remove-bottom uk-margin-remove-bottom"><code id="datasets_clipboard">{{datasets_dynamic}}</code></pre> <pre class="box-content uk-padding-remove-bottom uk-margin-remove-bottom"><code
id="datasets_clipboard">{{datasets_dynamic}}</code></pre>
</div> </div>
</li> </li>
<li> <li>
<a target="_blank" <a target="_blank"
href="/project-report?projectId={{projectId}}&size={{fetchDatasets.searchUtils.totalResults}}&type=dataset"> 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) <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> </a>
</li> </li>
<li> <li>
<a class="clickable" (click)="downloadfile(downloadURLAPI+csvParamsDatasets, 'funder-research-data-report')"> <a class="clickable"
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span> Get {{projectInfo.funder}} report (CSV) (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> </a>
</li> </li>
<li *ngIf="isRouteAvailable('participate/deposit-datasets') "> <li *ngIf="isRouteAvailable('participate/deposit-datasets') ">
<a routerLinkActive="router-link-active" routerLink="/participate/deposit-datasets"> <a routerLinkActive="router-link-active" routerLink="/participate/deposit-datasets">
<span class="uk-icon"> <span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" 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> <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 </span> Deposit
</a> </a>
</li> </li>
@ -502,18 +592,33 @@
</ul> </ul>
</div> </div>
<button *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-button portal-button uk-margin-small-top uk-width-1-1"> <button *ngIf="isRouteAvailable('participate/direct-claim') "
class=" uk-button portal-button uk-margin-small-top uk-width-1-1">
<span class="uk-icon"> <span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg> <svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
height="25"><path
d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path
d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975"
fill="none" stroke="#000"
stroke-width="1.1"></path></svg>
</span> Link this project to... </span> Link this project to...
</button> </button>
<div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;" class=" uk-margin-remove-top uk-padding-small"> <div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click"
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"> <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>"> <li uk-tooltip="pos:right;"
<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" > title="<div class='tooltip-custom-font-size uk-margin-small'>Research results</div>">
<span class="uk-icon" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="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> [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> </a>
</li> </li>
@ -527,6 +632,8 @@
</metrics--> </metrics-->
</div> </div>
</div> </div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div> </div>
<modal-loading></modal-loading> <modal-loading></modal-loading>
<modal-alert #AlertModalCsvError></modal-alert> <modal-alert #AlertModalCsvError></modal-alert>
@ -557,7 +664,7 @@
</div> </div>
</div> </div>
</div--> </div-->
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,10 +1,6 @@
import {Component, ViewChild} from '@angular/core'; import {Component, Input, ViewChild} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
import {Params} from '@angular/router'; import {Meta, Title} from '@angular/platform-browser';
import {Title, Meta} from '@angular/platform-browser';
import {Observable} from 'rxjs';
import {ProjectService} from './project.service'; import {ProjectService} from './project.service';
import {ProjectInfo} from '../../utils/entities/projectInfo'; import {ProjectInfo} from '../../utils/entities/projectInfo';
@ -26,18 +22,20 @@ import {ErrorCodes} from '../../utils/properties/errorCodes'
import {PiwikService} from '../../utils/piwik/piwik.service'; import {PiwikService} from '../../utils/piwik/piwik.service';
import {EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
import { SEOService } from '../../sharedComponents/SEO/SEO.service'; import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({ @Component({
selector: 'project', selector: 'project',
templateUrl: 'project.component.html', templateUrl: 'project.component.html',
}) })
export class ProjectComponent{ export class ProjectComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() communityId = null;
public projectInfo: ProjectInfo; public projectInfo: ProjectInfo;
public projectId : string ; public projectId: string;
public projectName: string; public projectName: string;
// Metrics tab variables // Metrics tab variables
@ -60,7 +58,7 @@ export class ProjectComponent{
public software_dynamic: string; public software_dynamic: string;
public orps_dynamic: string; public orps_dynamic: string;
public project ; public project;
// CSV variables // CSV variables
public downloadURLAPI: string; public downloadURLAPI: string;
@ -84,26 +82,32 @@ export class ProjectComponent{
private reloadOrps: boolean = true; private reloadOrps: boolean = true;
// Variables for publications, research data, software tabs // Variables for publications, research data, software tabs
public fetchPublications : FetchPublications; public fetchPublications: FetchPublications;
public linkToSearchPublications = ""; public linkToSearchPublications = "";
public fetchDatasets : FetchDatasets; public fetchDatasets: FetchDatasets;
public linkToSearchDatasets = ""; public linkToSearchDatasets = "";
public fetchSoftware: FetchSoftware; public fetchSoftware: FetchSoftware;
public linkToSearchSoftware = ""; public linkToSearchSoftware = "";
public fetchOrps: FetchOrps; public fetchOrps: FetchOrps;
public linkToSearchOrps = ""; public linkToSearchOrps = "";
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
public errorCodes:ErrorCodes = new ErrorCodes(); public errorCodes: ErrorCodes = new ErrorCodes();
public pageContents = null;
public divContents = null;
@ViewChild (ModalLoading) loading : ModalLoading ; @ViewChild(ModalLoading) loading: ModalLoading;
// Alert box when something is wrong with CSV requests // Alert box when something is wrong with CSV requests
@ViewChild('AlertModalCsvError') alertCsvError; @ViewChild('AlertModalCsvError') alertCsvError;
sub: any; piwiksub: any; infoSub: any; downloadFilePiwikSub: any; sub: any;
properties:EnvProperties; piwiksub: any;
constructor ( private _projectService: ProjectService, infoSub: any;
private _piwikService:PiwikService, downloadFilePiwikSub: any;
properties: EnvProperties;
constructor(private _projectService: ProjectService,
private _piwikService: PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private _searchPublicationsService: SearchPublicationsService, private _searchPublicationsService: SearchPublicationsService,
@ -114,6 +118,7 @@ properties:EnvProperties;
private _meta: Meta, private _meta: Meta,
private _title: Title, private _title: Title,
private _router: Router, private _router: Router,
private helper: HelperService,
private seoService: SEOService) { private seoService: SEOService) {
} }
@ -121,13 +126,15 @@ properties:EnvProperties;
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url); //this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
}); });
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
this.metricsClicked = false; this.metricsClicked = false;
this.statsClicked = false; this.statsClicked = false;
this.fetchPublications = new FetchPublications( this._searchPublicationsService); this.fetchPublications = new FetchPublications(this._searchPublicationsService);
this.fetchDatasets = new FetchDatasets(this._searchDatasetsService); this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
this.fetchSoftware = new FetchSoftware(this._searchSoftwareService); this.fetchSoftware = new FetchSoftware(this._searchSoftwareService);
this.fetchOrps = new FetchOrps(this._searchOrpsService); this.fetchOrps = new FetchOrps(this._searchOrpsService);
@ -142,36 +149,48 @@ properties:EnvProperties;
var funder = params['funder']; var funder = params['funder'];
if(this.projectId){ if (this.projectId) {
this.getProjectInfo(this.projectId); this.getProjectInfo(this.projectId);
this.actionsAfterLoadId(); this.actionsAfterLoadId();
}else if(grantId && funder){ } else if (grantId && funder) {
this.getProjectInfoByGrantId(grantId,funder); this.getProjectInfoByGrantId(grantId, funder);
}else{ } else {
this.showLoading = false; this.showLoading = false;
this.warningMessage="No valid project id"; this.warningMessage = "No valid project id";
} }
this.downloadURLAPI = this.properties.csvAPIURL; this.downloadURLAPI = this.properties.csvAPIURL;
this.createClipboard(); this.createClipboard();
this.csvParams = "?format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact \""+this.projectId+"\"))"; this.csvParams = "?format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact \"" + this.projectId + "\"))";
this.csvParamsDatasets = "?format=csv-special&type=datasets&fq=(((oaftype exact result) and (resulttypeid exact dataset)) and (relprojectid exact \""+this.projectId+"\"))"; this.csvParamsDatasets = "?format=csv-special&type=datasets&fq=(((oaftype exact result) and (resulttypeid exact dataset)) and (relprojectid exact \"" + this.projectId + "\"))";
this.csvParamsSoftware = "?format=csv-special&type=software&fq=(((oaftype exact result) and (resulttypeid exact software)) and (relprojectid exact \""+this.projectId+"\"))"; this.csvParamsSoftware = "?format=csv-special&type=software&fq=(((oaftype exact result) and (resulttypeid exact software)) and (relprojectid exact \"" + this.projectId + "\"))";
this.csvParamsOrps = "?format=csv-special&type=other&fq=(((oaftype exact result) and (resulttypeid exact other)) and (relprojectid exact \""+this.projectId+"\"))"; this.csvParamsOrps = "?format=csv-special&type=other&fq=(((oaftype exact result) and (resulttypeid exact other)) and (relprojectid exact \"" + this.projectId + "\"))";
HelperFunctions.scroll(); HelperFunctions.scroll();
}); });
} }
actionsAfterLoadId(){ private getPageContents() {
this.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;
})
}
actionsAfterLoadId() {
this.publications_dynamic = this.publications_dynamic =
"<script type=\"text/javascript\">" "<script type=\"text/javascript\">"
+ "\n<!--" + "\n<!--"
+ "\ndocument.write('<div id=\"oa_widget\"></div>');" + "\ndocument.write('<div id=\"oa_widget\"></div>');"
+ "\ndocument.write('<script type=\"text/javascript\"" + "\ndocument.write('<script type=\"text/javascript\""
+ " src=\""+this.properties.widgetLink + " src=\"" + this.properties.widgetLink
+ this.projectId + "&type=publication\"></script>');" + this.projectId + "&type=publication\"></script>');"
+ "\n-->" + "\n-->"
+ "\n</script>"; + "\n</script>";
@ -181,7 +200,7 @@ actionsAfterLoadId(){
+ "\n<!--" + "\n<!--"
+ "\ndocument.write('<div id=\"oa_widget\"></div>');" + "\ndocument.write('<div id=\"oa_widget\"></div>');"
+ "\ndocument.write('<script type=\"text/javascript\"" + "\ndocument.write('<script type=\"text/javascript\""
+ " src=\""+this.properties.widgetLink + " src=\"" + this.properties.widgetLink
+ this.projectId + "&type=dataset\"></script>');" + this.projectId + "&type=dataset\"></script>');"
+ "\n-->" + "\n-->"
+ "\n</script>"; + "\n</script>";
@ -191,7 +210,7 @@ actionsAfterLoadId(){
+ "\n<!--" + "\n<!--"
+ "\ndocument.write('<div id=\"oa_widget\"></div>');" + "\ndocument.write('<div id=\"oa_widget\"></div>');"
+ "\ndocument.write('<script type=\"text/javascript\"" + "\ndocument.write('<script type=\"text/javascript\""
+ "\nsrc=\""+this.properties.widgetLink + "\nsrc=\"" + this.properties.widgetLink
+ this.projectId + "&type=software\"></script>');" + this.projectId + "&type=software\"></script>');"
+ "\n-->" + "\n-->"
+ "\n</script>"; + "\n</script>";
@ -201,7 +220,7 @@ actionsAfterLoadId(){
+ "\n<!--" + "\n<!--"
+ "\ndocument.write('<div id=\"oa_widget\"></div>');" + "\ndocument.write('<div id=\"oa_widget\"></div>');"
+ "\ndocument.write('<script type=\"text/javascript\"" + "\ndocument.write('<script type=\"text/javascript\""
+ "\nsrc=\""+this.properties.widgetLink + "\nsrc=\"" + this.properties.widgetLink
+ this.projectId + "&type=other\"></script>');" + this.projectId + "&type=other\"></script>');"
+ "\n-->" + "\n-->"
+ "\n</script>"; + "\n</script>";
@ -212,24 +231,25 @@ actionsAfterLoadId(){
this.fetchDatasets.getNumForEntity("project", this.projectId, this.properties); this.fetchDatasets.getNumForEntity("project", this.projectId, this.properties);
this.fetchSoftware.getNumForEntity("project", this.projectId, this.properties); this.fetchSoftware.getNumForEntity("project", this.projectId, this.properties);
this.fetchOrps.getNumForEntity("project", this.projectId, this.properties); this.fetchOrps.getNumForEntity("project", this.projectId, this.properties);
} }
ngOnDestroy() { ngOnDestroy() {
if(this.sub){ if (this.sub) {
this.sub.unsubscribe(); this.sub.unsubscribe();
} }
if(this.piwiksub){ if (this.piwiksub) {
this.piwiksub.unsubscribe(); this.piwiksub.unsubscribe();
} }
if(this.infoSub) { if (this.infoSub) {
this.infoSub.unsubscribe(); this.infoSub.unsubscribe();
} }
if(this.downloadFilePiwikSub) { if (this.downloadFilePiwikSub) {
this.downloadFilePiwikSub.unsubscribe(); this.downloadFilePiwikSub.unsubscribe();
} }
} }
private createClipboard() { private createClipboard() {
if(typeof window !== 'undefined') { if (typeof window !== 'undefined') {
let publ_clipboard, datasets_clipboard, software_clipboard, orps_clipboard; let publ_clipboard, datasets_clipboard, software_clipboard, orps_clipboard;
let Clipboard; let Clipboard;
@ -273,38 +293,38 @@ actionsAfterLoadId(){
} }
public searchPublicationsInit() { public searchPublicationsInit() {
if(this.reloadPublications && this.fetchPublications.searchUtils.totalResults > 0) { if (this.reloadPublications && this.fetchPublications.searchUtils.totalResults > 0) {
this.searchPublications(); this.searchPublications();
} else if(this.fetchPublications.searchUtils.totalResults == 0) { } else if (this.fetchPublications.searchUtils.totalResults == 0) {
//this.statsClicked=true; //this.statsClicked=true;
//this.activeTab = "Statistics"; //this.activeTab = "Statistics";
} }
} }
public searchDatasetsInit() { public searchDatasetsInit() {
if(this.reloadDatasets && this.fetchDatasets.searchUtils.totalResults > 0) { if (this.reloadDatasets && this.fetchDatasets.searchUtils.totalResults > 0) {
this.searchDatasets(); this.searchDatasets();
} else if(this.fetchDatasets.searchUtils.totalResults == 0) { } else if (this.fetchDatasets.searchUtils.totalResults == 0) {
//this.statsClicked=true; //this.statsClicked=true;
//this.activeTab = "Statistics"; //this.activeTab = "Statistics";
} }
} }
public searchSoftwareInit() { public searchSoftwareInit() {
if(this.reloadSoftware && this.fetchSoftware.searchUtils.totalResults > 0) { if (this.reloadSoftware && this.fetchSoftware.searchUtils.totalResults > 0) {
this.searchSoftware(); this.searchSoftware();
} }
} }
public searchOrpsInit() { public searchOrpsInit() {
if(this.reloadOrps && this.fetchOrps.searchUtils.totalResults > 0) { if (this.reloadOrps && this.fetchOrps.searchUtils.totalResults > 0) {
this.searchOrps(); this.searchOrps();
} }
} }
private getProjectInfo (id:string) { private getProjectInfo(id: string) {
this.warningMessage = ''; this.warningMessage = '';
this.errorMessage="" this.errorMessage = ""
this.showLoading = true; this.showLoading = true;
this.projectInfo = null; this.projectInfo = null;
@ -317,22 +337,23 @@ actionsAfterLoadId(){
}, },
err => { err => {
//console.log(err); //console.log(err);
this.handleError("Error getting project for id: "+this.projectId, err); this.handleError("Error getting project for id: " + this.projectId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToProjects); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToProjects);
this.errorMessage = 'No project found'; this.errorMessage = 'No project found';
this.showLoading = false; this.showLoading = false;
} }
); );
} }
private getProjectInfoByGrantId (grantId:string, funder:string) {
private getProjectInfoByGrantId(grantId: string, funder: string) {
this.warningMessage = ''; this.warningMessage = '';
this.errorMessage="" this.errorMessage = ""
this.showLoading = true; this.showLoading = true;
this.projectInfo = null; this.projectInfo = null;
this._projectService.getProjectInfoByGrantId(grantId,funder,this.properties).subscribe( this._projectService.getProjectInfoByGrantId(grantId, funder, this.properties).subscribe(
data =>{ data => {
this.projectInfo = data; this.projectInfo = data;
@ -342,39 +363,49 @@ actionsAfterLoadId(){
}, },
err => { err => {
//console.log(err); //console.log(err);
this.handleError("Error getting project for grant id: "+grantId+" and funder: "+funder, err); this.handleError("Error getting project for grant id: " + grantId + " and funder: " + funder, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToProjects); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToProjects);
this.errorMessage = 'No project found'; this.errorMessage = 'No project found';
this.showLoading = false; this.showLoading = false;
} }
); );
} }
actionsAfterGettingProjectInfo(){
actionsAfterGettingProjectInfo() {
this.projectName = this.projectInfo.acronym; this.projectName = this.projectInfo.acronym;
if(this.projectName == undefined || this.projectName == '') { if (this.projectName == undefined || this.projectName == '') {
this.projectName = this.projectInfo.title; this.projectName = this.projectInfo.title;
} }
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url);
this.updateTitle(this.projectName); this.updateTitle(this.projectName);
this.updateDescription("project, "+this.projectName+ ","+this.projectInfo.funder+","+this.projectInfo.acronym); this.updateDescription("project, " + this.projectName + "," + this.projectInfo.funder + "," + this.projectInfo.acronym);
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.projectName, this.piwikSiteId).subscribe(); this.piwiksub = this._piwikService.trackView(this.properties, this.projectName, this.piwikSiteId).subscribe();
} }
this.project= { funderId: "", funderName: this.projectInfo.funder, projectId: this.projectId, projectName: this.projectInfo.title, projectAcronym: this.projectInfo.acronym, startDate: this.projectInfo.startDate, endDate: this.projectInfo.endDate }; this.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.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'; 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 //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.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.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.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.showLoading = false;
} }
public downloadfile(url:string, filename: string){
public downloadfile(url: string, filename: string) {
this.openLoading(); this.openLoading();
this.setMessageLoading("Downloading CSV file"); this.setMessageLoading("Downloading CSV file");
@ -387,19 +418,19 @@ actionsAfterGettingProjectInfo(){
window.document.body.appendChild(a); window.document.body.appendChild(a);
a.setAttribute('style', 'display: none'); a.setAttribute('style', 'display: none');
a.href = url; a.href = url;
a.download = filename+".csv"; a.download = filename + ".csv";
a.click(); a.click();
window.URL.revokeObjectURL(url); window.URL.revokeObjectURL(url);
a.remove(); // remove the element a.remove(); // remove the element
//window.open(window.URL.createObjectURL(data)); //window.open(window.URL.createObjectURL(data));
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.downloadFilePiwikSub = this._piwikService.trackDownload(this.properties, url).subscribe(); this.downloadFilePiwikSub = this._piwikService.trackDownload(this.properties, url).subscribe();
} }
}, },
error => { error => {
//console.log("Error downloading the file."); //console.log("Error downloading the file.");
this.handleError("Error downloading file: "+filename, error); this.handleError("Error downloading file: " + filename, error);
this.closeLoading(); this.closeLoading();
this.confirmOpenCsvError(); this.confirmOpenCsvError();
@ -408,7 +439,7 @@ actionsAfterGettingProjectInfo(){
); );
} }
/* /*
showHTML(){ showHTML(){
let info:string = "<h1>Publications of Project "; let info:string = "<h1>Publications of Project ";
@ -444,44 +475,48 @@ actionsAfterGettingProjectInfo(){
funct(data) { funct(data) {
var win = window.open(window.URL.createObjectURL(data)); var win = window.open(window.URL.createObjectURL(data));
} }
*/ */
public metricsResults($event) { public metricsResults($event) {
this.totalViews = $event.totalViews; this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads; this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews; this.pageViews = $event.pageViews;
} }
private updateDescription(description:string) { private updateDescription(description: string) {
this._meta.updateTag({content:description},"name='description'"); this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content:description},"property='og:description'"); this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title:string) {
var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._title.setTitle(_title);
this._meta.updateTag({content:_title},"property='og:title'");
}
private updateUrl(url:string) {
this._meta.updateTag({content:url},"property='og:url'");
} }
private openLoading(){ private updateTitle(title: string) {
if(this.loading){ var _prefix = "OpenAIRE | ";
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title);
this._meta.updateTag({content: _title}, "property='og:title'");
}
private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
private openLoading() {
if (this.loading) {
this.loading.open(); this.loading.open();
} }
} }
private closeLoading(){
if(this.loading){ private closeLoading() {
if (this.loading) {
this.loading.close(); this.loading.close();
} }
} }
private setMessageLoading(message: string){
if(this.loading){ private setMessageLoading(message: string) {
if (this.loading) {
this.loading.message = message; this.loading.message = message;
} }
} }
public confirmOpenCsvError(){ public confirmOpenCsvError() {
this.alertCsvError.cancelButton = false; this.alertCsvError.cancelButton = false;
this.alertCsvError.okButton = true; this.alertCsvError.okButton = true;
this.alertCsvError.alertTitle = "ERROR DOWNLOADING CSV FILE"; this.alertCsvError.alertTitle = "ERROR DOWNLOADING CSV FILE";
@ -491,12 +526,13 @@ actionsAfterGettingProjectInfo(){
} }
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Project Landing Page: "+message, error); console.error("Project Landing Page: " + message, error);
} }
isRouteAvailable(routeToCheck:string){
isRouteAvailable(routeToCheck: string) {
for (let i = 0; i < this.router.config.length; i++) { for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path; let routePath: string = this.router.config[i].path;
if(routePath == routeToCheck){ if (routePath == routeToCheck) {
return true; return true;
} }
} }

View File

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

View File

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

View File

@ -1,23 +1,38 @@
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" > <div id="tm-main" class=" uk-section uk-margin-small-top tm-middle">
<div uk-grid uk-grid> <div uk-grid uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first "> <div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container uk-margin-top publication"> <div class="uk-container uk-margin-top publication">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div> role="alert">{{warningMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div> <div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
<div *ngIf="publicationInfo != null" uk-grid class="uk-grid-large"> <div *ngIf="publicationInfo != null" uk-grid class="uk-grid-large">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div class="uk-width-expand@m uk-width-1-1@s"> <div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="publicationInfo.record" [data]=publicationInfo.record [URL]="properties.baseLink+'/search/publication?articleId='+articleId"></schema2jsonld> <schema2jsonld *ngIf="publicationInfo.record" [data]=publicationInfo.record
[URL]="properties.baseLink+'/search/publication?articleId='+articleId"></schema2jsonld>
<showTitle [titleName]="publicationInfo.title"></showTitle> <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.types && publicationInfo.types.length > 0"
<span *ngIf="publicationInfo.languages && publicationInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{publicationInfo.languages.join(", ")}}</span>{{" "}} class="uk-label custom-label label-blue label-publication"
<span *ngIf="publicationInfo.countries && publicationInfo.countries.length > 0" class="uk-label custom-label label-country " title="Country">{{publicationInfo.countries.join(", ")}}</span>{{" "}} title="Type">{{publicationInfo.types.join(", ")}}</span>{{" "}}
<span *ngIf="publicationInfo.languages && publicationInfo.languages.length > 0"
class="uk-label custom-label label-language "
title="Language">{{publicationInfo.languages.join(", ")}}</span>{{" "}}
<span *ngIf="publicationInfo.countries && publicationInfo.countries.length > 0"
class="uk-label custom-label label-country "
title="Country">{{publicationInfo.countries.join(", ")}}</span>{{" "}}
<!-- <span *ngIf="publicationInfo.title && publicationInfo.title.accessMode" [class]="'uk-label custom-label label-'+ publicationInfo.title.accessMode ">{{publicationInfo.title.accessMode}}</span> --> <!-- <span *ngIf="publicationInfo.title && publicationInfo.title.accessMode" [class]="'uk-label custom-label label-'+ publicationInfo.title.accessMode ">{{publicationInfo.title.accessMode}}</span> -->
<span *ngIf="publicationInfo.accessMode" [class]="'uk-label custom-label label-'+ publicationInfo.accessMode " title="Access Mode">{{publicationInfo.accessMode}}</span>{{" "}} <span *ngIf="publicationInfo.accessMode"
[class]="'uk-label custom-label label-'+ publicationInfo.accessMode "
title="Access Mode">{{publicationInfo.accessMode}}</span>{{" "}}
<span *ngIf="publicationInfo.underCurationMessage" class="uk-label custom-label label-underCuration" > <span *ngIf="publicationInfo.underCurationMessage" class="uk-label custom-label label-underCuration">
<span uk-tooltip="pos:right; delay:10" <span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}"> title="{{buildCurationTooltip()}}">
<i>Record in preview</i> <i>Record in preview</i>
@ -25,8 +40,7 @@
</span></span>{{" "}} </span></span>{{" "}}
<div class=" uk-margin-top">
<div class= " uk-margin-top">
<showAuthors [authors]="publicationInfo.authors"></showAuthors> <showAuthors [authors]="publicationInfo.authors"></showAuthors>
<span *ngIf="publicationInfo.date != ''">({{publicationInfo.date}})</span> <span *ngIf="publicationInfo.date != ''">({{publicationInfo.date}})</span>
</div> </div>
@ -34,11 +48,13 @@
<ul class="uk-list"> <ul class="uk-list">
<showPublisher [publisher]="publicationInfo.publisher" <showPublisher [publisher]="publicationInfo.publisher"
[journal]="publicationInfo.journal" [properties]="properties"></showPublisher> [journal]="publicationInfo.journal" [properties]="properties"></showPublisher>
<li *ngIf="publicationInfo.embargoEndDate"><span class="uk-text-bold">Embargo end date:</span> {{publicationInfo.embargoEndDate}}</li> <li *ngIf="publicationInfo.embargoEndDate"><span
class="uk-text-bold">Embargo end date:</span> {{publicationInfo.embargoEndDate}}</li>
<li *ngIf="publicationInfo.identifiers && publicationInfo.identifiers.size > 0"> <li *ngIf="publicationInfo.identifiers && publicationInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="publicationInfo.identifiers"></showIdentifiers> <showIdentifiers [identifiers]="publicationInfo.identifiers"></showIdentifiers>
</li> </li>
<li *ngIf="publicationInfo.subjects || publicationInfo.otherSubjects || publicationInfo.classifiedSubjects"> <li
*ngIf="publicationInfo.subjects || publicationInfo.otherSubjects || publicationInfo.classifiedSubjects">
<showSubjects [subjects]="publicationInfo.subjects" <showSubjects [subjects]="publicationInfo.subjects"
[otherSubjects]="publicationInfo.otherSubjects" [otherSubjects]="publicationInfo.otherSubjects"
[classifiedSubjects]="publicationInfo.classifiedSubjects"> [classifiedSubjects]="publicationInfo.classifiedSubjects">
@ -46,21 +62,26 @@
</li> </li>
</ul> </ul>
<hr *ngIf="publicationInfo.description"> <hr *ngIf="publicationInfo.description">
<div *ngIf="publicationInfo.description" class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto"> <div *ngIf="publicationInfo.description"
class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<span>{{publicationInfo.description.substring(0, showNumDescription)}}</span <span>{{publicationInfo.description.substring(0, showNumDescription)}}</span
><!--span *ngIf="showNumDescription > thresholdDescription"> ><!--span *ngIf="showNumDescription > thresholdDescription">
<a (click)="showNumDescription = thresholdDescription; scroll()"> <a (click)="showNumDescription = thresholdDescription; scroll()">
View less View less
</a> </a>
</span </span
--><span *ngIf="showNumDescription == thresholdDescription && publicationInfo.description.length > thresholdDescription">...</span --><span
><span *ngIf="showNumDescription == thresholdDescription && publicationInfo.description.length > thresholdDescription" class="uk-text-right"> *ngIf="showNumDescription == thresholdDescription && publicationInfo.description.length > thresholdDescription">...</span
><span
*ngIf="showNumDescription == thresholdDescription && publicationInfo.description.length > thresholdDescription"
class="uk-text-right">
<a (click)="showNumDescription = publicationInfo.description.length;"> <a (click)="showNumDescription = publicationInfo.description.length;">
View more View more
</a> </a>
</span> </span>
</div> </div>
<div *ngIf="publicationInfo.description && showNumDescription > thresholdDescription" class="uk-width-1-1 uk-text-right"> <div *ngIf="publicationInfo.description && showNumDescription > thresholdDescription"
class="uk-width-1-1 uk-text-right">
<!-- scroll() --> <!-- scroll() -->
<a (click)="showNumDescription = thresholdDescription;"> <a (click)="showNumDescription = thresholdDescription;">
View less View less
@ -68,9 +89,6 @@
</div> </div>
<ul class="custom-accordion" uk-accordion> <ul class="custom-accordion" uk-accordion>
<li *ngIf="publicationInfo.references" (click)="activeTab='References'"> <li *ngIf="publicationInfo.references" (click)="activeTab='References'">
@ -92,11 +110,16 @@
<div *ngIf="publicationInfo.references"> --> <div *ngIf="publicationInfo.references"> -->
<div> <div>
<div *ngIf="publicationInfo.references.length > pageSize" class="uk-margin-bottom"> <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> <span class="uk-h6">{{publicationInfo.references.length | number}}
<paging-no-load class="uk-float-right" [currentPage]="referencesPage" [totalResults]="publicationInfo.references.length" [size]="pageSize" (pageChange)="updateReferencesPage($event)"></paging-no-load> 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>
<div *ngFor="let item of publicationInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)"> <div
*ngFor="let item of publicationInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
<p *ngIf=" item && item['url']" <p *ngIf=" item && item['url']"
class="custom-external custom-icon"> class="custom-external custom-icon">
<a href="{{item['url']}}" target="_blank"> <a href="{{item['url']}}" target="_blank">
@ -131,7 +154,9 @@
<div *ngFor="let provenanceaction of getKeys(publicationInfo.relatedResearchResults)"> <div *ngFor="let provenanceaction of getKeys(publicationInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div> <div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [percentageName]="trust" [info]="publicationInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable> <tabTable [percentageName]="trust"
[info]="publicationInfo.relatedResearchResults.get(provenanceaction)"
[(properties)]=properties></tabTable>
</div> </div>
</div> </div>
</div> </div>
@ -155,7 +180,8 @@
<div *ngIf="publicationInfo.similarResearchResults"> --> <div *ngIf="publicationInfo.similarResearchResults"> -->
<div> <div>
<tabTable [percentageName]="similarity" [info]="publicationInfo.similarResearchResults" [(properties)]=properties></tabTable> <tabTable [percentageName]="similarity" [info]="publicationInfo.similarResearchResults"
[(properties)]=properties></tabTable>
</div> </div>
</div> </div>
</li> </li>
@ -178,16 +204,22 @@
<div *ngIf="publicationInfo.organizations"> --> <div *ngIf="publicationInfo.organizations"> -->
<div> <div>
<div *ngIf="publicationInfo.organizations.length > pageSize" class="uk-margin-bottom"> <div *ngIf="publicationInfo.organizations.length > pageSize" class="uk-margin-bottom">
<span class="uk-text-bold">{{publicationInfo.organizations.length | number}} organizations, page {{organizationsPage | number}} of {{totalPages(publicationInfo.organizations.length) | number}}</span> <span class="uk-text-bold">{{publicationInfo.organizations.length | number}}
<paging-no-load class="uk-float-right" [currentPage]="organizationsPage" [totalResults]="publicationInfo.organizations.length" [size]="pageSize" (pageChange)="updateOrganizationsPage($event)"></paging-no-load> organizations, page {{organizationsPage | number}}
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> </div>
<table class="uk-table uk-table-small uk-table-divider uk-table-middle "> <table class="uk-table uk-table-small uk-table-divider uk-table-middle ">
<tbody> <tbody>
<tr *ngFor="let organization of publicationInfo.organizations.slice((organizationsPage-1)*pageSize, organizationsPage*pageSize)"> <tr
*ngFor="let organization of publicationInfo.organizations.slice((organizationsPage-1)*pageSize, organizationsPage*pageSize)">
<td> <td>
<a *ngIf="(organization['id']) && ((organization['name']) || (organization['shortname']))" <a *ngIf="(organization['id']) && ((organization['name']) || (organization['shortname']))"
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization"> [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active"
routerLink="/search/organization">
{{organization['name']}} {{organization['name']}}
<span *ngIf="organization.name && organization.shortname"> ( </span> <span *ngIf="organization.name && organization.shortname"> ( </span>
<span *ngIf="organization.shortname">{{organization.shortname}}</span> <span *ngIf="organization.shortname">{{organization.shortname}}</span>
@ -205,9 +237,10 @@
</div> </div>
</td> </td>
<td> <td>
<div *ngIf="organization['trust']" title="{{organization['trust']}}%" > <div *ngIf="organization['trust']" title="{{organization['trust']}}%">
<div class="uk-text-center">{{organization['trust']}}%</div> <div class="uk-text-center">{{organization['trust']}}%</div>
<progress class="uk-progress uk-margin-remove" value="{{organization['trust']}}" max="100"></progress> <progress class="uk-progress uk-margin-remove" value="{{organization['trust']}}"
max="100"></progress>
</div> </div>
<div *ngIf="!organization['trust']"> <div *ngIf="!organization['trust']">
<p>no trust available</p> <p>no trust available</p>
@ -234,14 +267,18 @@
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<div *ngIf="publicationInfo.bioentities && bioentitiesNum > pageSize" class="uk-margin-bottom"> <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> <span class="uk-text-bold"> {{bioentitiesNum | number}}
<paging-no-load class="uk-float-right" [currentPage]="bioentitiesPage" [totalResults]="bioentitiesNum" [size]="pageSize" (pageChange)="updateBioentitiesPage($event)"></paging-no-load> 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> </div>
<table id="bioentitiesTable" class="uk-table "> <table id="bioentitiesTable" class="uk-table ">
<tbody> <tbody>
<ng-container *ngFor="let key of getKeys(publicationInfo.bioentities) let i=index"> <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)"> <tr
*ngFor="let keyIn of keysToArray(publicationInfo.bioentities.get(key)).slice((bioentitiesPage-1)*pageSize, bioentitiesPage*pageSize)">
<td class="uk-text-center" *ngIf="keyIn"> <td class="uk-text-center" *ngIf="keyIn">
<span class="custom-external custom-icon"> <span class="custom-external custom-icon">
<a href="{{publicationInfo.bioentities.get(key).get(keyIn)}}" <a href="{{publicationInfo.bioentities.get(key).get(keyIn)}}"
@ -272,14 +309,21 @@
<!-- </span> --> <!-- </span> -->
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<div *ngIf="publicationInfo.software && publicationInfo.software.length > pageSize" class="uk-margin-bottom"> <div *ngIf="publicationInfo.software && publicationInfo.software.length > pageSize"
<span class="uk-text-bold">{{publicationInfo.software.length | number}} software results, page {{softwarePage | number}} of {{totalPages(publicationInfo.software.length) | number}}</span> class="uk-margin-bottom">
<paging-no-load class="uk-float-right" [currentPage]="softwarePage" [totalResults]="publicationInfo.software.length" [size]="pageSize" (pageChange)="updateSoftwarePage($event)"></paging-no-load> <span class="uk-text-bold">{{publicationInfo.software.length | number}}
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> </div>
<table id="softwareTable" class="uk-table "> <table id="softwareTable" class="uk-table ">
<tbody> <tbody>
<tr *ngFor="let item of publicationInfo.software.slice((softwarePage-1)*pageSize, softwarePage*pageSize)" class="uk-text-center"> <tr
*ngFor="let item of publicationInfo.software.slice((softwarePage-1)*pageSize, softwarePage*pageSize)"
class="uk-text-center">
<td> <td>
<span class="custom-external custom-icon"> <span class="custom-external custom-icon">
<a href="{{item.url}}" target="_blank"> <a href="{{item.url}}" target="_blank">
@ -293,19 +337,25 @@
</div> </div>
</li> </li>
<li (click)="activeTab='Other Citations'" *ngIf="publicationInfo.openCitations && publicationInfo.openCitations.length > 0"> <li (click)="activeTab='Other Citations'"
*ngIf="publicationInfo.openCitations && publicationInfo.openCitations.length > 0">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Open Citations Open Citations
({{publicationInfo.openCitations.length | number}}) ({{publicationInfo.openCitations.length | number}})
</a> </a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<div *ngIf="publicationInfo.openCitations.length > pageSize" class="uk-margin-bottom"> <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> <span class="uk-h6">{{publicationInfo.openCitations.length | number}}
<paging-no-load class="uk-float-right" [currentPage]="openCitationsPage" [totalResults]="publicationInfo.openCitations.length" [size]="pageSize" (pageChange)="updateOpenCitationsPage($event)"></paging-no-load> 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> </div>
<ul class="uk-list uk-list-divider uk-margin"> <ul class="uk-list uk-list-divider uk-margin">
<li *ngFor="let result of publicationInfo.openCitations.slice((openCitationsPage-1)*pageSize, openCitationsPage*pageSize)"> <li
*ngFor="let result of publicationInfo.openCitations.slice((openCitationsPage-1)*pageSize, openCitationsPage*pageSize)">
<!-- <h5> <!-- <h5>
<span *ngIf="result.url" class="custom-external custom-icon" > <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']" [innerHTML]="result['title']"></a>
@ -343,7 +393,9 @@
({{result.year}}) ({{result.year}})
</span> </span>
</div> </div>
<span *ngIf="result.doi">Identifier: <a *ngIf="result.doi" target="_blank" class="custom-external custom-icon" href="{{doiURL}}{{result.doi}}">doi: {{result.doi}}</a></span> <span *ngIf="result.doi">Identifier: <a *ngIf="result.doi" target="_blank"
class="custom-external custom-icon"
href="{{doiURL}}{{result.doi}}">doi: {{result.doi}}</a></span>
</li> </li>
</ul> </ul>
</div> </div>
@ -356,7 +408,7 @@
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<metrics [pageViews]="pageViews" <metrics [pageViews]="pageViews"
[id]="articleId" [entityType]="'results'" [entity]="'Publication'" [id]="articleId" [entityType]="'results'" [entity]="'Publication'"
(metricsResults)="metricsResults($event)" [(properties)] = properties> (metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics> </metrics>
<!--i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="100%" height="250"></i-frame--> <!--i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="100%" height="250"></i-frame-->
<i-frame *ngIf="metricsClicked && totalViews>0" <i-frame *ngIf="metricsClicked && totalViews>0"
@ -368,13 +420,15 @@
</div> </div>
</li> </li>
<li (click)="activeTab='Other Versions'" *ngIf="properties.environment == 'development' && publicationInfo.deletedByInferenceIds"> <li (click)="activeTab='Other Versions'"
*ngIf="properties.environment == 'development' && publicationInfo.deletedByInferenceIds">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Other Versions Other Versions
({{publicationInfo.deletedByInferenceIds.length | number}}) ({{publicationInfo.deletedByInferenceIds.length | number}})
</a> </a>
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content"> <div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
<deletedByInference [id]="articleId" [ids]="publicationInfo.deletedByInferenceIds" [type]="'publications'"></deletedByInference> <deletedByInference [id]="articleId" [ids]="publicationInfo.deletedByInferenceIds"
[type]="'publications'"></deletedByInference>
</div> </div>
</li> </li>
</ul> </ul>
@ -383,7 +437,7 @@
<div class="uk-width-large@m uk-width-1-1@s"> <div class="uk-width-large@m uk-width-1-1@s">
<div class=" uk-padding-small"> <div class=" uk-padding-small">
<div > <div>
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div> <div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis></addThis> <addThis></addThis>
</div> </div>
@ -394,20 +448,21 @@
<li *ngIf="publicationInfo.hostedBy_collectedFrom && publicationInfo.hostedBy_collectedFrom.length > 0"> <li *ngIf="publicationInfo.hostedBy_collectedFrom && publicationInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="publicationInfo.hostedBy_collectedFrom"></availableOn> <availableOn [availableOn]="publicationInfo.hostedBy_collectedFrom"></availableOn>
</li> </li>
<li *ngIf="publicationInfo.fundedByProjects != undefined && publicationInfo.fundedByProjects.length > 0"> <li
*ngIf="publicationInfo.fundedByProjects != undefined && publicationInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="publicationInfo.fundedByProjects"></fundedBy> <fundedBy [fundedByProjects]="publicationInfo.fundedByProjects"></fundedBy>
</li> </li>
<li *ngIf="publicationInfo.contexts && publicationInfo.contexts.length >0 "> <li *ngIf="publicationInfo.contexts && publicationInfo.contexts.length >0 ">
<dl class="uk-description-list-line" > <dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to</dt> <dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of publicationInfo.contexts"> <dd class="line" *ngFor="let item of publicationInfo.contexts">
<span *ngIf = "!item['inline']" > <span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span> <span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span> <span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span> </span>
<mark *ngIf = "item['inline']" > <mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span> <span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span> <span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
@ -433,31 +488,59 @@
</li> </li>
</ul> </ul>
<button *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-button portal-button uk-width-1-1 "> <button *ngIf="isRouteAvailable('participate/direct-claim') "
class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon"> <span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg> <svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
height="25"><path
d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path
d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975"
fill="none" stroke="#000"
stroke-width="1.1"></path></svg>
</span> Link this publication to... </span> Link this publication to...
</button> </button>
<div *ngIf="isRouteAvailable('participate/direct-claim')" class=" uk-margin-remove-top uk-padding-small" <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;"> 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"> <ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>"> <li uk-tooltip="pos: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"> <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
<span class="uk-icon" > [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','project'])"
<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> 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> </a>
</li> </li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>"> <li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
<span class="uk-icon" > [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','context'])"
<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> 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> </a>
</li> </li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>"> <li uk-tooltip="pos:right;"
<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" > title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>">
<span class="uk-icon" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="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> [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> </a>
</li> </li>
@ -466,9 +549,11 @@
</div> </div>
</div> </div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

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

View File

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

View File

@ -1,24 +1,40 @@
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" > <div id="tm-main" class=" uk-section uk-margin-small-top tm-middle">
<div uk-grid uk-grid> <div uk-grid uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first "> <div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container uk-margin-top software"> <div class="uk-container uk-margin-top software">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div> role="alert">{{warningMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div> <div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
role="alert">{{errorMessage}}</div>
<div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
<div *ngIf="softwareInfo != null" uk-grid class="uk-grid-large"> <div *ngIf="softwareInfo != null" uk-grid class="uk-grid-large">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div class="uk-width-expand@m uk-width-1-1@s"> <div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="softwareInfo.record" [data]=softwareInfo.record [URL]="properties.baseLink+'/search/software?softwareId='+softwareId"></schema2jsonld> <schema2jsonld *ngIf="softwareInfo.record" [data]=softwareInfo.record
[URL]="properties.baseLink+'/search/software?softwareId='+softwareId"></schema2jsonld>
<showTitle [titleName]="softwareInfo.title"></showTitle> <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.types && softwareInfo.types.length > 0"
<span *ngIf="softwareInfo.programmingLanguages && softwareInfo.programmingLanguages.length > 0" class="uk-label custom-label label-progrLanguage " title="Programming Language">{{softwareInfo.programmingLanguages.join(", ")}}</span>{{" "}} class="uk-label custom-label label-software "
<span *ngIf="softwareInfo.languages && softwareInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{softwareInfo.languages.join(", ")}}</span>{{" "}} title="Type">{{softwareInfo.types.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.programmingLanguages && softwareInfo.programmingLanguages.length > 0"
class="uk-label custom-label label-progrLanguage "
title="Programming Language">{{softwareInfo.programmingLanguages.join(", ")}}</span>{{" "}}
<span *ngIf="softwareInfo.languages && softwareInfo.languages.length > 0"
class="uk-label custom-label label-language "
title="Language">{{softwareInfo.languages.join(", ")}}</span>{{" "}}
<span *ngIf="softwareInfo.countries && softwareInfo.countries.length > 0"
class="uk-label custom-label label-country "
title="Country">{{softwareInfo.countries.join(", ")}}</span>{{" "}}
<!-- <span *ngIf="softwareInfo.title && softwareInfo.title.accessMode" [class]="'uk-label custom-label label-'+ softwareInfo.title.accessMode " title="Access Mode">{{softwareInfo.title.accessMode}}</span> --> <!-- <span *ngIf="softwareInfo.title && softwareInfo.title.accessMode" [class]="'uk-label custom-label label-'+ softwareInfo.title.accessMode " title="Access Mode">{{softwareInfo.title.accessMode}}</span> -->
<span *ngIf="softwareInfo.accessMode" [class]="'uk-label custom-label label-'+ softwareInfo.accessMode " title="Access Mode">{{softwareInfo.accessMode}}</span>{{" "}} <span *ngIf="softwareInfo.accessMode" [class]="'uk-label custom-label label-'+ softwareInfo.accessMode "
<span *ngIf="softwareInfo.underCurationMessage" class="uk-label custom-label label-underCuration " > title="Access Mode">{{softwareInfo.accessMode}}</span>{{" "}}
<span *ngIf="softwareInfo.underCurationMessage" class="uk-label custom-label label-underCuration ">
<span uk-tooltip="pos:right; delay:10" <span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}"> title="{{buildCurationTooltip()}}">
<i>Record in preview</i> <i>Record in preview</i>
@ -32,7 +48,7 @@
</span> </span>
</div--> </div-->
<div class= " uk-margin-top"> <div class=" uk-margin-top">
<showAuthors [authors]="softwareInfo.authors"></showAuthors> <showAuthors [authors]="softwareInfo.authors"></showAuthors>
<span *ngIf="softwareInfo.date != ''">({{softwareInfo.date}})</span> <span *ngIf="softwareInfo.date != ''">({{softwareInfo.date}})</span>
</div> </div>
@ -41,7 +57,8 @@
<showPublisher [publisher]="softwareInfo.publisher" [properties]="properties" <showPublisher [publisher]="softwareInfo.publisher" [properties]="properties"
[journal]="softwareInfo.journal"></showPublisher> [journal]="softwareInfo.journal"></showPublisher>
<li *ngIf="softwareInfo.embargoEndDate"><span class="uk-text-bold">Embargo end date:</span> {{softwareInfo.embargoEndDate}}</li> <li *ngIf="softwareInfo.embargoEndDate"><span
class="uk-text-bold">Embargo end date:</span> {{softwareInfo.embargoEndDate}}</li>
<li *ngIf="softwareInfo.identifiers && softwareInfo.identifiers.size > 0"> <li *ngIf="softwareInfo.identifiers && softwareInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="softwareInfo.identifiers"></showIdentifiers> <showIdentifiers [identifiers]="softwareInfo.identifiers"></showIdentifiers>
</li> </li>
@ -52,17 +69,22 @@
</showSubjects> </showSubjects>
</li> </li>
</ul> </ul>
<hr *ngIf="softwareInfo.description" > <hr *ngIf="softwareInfo.description">
<div *ngIf="softwareInfo.description" class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto"> <div *ngIf="softwareInfo.description"
class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
<span>{{softwareInfo.description.substring(0, showNumDescription)}}</span <span>{{softwareInfo.description.substring(0, showNumDescription)}}</span
><span *ngIf="showNumDescription == thresholdDescription && softwareInfo.description.length > thresholdDescription">...</span ><span
><span *ngIf="showNumDescription == thresholdDescription && softwareInfo.description.length > thresholdDescription" class="uk-text-right"> *ngIf="showNumDescription == thresholdDescription && softwareInfo.description.length > thresholdDescription">...</span
><span
*ngIf="showNumDescription == thresholdDescription && softwareInfo.description.length > thresholdDescription"
class="uk-text-right">
<a (click)="showNumDescription = softwareInfo.description.length;"> <a (click)="showNumDescription = softwareInfo.description.length;">
View more View more
</a> </a>
</span> </span>
</div> </div>
<div *ngIf="softwareInfo.description && showNumDescription > thresholdDescription" class="uk-width-1-1 uk-text-right"> <div *ngIf="softwareInfo.description && showNumDescription > thresholdDescription"
class="uk-width-1-1 uk-text-right">
<a (click)="showNumDescription = thresholdDescription;"> <a (click)="showNumDescription = thresholdDescription;">
View less View less
</a> </a>
@ -115,7 +137,9 @@
<div *ngFor="let provenanceaction of getKeys(softwareInfo.relatedResearchResults)"> <div *ngFor="let provenanceaction of getKeys(softwareInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div> <div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [percentageName]="trust" [info]="softwareInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable> <tabTable [percentageName]="trust"
[info]="softwareInfo.relatedResearchResults.get(provenanceaction)"
[(properties)]=properties></tabTable>
</div> </div>
</div> </div>
</div> </div>
@ -139,7 +163,8 @@
<div *ngIf="softwareInfo.similarResearchResults"> --> <div *ngIf="softwareInfo.similarResearchResults"> -->
<div> <div>
<tabTable [percentageName]="similarity" [info]="softwareInfo.similarResearchResults" [(properties)]=properties></tabTable> <tabTable [percentageName]="similarity" [info]="softwareInfo.similarResearchResults"
[(properties)]=properties></tabTable>
</div> </div>
</div> </div>
</li> </li>
@ -151,7 +176,7 @@
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<metrics [pageViews]="pageViews" <metrics [pageViews]="pageViews"
[id]="softwareId" [entityType]="'results'" [entity]="'Software'" [id]="softwareId" [entityType]="'results'" [entity]="'Software'"
(metricsResults)="metricsResults($event)" [(properties)] = properties> (metricsResults)="metricsResults($event)" [(properties)]=properties>
</metrics> </metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0" <i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250"> [url]=viewsFrameUrl width="100%" height="250">
@ -162,13 +187,15 @@
</div> </div>
</li> </li>
<li (click)="activeTab='Other Versions'" *ngIf="properties.environment == 'development' && softwareInfo.deletedByInferenceIds"> <li (click)="activeTab='Other Versions'"
*ngIf="properties.environment == 'development' && softwareInfo.deletedByInferenceIds">
<a class="uk-accordion-title" href="#"> <a class="uk-accordion-title" href="#">
Other Versions Other Versions
({{softwareInfo.deletedByInferenceIds.length | number}}) ({{softwareInfo.deletedByInferenceIds.length | number}})
</a> </a>
<div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content"> <div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
<deletedByInference [id]="softwareId" [ids]="softwareInfo.deletedByInferenceIds" [type]="'software'"></deletedByInference> <deletedByInference [id]="softwareId" [ids]="softwareInfo.deletedByInferenceIds"
[type]="'software'"></deletedByInference>
</div> </div>
</li> </li>
</ul> </ul>
@ -177,13 +204,13 @@
<div class="uk-width-large@m uk-width-1-1@s"> <div class="uk-width-large@m uk-width-1-1@s">
<div class=" uk-padding-small"> <div class=" uk-padding-small">
<div > <div>
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div> <div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis></addThis> <addThis></addThis>
</div> </div>
<altmetrics *ngIf="softwareInfo.identifiers && softwareInfo.identifiers.get('doi')" <altmetrics *ngIf="softwareInfo.identifiers && softwareInfo.identifiers.get('doi')"
id="{{softwareInfo.identifiers.get('doi')[0]}}" type="doi"> id="{{softwareInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics > </altmetrics>
<ul class="uk-list uk-margin-remove-bottom"> <ul class="uk-list uk-margin-remove-bottom">
<li *ngIf="softwareInfo.hostedBy_collectedFrom && softwareInfo.hostedBy_collectedFrom.length > 0"> <li *ngIf="softwareInfo.hostedBy_collectedFrom && softwareInfo.hostedBy_collectedFrom.length > 0">
@ -194,15 +221,15 @@
</li> </li>
<li *ngIf="softwareInfo.contexts && softwareInfo.contexts.length >0 "> <li *ngIf="softwareInfo.contexts && softwareInfo.contexts.length >0 ">
<dl class="uk-description-list-line" > <dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to </dt> <dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of softwareInfo.contexts"> <dd class="line" *ngFor="let item of softwareInfo.contexts">
<span *ngIf = "!item['inline']" > <span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span> <span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span> <span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span> </span>
<mark *ngIf = "item['inline']" > <mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span> <span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span> <span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
@ -252,30 +279,57 @@
</li--> </li-->
</ul> </ul>
<button *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-button portal-button uk-width-1-1 "> <button *ngIf="isRouteAvailable('participate/direct-claim') "
class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon"> <span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg> <svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
height="25"><path
d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path
d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975"
fill="none" stroke="#000"
stroke-width="1.1"></path></svg>
</span> Link this software to... </span> Link this software to...
</button> </button>
<div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;"> <div *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"> <ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>"> <li uk-tooltip="pos: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" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
<span class="uk-icon" > [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','project'])"
<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> 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> </a>
</li> </li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>"> <li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
<span class="uk-icon" > [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','context'])"
<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> 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> </a>
</li> </li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>"> <li uk-tooltip="pos:right;"
<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" > title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>">
<span class="uk-icon" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="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> [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> </a>
</li> </li>
@ -283,8 +337,10 @@
</div> </div>
</div> </div>
</div> </div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div> </div>
<!-- Claiming FAB --> <!-- Claiming FAB -->
<div class="uk-inline"> <div class="uk-inline">
<div class=" uk-float-right " style="z-index: 200; bottom: 55px; position: fixed; right: 45%;"> <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>"> <!--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>">
@ -324,7 +380,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,9 +1,6 @@
import {Component, ViewChild} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser'; import {Meta, Title} from '@angular/platform-browser';
import {Observable} from 'rxjs';
import {SoftwareService} from './software.service'; import {SoftwareService} from './software.service';
import {SoftwareInfo} from '../../utils/entities/softwareInfo'; import {SoftwareInfo} from '../../utils/entities/softwareInfo';
@ -11,8 +8,9 @@ import {SoftwareInfo} from '../../utils/entities/softwareInfo';
import {RouterHelper} from '../../utils/routerHelper.class'; import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service'; import {PiwikService} from '../../utils/piwik/piwik.service';
import {EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
import { SEOService } from '../../sharedComponents/SEO/SEO.service'; import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
@Component({ @Component({
selector: 'software', selector: 'software',
@ -21,8 +19,9 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class";
export class SoftwareComponent { export class SoftwareComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() communityId = null;
public softwareInfo: SoftwareInfo; public softwareInfo: SoftwareInfo;
public softwareId : string ; public softwareId: string;
// APP BOX variables // APP BOX variables
public showAllCollectedFrom: boolean = false; public showAllCollectedFrom: boolean = false;
@ -51,19 +50,24 @@ export class SoftwareComponent {
public errorMessage = ""; public errorMessage = "";
public showLoading: boolean = true; public showLoading: boolean = true;
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
private result ; private result;
sub: any; piwiksub: any; infoSub: any; sub: any;
properties:EnvProperties; piwiksub: any;
infoSub: any;
properties: EnvProperties;
public pageContents = null;
public divContents = null;
constructor (private _softwareService: SoftwareService, constructor(private _softwareService: SoftwareService,
private _piwikService:PiwikService, private _piwikService: PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private _meta: Meta, private _meta: Meta,
private _title: Title, private _title: Title,
private _router: Router, private _router: Router,
private helper: HelperService,
private seoService: SEOService) { private seoService: SEOService) {
} }
@ -71,7 +75,9 @@ export class SoftwareComponent {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url); //this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
}); });
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
@ -81,20 +87,20 @@ export class SoftwareComponent {
this.softwareId = params['softwareId']; this.softwareId = params['softwareId'];
if(this.softwareId){ if (this.softwareId) {
this.getSoftwareInfo(this.softwareId); this.getSoftwareInfo(this.softwareId);
}else{ } else {
this.showLoading = false; this.showLoading = false;
this.warningMessage="No valid software id"; this.warningMessage = "No valid software id";
} }
this.metricsClicked = false; this.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":"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.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":"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.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(); this.scroll();
@ -102,21 +108,33 @@ export class SoftwareComponent {
} }
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() { ngOnDestroy() {
if(this.sub){ if (this.sub) {
this.sub.unsubscribe(); this.sub.unsubscribe();
} }
if(this.piwiksub){ if (this.piwiksub) {
this.piwiksub.unsubscribe(); this.piwiksub.unsubscribe();
} }
if(this.infoSub) { if (this.infoSub) {
this.infoSub.unsubscribe(); this.infoSub.unsubscribe();
} }
} }
private getSoftwareInfo(id:string) { private getSoftwareInfo(id: string) {
this.warningMessage = ''; this.warningMessage = '';
this.errorMessage="" this.errorMessage = ""
this.showLoading = true; this.showLoading = true;
this.softwareInfo = null; this.softwareInfo = null;
@ -129,19 +147,28 @@ export class SoftwareComponent {
this.updateTitle(this.softwareInfo.title.name); this.updateTitle(this.softwareInfo.title.name);
this.updateDescription("Software, search, repositories, open access,"+this.softwareInfo.title.name); this.updateDescription("Software, search, repositories, open access,"+this.softwareInfo.title.name);
}*/ }*/
if(this.softwareInfo.title){ if (this.softwareInfo.title) {
this.updateTitle(this.softwareInfo.title); this.updateTitle(this.softwareInfo.title);
this.updateDescription("Software, "+this.softwareInfo.title); this.updateDescription("Software, " + this.softwareInfo.title);
} }
if( this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.softwareInfo.title/*.name*/, this.piwikSiteId).subscribe(); this.piwiksub = this._piwikService.trackView(this.properties, this.softwareInfo.title/*.name*/, this.piwikSiteId).subscribe();
} }
this.result = [] 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: ''}; 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; let relatedResearchResultsNum = 0;
if(this.softwareInfo.relatedResearchResults != undefined) { if (this.softwareInfo.relatedResearchResults != undefined) {
this.softwareInfo.relatedResearchResults.forEach(function (value, key, map) { this.softwareInfo.relatedResearchResults.forEach(function (value, key, map) {
relatedResearchResultsNum += value.length; relatedResearchResultsNum += value.length;
}); });
@ -152,7 +179,7 @@ export class SoftwareComponent {
}, },
err => { err => {
//console.log(err) //console.log(err)
this.handleError("Error getting software for id: "+this.softwareId, err); this.handleError("Error getting software for id: " + this.softwareId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToSoftware); this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToSoftware);
this.errorMessage = 'No software found'; this.errorMessage = 'No software found';
this.showLoading = false; this.showLoading = false;
@ -170,18 +197,20 @@ export class SoftwareComponent {
this.pageViews = $event.pageViews; this.pageViews = $event.pageViews;
} }
private updateDescription(description:string) { private updateDescription(description: string) {
this._meta.updateTag({content:description},"name='description'"); this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content:description},"property='og:description'"); this._meta.updateTag({content: description}, "property='og:description'");
} }
private updateTitle(title:string) {
var _prefix ="OpenAIRE | "; private updateTitle(title: string) {
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); var _prefix = "OpenAIRE | ";
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title); this._title.setTitle(_title);
this._meta.updateTag({content:_title},"property='og:title'"); this._meta.updateTag({content: _title}, "property='og:title'");
} }
private updateUrl(url:string) {
this._meta.updateTag({content:url},"property='og:url'"); private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
} }
public buildCurationTooltip() { public buildCurationTooltip() {
@ -192,7 +221,8 @@ export class SoftwareComponent {
return tooltipContent; return tooltipContent;
} }
public getKeys( map) {
public getKeys(map) {
return Array.from(map.keys()); return Array.from(map.keys());
} }
@ -201,12 +231,13 @@ export class SoftwareComponent {
} }
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Software Landing Page: "+message, error); console.error("Software Landing Page: " + message, error);
} }
isRouteAvailable(routeToCheck:string){
isRouteAvailable(routeToCheck: string) {
for (let i = 0; i < this.router.config.length; i++) { for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path; let routePath: string = this.router.config[i].path;
if(routePath == routeToCheck){ if (routePath == routeToCheck) {
return true; return true;
} }
} }

View File

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

View File

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

View File

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

View File

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