use of uikit classes | tabs are not responsive in landing pages | metrics tab in landing pages updated (new component+service, removed from organization landing page)

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@45390 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2017-01-14 12:55:31 +00:00
parent e2aee4cadb
commit 85a98ff271
46 changed files with 1210 additions and 1279 deletions

View File

@ -32,18 +32,18 @@ export class XLargeDirective {
<div id="tm-main" class="tm-middle" uk-height-viewport="mode: expand"> <div id="tm-main" class="tm-middle" uk-height-viewport="mode: expand">
<div class="uk-container uk-container-center"> <div class="uk-container uk-container-center">
<div class="uk-grid" uk-grid> <div class="uk-grid" uk-grid>
<div class="tm-main uk-width-medium-3-4 uk-row-first"> <!--div class="tm-main uk-width-medium-3-4 uk-row-first"-->
<div class="tm-main uk-width-medium uk-row-first">
<main> <main>
<router-outlet></router-outlet> <router-outlet></router-outlet>
</main> </main>
</div> </div>
<!-- Sidebar --> <!-- Sidebar -->
<div id="tm-sidebar" class="tm-sidebar uk-width-medium-1-4 uk-hidden-small"> <!--div id="tm-sidebar" class="tm-sidebar uk-width-medium-1-4 uk-hidden-small"-->
<div class="uk-child-width-1-1" uk-grid> <div id="tm-sidebar" class="tm-sidebar uk-width-medium uk-hidden-small">
something in sidebar <!--div class="uk-child-width-1-1" uk-grid>
<login></login> <login></login>
</div> </div-->
</div> </div>
<!-- end of sidebar --> <!-- end of sidebar -->

View File

@ -1,3 +1,4 @@
//import {MaterialModule} from '@angular/material';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
@ -20,11 +21,10 @@ import { ErrorModule } from './error/error.module';
import {ServicesModule} from './services/services.module'; import {ServicesModule} from './services/services.module';
@NgModule({ @NgModule({
declarations: [ AppComponent, XLargeDirective ], declarations: [ AppComponent, XLargeDirective ],
imports: [ imports: [
//MaterialModule.forRoot(),
SharedModule, SharedModule,
HomeModule, HomeModule,
@ -38,7 +38,7 @@ import {ServicesModule} from './services/services.module';
TestModule, TestModule,
HomeModule, HomeModule,
AppRoutingModule, AppRoutingModule,
ErrorModule, ErrorModule
], exports:[] ], exports:[]
}) })
export class AppModule { export class AppModule {

View File

@ -10,7 +10,7 @@ import {ClaimResult} from '../../../utils/entities/claimEntities.class';
<div [ngClass]="showAccessRights?'col-md-8':'col-md-12'"> <div [ngClass]="showAccessRights?'col-md-8':'col-md-12'">
<span *ngIf="showAccessRights" (click)="removeDataset(dataset)" aria-hidden="true" class="btn "><i class="uk-icon-remove"></i></span> <span *ngIf="showAccessRights" (click)="removeDataset(dataset)" aria-hidden="true" class="btn "><i class="uk-icon-remove"></i></span>
<a *ngIf="dataset.url" target="_blank" href="{{dataset.url}}" >{{dataset.title}}</a> <a *ngIf="dataset.url" target="_blank" class="uk-icon-external-link" href="{{dataset.url}}" >{{dataset.title}}</a>
<span *ngIf="!dataset.url" >{{dataset.title}}</span> <span *ngIf="!dataset.url" >{{dataset.title}}</span>
<span *ngIf="dataset.date" >({{dataset.date.substring(0,4)}})</span> <span *ngIf="dataset.date" >({{dataset.date.substring(0,4)}})</span>
<span *ngIf="!showAccessRights" (click)="removeDataset(dataset)" aria-hidden="true" class="btn "><i class="uk-icon-remove"></i></span> <span *ngIf="!showAccessRights" (click)="removeDataset(dataset)" aria-hidden="true" class="btn "><i class="uk-icon-remove"></i></span>

View File

@ -1,40 +1,40 @@
<div> <div class="uk-container person">
<div class="container person"> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div>
<div class="container-header" > <div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div>
<div *ngIf="dataProviderInfo != null">
<h3 *ngIf="dataProviderInfo.title != null"> <div *ngIf="dataProviderInfo != null" class="uk-grid">
<div class="uk-width-7-10">
<!--h3 *ngIf="dataProviderInfo.title != null">
<a *ngIf="dataProviderInfo.title['url'] != undefined && dataProviderInfo.title['url'] != null" <a *ngIf="dataProviderInfo.title['url'] != undefined && dataProviderInfo.title['url'] != null"
href="{{dataProviderInfo.title['url']}}" target="_blank"> href="{{dataProviderInfo.title['url']}}" target="_blank" class="uk-icon-external-link">
{{dataProviderInfo.title['name']}} {{dataProviderInfo.title['name']}}
</a> </a>
<p *ngIf="dataProviderInfo.title['url'] == undefined || dataProviderInfo.title['url'] == null"> <p *ngIf="dataProviderInfo.title['url'] == undefined || dataProviderInfo.title['url'] == null">
{{dataProviderInfo.title['name']}} {{dataProviderInfo.title['name']}}
</p> </p>
</h3> </h3-->
</div> <showTitle [title]="dataProviderInfo.title"></showTitle>
<div *ngIf="warningMessage.length > 0" class="alert alert-warning" role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="alert alert-danger" role="alert">{{errorMessage}}</div>
</div>
<div class="row row-offcanvas row-offcanvas-right" > <dl class="uk-description-list-horizontal">
<div class="col-xs-6 col-sm-9 sidebar-offcanvas" *ngIf="dataProviderInfo != null">
<dl class="dl-horizontal">
<dt *ngIf="dataProviderInfo.type != undefined && dataProviderInfo.type != ''">Type: </dt> <dt *ngIf="dataProviderInfo.type != undefined && dataProviderInfo.type != ''">Type: </dt>
<dd *ngIf="dataProviderInfo.type != undefined && dataProviderInfo.type != ''">{{dataProviderInfo.type}}</dd> <dd *ngIf="dataProviderInfo.type != undefined && dataProviderInfo.type != ''">{{dataProviderInfo.type}}</dd>
<dt *ngIf="dataProviderInfo.compatibility != undefined && dataProviderInfo.compatibility != ''">Compatibility: </dt> <dt *ngIf="dataProviderInfo.compatibility != undefined && dataProviderInfo.compatibility != ''">Compatibility: </dt>
<dd *ngIf="dataProviderInfo.compatibility != undefined && dataProviderInfo.compatibility != ''">{{dataProviderInfo.compatibility}}</dd> <dd *ngIf="dataProviderInfo.compatibility != undefined && dataProviderInfo.compatibility != ''">{{dataProviderInfo.compatibility}}</dd>
<dt *ngIf="dataProviderInfo.oaiPmhURL != undefined && dataProviderInfo.oaiPmhURL != ''">OAI-PMH: </dt> <dt *ngIf="dataProviderInfo.oaiPmhURL != undefined && dataProviderInfo.oaiPmhURL != ''">OAI-PMH: </dt>
<dd *ngIf="dataProviderInfo.oaiPmhURL != undefined && dataProviderInfo.oaiPmhURL != ''"> <dd *ngIf="dataProviderInfo.oaiPmhURL != undefined && dataProviderInfo.oaiPmhURL != ''">
<span class="uk-icon-external-link">
<a href="{{dataProviderInfo.oaiPmhURL}}" target="_blank"> <a href="{{dataProviderInfo.oaiPmhURL}}" target="_blank">
{{dataProviderInfo.oaiPmhURL}} {{dataProviderInfo.oaiPmhURL}}
</a> </a>
</span>
</dd> </dd>
<dt *ngIf="dataProviderInfo.countries != undefined && dataProviderInfo.countries.length > 0">Countries: </dt> <dt *ngIf="dataProviderInfo.countries != undefined && dataProviderInfo.countries.length > 0">Countries: </dt>
<dd *ngIf="dataProviderInfo.countries != undefined">{{dataProviderInfo.countries}}</dd> <dd *ngIf="dataProviderInfo.countries != undefined">{{dataProviderInfo.countries}}</dd>
</dl> </dl>
<tabs [id] = "datasourceId" <tabs [id] = "datasourceId"
[name] = "dataProviderInfo.title['name']"
[resultsBy] = "dataProviderInfo.resultsBy" [resultsBy] = "dataProviderInfo.resultsBy"
[tabs]="dataProviderInfo.tabs" [tabs]="dataProviderInfo.tabs"
[statistics]="dataProviderInfo.statistics" [statistics]="dataProviderInfo.statistics"
@ -44,13 +44,12 @@
</div> </div>
<div class="col-xs-12 col-sm-3" *ngIf="dataProviderInfo != null"> <div class="uk-width-3-10">
<ul class="uk-list"> <ul class="uk-list uk-list-striped">
<li class="list-group-item"> <li>
Share - Bookmark Share - Bookmark
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
</div>
</div> </div>

View File

@ -8,7 +8,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
@Component({ @Component({
selector: 'datasetsTab', selector: 'datasetsTab',
template: ` template: `
<div *ngIf="searchDatasetsComponent.searchUtils.totalResults == 0" class = "alert alert-info " > <div *ngIf="searchDatasetsComponent.searchUtils.totalResults == 0" class = "uk-alert">
There are no datasets There are no datasets
</div> </div>

View File

@ -7,7 +7,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
@Component({ @Component({
selector: 'datasourcesTab', selector: 'datasourcesTab',
template: ` template: `
<div *ngIf="searchDataprovidersComponent.searchUtils.totalResults == 0" class = "alert alert-info " > <div *ngIf="searchDataprovidersComponent.searchUtils.totalResults == 0" class = "uk-alert">
There are no datasources There are no datasources
</div> </div>

View File

@ -3,7 +3,7 @@ import {Component, Input} from '@angular/core';
@Component({ @Component({
selector: 'organizationsTab', selector: 'organizationsTab',
template: ` template: `
<div *ngIf="organizations.length == 0" class = "alert alert-info " > <div *ngIf="organizations.length == 0" class = "uk-alert">
There are no organizations There are no organizations
</div> </div>
@ -15,7 +15,7 @@ import {Component, Input} from '@angular/core';
<div *ngFor="let item of organizations"> <div *ngFor="let item of organizations">
<p *ngIf=" item != undefined && item['url'] != undefined"> <p *ngIf=" item != undefined && item['url'] != undefined">
<a href="{{item['url']}}" target="_blank"> <a href="{{item['url']}}">
{{item['name']}} {{item['name']}}
</a> </a>
</p> </p>

View File

@ -8,7 +8,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
@Component({ @Component({
selector: 'projectsTab', selector: 'projectsTab',
template: ` template: `
<div *ngIf="searchProjectsComponent.searchUtils.totalResults == 0" class = "alert alert-info " > <div *ngIf="searchProjectsComponent.searchUtils.totalResults == 0" class = "uk-alert">
There are no projects There are no projects
</div> </div>

View File

@ -8,7 +8,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
@Component({ @Component({
selector: 'publicationsTab', selector: 'publicationsTab',
template: ` template: `
<div *ngIf="searchPublicationsComponent.searchUtils.totalResults == 0" class = "alert alert-info " > <div *ngIf="searchPublicationsComponent.searchUtils.totalResults == 0" class = "uk-alert">
There are no publications There are no publications
</div> </div>

View File

@ -9,7 +9,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
selector: 'relatedDatasourcesTab', selector: 'relatedDatasourcesTab',
template: ` template: `
<div *ngIf="searchPublicationsComponent.results.length == 0" class = "alert alert-info " > <div *ngIf="searchPublicationsComponent.results.length == 0" class = "uk-alert">
There are no related dataproviders There are no related dataproviders
</div> </div>
@ -22,19 +22,20 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
<table class="uk-table uk-table-striped"> <table class="uk-table uk-table-striped">
<thead> <thead>
<tr> <tr>
<th class="text-center">Data Provider Name</th> <th class="uk-text-center">Data Provider Name</th>
<th class="text-center">Number of publications/ datasets</th> <th class="uk-text-center">Number of publications/ datasets</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let item of searchPublicationsComponent.results"> <tr *ngFor="let item of searchPublicationsComponent.results">
<td class="text-center"> <td class="uk-text-center">
<a href="{{item.url}}" target="_blank"> <a href="{{item.url}}" target="_blank" class="uk-icon-external-link">
{{item.name}} {{item.name}}
</a> </a>
</td> </td>
<td class="text-center"> <td class="uk-text-center">
<a href="{{linkToSearchPublications}}{{item.id}}&ho=and&collectedFrom={{dataproviderId}}&co=and" target="_blank"> <a href="{{linkToSearchPublications}}{{item.id}}&ho=and&collectedFrom={{dataproviderId}}&co=and"
target="_blank" class="uk-icon-external-link">
{{item.count}} {{item.count}}
</a> </a>
</td> </td>

View File

@ -3,7 +3,7 @@ import {Component, Input} from '@angular/core';
@Component({ @Component({
selector: 'statisticsTab', selector: 'statisticsTab',
template: ` template: `
<div *ngIf="statistics == undefined" class = "alert alert-info " > <div *ngIf="statistics == undefined" class = "uk-alert">
There are no statistics There are no statistics
</div> </div>

View File

@ -13,53 +13,53 @@ import { SearchDataprovidersService } from '../../services/searchDataproviders.s
@Component({ @Component({
selector: 'tabs', selector: 'tabs',
template: ` template: `
<ul *ngIf="tabs != undefined" class="nav nav-tabs"> <ul *ngIf="tabs != undefined" class="uk-tab" data-uk-switcher="{connect:'#tab-content'}">
<li *ngIf="tabs.length>0" class="active"> <li *ngIf="tabs.length>0" class="uk-active">
<a data-toggle="tab" href="#{{tabs[0].content}}"> <a href="#{{tabs[0].content}}">
{{tabs[0].name}} {{tabs[0].name}}
<span class="badge" *ngIf="tabs[0].content=='publicationsTab'"> <span class="uk-badge uk-badge-notification" *ngIf="tabs[0].content=='publicationsTab'">
{{searchPublicationsComponent.searchUtils.totalResults}} {{searchPublicationsComponent.searchUtils.totalResults}}
</span> </span>
<span class="badge" *ngIf="tabs[0].content=='datasetsTab'"> <span class="uk-badge uk-badge-notification" *ngIf="tabs[0].content=='datasetsTab'">
{{searchDatasetsComponent.searchUtils.totalResults}} {{searchDatasetsComponent.searchUtils.totalResults}}
</span> </span>
<span class="badge" *ngIf="tabs[0].content=='projectsTab'"> <span class="uk-badge uk-badge-notification" *ngIf="tabs[0].content=='projectsTab'">
{{searchProjectsComponent.searchUtils.totalResults}} {{searchProjectsComponent.searchUtils.totalResults}}
</span> </span>
<span class="badge" *ngIf="tabs[0].content=='datasourcesTab'"> <span class="uk-badge uk-badge-notification" *ngIf="tabs[0].content=='datasourcesTab'">
{{searchDataprovidersComponent.searchUtils.totalResults}} {{searchDataprovidersComponent.searchUtils.totalResults}}
</span> </span>
<span class="badge" *ngIf="tabs[0].content=='organizationsTab'"> <span class="uk-badge uk-badge-notification" *ngIf="tabs[0].content=='organizationsTab'">
{{organizations.length}} {{organizations.length}}
</span> </span>
</a> </a>
</li> </li>
<li *ngFor="let tab of tabs; let i=index" role="presentation"> <li *ngFor="let tab of tabs; let i=index">
<a *ngIf="i>0" <a *ngIf="i>0"
(click)="search(tab.content, 1, 10)" data-toggle="tab" href="#{{tab.content}}"> (click)="search(tab.content, 1, 10)" href="#{{tab.content}}">
{{tab.name}} {{tab.name}}
<span class="badge" *ngIf="tab.content=='publicationsTab'"> <span class="uk-badge uk-badge-notification" *ngIf="tab.content=='publicationsTab'">
{{searchPublicationsComponent.searchUtils.totalResults}} {{searchPublicationsComponent.searchUtils.totalResults}}
</span> </span>
<span class="badge" *ngIf="tab.content=='datasetsTab'"> <span class="uk-badge uk-badge-notification" *ngIf="tab.content=='datasetsTab'">
{{searchDatasetsComponent.searchUtils.totalResults}} {{searchDatasetsComponent.searchUtils.totalResults}}
</span> </span>
<span class="badge" *ngIf="tab.content=='projectsTab'"> <span class="uk-badge uk-badge-notification" *ngIf="tab.content=='projectsTab'">
{{searchProjectsComponent.searchUtils.totalResults}} {{searchProjectsComponent.searchUtils.totalResults}}
</span> </span>
<span class="badge" *ngIf="tab.content=='datasourcesTab'"> <span class="uk-badge uk-badge-notification" *ngIf="tab.content=='datasourcesTab'">
{{searchDataprovidersComponent.searchUtils.totalResults}} {{searchDataprovidersComponent.searchUtils.totalResults}}
</span> </span>
<span class="badge" *ngIf="tab.content=='organizationsTab'"> <span class="uk-badge uk-badge-notification" *ngIf="tab.content=='organizationsTab'">
{{organizations.length}} {{organizations.length}}
</span> </span>
</a> </a>
</li> </li>
</ul> </ul>
<div *ngIf="tabs != undefined" class="tab-content"> <ul *ngIf="tabs != undefined" id="tab-content" class="uk-switcher uk-margin">
<div *ngIf="tabs.length>0" id="{{tabs[0].content}}" class="tab-pane fade in active panel-body"> <li *ngIf="tabs.length>0" id="{{tabs[0].content}}">
<publicationsTab *ngIf="tabs[0].content=='publicationsTab'" <publicationsTab *ngIf="tabs[0].content=='publicationsTab'"
[paramsForSearchLink]="paramsForSearchLink" [paramsForSearchLink]="paramsForSearchLink"
[searchPublicationsComponent]="searchPublicationsComponent"> [searchPublicationsComponent]="searchPublicationsComponent">
@ -85,12 +85,20 @@ import { SearchDataprovidersService } from '../../services/searchDataproviders.s
<relatedDatasourcesTab *ngIf="tabs[0].content=='relatedDatasourcesTab'" <relatedDatasourcesTab *ngIf="tabs[0].content=='relatedDatasourcesTab'"
[searchPublicationsComponent]="searchPublicationsComponentAggregators"> [searchPublicationsComponent]="searchPublicationsComponentAggregators">
</relatedDatasourcesTab> </relatedDatasourcesTab>
<div *ngIf="tabs[0].content=='metricsTab'" class="well"> <!--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}} <b>Views: </b>{{metrics}}
</div> </div-->
</div> <metrics *ngIf="tabs[0].content=='metricsTab' && metricsClicked"
[id]="id" [type]="'datasources'" [name]="name">
</metrics>
<div *ngFor="let tab of tabs; let i=index" id="{{tab.content}}" class="tab-pane fade panel-body">
</li>
<li *ngFor="let tab of tabs; let i=index" id="{{tab.content}}">
<publicationsTab *ngIf="i>0 && tab.content=='publicationsTab'" <publicationsTab *ngIf="i>0 && tab.content=='publicationsTab'"
[paramsForSearchLink]="paramsForSearchLink" [paramsForSearchLink]="paramsForSearchLink"
[searchPublicationsComponent] = "searchPublicationsComponent"> [searchPublicationsComponent] = "searchPublicationsComponent">
@ -115,17 +123,18 @@ import { SearchDataprovidersService } from '../../services/searchDataproviders.s
[dataproviderId]="id" [dataproviderId]="id"
[searchPublicationsComponent]="searchPublicationsComponentAggregators"> [searchPublicationsComponent]="searchPublicationsComponentAggregators">
</relatedDatasourcesTab> </relatedDatasourcesTab>
<div *ngIf="i>0 && tab.content=='metricsTab'" class="well"> <metrics *ngIf="i>0 && tab.content=='metricsTab' && metricsClicked"
<b>Views: </b>{{metrics}} [id]="id" [type]="'datasources'" [name]="name">
</div> </metrics>
</div> </li>
</div> </ul>
` `
}) })
export class TabsComponent { export class TabsComponent {
@Input() id: string; @Input() id: string;
@Input() name: string;
@Input() resultsBy: string; @Input() resultsBy: string;
@Input() tabs: {"name": string, "content": string}[]; @Input() tabs: {"name": string, "content": string}[];
//@Input() publications; //@Input() publications;
@ -137,8 +146,6 @@ export class TabsComponent {
@Input() _dataproviderService; @Input() _dataproviderService;
public metrics: string;
public paramsForSearchLink: string = ""; public paramsForSearchLink: string = "";
public reloadPublications: boolean = true; public reloadPublications: boolean = true;
@ -146,6 +153,7 @@ export class TabsComponent {
public reloadProjects: boolean = true; public reloadProjects: boolean = true;
public reloadDataproviders: boolean = true; public reloadDataproviders: boolean = true;
public reloadRelatedDatasources: boolean = true; public reloadRelatedDatasources: boolean = true;
public metricsClicked: boolean;
public searchPublicationsComponent : SearchPublicationsComponent; public searchPublicationsComponent : SearchPublicationsComponent;
public searchDatasetsComponent: SearchDatasetsComponent; public searchDatasetsComponent: SearchDatasetsComponent;
@ -169,6 +177,8 @@ export class TabsComponent {
if(this.tabs != undefined && this.tabs.length > 0) { if(this.tabs != undefined && this.tabs.length > 0) {
this.search(this.tabs[0].content, 1, 10); this.search(this.tabs[0].content, 1, 10);
this.count(1, 0); this.count(1, 0);
this.metricsClicked = false;
} }
if(this.resultsBy == "collectedFrom") { if(this.resultsBy == "collectedFrom") {
@ -209,23 +219,10 @@ export class TabsComponent {
} 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.getMetrics(); this.metricsClicked = true;
} }
} }
private getMetrics() {
console.info("getDatasourceMetrics: component");
this._dataproviderService.getMetrics(this.id).subscribe(
data => {
this.metrics = data;
},
err => {
console.log(err);
console.info("error");
}
);
}
private searchPublications(page: number, size: number) { private searchPublications(page: number, size: number) {
if(this.reloadPublications) { if(this.reloadPublications) {
this.searchPublicationsComponent.getResultsForDataproviders(this.id, this.resultsBy, page, size); this.searchPublicationsComponent.getResultsForDataproviders(this.id, this.resultsBy, page, size);

View File

@ -1,15 +1,18 @@
<div class="container dataset"> <div class="uk-container dataset">
<div class="container-header" > <!--div class="container-header" -->
<div *ngIf="datasetInfo != null" >
<showTitle [title]="datasetInfo.title"></showTitle>
</div>
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div> <div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div>
<div *ngIf="datasetInfo != null" class="uk-grid">
<div class="uk-width-7-10">
<showTitle [title]="datasetInfo.title"></showTitle>
<!--/div>
</div> </div>
<div class="uk-grid" > <div class="uk-grid">
<div class="uk-width-2-3" *ngIf="datasetInfo != null"> <div class="uk-width-2-3" *ngIf="datasetInfo != null"-->
<div> <div>
<showAuthors [authors]="datasetInfo.authors"></showAuthors> <showAuthors [authors]="datasetInfo.authors"></showAuthors>
<span *ngIf="datasetInfo.date != ''">({{datasetInfo.date}})</span> <span *ngIf="datasetInfo.date != ''">({{datasetInfo.date}})</span>
@ -39,7 +42,7 @@
</div> </div>
<inline-claim-result inlineType ="dataset" [inlineEntity]="result" (datasetAdded)="resultsAdded($event,false)" (publicationAdded)="resultsAdded($event,true)" ></inline-claim-result> <inline-claim-result inlineType ="dataset" [inlineEntity]="result" (datasetAdded)="resultsAdded($event,false)" (publicationAdded)="resultsAdded($event,true)" ></inline-claim-result>
<ul class="uk-tab" data-uk-tab="{connect:'#tab-content'}"> <ul class="uk-tab" data-uk-switcher="{connect:'#tab-content'}">
<li class="uk-active"> <li class="uk-active">
<a href="#relatedTab"> <a href="#relatedTab">
Related Research Results Related Research Results
@ -60,7 +63,7 @@
</a> </a>
</li> </li>
<li (click)="getMetrics()"> <li (click)="metricsClicked=true">
<a href="#metricsTab"> <a href="#metricsTab">
Metrics Metrics
</a> </a>
@ -95,46 +98,12 @@
</div> </div>
</li> </li>
<li id="metricsTab"> <li id="metricsTab">
<div *ngIf="metrics == undefined" class = "uk-alert uk-alert-warning"> <metrics *ngIf="metricsClicked" [id]="datasetId" [type]="'results'"></metrics>
Metrics are currently unavailable
</div>
<dl *ngIf="metrics != undefined" class="uk-description-list-horizontal uk-block">
<dt>TotalDownloads: </dt>
<dd>{{metrics.totalDownloads}}</dd>
<dt>TotalViews: </dt>
<dd>{{metrics.totalViews}}</dd>
</dl>
<table *ngIf="metrics != undefined && metrics.infos.size > 0"
class="uk-table uk-table-striped">
<thead>
<tr>
<th class="uk-text-center">ID</th>
<th class="uk-text-center">Number Of Downloads</th>
<th class="uk-text-center">Number Of Views</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let key of metrics.infos.keys()">
<td class="uk-text-center">
<a href="{{metrics.infos.get(key).url}}" target="_blank">
{{key}}
</a>
</td>
<td class="uk-text-center">
{{metrics.infos.get(key).numOfDownloads}}
</td>
<td class="uk-text-center">
{{metrics.infos.get(key).numOfViews}}
</td>
</tr>
</tbody>
</table>
</li> </li>
</ul> </ul>
</div> </div>
<div class="uk-width-1-3" *ngIf="datasetInfo != null"> <div class="uk-width-3-10" *ngIf="datasetInfo != null">
<ul class="uk-list uk-list-striped mainFunctionsBlock"> <ul class="uk-list uk-list-striped mainFunctionsBlock">
<li> <li>
<dl class="uk-description-list-line functionsSection"> <dl class="uk-description-list-line functionsSection">

View File

@ -2,7 +2,6 @@ import {Component, ViewChild} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs/Observable';
import {DatasetService} from '../../services/dataset.service'; import {DatasetService} from '../../services/dataset.service';
import {DatasetInfo} from '../../utils/entities/datasetInfo'; import {DatasetInfo} from '../../utils/entities/datasetInfo';
import {Metrics} from '../../utils/entities/metrics';
import {ActivatedRoute} from '@angular/router'; import {ActivatedRoute} from '@angular/router';
import {OpenaireProperties} from '../../utils/properties/openaireProperties' import {OpenaireProperties} from '../../utils/properties/openaireProperties'
import {InlineClaimContextComponent} from '../../claimPages/inlineClaims/inlineClaimContext.component'; import {InlineClaimContextComponent} from '../../claimPages/inlineClaims/inlineClaimContext.component';
@ -28,11 +27,10 @@ export class DatasetComponent {
} }
}); });
this.metricsClicked = false;
} }
public datasetInfo: DatasetInfo; public datasetInfo: DatasetInfo;
private metrics: Metrics;
private showStyle: boolean = false; private showStyle: boolean = false;
private showAllReferences: boolean = false; private showAllReferences: boolean = false;
private showAllRelResData: boolean = false; private showAllRelResData: boolean = false;
@ -40,7 +38,7 @@ export class DatasetComponent {
private showAllBioentities: boolean = false; private showAllBioentities: boolean = false;
private datasetId : string ; private datasetId : string ;
private result ; private result ;
private metricsClicked: boolean;
@ViewChild (InlineClaimProjectComponent) inlineClaimProject : InlineClaimProjectComponent ; @ViewChild (InlineClaimProjectComponent) inlineClaimProject : InlineClaimProjectComponent ;
@ViewChild (InlineClaimContextComponent) inlineClaimContext : InlineClaimContextComponent ; @ViewChild (InlineClaimContextComponent) inlineClaimContext : InlineClaimContextComponent ;
@ -74,18 +72,6 @@ export class DatasetComponent {
} }
getMetrics() {
console.info("getDatasetMetrics: component");
this._datasetService.getMetrics(this.datasetId).subscribe(
data => {
this.metrics = data;
},
err => {
console.log(err);
}
);
}
/********** Methods for Inline Claim of project / dataset ******/ /********** Methods for Inline Claim of project / dataset ******/
toggleClaimProject(){ toggleClaimProject(){
this.inlineClaimProject.toggle(); this.inlineClaimProject.toggle();

View File

@ -1,4 +1,4 @@
//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';
@ -15,6 +15,7 @@ import {ShowTitleComponent} from './showTitle.component';
import {ShowAuthorsComponent} from './showAuthors.component'; import {ShowAuthorsComponent} from './showAuthors.component';
import {ShowIdentifiersComponent} from './showIdentifiers.component'; import {ShowIdentifiersComponent} from './showIdentifiers.component';
import {ShowSubjectsComponent} from './showSubjects.component'; import {ShowSubjectsComponent} from './showSubjects.component';
import {MetricsComponent} from './metrics.component';
import {PublicationsTabComponent} from './dataProvider/publicationsTab.component'; import {PublicationsTabComponent} from './dataProvider/publicationsTab.component';
import {DatasetsTabComponent} from './dataProvider/datasetsTab.component'; import {DatasetsTabComponent} from './dataProvider/datasetsTab.component';
@ -25,7 +26,6 @@ import {OrganizationsTabComponent} from './dataProvider/organizationsTab.compone
import {RelatedDatasourcesTabComponent} from './dataProvider/relatedDatasourcesTab.component'; import {RelatedDatasourcesTabComponent} from './dataProvider/relatedDatasourcesTab.component';
import {TabsComponent} from './dataProvider/tabs.component'; import {TabsComponent} from './dataProvider/tabs.component';
import {DataProviderComponent} from './dataProvider/dataProvider.component'; import {DataProviderComponent} from './dataProvider/dataProvider.component';
import { PersonComponent } from './person/person.component'; import { PersonComponent } from './person/person.component';
import { ProjectComponent } from './project/project.component'; import { ProjectComponent } from './project/project.component';
@ -37,6 +37,7 @@ import { LandingRoutingModule } from './landing-routing.module';
@NgModule({ @NgModule({
imports: [ imports: [
//MaterialModule.forRoot(),
CommonModule, FormsModule, CommonModule, FormsModule,
UtilsModule, UtilsModule,
ClaimModule, ClaimModule,
@ -46,7 +47,7 @@ import { LandingRoutingModule } from './landing-routing.module';
], ],
declarations: [ declarations: [
TabPagingComponent, TabTableComponent, ShowTitleComponent, ShowAuthorsComponent,ShowIdentifiersComponent,ShowSubjectsComponent, TabPagingComponent, TabTableComponent, ShowTitleComponent, ShowAuthorsComponent,ShowIdentifiersComponent,ShowSubjectsComponent, MetricsComponent,
PublicationsTabComponent, DatasetsTabComponent, StatisticsTabComponent, ProjectsTabComponent, DatasourcesTabComponent, OrganizationsTabComponent, RelatedDatasourcesTabComponent, TabsComponent, PublicationsTabComponent, DatasetsTabComponent, StatisticsTabComponent, ProjectsTabComponent, DatasourcesTabComponent, OrganizationsTabComponent, RelatedDatasourcesTabComponent, TabsComponent,
DataProviderComponent, PersonComponent, ProjectComponent, PublicationComponent, OrganizationComponent, DatasetComponent, DataProviderComponent, PersonComponent, ProjectComponent, PublicationComponent, OrganizationComponent, DatasetComponent,
], ],

View File

@ -0,0 +1,108 @@
import {Component, Input} from '@angular/core';
import {Metrics} from '../utils/entities/metrics';
import {MetricsService } from '../services/metrics.service';
@Component({
selector: 'metrics',
template: `
<div *ngIf="metrics == undefined" class = "uk-alert uk-alert-warning">
Metrics are currently unavailable
</div>
<!--div *ngIf="i>0 && tab.content=='metricsTab' && metrics != undefined" class="uk-panel uk-panel-box"-->
<!--/div-->
<!--dl *ngIf="metrics != undefined"
class="uk-description-list-horizontal uk-panel uk-panel-box">
<dt *ngIf="type=='results'">Total Downloads: </dt>
<dt *ngIf="type!='results'" class="uk-text-break">
Total <span [innerHTML]="name"></span> Publication Downloads:
</dt>
<dd>{{metrics.totalDownloads}}</dd>
<dt>Total Views: </dt>
<dd>{{metrics.totalViews}}</dd>
</dl-->
<table *ngIf="metrics != undefined"
class="uk-table uk-panel-box">
<thead>
<tr>
<th *ngIf="type=='results'" class="uk-text-center">Total Downloads</th>
<th *ngIf="type!='results'" class="uk-text-center">
Total <span [innerHTML]="name"></span> Publication Downloads
</th>
<th *ngIf="type=='results'" class="uk-text-center">Total Views</th>
<th *ngIf="type!='results'" class="uk-text-center">
Total <span [innerHTML]="name"></span> Publication Views
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="uk-text-center">
{{metrics.totalDownloads}}
</td>
<td class="uk-text-center">
{{metrics.totalViews}}
</td>
</tr>
</tbody>
</table>
<table *ngIf="metrics != undefined && metrics.infos.size > 0"
class="uk-table uk-table-striped">
<thead>
<tr>
<th class="uk-text-center">From</th>
<th class="uk-text-center">Number Of Downloads</th>
<th class="uk-text-center">Number Of Views</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let key of metrics.infos.keys()">
<td class="uk-text-center">
<a href="{{metrics.infos.get(key).url}}">
{{metrics.infos.get(key).name}}
</a>
</td>
<td class="uk-text-center">
{{metrics.infos.get(key).numOfDownloads}}
</td>
<td class="uk-text-center">
{{metrics.infos.get(key).numOfViews}}
</td>
</tr>
</tbody>
</table>
`
})
export class MetricsComponent {
@Input() id: string;
@Input() type: string;
@Input() name: string = "";
metrics: Metrics;
constructor (private _metricsService: MetricsService) {}
ngOnInit() {
this.getMetrics();
}
getMetrics() {
//if(this.id == undefined || this.id == "") {
// console.log("supplied id in metrics is not acceptable");
//}
//if(this.type == undefined || this.type == "") {
// console.log("supplied id in metrics is not acceptable");
//}
this._metricsService.getMetrics(this.id, this.type).subscribe(
data => {
this.metrics = data;
},
err => {
console.log(err);
}
);
}
}

View File

@ -1,10 +1,13 @@
<div> <div class="uk-container organization">
<div class="container organization"> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div>
<div class="container-header" > <div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div>
<!--div class="container-header" >
<div *ngIf="organizationInfo != null"> <div *ngIf="organizationInfo != null">
<h3 *ngIf="organizationInfo.title != undefined"> <h3 *ngIf="organizationInfo.title != undefined">
<a *ngIf="organizationInfo.title['url'] != ''" <a *ngIf="organizationInfo.title['url'] != ''"
href="{{organizationInfo.title['url']}}" target="_blank"> href="{{organizationInfo.title['url']}}"
target="_blank" class="uk-icon-external-link">
{{organizationInfo.title['name']}} {{organizationInfo.title['name']}}
</a> </a>
<p *ngIf="organizationInfo.title['url'] == ''"> <p *ngIf="organizationInfo.title['url'] == ''">
@ -12,13 +15,14 @@
</p> </p>
</h3> </h3>
</div> </div>
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div>
</div> </div>
<div class="uk-grid"> <div class="uk-grid"-->
<div *ngIf="organizationInfo != null" class="uk-grid">
<div class="uk-width-7-10">
<showTitle [title]="organizationInfo.title"></showTitle>
<div class="uk-width-2-3" *ngIf="organizationInfo != null"> <!--div class="uk-width-2-3" *ngIf="organizationInfo != null"-->
<dl class="uk-description-list-horizontal"> <dl class="uk-description-list-horizontal">
<dt *ngIf="organizationInfo.name != undefined && organizationInfo.name != ''">Name: </dt> <dt *ngIf="organizationInfo.name != undefined && organizationInfo.name != ''">Name: </dt>
<dd *ngIf="organizationInfo.name != undefined && organizationInfo.name != ''">{{organizationInfo.name}}</dd> <dd *ngIf="organizationInfo.name != undefined && organizationInfo.name != ''">{{organizationInfo.name}}</dd>
@ -26,7 +30,7 @@
<dd *ngIf="organizationInfo.country != undefined && organizationInfo.country != ''">{{organizationInfo.country}}</dd> <dd *ngIf="organizationInfo.country != undefined && organizationInfo.country != ''">{{organizationInfo.country}}</dd>
</dl> </dl>
<ul class="uk-tab" data-uk-tab="{connect:'#tab-content'}"> <ul class="uk-tab" data-uk-switcher="{connect:'#tab-content'}">
<li class="uk-active"> <li class="uk-active">
<a href="#projectsTab"> <a href="#projectsTab">
Projects Projects
@ -45,11 +49,11 @@
</span> </span>
</a> </a>
</li> </li>
<li (click)="getMetrics()"> <!--li (click)="getMetrics()">
<a href="#metricsTab"> <a href="#metricsTab">
Metrics Metrics
</a> </a>
</li> </li-->
</ul> </ul>
<ul id="tab-content" class="uk-switcher uk-margin"> <ul id="tab-content" class="uk-switcher uk-margin">
@ -96,7 +100,7 @@
{{key}} {{key}}
</td> </td>
<td *ngIf="fundersSet.has(key)"> <td *ngIf="fundersSet.has(key)">
<a *ngIf="item['url'] != '' && item['name'] != ''" class="custom-external" href="{{item['url']}}" target="_blank"> <a *ngIf="item['url'] != '' && item['name'] != ''" href="{{item['url']}}">
{{item['name']}} {{item['name']}}
</a> </a>
<p *ngIf="item['url'] == '' && item['name'] != ''">{{item['name']}}</p> <p *ngIf="item['url'] == '' && item['name'] != ''">{{item['name']}}</p>
@ -125,18 +129,18 @@
<search-result [(results)]="searchDataprovidersComponent.results" [(status)]= "searchDataprovidersComponent.status"></search-result> <search-result [(results)]="searchDataprovidersComponent.results" [(status)]= "searchDataprovidersComponent.status"></search-result>
</div> </div>
</li> </li>
<li id="metricsTab"> <!--li id="metricsTab">
<div *ngIf="metrics == undefined" class = "uk-alert uk-alert-warning"> <div *ngIf="metrics == undefined" class = "uk-alert uk-alert-warning">
Metrics are currently unavailable Metrics are currently unavailable
</div> </div>
<div class="uk-block"> <div *ngIf="metrics != undefined" class="uk-panel uk-panel-box">
<b>Views: </b>{{metrics}} <b>Views: </b>{{metrics}}
</div> </div>
</li> </li-->
</ul> </ul>
</div> </div>
<div class="uk-width-1-3" *ngIf="organizationInfo != null"> <div class="uk-width-3-10">
<ul class="uk-list uk-list-striped"> <ul class="uk-list uk-list-striped">
<li> <li>
Share - Bookmark Share - Bookmark
@ -154,5 +158,4 @@
</ul> </ul>
</div> </div>
</div> </div>
</div>
</div> </div>

View File

@ -21,7 +21,7 @@ import {ExportCSVComponent} from '../../utils/exportCSV.component';
export class OrganizationComponent { export class OrganizationComponent {
organizationInfo: OrganizationInfo; organizationInfo: OrganizationInfo;
private metrics: string; //private metrics: string;
private organizationId: string; private organizationId: string;
private projectsNum: number = 0; private projectsNum: number = 0;
private fundersSet: Set<string>; private fundersSet: Set<string>;
@ -110,7 +110,7 @@ export class OrganizationComponent {
} }
); );
} }
/*
private getMetrics() { private getMetrics() {
console.info("getOrganizationMetrics: component"); console.info("getOrganizationMetrics: component");
this._organizationService.getMetrics(this.organizationId).subscribe( this._organizationService.getMetrics(this.organizationId).subscribe(
@ -122,7 +122,7 @@ export class OrganizationComponent {
} }
); );
} }
*/
private handleClick(funder: string) { private handleClick(funder: string) {
if(this.emptyFundersSet) { if(this.emptyFundersSet) {
this.fundersSet.clear(); this.fundersSet.clear();

View File

@ -1,16 +1,11 @@
<div> <div class="uk-container person">
<div class="container person">
<div class="container-header" >
<div *ngIf="personInfo != null">
<h3>{{personInfo.fullname}}</h3>
</div>
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div> <div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div>
</div>
<div class="uk-grid"> <div *ngIf="personInfo != null" class="uk-grid">
<div class="uk-width-7-10">
<h2>{{personInfo.fullname}}</h2>
<div class="uk-width-2-3" *ngIf="personInfo != null">
<dl class="uk-description-list-horizontal"> <dl class="uk-description-list-horizontal">
<dt *ngIf="personInfo.secondnames != undefined && personInfo.secondnames != ''">Last name: </dt> <dt *ngIf="personInfo.secondnames != undefined && personInfo.secondnames != ''">Last name: </dt>
<dd *ngIf="personInfo.secondnames != undefined && personInfo.secondnames != ''">{{personInfo.secondnames}}</dd> <dd *ngIf="personInfo.secondnames != undefined && personInfo.secondnames != ''">{{personInfo.secondnames}}</dd>
@ -20,7 +15,7 @@
<dd *ngIf="personInfo.country != undefined && personInfo.country != ''">{{personInfo.country}}</dd> <dd *ngIf="personInfo.country != undefined && personInfo.country != ''">{{personInfo.country}}</dd>
</dl> </dl>
<ul class="uk-tab" data-uk-tab="{connect:'#tab-content'}"> <ul class="uk-tab" data-uk-switcher="{connect:'#tab-content'}">
<li class="uk-active"> <li class="uk-active">
<a href="#publicationsTab"> <a href="#publicationsTab">
Publications Publications
@ -75,7 +70,7 @@
</ul> </ul>
</div> </div>
<div class="uk-width-1-3" *ngIf="personInfo != null"> <div class="uk-width-3-10">
<ul class="uk-list uk-list-striped"> <ul class="uk-list uk-list-striped">
<li> <li>
Share - Bookmark Share - Bookmark
@ -83,5 +78,4 @@
</ul> </ul>
</div> </div>
</div> </div>
</div>
</div> </div>

View File

@ -1,17 +1,12 @@
<div> <div class="uk-container person">
<div class="container person">
<div class="container-header" >
<div *ngIf="projectInfo != null">
<h3 *ngIf="projectInfo.acronym != undefined && projectInfo.acronym != ''">{{projectInfo.acronym}}</h3>
<h3 *ngIf="projectInfo.acronym == undefined || projectInfo.acronym == ''">{{projectInfo.title}}</h3>
</div>
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div> <div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div>
</div>
<div class="uk-grid" > <div *ngIf="projectInfo != null" class="uk-grid">
<div class="uk-width-7-10">
<div class="uk-width-2-3" *ngIf="projectInfo != null"> <!--h3 *ngIf="projectInfo.acronym != undefined && projectInfo.acronym != ''">{{projectInfo.acronym}}</h3>
<h3 *ngIf="projectInfo.acronym == undefined || projectInfo.acronym == ''">{{projectInfo.title}}</h3-->
<h3>{{projectName}}</h3>
<dl class="uk-description-list-horizontal"> <dl class="uk-description-list-horizontal">
<dt *ngIf="projectInfo.title != undefined && projectInfo.title != ''">Title: </dt> <dt *ngIf="projectInfo.title != undefined && projectInfo.title != ''">Title: </dt>
@ -35,7 +30,7 @@
<span *ngFor="let key of projectInfo.organizations.keys() let i=index"> <span *ngFor="let key of projectInfo.organizations.keys() let i=index">
<a *ngIf="projectInfo.organizations.get(key) != null && <a *ngIf="projectInfo.organizations.get(key) != null &&
projectInfo.organizations.get(key) != ''" projectInfo.organizations.get(key) != ''"
href="{{(projectInfo.organizations.get(key))}}" target="_blank"> href="{{(projectInfo.organizations.get(key))}}">
{{key}} {{key}}
</a> </a>
<span *ngIf="projectInfo.organizations.get(key) == null || <span *ngIf="projectInfo.organizations.get(key) == null ||
@ -47,9 +42,11 @@
</dd> </dd>
<dt *ngIf="projectInfo.urlInfo != undefined && projectInfo.urlInfo != ''">More information:</dt> <dt *ngIf="projectInfo.urlInfo != undefined && projectInfo.urlInfo != ''">More information:</dt>
<dd *ngIf="projectInfo.urlInfo != undefined && projectInfo.urlInfo != ''"> <dd *ngIf="projectInfo.urlInfo != undefined && projectInfo.urlInfo != ''">
<span class="uk-icon-external-link">
<a target="_blank" href="{{projectInfo.url}}"> <a target="_blank" href="{{projectInfo.url}}">
{{projectInfo.urlInfo}} {{projectInfo.urlInfo}}
</a> </a>
</span>
</dd> </dd>
</dl> </dl>
<div class="uk-text-right"> <div class="uk-text-right">
@ -57,7 +54,7 @@
</div> </div>
<inline-claim-result inlineType ="'project'" [inlineEntity]=project (datasetAdded)="resultsAdded($event,false)" (publicationAdded)="resultsAdded($event,true)" ></inline-claim-result> <inline-claim-result inlineType ="'project'" [inlineEntity]=project (datasetAdded)="resultsAdded($event,false)" (publicationAdded)="resultsAdded($event,true)" ></inline-claim-result>
<ul class="uk-tab" data-uk-tab="{connect:'#tab-content'}"> <ul class="uk-tab" data-uk-switcher="{connect:'#tab-content'}">
<li class="uk-active"> <li class="uk-active">
<a href="#publicationsTab"> <a href="#publicationsTab">
Publications Publications
@ -79,7 +76,7 @@
Statistics Statistics
</a> </a>
</li> </li>
<li (click)="getMetrics()"> <li (click)="metricsClicked=true;">
<a href="#metricsTab"> <a href="#metricsTab">
Metrics Metrics
</a> </a>
@ -132,18 +129,13 @@
</div> </div>
</li> </li>
<li id="metricsTab"> <li id="metricsTab">
<div *ngIf="metrics == undefined" class = "uk-alert uk-alert-warning"> <metrics *ngIf="metricsClicked" [id]="projectId" [type]="'projects'" [name]="projectName"></metrics>
Metrics are currently unavailable
</div>
<div class="uk-block">
<b>Views: </b>{{metrics}}
</div>
<i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="100%" height="350"></i-frame> <i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="100%" height="350"></i-frame>
</li> </li>
</ul> </ul>
</div> </div>
<div class="uk-width-1-3" *ngIf="projectInfo != null"> <div class="uk-width-3-10">
<ul class="uk-list uk-list-striped"> <ul class="uk-list uk-list-striped">
<li> <li>
Share - Bookmark Share - Bookmark
@ -188,5 +180,4 @@
</ul> </ul>
</div> </div>
</div> </div>
</div>
</div> </div>

View File

@ -22,7 +22,7 @@ export class ProjectComponent{
private projectId : string ; private projectId : string ;
public projectInfo: ProjectInfo; public projectInfo: ProjectInfo;
private metrics: string; private projectName: string;
private metricsClicked: boolean; private metricsClicked: boolean;
private viewsFrameUrl: string; private viewsFrameUrl: string;
@ -119,8 +119,9 @@ export class ProjectComponent{
data => { data => {
this.projectInfo = data; this.projectInfo = data;
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 };
console.log(this.project);
this.projectName = (this.projectInfo.acronym != undefined && this.projectInfo.acronym != '') ? this.projectInfo.acronym : this.projectInfo.title;
this.viewsFrameUrl = ('http://vaggelas.athenarc.gr/stats/merge.php?com=query&data=[{"table":"project_stats_monthly","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":"Number of views for project '+this.projectName+'","yaxisheaders":["sum of views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"id","values":["'+this.projectId+'"],"to":"-1"}]}]&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');
}, },
err => { err => {
console.log(err); console.log(err);
@ -129,22 +130,6 @@ export class ProjectComponent{
); );
} }
getMetrics() {
this.metricsClicked = true;
let projectName: string = (this.projectInfo.acronym != undefined && this.projectInfo.acronym != '') ? this.projectInfo.acronym : this.projectInfo.title;
this.viewsFrameUrl = ('http://vaggelas.athenarc.gr/stats/merge.php?com=query&data=[{"table":"project_stats_monthly","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":"Number of views for project '+projectName+'","yaxisheaders":["sum of views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"id","values":["'+this.projectId+'"],"to":"-1"}]}]&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');
console.info("getProjectMetrics: component");
this._projectService.getMetrics(this.projectId).subscribe(
data => {
this.metrics = data;
},
err => {
console.log(err);
}
);
}
/* /*
********* Methods for Inline Claim of results ***** ********* Methods for Inline Claim of results *****
*/ */

View File

@ -1,15 +1,18 @@
<div class="container publication"> <div class="uk-container publication">
<div class="container-header" > <!--div class="container-header" -->
<div *ngIf="publicationInfo != null">
<showTitle [title]="publicationInfo.title"></showTitle>
</div>
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div> <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div> <div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div>
</div>
<div class="uk-grid"> <div *ngIf="publicationInfo != null" class="uk-grid">
<div class="uk-width-7-10">
<showTitle [title]="publicationInfo.title"></showTitle>
<!--/div-->
<!--/div-->
<div class="uk-width-2-3" *ngIf="publicationInfo != null"> <!--div class="uk-grid"-->
<!--div class="uk-width-7-10" *ngIf="publicationInfo != null"-->
<div> <div>
<showAuthors [authors]="publicationInfo.authors"></showAuthors> <showAuthors [authors]="publicationInfo.authors"></showAuthors>
<span *ngIf="publicationInfo.date != ''">({{publicationInfo.date}})</span> <span *ngIf="publicationInfo.date != ''">({{publicationInfo.date}})</span>
@ -56,7 +59,7 @@
</div> </div>
<inline-claim-result inlineType ="publication" [inlineEntity]="result" (datasetAdded)="resultsAdded($event,false)" (publicationAdded)="resultsAdded($event,true)" ></inline-claim-result> <inline-claim-result inlineType ="publication" [inlineEntity]="result" (datasetAdded)="resultsAdded($event,false)" (publicationAdded)="resultsAdded($event,true)" ></inline-claim-result>
<ul class="uk-tab" data-uk-tab="{connect:'#tab-content'}" (click)="myfunct()"> <ul class="uk-tab" data-uk-switcher="{connect:'#tab-content'}">
<li class="uk-active"> <li class="uk-active">
<a href="#citationsTab"> <a href="#citationsTab">
References References
@ -97,7 +100,7 @@
</a> </a>
</li> </li>
<li> <li>
<a id="metrtab" href="#metricsTab" (click)="getMetrics('bla')"> <a href="#metricsTab" (click)="metricsClicked=true;">
Metrics Metrics
</a> </a>
</li> </li>
@ -111,15 +114,15 @@
</div> </div>
<div *ngIf="publicationInfo.references != undefined"> <div *ngIf="publicationInfo.references != undefined">
<tabPaging [showAll]="showAllReferences" [length]="publicationInfo.references.length" (changeShowAll)="showChange($event)"></tabPaging> <div>
<p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:">Let us know how we are doing!</a>
</p> </div>
<tabPaging [showAll]="showAllReferences" [length]="publicationInfo.references.length" (changeShowAll)="showChange($event)"></tabPaging>
<div *ngFor="let item of publicationInfo.references.slice(0,10)"> <div *ngFor="let item of publicationInfo.references.slice(0,10)">
<p *ngIf=" item != undefined && item['url'] != undefined"> <p *ngIf=" item != undefined && item['url'] != undefined" class="uk-icon-external-link">
<a href="{{item['url']}}" target="_blank"> <a href="{{item['url']}}" target="_blank">
{{item['name']}} {{item['name']}}
</a> </a>
@ -131,7 +134,7 @@
<div *ngIf="showAllReferences"> <div *ngIf="showAllReferences">
<div *ngFor="let item of publicationInfo.references.slice(10)"> <div *ngFor="let item of publicationInfo.references.slice(10)">
<p *ngIf=" item != undefined && item['url'] != undefined"> <p *ngIf=" item != undefined && item['url'] != undefined" class="uk-icon-external-link">
<a href="{{item['url']}}" target="_blank"> <a href="{{item['url']}}" target="_blank">
{{item['name']}} {{item['name']}}
</a> </a>
@ -189,8 +192,9 @@
</thead> </thead>
<tbody *ngFor="let key of publicationInfo.bioentities.keys()"> <tbody *ngFor="let key of publicationInfo.bioentities.keys()">
<tr *ngFor="let keyIn of publicationInfo.bioentities.get(key).keys()"> <tr *ngFor="let keyIn of publicationInfo.bioentities.get(key).keys()">
<td class="uk-text-center" *ngIf="keyIn != undefined"> <td class="uk-text-center uk-icon-external-link" *ngIf="keyIn != undefined">
<a href="{{publicationInfo.bioentities.get(key).get(keyIn)}}" target="_blank"> <a href="{{publicationInfo.bioentities.get(key).get(keyIn)}}"
target="_blank">
{{keyIn}} {{keyIn}}
</a> </a>
</td> </td>
@ -213,8 +217,8 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let item of publicationInfo.software"> <tr *ngFor="let item of publicationInfo.software" class="uk-text-center">
<td class="uk-text-center"> <td class="uk-icon-external-link">
<a href="{{item.url}}" target="_blank"> <a href="{{item.url}}" target="_blank">
{{item.name}} {{item.name}}
</a> </a>
@ -224,47 +228,14 @@
</table> </table>
</li> </li>
<li id="metricsTab"> <li id="metricsTab">
<div *ngIf="metrics == undefined" class = "uk-alert uk-alert-warning"> <metrics *ngIf="metricsClicked" [id]="articleId" [type]="'results'"></metrics>
Metrics are currently unavailable
</div>
<dl *ngIf="metrics != undefined" class="uk-description-list-horizontal uk-block">
<dt>TotalDownloads: </dt>
<dd>{{metrics.totalDownloads}}</dd>
<dt>TotalViews: </dt>
<dd>{{metrics.totalViews}}</dd>
</dl>
<table *ngIf="metrics != undefined && metrics.infos.size > 0"
class="uk-table uk-table-striped">
<thead>
<tr>
<th class="uk-text-center">ID</th>
<th class="uk-text-center">Number Of Downloads</th>
<th class="uk-text-center">Number Of Views</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let key of metrics.infos.keys()">
<td class="uk-text-center">
<a href="{{metrics.infos.get(key).url}}" target="_blank">
{{key}}
</a>
</td>
<td class="uk-text-center">
{{metrics.infos.get(key).numOfDownloads}}
</td>
<td class="uk-text-center">
{{metrics.infos.get(key).numOfViews}}
</td>
</tr>
</tbody>
</table>
<!--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]=openaireViewsFrameUrl width="100%" height="250"></i-frame> <i-frame *ngIf="metricsClicked" [url]=openaireViewsFrameUrl width="100%" height="250"></i-frame>
</li> </li>
</ul> </ul>
</div> </div>
<div class="uk-width-1-3" *ngIf="publicationInfo != null">
<div class="uk-width-3-10">
<ul class="uk-list uk-list-striped mainFunctionsBlock"> <ul class="uk-list uk-list-striped mainFunctionsBlock">
<li> <li>
@ -308,20 +279,24 @@
View less View less
</a> </a>
</dd> </dd>
<dd class="line" *ngFor="let key of publicationInfo.downloadFrom.keys() let i=index"> <dd class="line {{publicationInfo.downloadFrom.get(key)['accessMode']}}"
<div *ngIf="i<5 || showAllDownloadFrom"> *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"> <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}}"> <a href="{{url}}" [class]="publicationInfo.downloadFrom.get(key)['accessMode']"
[{{i+1}}] -- accessMode={{publicationInfo.downloadFrom.get(key)['accessMode']}} [title]="publicationInfo.downloadFrom.get(key)['accessMode']">
[{{i+1}}]
</a> </a>
</span> </span>
</div> </div>
<a *ngIf="publicationInfo.downloadFrom.get(key)['url'].length == 1" href="{{publicationInfo.downloadFrom.get(key)['url']}}"> <a *ngIf="publicationInfo.downloadFrom.get(key)['url'].length == 1"
{{key}} -- accessMode={{publicationInfo.downloadFrom.get(key)['accessMode']}} href="{{publicationInfo.downloadFrom.get(key)['url']}}">
{{key}}
</a> </a>
</div> </span>
</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;">
@ -344,7 +319,7 @@
</a> </a>
</dd> </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"> <div *ngIf="i<5 || showAllPublishedIn" 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">
@ -353,7 +328,8 @@
</a> </a>
</span> </span>
</div> </div>
<a *ngIf="publicationInfo.publishedIn.get(key)['url'].length == 1" href="{{publicationInfo.publishedIn.get(key)['url']}}"> <a *ngIf="publicationInfo.publishedIn.get(key)['url'].length == 1"
href="{{publicationInfo.publishedIn.get(key)['url']}}">
{{key}} {{key}}
</a> </a>
</div> </div>
@ -440,7 +416,7 @@
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
<!--script> <!--script>
$("#tabs").on('change.uk.tab', function(event, area, previous){ $("#tabs").on('change.uk.tab', function(event, area, previous){

View File

@ -2,7 +2,6 @@ import {Component, ViewChild} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs/Observable';
import {PublicationService} from '../../services/publication.service'; import {PublicationService} from '../../services/publication.service';
import {PublicationInfo} from '../../utils/entities/publicationInfo'; import {PublicationInfo} from '../../utils/entities/publicationInfo';
import {Metrics} from '../../utils/entities/metrics';
import {ActivatedRoute} from '@angular/router'; import {ActivatedRoute} from '@angular/router';
import {OpenaireProperties} from '../../utils/properties/openaireProperties'; import {OpenaireProperties} from '../../utils/properties/openaireProperties';
import {InlineClaimContextComponent} from '../../claimPages/inlineClaims/inlineClaimContext.component'; import {InlineClaimContextComponent} from '../../claimPages/inlineClaims/inlineClaimContext.component';
@ -21,11 +20,10 @@ export class PublicationComponent {
public showAllFundedBy: boolean = false; public showAllFundedBy: boolean = false;
public showAllPublishedIn: boolean = false; public showAllPublishedIn: boolean = false;
constructor (private _publicationService: PublicationService, private route: ActivatedRoute) { constructor (private _publicationService: PublicationService,
private route: ActivatedRoute) {
} }
ngOnInit() { ngOnInit() {
this.metricsClicked = false;
this.sub = this.route.queryParams.subscribe(data => { this.sub = this.route.queryParams.subscribe(data => {
this.articleId = data['articleId']; this.articleId = data['articleId'];
console.info("Article id is :"+this.articleId); console.info("Article id is :"+this.articleId);
@ -34,22 +32,20 @@ export class PublicationComponent {
}else{ }else{
console.info("Article id not found"); console.info("Article id not found");
} }
}); });
this.metricsClicked = false;
//this.viewsFrameUrl = 'http://vaggelas.athenarc.gr/stats/merge.php?com=query&data=[{"table":"result_stats_monthly","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":0,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Number of views for '+this.publicationInfo.title.name+'","yaxisheaders":["sum of views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"result_stats_monthly(id)-(id)result-id","values":["'+this.articleId+'"],"to":"-1"}]}]&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.openaireViewsFrameUrl = 'http://vaggelas.athenarc.gr/stats/merge.php?com=query&data=[{"table":"result_stats_monthly_charts","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":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"result_stats_monthly_charts(id)-(id)result-id","values":["'+this.articleId+'"],"to":"-1"}]},{"table":"repo_view_stats_monthly_charts","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"repo_view_stats_monthly_charts(source)-(piwik_id)datasource_piwik(openaire_id)-(id)datasource-name","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":0,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"repo_view_stats_monthly_charts(id)-(orid)result_oids(id)-(id)result-id","values":["'+this.articleId+'"],"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';
} }
ngAfterContentInit() {
}
ngOnDestroy() { ngOnDestroy() {
this.sub.unsubscribe(); this.sub.unsubscribe();
} }
sub: any;getPublicationView sub: any;getPublicationView
articleId: string; articleId: string;
public publicationInfo: PublicationInfo; public publicationInfo: PublicationInfo;
private metrics: Metrics;
private metricsClicked: boolean; private metricsClicked: boolean;
private viewsFrameUrl: string; private viewsFrameUrl: string;
private openaireViewsFrameUrl: string; private openaireViewsFrameUrl: string;
@ -71,19 +67,6 @@ ngAfterContentInit() {
public warningMessage = ""; public warningMessage = "";
public errorMessage = ""; public errorMessage = "";
public activeTab: string = '';
public myfunct() {
//this.activeTab = tab;
/*UIkit.ul($('[data-uk-tab]').on('show.uk.tab', function(event, area){
console.info("Switcher switched to ", area);
}));*/
//var elem = document.activeElement;
//console.info("id="+elem.id);
console.info("hi");
}
getPublicationInfo(id:string) { getPublicationInfo(id:string) {
this.warningMessage = ''; this.warningMessage = '';
this.errorMessage="" this.errorMessage=""
@ -117,23 +100,6 @@ ngAfterContentInit() {
} }
} }
getMetrics(id: any) {
console.info(id);
this.metricsClicked = true;
//this.viewsFrameUrl = 'http://vaggelas.athenarc.gr/stats/merge.php?com=query&data=[{"table":"result_stats_monthly","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":0,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Number of views for '+this.publicationInfo.title.name+'","yaxisheaders":["sum of views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"result_stats_monthly(id)-(id)result-id","values":["'+this.articleId+'"],"to":"-1"}]}]&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.openaireViewsFrameUrl = 'http://vaggelas.athenarc.gr/stats/merge.php?com=query&data=[{"table":"result_stats_monthly_charts","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":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"result_stats_monthly_charts(id)-(id)result-id","values":["'+this.articleId+'"],"to":"-1"}]},{"table":"repo_view_stats_monthly_charts","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"repo_view_stats_monthly_charts(source)-(piwik_id)datasource_piwik(openaire_id)-(id)datasource-name","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":0,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"repo_view_stats_monthly_charts(id)-(orid)result_oids(id)-(id)result-id","values":["'+this.articleId+'"],"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';
console.info("getPublicationMetrics: component");
this._publicationService.getMetrics(this.articleId).subscribe(
data => {
this.metrics = data;
},
err => {
console.log(err);
}
);
}
/* /*
********* Methods for Inline Claim of project / publication ***** ********* Methods for Inline Claim of project / publication *****
*/ */

View File

@ -8,14 +8,14 @@ import {Component, Input} from '@angular/core';
<a class="uk-text-muted" (click)="showAll = !showAll;">View less authors</a> <a class="uk-text-muted" (click)="showAll = !showAll;">View less authors</a>
</div> </div>
<span *ngFor="let item of authors.slice(0,30)"> <span *ngFor="let item of authors.slice(0,30)">
<a class="custom-external" href="{{item['url']}}" target="_blank"> <a href="{{item['url']}}">
{{item['name']}}; {{item['name']}};
</a> </a>
</span> </span>
<span *ngIf="!showAll && authors.length > 30"> ... </span> <span *ngIf="!showAll && authors.length > 30"> ... </span>
<span *ngIf="showAll"> <span *ngIf="showAll">
<span *ngFor="let item of authors.slice(30)"> <span *ngFor="let item of authors.slice(30)">
<a class="custom-external" href="{{item['url']}}" target="_blank"> <a href="{{item['url']}}">
{{item['name']}}; {{item['name']}};
</a> </a>
</span> </span>

View File

@ -10,14 +10,16 @@ import {OpenaireProperties} from '../utils/properties/openaireProperties';
<span *ngFor="let key of identifiers.keys() let i=index"> <span *ngFor="let key of identifiers.keys() let i=index">
<span *ngFor="let item of identifiers.get(key) let j=index"> <span *ngFor="let item of identifiers.get(key) let j=index">
<span *ngIf="i>0 || j>0">, </span> <span *ngIf="i>0 || j>0">, </span>
<a *ngIf="key=='doi'" class="custom-external" href="{{doiURL}}{{item}}" target="_blank"> <span class="uk-icon-external-link">
<a *ngIf="key=='doi'" href="{{doiURL}}{{item}}" target="_blank">
{{key}}: {{item}} {{key}}: {{item}}
</a> </a>
<a *ngIf="key=='pmc'" class="custom-external" href="{{pmcURL}}{{item}}" target="_blank"> <a *ngIf="key=='pmc'" href="{{pmcURL}}{{item}}" target="_blank">
{{key}}: {{item}} {{key}}: {{item}}
</a> </a>
</span> </span>
</span> </span>
</span>
</dd> </dd>
</span> </span>

View File

@ -29,9 +29,7 @@ import {Component, Input} from '@angular/core';
</div> </div>
</dd> </dd>
<dd class="uk-grid" <dd *ngIf="classifiedSubjects != undefined && classifiedSubjects.size > 0">
*ngIf="classifiedSubjects != undefined && classifiedSubjects.size > 0">
<div uk-push-4-5>
<a (click)="showClassifiedSbj = !showClassifiedSbj;"> <a (click)="showClassifiedSbj = !showClassifiedSbj;">
<div *ngIf="!showClassifiedSbj"> <div *ngIf="!showClassifiedSbj">
Show additional classifications Show additional classifications
@ -43,7 +41,7 @@ import {Component, Input} from '@angular/core';
</div> </div>
</a> </a>
<div class="uk-block" *ngIf="showClassifiedSbj"> <div class="uk-panel uk-panel-box" *ngIf="showClassifiedSbj">
<div *ngFor="let key of classifiedSubjects.keys()"> <div *ngFor="let key of classifiedSubjects.keys()">
Classified by OpenAIRE into Classified by OpenAIRE into
<div> <div>
@ -51,7 +49,6 @@ import {Component, Input} from '@angular/core';
</div> </div>
</div> </div>
</div> </div>
</div>
</dd> </dd>
</span> </span>
` `

View File

@ -5,14 +5,14 @@ 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']" >
<div *ngIf="title['url'] != undefined"> <span *ngIf="title['url'] != undefined && title['url'] != null" class="uk-icon-external-link">
<a class="custom-external" href="{{title['url']}}" target="_blank"> <a href="{{title['url']}}" target="_blank"
<div [innerHTML]="title['name']"></div> [innerHTML]="title['name']">
</a> </a>
</div> </span>
<div *ngIf="title['url'] == undefined"> <span *ngIf="title['url'] == undefined || title['url'] == null"
<div [innerHTML]="title['name']"></div> [innerHTML]="title['name']">
</div> </span>
</h2> </h2>
` `
@ -26,5 +26,8 @@ export class ShowTitleComponent {
} }
ngOnInit() { ngOnInit() {
if(this.title['accessMode'] == undefined) {
this.title['accessMode'] = "";
}
} }
} }

View File

@ -3,13 +3,11 @@ import {Component, Input, Output, EventEmitter} from '@angular/core';
@Component({ @Component({
selector: 'tabPaging', selector: 'tabPaging',
template: ` template: `
<div class="panel panel-default" *ngIf="!showAll && length > 10"> <div class="uk-panel" *ngIf="!showAll && length > 10">
<div class="panel-heading">
<a (click)="changeShowAll.emit({value: true});"> <a (click)="changeShowAll.emit({value: true});">
<div class="uk-float-right">view all {{length}}</div> <div class="uk-float-right">view all {{length}}</div>
</a> </a>
</div> </div>
</div>
` `
}) })

View File

@ -17,7 +17,7 @@ import {Component, Input} from '@angular/core';
<span *ngIf="item['class'] == 'dataset'" class="glyphicon glyphicon-star" aria-hidden="true"> <span *ngIf="item['class'] == 'dataset'" class="glyphicon glyphicon-star" aria-hidden="true">
</span> </span>
<a *ngIf="item['url'] != '' && item['name'] != ''" class="custom-external" href="{{item['url']}}" target="_blank"> <a *ngIf="item['url'] != '' && item['name'] != ''" href="{{item['url']}}">
{{item['name']}} {{item['name']}}
</a> </a>
<p *ngIf="item['url'] == '' && item['name'] != ''">{{item['name']}}</p> <p *ngIf="item['url'] == '' && item['name'] != ''">{{item['name']}}</p>

View File

@ -8,7 +8,7 @@ import {SearchCrossrefService} from '../services/searchCrossref.service';
template: ` template: `
<h1>Search Demo</h1> <h1>Search Demo</h1>
<p><i>Fetches from crossref </i></p> <p><i>Fetches from crossref </i></p>
<form> <form class="uk-form">
<input #term [(ngModel)]="keyword" name="keyword" /> <input #term [(ngModel)]="keyword" name="keyword" />
<button (click)="search(term.value,10,1)" type="submit" class="uk-button">Search</button> <button (click)="search(term.value,10,1)" type="submit" class="uk-button">Search</button>
</form> </form>

View File

@ -92,7 +92,7 @@ import { ErrorCodes} from '../../utils/properties/openaireProperties';
<div *ngIf="result['websiteURL'] != undefined && result['websiteURL'] != ''"> <div *ngIf="result['websiteURL'] != undefined && result['websiteURL'] != ''">
<span>Website URL: </span> <span>Website URL: </span>
<span> <span>
<a class="custom-external" href="{{result['websiteURL']}}" target="_blank"> <a href="{{result['websiteURL']}}" target="_blank" class="uk-icon-external-link">
{{result['websiteURL']}} {{result['websiteURL']}}
</a> </a>
</span> </span>
@ -100,7 +100,7 @@ import { ErrorCodes} from '../../utils/properties/openaireProperties';
<div *ngIf="result['OAIPMHURL'] != undefined && result['OAIPMHURL'] != ''"> <div *ngIf="result['OAIPMHURL'] != undefined && result['OAIPMHURL'] != ''">
<span>OAI-PMH URL: </span> <span>OAI-PMH URL: </span>
<span> <span>
<a class="custom-external" href="{{result['OAIPMHURL']}}" target="_blank"> <a href="{{result['OAIPMHURL']}}" target="_blank" class="uk-icon-external-link">
{{result['OAIPMHURL']}} {{result['OAIPMHURL']}}
</a> </a>
</span> </span>

View File

@ -37,22 +37,6 @@ export class DataProviderService {
} }
getMetrics (id: string):any {
console.info("getDataproviderMetrics in service");
//let url = OpenaireProperties. getSearchAPIURLLast() + 'publications/' +id+"?format=json";
let url = OpenaireProperties.getMetricsAPIURL()+"datasources/"+id+"/clicks";
let key = url;
if (this._cache.has(key)) {
return Observable.of(this._cache.get(key));
}
return this.http.get(url)
.map(res => <any> res.json())
.map(res => res['views'])
.do(res => {
this._cache.set(key, res);
});
}
private handleError (error: Response) { private handleError (error: Response) {
// in a real world app, we may send the error to some remote logging infrastructure // in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console // instead of just logging it to the console

View File

@ -2,7 +2,6 @@ import {Injectable} from '@angular/core';
import {Http, Response} from '@angular/http'; import {Http, Response} from '@angular/http';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs/Observable';
import {DatasetInfo} from '../utils/entities/datasetInfo'; import {DatasetInfo} from '../utils/entities/datasetInfo';
import {Metrics} from '../utils/entities/metrics';
import {OpenaireProperties} from '../utils/properties/openaireProperties'; import {OpenaireProperties} from '../utils/properties/openaireProperties';
import 'rxjs/add/observable/of'; import 'rxjs/add/observable/of';
import 'rxjs/add/operator/do'; import 'rxjs/add/operator/do';
@ -15,7 +14,6 @@ export class DatasetService {
constructor(private http: Http, public _cache: CacheService) {} constructor(private http: Http, public _cache: CacheService) {}
datasetInfo: DatasetInfo; datasetInfo: DatasetInfo;
metrics: Metrics;
getDatasetInfo (id: string):any { getDatasetInfo (id: string):any {
console.info("getDatasetInfo in service"); console.info("getDatasetInfo in service");
@ -45,23 +43,7 @@ export class DatasetService {
}) })
.map(res => this.parseDatasetInfo(res)); .map(res => this.parseDatasetInfo(res));
}
getMetrics (id: string):any {
console.info("getDatasetViews in service");
//let url = OpenaireProperties. getSearchAPIURLLast() + 'publications/' +id+"?format=json";
let url = OpenaireProperties.getMetricsAPIURL()+"results/"+id+"/clicks";
let key = url;
if (this._cache.has(key)) {
return Observable.of(this._cache.get(key)).map(res => this.parseMetrics(res["downloads"], res["views"], res["total_downloads"], res["total_views"]));
}
return this.http.get(url)
.map(res => <any> res.json())
.do(res => {
this._cache.set(key, res);
})
.map(res => this.parseMetrics(res["downloads"], res["views"], res["total_downloads"], res["total_views"]));
}
private handleError (error: Response) { private handleError (error: Response) {
// in a real world app, we may send the error to some remote logging infrastructure // in a real world app, we may send the error to some remote logging infrastructure
@ -70,50 +52,6 @@ export class DatasetService {
return Observable.throw(error || 'Server error'); return Observable.throw(error || 'Server error');
} }
parseMetrics(downloads: string, views: string, totalDownloads: any, totalViews: any): any {
this.metrics = new Metrics();
this.metrics.totalDownloads = totalDownloads;
this.metrics.totalViews = totalViews;
this.metrics.infos = new Map<string, {"url": string, "numOfDownloads": string, "numOfViews": string}>();
for(let i=0; i<downloads.length; i++) {
let id: string = downloads[i]['datasource_id'];
if(this.metrics.infos.has(id)) {
this.metrics.infos.get(id).numOfDownloads = downloads[i]['value'];
} else {
let info;//: {"url": string, "numOfDownloads": string, "numOfViews": string};
info = {};
info.url = OpenaireProperties.getsearchLinkToDataProvider()+id;
info.numOfDownloads = downloads[i]['value'];
info.numOfViews = "0";
this.metrics.infos.set(id, info);
}
}
for(let i=0; i<views.length; i++) {
let id: string = views[i]['datasource_id'];
if(this.metrics.infos.has(id)) {
this.metrics.infos.get(id).numOfViews = views[i]['value'];
} else {
let info;//: {"url": string, "numOfDownloads": string, "numOfViews": string};
info = {};
info.url = OpenaireProperties.getsearchLinkToDataProvider()+id;
info.numOfDownloads = "0";
info.numOfViews = views[i]['value'];
this.metrics.infos.set(id, info);
}
}
return this.metrics;
}
parseDatasetInfo (data: any):any { parseDatasetInfo (data: any):any {
this.datasetInfo = new DatasetInfo(); this.datasetInfo = new DatasetInfo();

View File

@ -0,0 +1,77 @@
import {Injectable} from '@angular/core';
import {Http, Response} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import {Metrics} from '../utils/entities/metrics';
import {OpenaireProperties} from '../utils/properties/openaireProperties';
import 'rxjs/add/operator/do';
import { CacheService } from '../shared/cache.service';
@Injectable()
export class MetricsService {
metrics: Metrics;
constructor(private http: Http, public _cache: CacheService) {}
getMetrics (id: string, entity: string):any {
console.info("getPublicationViews in service");
//let url = OpenaireProperties. getSearchAPIURLLast() + 'publications/' +id+"?format=json";
let url = OpenaireProperties.getMetricsAPIURL()+entity+"/"+id+"/clicks";
let key = url;
if (this._cache.has(key)) {
return Observable.of(this._cache.get(key));
}
return this.http.get(url)
.map(res => <any> res.json())
.map(res => this.parseMetrics(res["downloads"], res["views"], res["total_downloads"], res["total_views"]))
.do(res => {
this._cache.set(key, res);
});
}
parseMetrics(downloads: string, views: string, totalDownloads: any, totalViews: any): any {
this.metrics = new Metrics();
this.metrics.totalDownloads = totalDownloads;
this.metrics.totalViews = totalViews;
this.metrics.infos = new Map<string, {"name": string, "url": string, "numOfDownloads": string, "numOfViews": string}>();
for(let i=0; i<downloads.length; i++) {
let id: string = downloads[i]['datasource_id'];
if(this.metrics.infos.has(id)) {
this.metrics.infos.get(id).numOfDownloads = downloads[i]['value'];
} else {
let info;//: {"url": string, "numOfDownloads": string, "numOfViews": string};
info = {};
info.name = downloads[i]['datasource_name'];
info.url = OpenaireProperties.getsearchLinkToDataProvider()+id;
info.numOfDownloads = downloads[i]['value'];
info.numOfViews = "0";
this.metrics.infos.set(id, info);
}
}
for(let i=0; i<views.length; i++) {
let id: string = views[i]['datasource_id'];
if(this.metrics.infos.has(id)) {
this.metrics.infos.get(id).numOfViews = views[i]['value'];
} else {
let info;//: {"url": string, "numOfDownloads": string, "numOfViews": string};
info = {};
info.name = views[i]['datasource_name'];
info.url = OpenaireProperties.getsearchLinkToDataProvider()+id;
info.numOfDownloads = "0";
info.numOfViews = views[i]['value'];
this.metrics.infos.set(id, info);
}
}
console.info(this.metrics.infos.size);
return this.metrics;
}
}

View File

@ -34,7 +34,7 @@ export class OrganizationService {
} }
/*
getMetrics (id: string):any { getMetrics (id: string):any {
console.info("getOrganizationMetrics in service"); console.info("getOrganizationMetrics in service");
//let url = OpenaireProperties. getSearchAPIURLLast() + 'publications/' +id+"?format=json"; //let url = OpenaireProperties. getSearchAPIURLLast() + 'publications/' +id+"?format=json";
@ -50,7 +50,7 @@ export class OrganizationService {
this._cache.set(key, res); this._cache.set(key, res);
}); });
} }
*/
private handleError (error: Response) { private handleError (error: Response) {
// in a real world app, we may send the error to some remote logging infrastructure // in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console // instead of just logging it to the console

View File

@ -36,22 +36,6 @@ export class ProjectService {
} }
getMetrics (id: string):any {
console.info("getProjectsMetrics in service");
//let url = OpenaireProperties. getSearchAPIURLLast() + 'publications/' +id+"?format=json";
let url = OpenaireProperties.getMetricsAPIURL()+"projects/"+id+"/clicks";
let key = url;
if (this._cache.has(key)) {
return Observable.of(this._cache.get(key));
}
return this.http.get(url)
.map(res => <any> res.json())
.map(res => res['views'])
.do(res => {
this._cache.set(key, res);
});
}
/* /*
get project strtDate and endDate get project strtDate and endDate
*/ */

View File

@ -2,7 +2,6 @@ import {Injectable} from '@angular/core';
import {Http, Response} from '@angular/http'; import {Http, Response} from '@angular/http';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs/Observable';
import {PublicationInfo} from '../utils/entities/publicationInfo'; import {PublicationInfo} from '../utils/entities/publicationInfo';
import {Metrics} from '../utils/entities/metrics';
import {OpenaireProperties} from '../utils/properties/openaireProperties'; import {OpenaireProperties} from '../utils/properties/openaireProperties';
import 'rxjs/add/observable/of'; import 'rxjs/add/observable/of';
import 'rxjs/add/operator/do'; import 'rxjs/add/operator/do';
@ -14,7 +13,6 @@ export class PublicationService {
constructor(private http: Http, public _cache: CacheService) {} constructor(private http: Http, public _cache: CacheService) {}
publicationInfo: PublicationInfo; publicationInfo: PublicationInfo;
metrics: Metrics;
getPublicationInfo (id: string):any { getPublicationInfo (id: string):any {
console.info("getPublicationInfo in service"); console.info("getPublicationInfo in service");
@ -45,22 +43,6 @@ export class PublicationService {
.map(res => this.parsePublicationInfo(res)); .map(res => this.parsePublicationInfo(res));
} }
getMetrics (id: string):any {
console.info("getPublicationViews in service");
//let url = OpenaireProperties. getSearchAPIURLLast() + 'publications/' +id+"?format=json";
let url = OpenaireProperties.getMetricsAPIURL()+"results/"+id+"/clicks";
let key = url;
if (this._cache.has(key)) {
return Observable.of(this._cache.get(key));
}
return this.http.get(url)
.map(res => <any> res.json())
.map(res => this.parseMetrics(res["downloads"], res["views"], res["total_downloads"], res["total_views"]))
.do(res => {
this._cache.set(key, res);
});
}
private handleError (error: Response) { private handleError (error: Response) {
// in a real world app, we may send the error to some remote logging infrastructure // in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console // instead of just logging it to the console
@ -68,50 +50,6 @@ export class PublicationService {
return Observable.throw(error || 'Server error'); return Observable.throw(error || 'Server error');
} }
parseMetrics(downloads: string, views: string, totalDownloads: any, totalViews: any): any {
this.metrics = new Metrics();
this.metrics.totalDownloads = totalDownloads;
this.metrics.totalViews = totalViews;
this.metrics.infos = new Map<string, {"url": string, "numOfDownloads": string, "numOfViews": string}>();
for(let i=0; i<downloads.length; i++) {
let id: string = downloads[i]['datasource_id'];
if(this.metrics.infos.has(id)) {
this.metrics.infos.get(id).numOfDownloads = downloads[i]['value'];
} else {
let info;//: {"url": string, "numOfDownloads": string, "numOfViews": string};
info = {};
info.url = OpenaireProperties.getsearchLinkToDataProvider()+id;
info.numOfDownloads = downloads[i]['value'];
info.numOfViews = "0";
this.metrics.infos.set(id, info);
}
}
for(let i=0; i<views.length; i++) {
let id: string = views[i]['datasource_id'];
if(this.metrics.infos.has(id)) {
this.metrics.infos.get(id).numOfViews = views[i]['value'];
} else {
let info;//: {"url": string, "numOfDownloads": string, "numOfViews": string};
info = {};
info.url = OpenaireProperties.getsearchLinkToDataProvider()+id;
info.numOfDownloads = "0";
info.numOfViews = views[i]['value'];
this.metrics.infos.set(id, info);
}
}
return this.metrics;
}
parsePublicationInfo (data: any):any { parsePublicationInfo (data: any):any {
this.publicationInfo = new PublicationInfo(); this.publicationInfo = new PublicationInfo();
@ -336,6 +274,7 @@ export class PublicationService {
} else { } else {
key = data[0]['source']; key = data[0]['source'];
} }
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});
} }
@ -358,6 +297,7 @@ export class PublicationService {
counter1++; counter1++;
} }
} }
}
if(this.publicationInfo.title != undefined) { if(this.publicationInfo.title != undefined) {
switch (this.publicationInfo.title['accessMode']) { switch (this.publicationInfo.title['accessMode']) {
case undefined: case undefined:

View File

@ -12,6 +12,7 @@ import { OrganizationService} from './organization.service';
import { PersonService} from './person.service'; import { PersonService} from './person.service';
import { ProjectService} from './project.service'; import { ProjectService} from './project.service';
import { PublicationService} from './publication.service'; import { PublicationService} from './publication.service';
import { MetricsService } from './metrics.service';
import { SearchCrossrefService } from './searchCrossref.service'; import { SearchCrossrefService } from './searchCrossref.service';
import { SearchDataciteService } from './searchDatacite.service'; import { SearchDataciteService } from './searchDatacite.service';
import { SearchOrcidService } from './searchOrcid.service'; import { SearchOrcidService } from './searchOrcid.service';
@ -38,11 +39,11 @@ import {LoginService} from './login.service';
], ],
providers:[ providers:[
ContextsService, DatasetService, OpenaireProjectsService,OrganizationService, ContextsService, DatasetService, OpenaireProjectsService,OrganizationService,
PersonService, ProjectService, PublicationService, SearchCrossrefService, PersonService, ProjectService, PublicationService, MetricsService,
SearchCrossrefService, SearchDataciteService, SearchOrcidService, SearchCrossrefService, SearchCrossrefService, SearchDataciteService,
SearchPublicationsService, SearchDataprovidersService, DataProviderService, SearchOrcidService, SearchPublicationsService, SearchDataprovidersService,
SearchProjectsService, SearchDatasetsService, SearchOrganizationsService, DataProviderService, SearchProjectsService, SearchDatasetsService,
SearchPeopleService, ISVocabulariesService, SearchOrganizationsService, SearchPeopleService, ISVocabulariesService,
RefineFieldResultsService, RefineFieldResultsService,
EntitiesSearchService, EntitiesSearchService,
LoginService LoginService

View File

@ -8,7 +8,8 @@ import {User} from '../utils/entities/user';
template: ` template: `
<form *ngIf="!loggedIn" class="uk-form uk-width-medium-1-3"> <!--form *ngIf="!loggedIn" class="uk-form uk-width-medium-1-3"-->
<form *ngIf="!loggedIn" class="uk-form uk-flex uk-flex-center">
<fieldset> <fieldset>
<legend>Login Form</legend> <legend>Login Form</legend>
<div class="uk-form-row"> <div class="uk-form-row">

View File

@ -90,6 +90,22 @@ import 'rxjs/Rx';
</li> </li>
</ul> </ul>
<div class="uk-navbar-flip">
<ul class="uk-navbar-nav uk-hidden-small">
<li class="uk-parent" data-uk-dropdown="" aria-haspopup="true" aria-expanded="false">
<!-- This is a button toggling the modal -->
<a href="#login" data-uk-modal="center: true">Sign In</a>
<!-- This is the modal -->
<div id="login" class="uk-modal">
<div class="uk-modal-dialog">
<a class="uk-modal-close uk-close"></a>
<login></login>
</div>
</div>
</li>
</ul>
</div>
<a href="#offcanvas-mainmenu" class="uk-navbar-toggle uk-visible-small" data-uk-offcanvas=""></a> <a href="#offcanvas-mainmenu" class="uk-navbar-toggle uk-visible-small" data-uk-offcanvas=""></a>

View File

@ -1,5 +1,5 @@
export class Metrics { export class Metrics {
totalDownloads: string; totalDownloads: string;
totalViews: string; totalViews: string;
infos: Map<string, {"url": string, "numOfDownloads": string, "numOfViews": string}>; infos: Map<string, {"name": string, "url": string, "numOfDownloads": string, "numOfViews": string}>;
} }

View File

@ -43,9 +43,12 @@ export class OpenaireProperties {
// private static searchAPIURLLAst = "http://rudie.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 searchAPIURLLAst = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT-new/rest/v2/api/"; //private static searchAPIURLLAst = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT-new/rest/v2/api/";
//private static searchAPIURLLAst = "http://scoobydoo.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
// private static searchResourcesAPIURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/resources"; // private static searchResourcesAPIURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/resources";
private static searchResourcesAPIURL = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT-new/rest/v2/api/resources"; //private static searchResourcesAPIURL = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT-new/rest/v2/api/resources";
private static searchResourcesAPIURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/resources";
//private static searchServiveURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/"; //private static searchServiveURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/";
private static searchServiveURL = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT/"; private static searchServiveURL = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT/";

View File

@ -15,7 +15,7 @@ import {Component, Input} from '@angular/core';
<div role="separator" class="divider" *ngFor="let item of dataProviders"> <div role="separator" class="divider" *ngFor="let item of dataProviders">
<p *ngIf="item['url'] != undefined && item['url']"> <p *ngIf="item['url'] != undefined && item['url']">
<a href="{{item['url']}}" target="_blank"> <a href="{{item['url']}}" target="_blank" class="uk-icon-external-link">
{{item['name']}} {{item['name']}}
</a> </a>
</p> </p>
@ -25,7 +25,7 @@ import {Component, Input} from '@angular/core';
<p> <p>
<span *ngFor="let item of dataProviders.organizations"> <span *ngFor="let item of dataProviders.organizations">
<a *ngIf="item['url']!=''" href="{{item['url']}}" target="_blank"> <a *ngIf="item['url']!=''" href="{{item['url']}}" target="_blank" class="uk-icon-external-link">
{{item['name']}} {{item['name']}}
</a> </a>
<p *ngIf="item['url']==''"> <p *ngIf="item['url']==''">
@ -41,7 +41,7 @@ import {Component, Input} from '@angular/core';
<p *ngIf="item['websiteUrl'] != null && item['websiteUrl'] != ''"> <p *ngIf="item['websiteUrl'] != null && item['websiteUrl'] != ''">
Website URL: Website URL:
<a href="{{item['websiteUrl']}}" target="_blank"> <a href="{{item['websiteUrl']}}" target="_blank" class="uk-icon-external-link" >
{{item['websiteUrl']}} {{item['websiteUrl']}}
</a> </a>
</p> </p>

View File

@ -1,3 +1,4 @@
//import {MaterialModule} from '@angular/material';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
@ -35,7 +36,7 @@ export const UNIVERSAL_KEY = 'UNIVERSAL_CACHE';
@NgModule({ @NgModule({
bootstrap: [ AppComponent ], bootstrap: [ AppComponent ],
imports: [ imports: [
// MaterialModule.forRoot() should be included first //MaterialModule.forRoot(),// should be included first
UniversalModule, // BrowserModule, HttpModule, and JsonpModule are included UniversalModule, // BrowserModule, HttpModule, and JsonpModule are included
FormsModule, FormsModule,
@ -56,7 +57,7 @@ export const UNIVERSAL_KEY = 'UNIVERSAL_CACHE';
CacheService, CacheService,
Meta, //Meta,
// { provide: AUTO_PREBOOT, useValue: false } // turn off auto preboot complete // { provide: AUTO_PREBOOT, useValue: false } // turn off auto preboot complete
] ]

View File

@ -5,8 +5,8 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="http://scoobydoo.di.uoa.gr:8083/joomlaNew/templates/yootheme/vendor/yootheme/theme/platforms/joomla/assets/images/favicon.png"> <!--link rel="shortcut icon" href="http://scoobydoo.di.uoa.gr:8083/joomlaNew/templates/yootheme/vendor/yootheme/theme/platforms/joomla/assets/images/favicon.png">
<link rel="apple-touch-icon-precomposed" href="http://scoobydoo.di.uoa.gr:8083/joomlaNew/templates/yootheme/vendor/yootheme/theme/platforms/joomla/assets/images/apple-touch-icon.png"> <link rel="apple-touch-icon-precomposed" href="http://scoobydoo.di.uoa.gr:8083/joomlaNew/templates/yootheme/vendor/yootheme/theme/platforms/joomla/assets/images/apple-touch-icon.png"-->
<base href="/" /> <base href="/" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="author" content="Super User" /> <meta name="author" content="Super User" />
@ -44,13 +44,20 @@
<script src="assets/uikit-2.27.2/js/core/tab.min.js" type="text/javascript"></script> <script src="assets/uikit-2.27.2/js/core/tab.min.js" type="text/javascript"></script>
<script src="assets/uikit-2.27.2/js/core/switcher.min.js" type="text/javascript"></script> <script src="assets/uikit-2.27.2/js/core/switcher.min.js" type="text/javascript"></script>
<!--script src="assets/uikit-2.27.2/js/core/dropdown.min.js" type="text/javascript"></script--> <!--script src="assets/uikit-2.27.2/js/core/dropdown.min.js" type="text/javascript"></script-->
<!-- Progress Bar -->
<link href="assets/uikit-2.27.2/css/components/progress.css" rel="stylesheet" type="text/css" /> <link href="assets/uikit-2.27.2/css/components/progress.css" rel="stylesheet" type="text/css" />
<!-- Tooltip -->
<link href="assets/uikit-2.27.2/css/components/tooltip.css" rel="stylesheet" type="text/css" /> <link href="assets/uikit-2.27.2/css/components/tooltip.css" rel="stylesheet" type="text/css" />
<script src="assets/uikit-2.27.2/js/components/tooltip.min.js" type="text/javascript"></script> <script src="assets/uikit-2.27.2/js/components/tooltip.min.js" type="text/javascript"></script>
<!-- Button -->
<script src="assets/uikit-2.27.2/js/core/button.min.js" type="text/javascript"></script> <script src="assets/uikit-2.27.2/js/core/button.min.js" type="text/javascript"></script>
<!-- Alert -->
<script src="assets/uikit-2.27.2/js/core/alert.min.js" type="text/javascript"></script> <script src="assets/uikit-2.27.2/js/core/alert.min.js" type="text/javascript"></script>
<!-- Grid -->
<script src="assets/uikit-2.27.2/js/components/grid.min.js" type="text/javascript"></script> <script src="assets/uikit-2.27.2/js/components/grid.min.js" type="text/javascript"></script>
<!-- Modal -->
<script src="assets/uikit-2.27.2/js/core/modal.min.js" type="text/javascript"></script>
<!--script src="http://scoobydoo.di.uoa.gr:8083/joomlaNew/templates/yootheme/vendor/assets/uikit/src/js/core/dropdown.js" type="text/javascript"></script--> <!--script src="http://scoobydoo.di.uoa.gr:8083/joomlaNew/templates/yootheme/vendor/assets/uikit/src/js/core/dropdown.js" type="text/javascript"></script-->
@ -113,12 +120,14 @@
.OPEN { .OPEN {
background: rgba(0, 0, 0, 0) url("/assets/openAccess.png") no-repeat scroll right center; background: rgba(0, 0, 0, 0) url("/assets/openAccess.png") no-repeat scroll right center;
padding-right: 18px; padding-right: 18px;
min-height: 18px;
} }
.EMBARGO, .CLOSED, .RESTRICTED { .EMBARGO, .CLOSED, .RESTRICTED {
background: rgba(0, 0, 0, 0) url("/assets/closedAccess.png") no-repeat scroll right center; background: rgba(0, 0, 0, 0) url("/assets/closedAccess.png") no-repeat scroll right center;
padding-right: 18px; padding-right: 18px;
} }
</style> </style>
</head> </head>

View File

@ -1,3 +1,4 @@
//import {MaterialModule} from '@angular/material';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
@ -27,7 +28,7 @@ export const UNIVERSAL_KEY = 'UNIVERSAL_CACHE';
@NgModule({ @NgModule({
bootstrap: [ AppComponent ], bootstrap: [ AppComponent ],
imports: [ imports: [
// MaterialModule.forRoot() should be included first //MaterialModule.forRoot(),// should be included first
UniversalModule, // BrowserModule, HttpModule, and JsonpModule are included UniversalModule, // BrowserModule, HttpModule, and JsonpModule are included
FormsModule, FormsModule,