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:
konstantina.galouni 2017-01-25 14:29:03 +00:00
parent b575656976
commit e2c0915f34
14 changed files with 307 additions and 162 deletions

View File

@ -17,13 +17,13 @@ import {OrganizationService} from '../services/organization.service';
<h2>Deposit {{requestFor}}</h2>
</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">
Loading...
</div>
<div *ngIf="searchDataprovidersComponent.searchUtils.totalResults > 0">
<h2 *ngIf="organization != undefined">
<div *ngIf="searchDataprovidersComponent.searchUtils.status == errorCodes.DONE">
<h2>
<span>Data providers for institution: </span>
<a *ngIf="organization['url']!=''" href="{{organization.url}}" target="_blank">
<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>
</h2>
</div>
<div *ngIf="searchDataprovidersComponent.searchUtils.totalResults > 0">
<p>Please use the information/contacts shown below to deposit your {{requestFor}}.</p>
<!--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>
<search-result [(results)]="searchDataprovidersComponent.results" [(status)]= "searchDataprovidersComponent.searchUtils.status"></search-result>
</div>
<div *ngIf="(searchDataprovidersComponent.searchUtils.totalResults == 0 && status == errorCodes.DONE)
|| status == errorCodes.NONE || status == errorCodes.ERROR" class = "alert alert-warning">
<div *ngIf="searchDataprovidersComponent.searchUtils.status == errorCodes.NONE
|| status == errorCodes.NONE
|| searchDataprovidersComponent.searchUtils.status == errorCodes.ERROR
|| status == errorCodes.ERROR"
class = "uk-alert uk-alert-warning" role="alert">
<div *ngIf="organization != undefined">
No data providers found
<span *ngIf="organization != undefined">
for institution:
<a *ngIf="organization['url']!=''" href="{{organization.url}}">
<span>{{organization['name']}}</span>
</a>
<span *ngIf="organization['url']==''">{{organization['name']}}</span>
<span *ngIf="searchDataprovidersComponent.searchUtils.status == errorCodes.ERROR">
An error occured.
</span>
No data providers found for institution:
<a *ngIf="organization['url']!=''" href="{{organization.url}}">
<span>{{organization['name']}}</span>
</a>
<span *ngIf="organization['url']==''">{{organization['name']}}</span>
.
</div>
<div *ngIf="organization == undefined && organizationId != ''">
<div *ngIf="status == errorCodes.NONE && organizationId != ''">
No organization with ID: {{organizationId}} found.
</div>
<div *ngIf="status == errorCodes.ERROR && organizationId != ''">
An error occured.
</div>
<div *ngIf="organizationId == ''">
No ID for organization.
</div>

View File

@ -76,6 +76,32 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
[paramsForSearchLink]="paramsForSearchLink"
[searchDatasetsComponent]="searchDatasetsComponent">
</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'"
[statistics]="statistics" [show]=statsClicked>
</statisticsTab-->
@ -94,7 +120,6 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
<i-frame [url]=docsTypesUrl width="800" height="350"></i-frame>
</div>
<div *ngIf="(searchPublicationsComponent.searchUtils.totalResults > 0)">
<div>
<p class="uk-text-bold">Funders in Data Providers Publications</p>
@ -102,13 +127,14 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
<p class="uk-text-bold">Projects with most Publications</p>
<i-frame [url]=pubsProjectsUrl width="800" height="350"></i-frame>
</div>
<div *ngIf="(searchDatasetsComponent.searchUtils.totalResults > 0)">
<div>
<p class="uk-text-bold">Projects with most Research Data</p>
<i-frame [url]=dataProjectsUrl width="800" height="350"></i-frame>
</div>
<div *ngIf="(searchDatasetsComponent.searchUtils.totalResults > 0)">
<div>
<p class="uk-text-bold">Projects with most Research Data</p>
<i-frame [url]=dataProjectsUrl width="800" height="350"></i-frame>
</div>
</div>
</div>
</div>
</div>
@ -133,10 +159,14 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
<b>Views: </b>{{metrics}}
</div-->
<metrics *ngIf="tabs[0].content=='metricsTab' && metricsClicked"
[id]="id" [type]="'datasources'" [name]="name">
[id]="id" [type]="'datasources'" [name]="name" (metricsResults)="metricsResults($event)">
</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" [url]=downloadsFrameUrl width="100%" height="250"></i-frame>
<i-frame *ngIf="tabs[0].content=='metricsTab' && metricsClicked && totalViews > 0"
[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 *ngFor="let tab of tabs; let i=index" id="{{tab.content}}">
@ -148,6 +178,23 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
[paramsForSearchLink]="paramsForSearchLink"
[searchDatasetsComponent]="searchDatasetsComponent">
</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'"
[searchPublicationsComponent] = "searchPublicationsComponent"
[searchDatasetsComponent]="searchDatasetsComponent" [id]="id">
@ -175,36 +222,25 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
<p class="uk-text-bold">Projects with most Publications</p>
<i-frame [url]=pubsProjectsUrl width="800" height="350"></i-frame>
</div>
<div *ngIf="(searchDatasetsComponent.searchUtils.totalResults > 0)">
<div>
<p class="uk-text-bold">Projects with most Research Data</p>
<i-frame [url]=dataProjectsUrl width="800" height="350"></i-frame>
</div>
<div *ngIf="(searchDatasetsComponent.searchUtils.totalResults > 0)">
<div>
<p class="uk-text-bold">Projects with most Research Data</p>
<i-frame [url]=dataProjectsUrl width="800" height="350"></i-frame>
</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"
[id]="id" [type]="'datasources'" [name]="name">
[id]="id" [type]="'datasources'" [name]="name" (metricsResults)="metricsResults($event)">
</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" [url]=downloadsFrameUrl width="100%" height="250"></i-frame>
<i-frame *ngIf="i>0 && tab.content=='metricsTab' && metricsClicked && totalViews > 0"
[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>
</ul>
`
@ -235,6 +271,8 @@ export class TabsComponent {
public metricsClicked: boolean;
private viewsFrameUrl: string;
private downloadsFrameUrl: string;
private totalViews: number;
private totalDownloads: number;
public statsClicked: boolean = false;
private docsTimelineUrl: string;
@ -304,6 +342,7 @@ export class TabsComponent {
}
private search(content: string, page: number, size: number) {
console.info(content);
if(content=='publicationsTab') {
this.searchPublications(page, size);
} else if(content=='datasetsTab') {
@ -311,6 +350,7 @@ export class TabsComponent {
} else if(content=='projectsTab') {
this.searchProjects(page, size);
} else if(content=='datasourcesTab') {
console.info("fdsfsfs");
this.searchDatasources(page, size);
} else if(content=='relatedDatasourcesTab') {
this.searchRelatedDatasources(1, 0);
@ -355,7 +395,9 @@ export class TabsComponent {
}
private searchDatasources(page: number, size: number) {
console.info("search intro");
if(this.reloadDataproviders) {
console.info("request");
this.searchDataprovidersComponent.getResultsForDataproviders(this.id, page, size);
}
this.reloadDataproviders = false;
@ -376,4 +418,9 @@ export class TabsComponent {
//searchPublicationsComponentAggregator
this.searchPublicationsComponentAggregators.getAggregatorResults(this.id, page, size);
}
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
}
}

View File

@ -94,9 +94,15 @@
</div>
</li>
<li id="metricsTab">
<metrics *ngIf="metricsClicked" [id]="datasetId" [type]="'results'"></metrics>
<i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="100%" height="250"></i-frame>
<i-frame *ngIf="metricsClicked" [url]=downloadsFrameUrl width="100%" height="250"></i-frame>
<metrics *ngIf="metricsClicked"
[id]="datasetId" [type]="'results'" (metricsResults)="metricsResults($event)">
</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>
</ul>
</div>

View File

@ -23,7 +23,8 @@ export class DatasetComponent {
private metricsClicked: boolean;
private viewsFrameUrl: string;
private downloadsFrameUrl: string;
private totalViews: number;
private totalDownloads: number;
public warningMessage = "";
public errorMessage = "";
@ -71,8 +72,13 @@ export class DatasetComponent {
);
}
showChange($event) {
this.showAllReferences=$event.value;
}
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
}
}

View File

@ -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 {MetricsService } from '../services/metrics.service';
import {ErrorCodes} from '../utils/properties/openaireProperties';
@ -84,6 +84,7 @@ import {ErrorCodes} from '../utils/properties/openaireProperties';
})
export class MetricsComponent {
@Output() metricsResults = new EventEmitter();
@Input() id: string;
@Input() type: string;
@Input() name: string = "";
@ -112,6 +113,11 @@ export class MetricsComponent {
data => {
this.metrics = data;
this.status = this.errorCodes.DONE;
this.metricsResults.emit({
totalViews: this.metrics.totalViews,
totalDownloads: this.metrics.totalDownloads
});
},
err => {
console.log(err);
@ -119,6 +125,10 @@ export class MetricsComponent {
if(err.status == '404') {
this.status = this.errorCodes.NOT_AVAILABLE;
}
this.metricsResults.emit({
totalViews: 0,
totalDownloads: 0
});
}
);
}

View File

@ -137,10 +137,16 @@
</div>
</li>
<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="100%" height="250"></i-frame>
<i-frame *ngIf="metricsClicked" [url]=downloadsFrameUrl width="100%" height="250"></i-frame>
<i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250">
</i-frame>
</li>
</ul>
</div>

View File

@ -24,6 +24,8 @@ export class ProjectComponent{
public metricsClicked: boolean;
public viewsFrameUrl: string;
public downloadsFrameUrl: string;
private totalViews: number;
private totalDownloads: number;
public statsClicked: boolean;
public chartScientificResultsUrl: string;
public chartAccessModeUrl: string;
@ -139,5 +141,10 @@ export class ProjectComponent{
.subscribe(data => window.open(window.URL.createObjectURL(data)),
error => console.log("Error downloading the file."),
() => console.log('Completed file download.'));
}
}
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
}
}

View File

@ -225,19 +225,25 @@
</table>
</li>
<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]=downloadsFrameUrl width="100%" height="250"></i-frame>
<i-frame *ngIf="metricsClicked && totalViews>0"
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
<i-frame *ngIf="metricsClicked && totalDownloads>0"
[url]=downloadsFrameUrl width="100%" height="250">
</i-frame>
</li>
</ul>
</div>
<div class="uk-width-3-10">
<ul class="uk-list uk-list-striped mainFunctionsBlock">
<ul class="uk-list uk-list-striped">
<li>
<dl class="uk-description-list-line functionsSection">
<dl class="uk-description-list-line">
<dt >Share - Bookmark</dt>
<dd>
<!--div *ngIf="doi != undefined"
@ -248,40 +254,39 @@
</dl>
</li>
<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>
<dd *ngIf="showAllDownloadFrom" class="uk-text-right">
<a class="uk-text-muted" (click)="showAllDownloadFrom = !showAllDownloadFrom;">
View less
</a>
</dd>
<dd class="line {{publicationInfo.downloadFrom.get(key)['accessMode']}}"
<dd class="line"
*ngFor="let key of publicationInfo.downloadFrom.keys() let i=index"
[title]="publicationInfo.downloadFrom.get(key)['accessMode']">
<span *ngIf="i<5 || showAllDownloadFrom" class="uk-icon-external-link">
<div *ngIf="publicationInfo.downloadFrom.get(key)['url'].length > 1">
{{key}}
<span *ngFor="let url of publicationInfo.downloadFrom.get(key)['url']; let i=index;">
<a href="{{url}}" [class]="publicationInfo.downloadFrom.get(key)['accessMode']"
[title]="publicationInfo.downloadFrom.get(key)['accessMode']"
target="_blank">
[{{i+1}}]
</a>
</span>
</div>
<a *ngIf="publicationInfo.downloadFrom.get(key)['url'].length == 1"
href="{{publicationInfo.downloadFrom.get(key)['url']}}"
target="_blank">
{{key}}
</a>
</span>
<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">
{{key}}
<span *ngFor="let url of publicationInfo.downloadFrom.get(key)['url']; let i=index;">
<a href="{{url}}" target="_blank"
[title]="publicationInfo.downloadFrom.get(key)['accessMode']">
[{{i+1}}]
</a>
</span>
</div>
<a *ngIf="publicationInfo.downloadFrom.get(key)['url'].length == 1"
href="{{publicationInfo.downloadFrom.get(key)['url']}}"
[title]="publicationInfo.downloadFrom.get(key)['accessMode']"
target="_blank">
{{key}}
</a>
</span>
</div>
</dd>
<dd *ngIf="showAllDownloadFrom" class="uk-text-right">
<a class="uk-text-muted" (click)="showAllDownloadFrom = !showAllDownloadFrom;">
View less
</a>
</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;">
View more
</a>
@ -289,28 +294,27 @@
</dl>
</li>
<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>
<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">
<div *ngIf="i<5 || showAllPublishedIn" class="uk-icon-external-link">
<div *ngIf="publicationInfo.publishedIn.get(key)['url'].length > 1">
{{key}}
<span *ngFor="let url of publicationInfo.publishedIn.get(key)['url']; let i=index">
<a href="{{url}}" target="_blank">
[{{i+1}}]
</a>
</span>
</div>
<a *ngIf="publicationInfo.publishedIn.get(key)['url'].length == 1"
href="{{publicationInfo.publishedIn.get(key)['url']}}"
target="_blank">
{{key}}
</a>
<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">
{{key}}
<span *ngFor="let url of publicationInfo.publishedIn.get(key)['url']; let i=index">
<a href="{{url}}" target="_blank"
[title]="publicationInfo.publishedIn.get(key)['accessMode']">
[{{i+1}}]
</a>
</span>
</div>
<a *ngIf="publicationInfo.publishedIn.get(key)['url'].length == 1"
href="{{publicationInfo.publishedIn.get(key)['url']}}"
[title]="publicationInfo.publishedIn.get(key)['accessMode']"
target="_blank">
{{key}}
</a>
</span>
</div>
</dd>
<dd *ngIf="showAllPublishedIn" class="uk-text-right">
@ -318,6 +322,7 @@
View less
</a>
</dd>
<dd *ngIf="!showAllPublishedIn && publicationInfo.publishedIn.size > 5">...</dd>
<dd *ngIf="!showAllPublishedIn && publicationInfo.publishedIn.length > 5" class="uk-text-right">
<a class="uk-text-muted" (click)="showAllPublishedIn = !showAllPublishedIn;">
View more
@ -327,13 +332,8 @@
</li>
<li *ngIf="publicationInfo.fundedByProjects != undefined">
<dl class="uk-description-list-line functionsSection" >
<dl class="uk-description-list-line" >
<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
data-uk-tooltip="{pos:'right'}" title="{{item['title']}}
| Project Code: {{item['code']}}
@ -359,16 +359,17 @@
View less
</a>
</dd>
<dd *ngIf="!showAllFundedBy && publicationInfo.fundedByProjects.length > 5">...</dd>
<dd *ngIf="!showAllFundedBy && publicationInfo.fundedByProjects.length > 5" class="uk-text-right">
<a class="uk-text-muted" (click)="showAllFundedBy = !showAllFundedBy;">
View more
</a>
</dd>
</dl>
</li>
<li *ngIf="publicationInfo.contexts != undefined">
<dl class="uk-description-list-line functionsSection" >
<dl class="uk-description-list-line" >
<dt class="title">Related to</dt>
<dd class="line" *ngFor="let item of publicationInfo.contexts">
<span *ngIf = "!item['inline']" >
@ -387,13 +388,8 @@
</li>
<li *ngIf="publicationInfo.collectedFrom != undefined">
<dl class="uk-description-list-line functionsSection">
<dl class="uk-description-list-line">
<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">
<a *ngIf="i<5 || showAllCollectedFrom" href="{{item['url']}}">
{{item['name']}}

View File

@ -17,12 +17,14 @@ export class PublicationComponent {
public showAllFundedBy: boolean = false;
public showAllPublishedIn: boolean = false;
sub: any;getPublicationView
sub: any;
articleId: string;
public publicationInfo: PublicationInfo;
private metricsClicked: boolean;
private viewsFrameUrl: string;
private downloadsFrameUrl: string;
private totalViews: number;
private totalDownloads: number;
public showAllReferences: boolean = false;
public showAllRelResData: boolean = false;
@ -98,10 +100,18 @@ export class PublicationComponent {
);
}
}
showChange($event) {
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;
}
}

View File

@ -5,12 +5,12 @@ import {Component, Input} from '@angular/core';
selector: 'showTitle',
template: `
<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"
[innerHTML]="title['name']">
</a>
</span>
<span *ngIf="title['url'] == undefined || title['url'] == null"
<span *ngIf="title['url'] == undefined || title['url'] == null || title['url'] == ''"
[innerHTML]="title['name']">
</span>
</h2>

View File

@ -120,24 +120,28 @@ export class ProjectService {
if(data[2].hasOwnProperty("to") && name != "") {
url = OpenaireProperties.getsearchLinkToOrganization()+data[2]['to'].content;
console.info("data[2]['to'].content: "+data[2]['to'].content);
}
if(name != "") {
this.projectInfo.organizations.set(name, url);
}
} else {
for(let i=0; i<data[2].length; i++) {
if(data[2][i].hasOwnProperty("legalshortname")) {
name = data[2][i].legalshortname;
} else if(data[2][i].hasOwnProperty("legalname")) {
name = data[2][i].legalname;
}
if(data[2][i].hasOwnProperty("to") && data[2][i]['to'].class == "hasParticipant") {
if(data[2][i].hasOwnProperty("legalshortname")) {
name = data[2][i].legalshortname;
} else if(data[2][i].hasOwnProperty("legalname")) {
name = data[2][i].legalname;
}
if(data[2][i].hasOwnProperty("to") && name!="") {
url = OpenaireProperties.getsearchLinkToOrganization()+data[2][i]['to'].content;
}
if(data[2][i].hasOwnProperty("to") && name!="") {
url = OpenaireProperties.getsearchLinkToOrganization()+data[2][i]['to'].content;
console.info("data[2]["+i+"]['to'].content: "+data[2][i]['to'].content);
}
if(name != "") {
this.projectInfo.organizations.set(name, url);
if(name != "") {
this.projectInfo.organizations.set(name, url);
}
}
}
}

View File

@ -67,7 +67,7 @@ export class PublicationService {
this.publicationInfo.title = {"name": "", "url": "", "accessMode": ""};
if(data[0]['bestlicense'].hasOwnProperty("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) {
@ -211,8 +211,8 @@ export class PublicationService {
if(data[3] != null) {
if(data[3].hasOwnProperty("instance")) {
this.publicationInfo.downloadFrom = new Map<string, {"url": string[], "accessMode": string[]}>();
this.publicationInfo.publishedIn = 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[], "bestAccessMode": string}>();
this.publicationInfo.types = new Array<string>();
@ -244,24 +244,49 @@ export class PublicationService {
if(instance.hasOwnProperty("hostedby")) {
if(instance['hostedby'].name != "other resources" && instance['hostedby'].name != "Unknown Repository") {
if(!this.publicationInfo.downloadFrom.has(instance['hostedby'].name)) {
this.publicationInfo.downloadFrom.set(instance['hostedby'].name, {"url": null, "accessMode": null});
let key: string = instance['hostedby'].name;
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(instance['hostedby'].name)['url'] = new Array<string>();
}
this.publicationInfo.downloadFrom.get(key)['url'].push(url);
this.publicationInfo.downloadFrom.get(instance['hostedby'].name)['url'].push(url);
if(this.publicationInfo.downloadFrom.get(instance['hostedby'].name)['accessMode'] == null) {
this.publicationInfo.downloadFrom.get(instance['hostedby'].name)['accessMode'] = new Array<string>();
if(this.publicationInfo.downloadFrom.get(key)['accessMode'] == null) {
this.publicationInfo.downloadFrom.get(key)['accessMode'] = new Array<string>();
}
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 {
this.publicationInfo.downloadFrom.get(instance['hostedby'].name)['accessMode'].push("");
this.publicationInfo.downloadFrom.get(key)['accessMode'].push("");
}
} else {
if(data[0] != null && data[0].hasOwnProperty("source")) {
@ -276,7 +301,7 @@ export class PublicationService {
}
if(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) {
@ -291,6 +316,29 @@ export class PublicationService {
if(instance.hasOwnProperty("licence")) {
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 {
this.publicationInfo.publishedIn.get(key)['accessMode'].push("");
}
@ -330,9 +378,10 @@ export class PublicationService {
}
break;
case "OPEN":
if(this.publicationInfo.title['url'] == "") {
this.publicationInfo.title['url'] = url;
console.info("title url by empty = "+this.publicationInfo.title.url);
if(instance['licence'].classid == "OPEN" &&
this.publicationInfo.title['url'] == "") {
this.publicationInfo.title['url'] = url;
console.info("title url by empty = "+this.publicationInfo.title.url);
}
break;
}
@ -479,7 +528,7 @@ export class PublicationService {
&& this.publicationInfo.identifiers.has('doi')) {
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;
@ -488,7 +537,7 @@ export class PublicationService {
} else {
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];
@ -500,7 +549,7 @@ export class PublicationService {
if(this.publicationInfo.title != undefined && this.publicationInfo.title['url'] == "") {
this.publicationInfo.title['url'] = url;
console.info("title url by doi = "+this.publicationInfo.title.url);
console.info("title url: by doi");
}
}

View File

@ -4,8 +4,8 @@ export class PublicationInfo {
date: string;
embargoEndDate: string;
types: string[];
downloadFrom: Map<string, {"url": string[], "accessMode": string[]}>; //key is name
publishedIn: 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[], "bestAccessMode": string}>; //key is name
bioentities: Map<string, Map<string, string>>; //<site name, <>>
software: { "name": string, "url": string}[]; //<site name, <>>
identifiers: Map<string, string[]>; //key is the classname

View File

@ -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://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";