no chart shown if metrics number = 0 | Publication landing: appbox: view less only on bottom, 3 dots added if there are >5 results, accessmode added in published in section, best access mode info added in published in and download from sections | Deposit results: tiny fix in loading message | Project landing: fix organizations' urls
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@45590 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
b575656976
commit
e2c0915f34
|
@ -17,13 +17,13 @@ import {OrganizationService} from '../services/organization.service';
|
||||||
<h2>Deposit {{requestFor}}</h2>
|
<h2>Deposit {{requestFor}}</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="status == errorCodes.LOADING || (status == errorCodes.LOADING && searchDataprovidersComponent.searchUtils.status == errorCodes.LOADING)"
|
<div *ngIf="status == errorCodes.LOADING"
|
||||||
class="uk-alert uk-alert-primary" role="alert">
|
class="uk-alert uk-alert-primary" role="alert">
|
||||||
Loading...
|
Loading...
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="searchDataprovidersComponent.searchUtils.totalResults > 0">
|
<div *ngIf="searchDataprovidersComponent.searchUtils.status == errorCodes.DONE">
|
||||||
<h2 *ngIf="organization != undefined">
|
<h2>
|
||||||
<span>Data providers for institution: </span>
|
<span>Data providers for institution: </span>
|
||||||
<a *ngIf="organization['url']!=''" href="{{organization.url}}" target="_blank">
|
<a *ngIf="organization['url']!=''" href="{{organization.url}}" target="_blank">
|
||||||
<span>{{organization['name']}} (<i class="uk-icon-external-link"></i>)</span>
|
<span>{{organization['name']}} (<i class="uk-icon-external-link"></i>)</span>
|
||||||
|
@ -31,31 +31,34 @@ import {OrganizationService} from '../services/organization.service';
|
||||||
<span *ngIf="organization['url']==''">{{organization['name']}}</span>
|
<span *ngIf="organization['url']==''">{{organization['name']}}</span>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div *ngIf="searchDataprovidersComponent.searchUtils.totalResults > 0">
|
|
||||||
<p>Please use the information/contacts shown below to deposit your {{requestFor}}.</p>
|
<p>Please use the information/contacts shown below to deposit your {{requestFor}}.</p>
|
||||||
<!--showDataProviders [dataProviders]=dataProviders></showDataProviders-->
|
<!--showDataProviders [dataProviders]=dataProviders></showDataProviders-->
|
||||||
<div class = "uk-text-right" *ngIf = "searchDataprovidersComponent.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDataproviders" >View all {{searchDataprovidersComponent.searchUtils.totalResults}} results</a></div>
|
<div class = "uk-text-right" *ngIf = "searchDataprovidersComponent.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDataproviders" >View all {{searchDataprovidersComponent.searchUtils.totalResults}} results</a></div>
|
||||||
<search-result [(results)]="searchDataprovidersComponent.results" [(status)]= "searchDataprovidersComponent.searchUtils.status"></search-result>
|
<search-result [(results)]="searchDataprovidersComponent.results" [(status)]= "searchDataprovidersComponent.searchUtils.status"></search-result>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="(searchDataprovidersComponent.searchUtils.totalResults == 0 && status == errorCodes.DONE)
|
<div *ngIf="searchDataprovidersComponent.searchUtils.status == errorCodes.NONE
|
||||||
|| status == errorCodes.NONE || status == errorCodes.ERROR" class = "alert alert-warning">
|
|| status == errorCodes.NONE
|
||||||
|
|| searchDataprovidersComponent.searchUtils.status == errorCodes.ERROR
|
||||||
|
|| status == errorCodes.ERROR"
|
||||||
|
class = "uk-alert uk-alert-warning" role="alert">
|
||||||
<div *ngIf="organization != undefined">
|
<div *ngIf="organization != undefined">
|
||||||
No data providers found
|
<span *ngIf="searchDataprovidersComponent.searchUtils.status == errorCodes.ERROR">
|
||||||
<span *ngIf="organization != undefined">
|
An error occured.
|
||||||
for institution:
|
</span>
|
||||||
|
No data providers found for institution:
|
||||||
<a *ngIf="organization['url']!=''" href="{{organization.url}}">
|
<a *ngIf="organization['url']!=''" href="{{organization.url}}">
|
||||||
<span>{{organization['name']}}</span>
|
<span>{{organization['name']}}</span>
|
||||||
</a>
|
</a>
|
||||||
<span *ngIf="organization['url']==''">{{organization['name']}}</span>
|
<span *ngIf="organization['url']==''">{{organization['name']}}</span>
|
||||||
</span>
|
|
||||||
.
|
.
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="organization == undefined && organizationId != ''">
|
<div *ngIf="status == errorCodes.NONE && organizationId != ''">
|
||||||
No organization with ID: {{organizationId}} found.
|
No organization with ID: {{organizationId}} found.
|
||||||
</div>
|
</div>
|
||||||
|
<div *ngIf="status == errorCodes.ERROR && organizationId != ''">
|
||||||
|
An error occured.
|
||||||
|
</div>
|
||||||
<div *ngIf="organizationId == ''">
|
<div *ngIf="organizationId == ''">
|
||||||
No ID for organization.
|
No ID for organization.
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -76,6 +76,32 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||||
[paramsForSearchLink]="paramsForSearchLink"
|
[paramsForSearchLink]="paramsForSearchLink"
|
||||||
[searchDatasetsComponent]="searchDatasetsComponent">
|
[searchDatasetsComponent]="searchDatasetsComponent">
|
||||||
</datasetsTab>
|
</datasetsTab>
|
||||||
|
|
||||||
|
|
||||||
|
<projectsTab *ngIf="tabs[0].content=='projectsTab'"
|
||||||
|
[paramsForSearchLink]="paramsForSearchLink"
|
||||||
|
[searchProjectsComponent]="searchProjectsComponent">
|
||||||
|
</projectsTab>
|
||||||
|
|
||||||
|
<datasourcesTab *ngIf="tabs[0].content=='datasourcesTab'"
|
||||||
|
|
||||||
|
[paramsForSearchLink]="paramsForSearchLink"
|
||||||
|
[searchDataprovidersComponent]="searchDataprovidersComponent">
|
||||||
|
|
||||||
|
</datasourcesTab>
|
||||||
|
<organizationsTab *ngIf="tabs[0].content=='organizationsTab'"
|
||||||
|
[organizations]="organizations">
|
||||||
|
</organizationsTab>
|
||||||
|
<relatedDatasourcesTab *ngIf="tabs[0].content=='relatedDatasourcesTab'"
|
||||||
|
[searchPublicationsComponent]="searchPublicationsComponentAggregators">
|
||||||
|
</relatedDatasourcesTab>
|
||||||
|
<!--div *ngIf="tabs[0].content=='metricsTab' && metrics == undefined" class = "uk-alert uk-alert-warning">
|
||||||
|
Metrics are currently unavailable
|
||||||
|
</div>
|
||||||
|
<div *ngIf="tabs[0].content=='metricsTab' && metrics != undefined" class="uk-panel uk-panel-box">
|
||||||
|
<b>Views: </b>{{metrics}}
|
||||||
|
</div-->
|
||||||
|
|
||||||
<!--statisticsTab *ngIf="tabs[0].content=='statisticsTab'"
|
<!--statisticsTab *ngIf="tabs[0].content=='statisticsTab'"
|
||||||
[statistics]="statistics" [show]=statsClicked>
|
[statistics]="statistics" [show]=statsClicked>
|
||||||
</statisticsTab-->
|
</statisticsTab-->
|
||||||
|
@ -94,7 +120,6 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||||
<i-frame [url]=docsTypesUrl width="800" height="350"></i-frame>
|
<i-frame [url]=docsTypesUrl width="800" height="350"></i-frame>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div *ngIf="(searchPublicationsComponent.searchUtils.totalResults > 0)">
|
<div *ngIf="(searchPublicationsComponent.searchUtils.totalResults > 0)">
|
||||||
<div>
|
<div>
|
||||||
<p class="uk-text-bold">Funders in Data Providers Publications</p>
|
<p class="uk-text-bold">Funders in Data Providers Publications</p>
|
||||||
|
@ -112,6 +137,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<projectsTab *ngIf="tabs[0].content=='projectsTab'"
|
<projectsTab *ngIf="tabs[0].content=='projectsTab'"
|
||||||
[paramsForSearchLink]="paramsForSearchLink"
|
[paramsForSearchLink]="paramsForSearchLink"
|
||||||
[searchProjectsComponent]="searchProjectsComponent">
|
[searchProjectsComponent]="searchProjectsComponent">
|
||||||
|
@ -133,10 +159,14 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||||
<b>Views: </b>{{metrics}}
|
<b>Views: </b>{{metrics}}
|
||||||
</div-->
|
</div-->
|
||||||
<metrics *ngIf="tabs[0].content=='metricsTab' && metricsClicked"
|
<metrics *ngIf="tabs[0].content=='metricsTab' && metricsClicked"
|
||||||
[id]="id" [type]="'datasources'" [name]="name">
|
[id]="id" [type]="'datasources'" [name]="name" (metricsResults)="metricsResults($event)">
|
||||||
</metrics>
|
</metrics>
|
||||||
<i-frame *ngIf="tabs[0].content=='metricsTab' && metricsClicked" [url]=viewsFrameUrl width="100%" height="250"></i-frame>
|
<i-frame *ngIf="tabs[0].content=='metricsTab' && metricsClicked && totalViews > 0"
|
||||||
<i-frame *ngIf="tabs[0].content=='metricsTab' && metricsClicked" [url]=downloadsFrameUrl width="100%" height="250"></i-frame>
|
[url]=viewsFrameUrl width="100%" height="250">
|
||||||
|
</i-frame>
|
||||||
|
<i-frame *ngIf="tabs[0].content=='metricsTab' && metricsClicked && totalDownloads > 0"
|
||||||
|
[url]=downloadsFrameUrl width="100%" height="250">
|
||||||
|
</i-frame>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li *ngFor="let tab of tabs; let i=index" id="{{tab.content}}">
|
<li *ngFor="let tab of tabs; let i=index" id="{{tab.content}}">
|
||||||
|
@ -148,6 +178,23 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||||
[paramsForSearchLink]="paramsForSearchLink"
|
[paramsForSearchLink]="paramsForSearchLink"
|
||||||
[searchDatasetsComponent]="searchDatasetsComponent">
|
[searchDatasetsComponent]="searchDatasetsComponent">
|
||||||
</datasetsTab>
|
</datasetsTab>
|
||||||
|
|
||||||
|
<projectsTab *ngIf="i>0 && tab.content=='projectsTab'"
|
||||||
|
[paramsForSearchLink]="paramsForSearchLink"
|
||||||
|
[searchProjectsComponent]="searchProjectsComponent">
|
||||||
|
</projectsTab>
|
||||||
|
<datasourcesTab *ngIf="i>0 && tab.content=='datasourcesTab'"
|
||||||
|
[paramsForSearchLink]="paramsForSearchLink"
|
||||||
|
[searchDataprovidersComponent]="searchDataprovidersComponent">
|
||||||
|
</datasourcesTab>
|
||||||
|
<organizationsTab *ngIf="i>0 && tab.content=='organizationsTab'"
|
||||||
|
[organizations]="organizations">
|
||||||
|
</organizationsTab>
|
||||||
|
<relatedDatasourcesTab *ngIf="i>0 && tab.content=='relatedDatasourcesTab'"
|
||||||
|
[dataproviderId]="id"
|
||||||
|
[searchPublicationsComponent]="searchPublicationsComponentAggregators">
|
||||||
|
</relatedDatasourcesTab>
|
||||||
|
|
||||||
<!--statisticsTab *ngIf="i>0 && tab.content=='statisticsTab'"
|
<!--statisticsTab *ngIf="i>0 && tab.content=='statisticsTab'"
|
||||||
[searchPublicationsComponent] = "searchPublicationsComponent"
|
[searchPublicationsComponent] = "searchPublicationsComponent"
|
||||||
[searchDatasetsComponent]="searchDatasetsComponent" [id]="id">
|
[searchDatasetsComponent]="searchDatasetsComponent" [id]="id">
|
||||||
|
@ -180,31 +227,20 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||||
<div>
|
<div>
|
||||||
<p class="uk-text-bold">Projects with most Research Data</p>
|
<p class="uk-text-bold">Projects with most Research Data</p>
|
||||||
<i-frame [url]=dataProjectsUrl width="800" height="350"></i-frame>
|
<i-frame [url]=dataProjectsUrl width="800" height="350"></i-frame>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<projectsTab *ngIf="i>0 && tab.content=='projectsTab'"
|
|
||||||
[paramsForSearchLink]="paramsForSearchLink"
|
|
||||||
[searchProjectsComponent]="searchProjectsComponent">
|
|
||||||
</projectsTab>
|
|
||||||
<datasourcesTab *ngIf="i>0 && tab.content=='datasourcesTab'"
|
|
||||||
[paramsForSearchLink]="paramsForSearchLink"
|
|
||||||
[searchDataprovidersComponent]="searchDataprovidersComponent">
|
|
||||||
</datasourcesTab>
|
|
||||||
<organizationsTab *ngIf="i>0 && tab.content=='organizationsTab'"
|
|
||||||
[organizations]="organizations">
|
|
||||||
</organizationsTab>
|
|
||||||
<relatedDatasourcesTab *ngIf="i>0 && tab.content=='relatedDatasourcesTab'"
|
|
||||||
[dataproviderId]="id"
|
|
||||||
[searchPublicationsComponent]="searchPublicationsComponentAggregators">
|
|
||||||
</relatedDatasourcesTab>
|
|
||||||
<metrics *ngIf="i>0 && tab.content=='metricsTab' && metricsClicked"
|
<metrics *ngIf="i>0 && tab.content=='metricsTab' && metricsClicked"
|
||||||
[id]="id" [type]="'datasources'" [name]="name">
|
[id]="id" [type]="'datasources'" [name]="name" (metricsResults)="metricsResults($event)">
|
||||||
</metrics>
|
</metrics>
|
||||||
<i-frame *ngIf="i>0 && tab.content=='metricsTab' && metricsClicked" [url]=viewsFrameUrl width="100%" height="250"></i-frame>
|
<i-frame *ngIf="i>0 && tab.content=='metricsTab' && metricsClicked && totalViews > 0"
|
||||||
<i-frame *ngIf="i>0 && tab.content=='metricsTab' && metricsClicked" [url]=downloadsFrameUrl width="100%" height="250"></i-frame>
|
[url]=viewsFrameUrl width="100%" height="250">
|
||||||
|
</i-frame>
|
||||||
|
<i-frame *ngIf="i>0 && tab.content=='metricsTab' && metricsClicked && totalDownloads > 0"
|
||||||
|
[url]=downloadsFrameUrl width="100%" height="250">
|
||||||
|
</i-frame>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
`
|
`
|
||||||
|
@ -235,6 +271,8 @@ export class TabsComponent {
|
||||||
public metricsClicked: boolean;
|
public metricsClicked: boolean;
|
||||||
private viewsFrameUrl: string;
|
private viewsFrameUrl: string;
|
||||||
private downloadsFrameUrl: string;
|
private downloadsFrameUrl: string;
|
||||||
|
private totalViews: number;
|
||||||
|
private totalDownloads: number;
|
||||||
|
|
||||||
public statsClicked: boolean = false;
|
public statsClicked: boolean = false;
|
||||||
private docsTimelineUrl: string;
|
private docsTimelineUrl: string;
|
||||||
|
@ -304,6 +342,7 @@ export class TabsComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
private search(content: string, page: number, size: number) {
|
private search(content: string, page: number, size: number) {
|
||||||
|
console.info(content);
|
||||||
if(content=='publicationsTab') {
|
if(content=='publicationsTab') {
|
||||||
this.searchPublications(page, size);
|
this.searchPublications(page, size);
|
||||||
} else if(content=='datasetsTab') {
|
} else if(content=='datasetsTab') {
|
||||||
|
@ -311,6 +350,7 @@ export class TabsComponent {
|
||||||
} else if(content=='projectsTab') {
|
} else if(content=='projectsTab') {
|
||||||
this.searchProjects(page, size);
|
this.searchProjects(page, size);
|
||||||
} else if(content=='datasourcesTab') {
|
} else if(content=='datasourcesTab') {
|
||||||
|
console.info("fdsfsfs");
|
||||||
this.searchDatasources(page, size);
|
this.searchDatasources(page, size);
|
||||||
} else if(content=='relatedDatasourcesTab') {
|
} else if(content=='relatedDatasourcesTab') {
|
||||||
this.searchRelatedDatasources(1, 0);
|
this.searchRelatedDatasources(1, 0);
|
||||||
|
@ -355,7 +395,9 @@ export class TabsComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
private searchDatasources(page: number, size: number) {
|
private searchDatasources(page: number, size: number) {
|
||||||
|
console.info("search intro");
|
||||||
if(this.reloadDataproviders) {
|
if(this.reloadDataproviders) {
|
||||||
|
console.info("request");
|
||||||
this.searchDataprovidersComponent.getResultsForDataproviders(this.id, page, size);
|
this.searchDataprovidersComponent.getResultsForDataproviders(this.id, page, size);
|
||||||
}
|
}
|
||||||
this.reloadDataproviders = false;
|
this.reloadDataproviders = false;
|
||||||
|
@ -376,4 +418,9 @@ export class TabsComponent {
|
||||||
//searchPublicationsComponentAggregator
|
//searchPublicationsComponentAggregator
|
||||||
this.searchPublicationsComponentAggregators.getAggregatorResults(this.id, page, size);
|
this.searchPublicationsComponentAggregators.getAggregatorResults(this.id, page, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public metricsResults($event) {
|
||||||
|
this.totalViews = $event.totalViews;
|
||||||
|
this.totalDownloads = $event.totalDownloads;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,9 +94,15 @@
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li id="metricsTab">
|
<li id="metricsTab">
|
||||||
<metrics *ngIf="metricsClicked" [id]="datasetId" [type]="'results'"></metrics>
|
<metrics *ngIf="metricsClicked"
|
||||||
<i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="100%" height="250"></i-frame>
|
[id]="datasetId" [type]="'results'" (metricsResults)="metricsResults($event)">
|
||||||
<i-frame *ngIf="metricsClicked" [url]=downloadsFrameUrl width="100%" height="250"></i-frame>
|
</metrics>
|
||||||
|
<i-frame *ngIf="metricsClicked && totalViews > 0"
|
||||||
|
[url]=viewsFrameUrl width="100%" height="250">
|
||||||
|
</i-frame>
|
||||||
|
<i-frame *ngIf="metricsClicked && totalDownloads > 0"
|
||||||
|
[url]=downloadsFrameUrl width="100%" height="250">
|
||||||
|
</i-frame>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -23,7 +23,8 @@ export class DatasetComponent {
|
||||||
private metricsClicked: boolean;
|
private metricsClicked: boolean;
|
||||||
private viewsFrameUrl: string;
|
private viewsFrameUrl: string;
|
||||||
private downloadsFrameUrl: string;
|
private downloadsFrameUrl: string;
|
||||||
|
private totalViews: number;
|
||||||
|
private totalDownloads: number;
|
||||||
|
|
||||||
public warningMessage = "";
|
public warningMessage = "";
|
||||||
public errorMessage = "";
|
public errorMessage = "";
|
||||||
|
@ -75,4 +76,9 @@ export class DatasetComponent {
|
||||||
showChange($event) {
|
showChange($event) {
|
||||||
this.showAllReferences=$event.value;
|
this.showAllReferences=$event.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public metricsResults($event) {
|
||||||
|
this.totalViews = $event.totalViews;
|
||||||
|
this.totalDownloads = $event.totalDownloads;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, Input} from '@angular/core';
|
import {Component, Input, Output, EventEmitter} from '@angular/core';
|
||||||
import {Metrics} from '../utils/entities/metrics';
|
import {Metrics} from '../utils/entities/metrics';
|
||||||
import {MetricsService } from '../services/metrics.service';
|
import {MetricsService } from '../services/metrics.service';
|
||||||
import {ErrorCodes} from '../utils/properties/openaireProperties';
|
import {ErrorCodes} from '../utils/properties/openaireProperties';
|
||||||
|
@ -84,6 +84,7 @@ import {ErrorCodes} from '../utils/properties/openaireProperties';
|
||||||
})
|
})
|
||||||
|
|
||||||
export class MetricsComponent {
|
export class MetricsComponent {
|
||||||
|
@Output() metricsResults = new EventEmitter();
|
||||||
@Input() id: string;
|
@Input() id: string;
|
||||||
@Input() type: string;
|
@Input() type: string;
|
||||||
@Input() name: string = "";
|
@Input() name: string = "";
|
||||||
|
@ -112,6 +113,11 @@ export class MetricsComponent {
|
||||||
data => {
|
data => {
|
||||||
this.metrics = data;
|
this.metrics = data;
|
||||||
this.status = this.errorCodes.DONE;
|
this.status = this.errorCodes.DONE;
|
||||||
|
this.metricsResults.emit({
|
||||||
|
totalViews: this.metrics.totalViews,
|
||||||
|
totalDownloads: this.metrics.totalDownloads
|
||||||
|
|
||||||
|
});
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
@ -119,6 +125,10 @@ export class MetricsComponent {
|
||||||
if(err.status == '404') {
|
if(err.status == '404') {
|
||||||
this.status = this.errorCodes.NOT_AVAILABLE;
|
this.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
|
this.metricsResults.emit({
|
||||||
|
totalViews: 0,
|
||||||
|
totalDownloads: 0
|
||||||
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,10 +137,16 @@
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li id="metricsTab">
|
<li id="metricsTab">
|
||||||
<metrics *ngIf="metricsClicked" [id]="projectId" [type]="'projects'" [name]="projectName"></metrics>
|
<metrics *ngIf="metricsClicked"
|
||||||
|
[id]="projectId" [type]="'projects'" [name]="projectName" (metricsResults)="metricsResults($event)">
|
||||||
|
</metrics>
|
||||||
<!--i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="800" height="350"></i-frame-->
|
<!--i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="800" height="350"></i-frame-->
|
||||||
<i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="100%" height="250"></i-frame>
|
<i-frame *ngIf="metricsClicked && totalViews > 0"
|
||||||
<i-frame *ngIf="metricsClicked" [url]=downloadsFrameUrl width="100%" height="250"></i-frame>
|
[url]=viewsFrameUrl width="100%" height="250">
|
||||||
|
</i-frame>
|
||||||
|
<i-frame *ngIf="metricsClicked && totalDownloads > 0"
|
||||||
|
[url]=downloadsFrameUrl width="100%" height="250">
|
||||||
|
</i-frame>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -24,6 +24,8 @@ export class ProjectComponent{
|
||||||
public metricsClicked: boolean;
|
public metricsClicked: boolean;
|
||||||
public viewsFrameUrl: string;
|
public viewsFrameUrl: string;
|
||||||
public downloadsFrameUrl: string;
|
public downloadsFrameUrl: string;
|
||||||
|
private totalViews: number;
|
||||||
|
private totalDownloads: number;
|
||||||
public statsClicked: boolean;
|
public statsClicked: boolean;
|
||||||
public chartScientificResultsUrl: string;
|
public chartScientificResultsUrl: string;
|
||||||
public chartAccessModeUrl: string;
|
public chartAccessModeUrl: string;
|
||||||
|
@ -140,4 +142,9 @@ export class ProjectComponent{
|
||||||
error => console.log("Error downloading the file."),
|
error => console.log("Error downloading the file."),
|
||||||
() => console.log('Completed file download.'));
|
() => console.log('Completed file download.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public metricsResults($event) {
|
||||||
|
this.totalViews = $event.totalViews;
|
||||||
|
this.totalDownloads = $event.totalDownloads;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,19 +225,25 @@
|
||||||
</table>
|
</table>
|
||||||
</li>
|
</li>
|
||||||
<li id="metricsTab">
|
<li id="metricsTab">
|
||||||
<metrics *ngIf="metricsClicked" [id]="articleId" [type]="'results'"></metrics>
|
<metrics *ngIf="metricsClicked"
|
||||||
|
[id]="articleId" [type]="'results'" (metricsResults)="metricsResults($event)">
|
||||||
|
</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" [url]=viewsFrameUrl width="100%" height="250"></i-frame>
|
<i-frame *ngIf="metricsClicked && totalViews>0"
|
||||||
<i-frame *ngIf="metricsClicked" [url]=downloadsFrameUrl width="100%" height="250"></i-frame>
|
[url]=viewsFrameUrl width="100%" height="250">
|
||||||
|
</i-frame>
|
||||||
|
<i-frame *ngIf="metricsClicked && totalDownloads>0"
|
||||||
|
[url]=downloadsFrameUrl width="100%" height="250">
|
||||||
|
</i-frame>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="uk-width-3-10">
|
<div class="uk-width-3-10">
|
||||||
|
|
||||||
<ul class="uk-list uk-list-striped mainFunctionsBlock">
|
<ul class="uk-list uk-list-striped">
|
||||||
<li>
|
<li>
|
||||||
<dl class="uk-description-list-line functionsSection">
|
<dl class="uk-description-list-line">
|
||||||
<dt >Share - Bookmark</dt>
|
<dt >Share - Bookmark</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<!--div *ngIf="doi != undefined"
|
<!--div *ngIf="doi != undefined"
|
||||||
|
@ -248,40 +254,39 @@
|
||||||
</dl>
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
<li *ngIf="publicationInfo.downloadFrom != undefined && publicationInfo.downloadFrom.size > 0">
|
<li *ngIf="publicationInfo.downloadFrom != undefined && publicationInfo.downloadFrom.size > 0">
|
||||||
<dl class="uk-description-list-line functionsSection">
|
<dl class="uk-description-list-line">
|
||||||
<dt class="title">Download from</dt>
|
<dt class="title">Download from</dt>
|
||||||
<dd *ngIf="showAllDownloadFrom" class="uk-text-right">
|
<dd class="line"
|
||||||
<a class="uk-text-muted" (click)="showAllDownloadFrom = !showAllDownloadFrom;">
|
|
||||||
View less
|
|
||||||
</a>
|
|
||||||
</dd>
|
|
||||||
<dd class="line {{publicationInfo.downloadFrom.get(key)['accessMode']}}"
|
|
||||||
*ngFor="let key of publicationInfo.downloadFrom.keys() let i=index"
|
*ngFor="let key of publicationInfo.downloadFrom.keys() let i=index"
|
||||||
[title]="publicationInfo.downloadFrom.get(key)['accessMode']">
|
[title]="publicationInfo.downloadFrom.get(key)['accessMode']">
|
||||||
<span *ngIf="i<5 || showAllDownloadFrom" class="uk-icon-external-link">
|
<div *ngIf="i<5 || showAllDownloadFrom"
|
||||||
|
class="{{publicationInfo.downloadFrom.get(key)['bestAccessMode']}}">
|
||||||
|
<span class="uk-icon-external-link">
|
||||||
<div *ngIf="publicationInfo.downloadFrom.get(key)['url'].length > 1">
|
<div *ngIf="publicationInfo.downloadFrom.get(key)['url'].length > 1">
|
||||||
{{key}}
|
{{key}}
|
||||||
<span *ngFor="let url of publicationInfo.downloadFrom.get(key)['url']; let i=index;">
|
<span *ngFor="let url of publicationInfo.downloadFrom.get(key)['url']; let i=index;">
|
||||||
<a href="{{url}}" [class]="publicationInfo.downloadFrom.get(key)['accessMode']"
|
<a href="{{url}}" target="_blank"
|
||||||
[title]="publicationInfo.downloadFrom.get(key)['accessMode']"
|
[title]="publicationInfo.downloadFrom.get(key)['accessMode']">
|
||||||
target="_blank">
|
|
||||||
[{{i+1}}]
|
[{{i+1}}]
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<a *ngIf="publicationInfo.downloadFrom.get(key)['url'].length == 1"
|
<a *ngIf="publicationInfo.downloadFrom.get(key)['url'].length == 1"
|
||||||
href="{{publicationInfo.downloadFrom.get(key)['url']}}"
|
href="{{publicationInfo.downloadFrom.get(key)['url']}}"
|
||||||
|
[title]="publicationInfo.downloadFrom.get(key)['accessMode']"
|
||||||
target="_blank">
|
target="_blank">
|
||||||
{{key}}
|
{{key}}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
</div>
|
||||||
</dd>
|
</dd>
|
||||||
<dd *ngIf="showAllDownloadFrom" class="uk-text-right">
|
<dd *ngIf="showAllDownloadFrom" class="uk-text-right">
|
||||||
<a class="uk-text-muted" (click)="showAllDownloadFrom = !showAllDownloadFrom;">
|
<a class="uk-text-muted" (click)="showAllDownloadFrom = !showAllDownloadFrom;">
|
||||||
View less
|
View less
|
||||||
</a>
|
</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dd *ngIf="!showAllDownloadFrom && publicationInfo.downloadFrom.length > 5" class="uk-text-right">
|
<dd *ngIf="!showAllDownloadFrom && publicationInfo.downloadFrom.size > 5">...</dd>
|
||||||
|
<dd *ngIf="!showAllDownloadFrom && publicationInfo.downloadFrom.size > 5" class="uk-text-right">
|
||||||
<a class="uk-text-muted" (click)="showAllDownloadFrom = !showAllDownloadFrom;">
|
<a class="uk-text-muted" (click)="showAllDownloadFrom = !showAllDownloadFrom;">
|
||||||
View more
|
View more
|
||||||
</a>
|
</a>
|
||||||
|
@ -289,28 +294,27 @@
|
||||||
</dl>
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
<li *ngIf="publicationInfo.publishedIn != undefined && publicationInfo.publishedIn.size > 0">
|
<li *ngIf="publicationInfo.publishedIn != undefined && publicationInfo.publishedIn.size > 0">
|
||||||
<dl class="uk-description-list-line functionsSection">
|
<dl class="uk-description-list-line">
|
||||||
<dt class="title">Published in</dt>
|
<dt class="title">Published in</dt>
|
||||||
<dd *ngIf="showAllPublishedIn" class="uk-text-right">
|
|
||||||
<a class="uk-text-muted" (click)="showAllPublishedIn = !showAllPublishedIn;">
|
|
||||||
View less
|
|
||||||
</a>
|
|
||||||
</dd>
|
|
||||||
<dd class="line" *ngFor="let key of publicationInfo.publishedIn.keys() let i=index">
|
<dd class="line" *ngFor="let key of publicationInfo.publishedIn.keys() let i=index">
|
||||||
<div *ngIf="i<5 || showAllPublishedIn" class="uk-icon-external-link">
|
<div *ngIf="i<5 || showAllPublishedIn" class="{{publicationInfo.publishedIn.get(key)['bestAccessMode']}}">
|
||||||
|
<span class="uk-icon-external-link">
|
||||||
<div *ngIf="publicationInfo.publishedIn.get(key)['url'].length > 1">
|
<div *ngIf="publicationInfo.publishedIn.get(key)['url'].length > 1">
|
||||||
{{key}}
|
{{key}}
|
||||||
<span *ngFor="let url of publicationInfo.publishedIn.get(key)['url']; let i=index">
|
<span *ngFor="let url of publicationInfo.publishedIn.get(key)['url']; let i=index">
|
||||||
<a href="{{url}}" target="_blank">
|
<a href="{{url}}" target="_blank"
|
||||||
|
[title]="publicationInfo.publishedIn.get(key)['accessMode']">
|
||||||
[{{i+1}}]
|
[{{i+1}}]
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<a *ngIf="publicationInfo.publishedIn.get(key)['url'].length == 1"
|
<a *ngIf="publicationInfo.publishedIn.get(key)['url'].length == 1"
|
||||||
href="{{publicationInfo.publishedIn.get(key)['url']}}"
|
href="{{publicationInfo.publishedIn.get(key)['url']}}"
|
||||||
|
[title]="publicationInfo.publishedIn.get(key)['accessMode']"
|
||||||
target="_blank">
|
target="_blank">
|
||||||
{{key}}
|
{{key}}
|
||||||
</a>
|
</a>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</dd>
|
</dd>
|
||||||
<dd *ngIf="showAllPublishedIn" class="uk-text-right">
|
<dd *ngIf="showAllPublishedIn" class="uk-text-right">
|
||||||
|
@ -318,6 +322,7 @@
|
||||||
View less
|
View less
|
||||||
</a>
|
</a>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dd *ngIf="!showAllPublishedIn && publicationInfo.publishedIn.size > 5">...</dd>
|
||||||
<dd *ngIf="!showAllPublishedIn && publicationInfo.publishedIn.length > 5" class="uk-text-right">
|
<dd *ngIf="!showAllPublishedIn && publicationInfo.publishedIn.length > 5" class="uk-text-right">
|
||||||
<a class="uk-text-muted" (click)="showAllPublishedIn = !showAllPublishedIn;">
|
<a class="uk-text-muted" (click)="showAllPublishedIn = !showAllPublishedIn;">
|
||||||
View more
|
View more
|
||||||
|
@ -327,13 +332,8 @@
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li *ngIf="publicationInfo.fundedByProjects != undefined">
|
<li *ngIf="publicationInfo.fundedByProjects != undefined">
|
||||||
<dl class="uk-description-list-line functionsSection" >
|
<dl class="uk-description-list-line" >
|
||||||
<dt class="title">Funded By</dt>
|
<dt class="title">Funded By</dt>
|
||||||
<dd *ngIf="showAllFundedBy" class="uk-text-right">
|
|
||||||
<a class="uk-text-muted" (click)="showAllFundedBy = !showAllFundedBy;">
|
|
||||||
View less
|
|
||||||
</a>
|
|
||||||
</dd>
|
|
||||||
<dd
|
<dd
|
||||||
data-uk-tooltip="{pos:'right'}" title="{{item['title']}}
|
data-uk-tooltip="{pos:'right'}" title="{{item['title']}}
|
||||||
| Project Code: {{item['code']}}
|
| Project Code: {{item['code']}}
|
||||||
|
@ -359,6 +359,7 @@
|
||||||
View less
|
View less
|
||||||
</a>
|
</a>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dd *ngIf="!showAllFundedBy && publicationInfo.fundedByProjects.length > 5">...</dd>
|
||||||
<dd *ngIf="!showAllFundedBy && publicationInfo.fundedByProjects.length > 5" class="uk-text-right">
|
<dd *ngIf="!showAllFundedBy && publicationInfo.fundedByProjects.length > 5" class="uk-text-right">
|
||||||
<a class="uk-text-muted" (click)="showAllFundedBy = !showAllFundedBy;">
|
<a class="uk-text-muted" (click)="showAllFundedBy = !showAllFundedBy;">
|
||||||
View more
|
View more
|
||||||
|
@ -368,7 +369,7 @@
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li *ngIf="publicationInfo.contexts != undefined">
|
<li *ngIf="publicationInfo.contexts != undefined">
|
||||||
<dl class="uk-description-list-line functionsSection" >
|
<dl class="uk-description-list-line" >
|
||||||
<dt class="title">Related to</dt>
|
<dt class="title">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']" >
|
||||||
|
@ -387,13 +388,8 @@
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li *ngIf="publicationInfo.collectedFrom != undefined">
|
<li *ngIf="publicationInfo.collectedFrom != undefined">
|
||||||
<dl class="uk-description-list-line functionsSection">
|
<dl class="uk-description-list-line">
|
||||||
<dt>Collected from</dt>
|
<dt>Collected from</dt>
|
||||||
<!--dd *ngIf="showAllCollectedFrom" class="uk-text-right">
|
|
||||||
<a class="uk-text-muted" (click)="showAllCollectedFrom = !showAllCollectedFrom;">
|
|
||||||
View less
|
|
||||||
</a>
|
|
||||||
</dd-->
|
|
||||||
<dd *ngFor="let item of publicationInfo.collectedFrom let i=index">
|
<dd *ngFor="let item of publicationInfo.collectedFrom let i=index">
|
||||||
<a *ngIf="i<5 || showAllCollectedFrom" href="{{item['url']}}">
|
<a *ngIf="i<5 || showAllCollectedFrom" href="{{item['url']}}">
|
||||||
{{item['name']}}
|
{{item['name']}}
|
||||||
|
|
|
@ -17,12 +17,14 @@ export class PublicationComponent {
|
||||||
public showAllFundedBy: boolean = false;
|
public showAllFundedBy: boolean = false;
|
||||||
public showAllPublishedIn: boolean = false;
|
public showAllPublishedIn: boolean = false;
|
||||||
|
|
||||||
sub: any;getPublicationView
|
sub: any;
|
||||||
articleId: string;
|
articleId: string;
|
||||||
public publicationInfo: PublicationInfo;
|
public publicationInfo: PublicationInfo;
|
||||||
private metricsClicked: boolean;
|
private metricsClicked: boolean;
|
||||||
private viewsFrameUrl: string;
|
private viewsFrameUrl: string;
|
||||||
private downloadsFrameUrl: string;
|
private downloadsFrameUrl: string;
|
||||||
|
private totalViews: number;
|
||||||
|
private totalDownloads: number;
|
||||||
|
|
||||||
public showAllReferences: boolean = false;
|
public showAllReferences: boolean = false;
|
||||||
public showAllRelResData: boolean = false;
|
public showAllRelResData: boolean = false;
|
||||||
|
@ -103,5 +105,13 @@ export class PublicationComponent {
|
||||||
this.showAllReferences=$event.value;
|
this.showAllReferences=$event.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public downloadClicked($event) {
|
||||||
|
this.totalViews = $event.totalViews;
|
||||||
|
this.totalDownloads = $event.totalDownloads;
|
||||||
|
}
|
||||||
|
|
||||||
|
public metricsResults($event) {
|
||||||
|
this.totalViews = $event.totalViews;
|
||||||
|
this.totalDownloads = $event.totalDownloads;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,12 @@ import {Component, Input} from '@angular/core';
|
||||||
selector: 'showTitle',
|
selector: 'showTitle',
|
||||||
template: `
|
template: `
|
||||||
<h2 *ngIf="title != undefined" [class] = "title['accessMode']" data-uk-tooltip [title]="title['accessMode']" >
|
<h2 *ngIf="title != undefined" [class] = "title['accessMode']" data-uk-tooltip [title]="title['accessMode']" >
|
||||||
<span *ngIf="title['url'] != undefined && title['url'] != null" class="uk-icon-external-link">
|
<span *ngIf="title['url'] != undefined && title['url'] != null && title['url'] != ''" class="uk-icon-external-link">
|
||||||
<a href="{{title['url']}}" target="_blank"
|
<a href="{{title['url']}}" target="_blank"
|
||||||
[innerHTML]="title['name']">
|
[innerHTML]="title['name']">
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="title['url'] == undefined || title['url'] == null"
|
<span *ngIf="title['url'] == undefined || title['url'] == null || title['url'] == ''"
|
||||||
[innerHTML]="title['name']">
|
[innerHTML]="title['name']">
|
||||||
</span>
|
</span>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
|
@ -120,12 +120,14 @@ export class ProjectService {
|
||||||
|
|
||||||
if(data[2].hasOwnProperty("to") && name != "") {
|
if(data[2].hasOwnProperty("to") && name != "") {
|
||||||
url = OpenaireProperties.getsearchLinkToOrganization()+data[2]['to'].content;
|
url = OpenaireProperties.getsearchLinkToOrganization()+data[2]['to'].content;
|
||||||
|
console.info("data[2]['to'].content: "+data[2]['to'].content);
|
||||||
}
|
}
|
||||||
if(name != "") {
|
if(name != "") {
|
||||||
this.projectInfo.organizations.set(name, url);
|
this.projectInfo.organizations.set(name, url);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for(let i=0; i<data[2].length; i++) {
|
for(let i=0; i<data[2].length; i++) {
|
||||||
|
if(data[2][i].hasOwnProperty("to") && data[2][i]['to'].class == "hasParticipant") {
|
||||||
if(data[2][i].hasOwnProperty("legalshortname")) {
|
if(data[2][i].hasOwnProperty("legalshortname")) {
|
||||||
name = data[2][i].legalshortname;
|
name = data[2][i].legalshortname;
|
||||||
} else if(data[2][i].hasOwnProperty("legalname")) {
|
} else if(data[2][i].hasOwnProperty("legalname")) {
|
||||||
|
@ -134,6 +136,7 @@ export class ProjectService {
|
||||||
|
|
||||||
if(data[2][i].hasOwnProperty("to") && name!="") {
|
if(data[2][i].hasOwnProperty("to") && name!="") {
|
||||||
url = OpenaireProperties.getsearchLinkToOrganization()+data[2][i]['to'].content;
|
url = OpenaireProperties.getsearchLinkToOrganization()+data[2][i]['to'].content;
|
||||||
|
console.info("data[2]["+i+"]['to'].content: "+data[2][i]['to'].content);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(name != "") {
|
if(name != "") {
|
||||||
|
@ -142,6 +145,7 @@ export class ProjectService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(this.projectInfo.funder == "EC") {
|
if(this.projectInfo.funder == "EC") {
|
||||||
this.projectInfo.url = OpenaireProperties.getCordisURL()+this.projectInfo.contractNum;
|
this.projectInfo.url = OpenaireProperties.getCordisURL()+this.projectInfo.contractNum;
|
||||||
|
|
|
@ -67,7 +67,7 @@ export class PublicationService {
|
||||||
this.publicationInfo.title = {"name": "", "url": "", "accessMode": ""};
|
this.publicationInfo.title = {"name": "", "url": "", "accessMode": ""};
|
||||||
if(data[0]['bestlicense'].hasOwnProperty("classid")) {
|
if(data[0]['bestlicense'].hasOwnProperty("classid")) {
|
||||||
this.publicationInfo.title.accessMode = data[0]['bestlicense'].classid;
|
this.publicationInfo.title.accessMode = data[0]['bestlicense'].classid;
|
||||||
console.info("accessmode by bestlicense = "+this.publicationInfo.title.accessMode);
|
console.info("accessmode by bestlicence = "+data[0]['bestlicense'].classid);
|
||||||
}
|
}
|
||||||
if(data[1] != null) {
|
if(data[1] != null) {
|
||||||
|
|
||||||
|
@ -211,8 +211,8 @@ export class PublicationService {
|
||||||
|
|
||||||
if(data[3] != null) {
|
if(data[3] != null) {
|
||||||
if(data[3].hasOwnProperty("instance")) {
|
if(data[3].hasOwnProperty("instance")) {
|
||||||
this.publicationInfo.downloadFrom = new Map<string, {"url": string[], "accessMode": string[]}>();
|
this.publicationInfo.downloadFrom = new Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>();
|
||||||
this.publicationInfo.publishedIn = new Map<string, {"url": string[], "accessMode": string[]}>();
|
this.publicationInfo.publishedIn = new Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>();
|
||||||
|
|
||||||
this.publicationInfo.types = new Array<string>();
|
this.publicationInfo.types = new Array<string>();
|
||||||
|
|
||||||
|
@ -244,24 +244,49 @@ export class PublicationService {
|
||||||
|
|
||||||
if(instance.hasOwnProperty("hostedby")) {
|
if(instance.hasOwnProperty("hostedby")) {
|
||||||
if(instance['hostedby'].name != "other resources" && instance['hostedby'].name != "Unknown Repository") {
|
if(instance['hostedby'].name != "other resources" && instance['hostedby'].name != "Unknown Repository") {
|
||||||
if(!this.publicationInfo.downloadFrom.has(instance['hostedby'].name)) {
|
let key: string = instance['hostedby'].name;
|
||||||
this.publicationInfo.downloadFrom.set(instance['hostedby'].name, {"url": null, "accessMode": null});
|
|
||||||
|
if(!this.publicationInfo.downloadFrom.has(key)) {
|
||||||
|
this.publicationInfo.downloadFrom.set(key, {"url": null, "accessMode": null, "bestAccessMode": null});
|
||||||
|
}
|
||||||
|
if(this.publicationInfo.downloadFrom.get(key)['url'] == null) {
|
||||||
|
this.publicationInfo.downloadFrom.get(key)['url'] = new Array<string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.publicationInfo.downloadFrom.get(instance['hostedby'].name)['url'] == null) {
|
this.publicationInfo.downloadFrom.get(key)['url'].push(url);
|
||||||
this.publicationInfo.downloadFrom.get(instance['hostedby'].name)['url'] = new Array<string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.publicationInfo.downloadFrom.get(instance['hostedby'].name)['url'].push(url);
|
if(this.publicationInfo.downloadFrom.get(key)['accessMode'] == null) {
|
||||||
|
this.publicationInfo.downloadFrom.get(key)['accessMode'] = new Array<string>();
|
||||||
if(this.publicationInfo.downloadFrom.get(instance['hostedby'].name)['accessMode'] == null) {
|
|
||||||
this.publicationInfo.downloadFrom.get(instance['hostedby'].name)['accessMode'] = new Array<string>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(instance.hasOwnProperty("licence")) {
|
if(instance.hasOwnProperty("licence")) {
|
||||||
this.publicationInfo.downloadFrom.get(instance['hostedby'].name)['accessMode'].push(instance['licence'].classid);
|
this.publicationInfo.downloadFrom.get(key)['accessMode'].push(instance['licence'].classid);
|
||||||
|
|
||||||
|
switch (this.publicationInfo.downloadFrom.get(key)['bestAccessMode']) {
|
||||||
|
case null:
|
||||||
|
this.publicationInfo.downloadFrom.get(key)['bestAccessMode'] = instance['licence'].classid;
|
||||||
|
break;
|
||||||
|
case "CLOSED":
|
||||||
|
if(instance['licence'].classid == "OPEN" ||
|
||||||
|
instance['licence'].classid == "EMBARGO" ||
|
||||||
|
instance['licence'].classid == "RESTRICTED") {
|
||||||
|
this.publicationInfo.downloadFrom.get(key)['bestAccessMode'] = instance['licence'].classid;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "RESTRICTED":
|
||||||
|
if(instance['licence'].classid == "OPEN" ||
|
||||||
|
instance['licence'].classid == "EMBARGO") {
|
||||||
|
this.publicationInfo.downloadFrom.get(key)['bestAccessMode'] = instance['licence'].classid;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "EMBARGO":
|
||||||
|
if(instance['licence'].classid == "OPEN") {
|
||||||
|
this.publicationInfo.downloadFrom.get(key)['bestAccessMode'] = instance['licence'].classid;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.publicationInfo.downloadFrom.get(instance['hostedby'].name)['accessMode'].push("");
|
this.publicationInfo.downloadFrom.get(key)['accessMode'].push("");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(data[0] != null && data[0].hasOwnProperty("source")) {
|
if(data[0] != null && data[0].hasOwnProperty("source")) {
|
||||||
|
@ -276,7 +301,7 @@ export class PublicationService {
|
||||||
}
|
}
|
||||||
if(key != "") {
|
if(key != "") {
|
||||||
if(!this.publicationInfo.publishedIn.has(key)) {
|
if(!this.publicationInfo.publishedIn.has(key)) {
|
||||||
this.publicationInfo.publishedIn.set(key, {"url": null, "accessMode": null});
|
this.publicationInfo.publishedIn.set(key, {"url": null, "accessMode": null, "bestAccessMode": null});
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.publicationInfo.publishedIn.get(key)['url'] == null) {
|
if(this.publicationInfo.publishedIn.get(key)['url'] == null) {
|
||||||
|
@ -291,6 +316,29 @@ export class PublicationService {
|
||||||
|
|
||||||
if(instance.hasOwnProperty("licence")) {
|
if(instance.hasOwnProperty("licence")) {
|
||||||
this.publicationInfo.publishedIn.get(key)['accessMode'].push(instance['licence'].classid);
|
this.publicationInfo.publishedIn.get(key)['accessMode'].push(instance['licence'].classid);
|
||||||
|
switch (this.publicationInfo.publishedIn.get(key)['bestAccessMode']) {
|
||||||
|
case null:
|
||||||
|
this.publicationInfo.publishedIn.get(key)['bestAccessMode'] = instance['licence'].classid;
|
||||||
|
break;
|
||||||
|
case "CLOSED":
|
||||||
|
if(instance['licence'].classid == "OPEN" ||
|
||||||
|
instance['licence'].classid == "EMBARGO" ||
|
||||||
|
instance['licence'].classid == "RESTRICTED") {
|
||||||
|
this.publicationInfo.publishedIn.get(key)['bestAccessMode'] = instance['licence'].classid;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "RESTRICTED":
|
||||||
|
if(instance['licence'].classid == "OPEN" ||
|
||||||
|
instance['licence'].classid == "EMBARGO") {
|
||||||
|
this.publicationInfo.publishedIn.get(key)['bestAccessMode'] = instance['licence'].classid;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "EMBARGO":
|
||||||
|
if(instance['licence'].classid == "OPEN") {
|
||||||
|
this.publicationInfo.publishedIn.get(key)['bestAccessMode'] = instance['licence'].classid;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.publicationInfo.publishedIn.get(key)['accessMode'].push("");
|
this.publicationInfo.publishedIn.get(key)['accessMode'].push("");
|
||||||
}
|
}
|
||||||
|
@ -330,7 +378,8 @@ export class PublicationService {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "OPEN":
|
case "OPEN":
|
||||||
if(this.publicationInfo.title['url'] == "") {
|
if(instance['licence'].classid == "OPEN" &&
|
||||||
|
this.publicationInfo.title['url'] == "") {
|
||||||
this.publicationInfo.title['url'] = url;
|
this.publicationInfo.title['url'] = url;
|
||||||
console.info("title url by empty = "+this.publicationInfo.title.url);
|
console.info("title url by empty = "+this.publicationInfo.title.url);
|
||||||
}
|
}
|
||||||
|
@ -479,7 +528,7 @@ export class PublicationService {
|
||||||
&& this.publicationInfo.identifiers.has('doi')) {
|
&& this.publicationInfo.identifiers.has('doi')) {
|
||||||
|
|
||||||
if( this.publicationInfo.downloadFrom == null) {
|
if( this.publicationInfo.downloadFrom == null) {
|
||||||
this.publicationInfo.downloadFrom = new Map<string, {"url": string[], "accessMode": string[]}>();
|
this.publicationInfo.downloadFrom = new Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>();
|
||||||
}
|
}
|
||||||
|
|
||||||
let key: string;
|
let key: string;
|
||||||
|
@ -488,7 +537,7 @@ export class PublicationService {
|
||||||
} else {
|
} else {
|
||||||
key = this.publicationInfo.publisher;
|
key = this.publicationInfo.publisher;
|
||||||
}
|
}
|
||||||
this.publicationInfo.downloadFrom.set(key, {"url": null, "accessMode": null});
|
this.publicationInfo.downloadFrom.set(key, {"url": null, "accessMode": null, "bestAccessMode": null});
|
||||||
|
|
||||||
let url = OpenaireProperties.getDoiURL()+this.publicationInfo.identifiers.get("doi")[0];
|
let url = OpenaireProperties.getDoiURL()+this.publicationInfo.identifiers.get("doi")[0];
|
||||||
|
|
||||||
|
@ -500,7 +549,7 @@ export class PublicationService {
|
||||||
|
|
||||||
if(this.publicationInfo.title != undefined && this.publicationInfo.title['url'] == "") {
|
if(this.publicationInfo.title != undefined && this.publicationInfo.title['url'] == "") {
|
||||||
this.publicationInfo.title['url'] = url;
|
this.publicationInfo.title['url'] = url;
|
||||||
console.info("title url by doi = "+this.publicationInfo.title.url);
|
console.info("title url: by doi");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ export class PublicationInfo {
|
||||||
date: string;
|
date: string;
|
||||||
embargoEndDate: string;
|
embargoEndDate: string;
|
||||||
types: string[];
|
types: string[];
|
||||||
downloadFrom: Map<string, {"url": string[], "accessMode": string[]}>; //key is name
|
downloadFrom: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>; //key is name
|
||||||
publishedIn: Map<string, {"url": string[], "accessMode": string[]}>; //key is name
|
publishedIn: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>; //key is name
|
||||||
bioentities: Map<string, Map<string, string>>; //<site name, <>>
|
bioentities: Map<string, Map<string, string>>; //<site name, <>>
|
||||||
software: { "name": string, "url": string}[]; //<site name, <>>
|
software: { "name": string, "url": string}[]; //<site name, <>>
|
||||||
identifiers: Map<string, string[]>; //key is the classname
|
identifiers: Map<string, string[]>; //key is the classname
|
||||||
|
|
|
@ -43,6 +43,7 @@ export class OpenaireProperties {
|
||||||
// private static searchAPIURLLAst = " http://beta.services.openaire.eu/search/v2/api/";
|
// private static searchAPIURLLAst = " http://beta.services.openaire.eu/search/v2/api/";
|
||||||
private static searchAPIURLLAst = " http://beta.services.openaire.eu/search/v2/api/";
|
private static searchAPIURLLAst = " http://beta.services.openaire.eu/search/v2/api/";
|
||||||
//private static searchAPIURLLAst = "http://scoobydoo.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
|
//private static searchAPIURLLAst = "http://scoobydoo.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
|
||||||
|
//private static searchAPIURLLAst = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
|
||||||
|
|
||||||
// private static searchResourcesAPIURL = " http://beta.services.openaire.eu/search/v2/api/resources";
|
// private static searchResourcesAPIURL = " http://beta.services.openaire.eu/search/v2/api/resources";
|
||||||
private static searchResourcesAPIURL = " http://beta.services.openaire.eu/search/v2/api/resources";
|
private static searchResourcesAPIURL = " http://beta.services.openaire.eu/search/v2/api/resources";
|
||||||
|
|
Loading…
Reference in New Issue