Add new statistic page using the API| change menu - use community API to get community info for logo and name | fix the height of logo in communities page
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@50988 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
b3cee9f450
commit
abc7f5e847
|
@ -11,7 +11,7 @@ const routes: Routes = [
|
||||||
{ path: 'community', loadChildren: './community/community.module#CommunityModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{ path: 'community', loadChildren: './community/community.module#CommunityModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||||
{ path: 'communities', loadChildren: './communities/communities.module#CommunitiesModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{ path: 'communities', loadChildren: './communities/communities.module#CommunitiesModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||||
{ path: 'my-communities', loadChildren: './my-communities/communities.module#CommunitiesModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{ path: 'my-communities', loadChildren: './my-communities/communities.module#CommunitiesModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||||
|
{ path: 'statistics', loadChildren: './statistics/statistics.module#StatisticsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||||
{ path: 'search/publication', loadChildren: './landingPages/publication/libPublication.module#LibPublicationModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{ path: 'search/publication', loadChildren: './landingPages/publication/libPublication.module#LibPublicationModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||||
{ path: 'search/dataset', loadChildren: './landingPages/dataset/libDataset.module#LibDatasetModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{ path: 'search/dataset', loadChildren: './landingPages/dataset/libDataset.module#LibDatasetModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||||
{ path: 'search/software', loadChildren: './landingPages/software/libSoftware.module#LibSoftwareModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{ path: 'search/software', loadChildren: './landingPages/software/libSoftware.module#LibSoftwareModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||||
|
|
|
@ -5,6 +5,7 @@ import {ActivatedRoute} from '@angular/router';
|
||||||
import { EnvProperties} from './openaireLibrary/utils/properties/env-properties';
|
import { EnvProperties} from './openaireLibrary/utils/properties/env-properties';
|
||||||
import{MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu';
|
import{MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu';
|
||||||
import { EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service';
|
import { EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service';
|
||||||
|
import {CommunityService} from "./community/community.service";
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -43,45 +44,56 @@ export class AppComponent {
|
||||||
|
|
||||||
|
|
||||||
menuItems:RootMenuItem []=[];
|
menuItems:RootMenuItem []=[];
|
||||||
|
public community = null;
|
||||||
feedbackmail:string
|
feedbackmail:string
|
||||||
properties:EnvProperties;
|
properties:EnvProperties;
|
||||||
community: {id:string, name:string, logoUrl:string};
|
// community: {id:string, name:string, logoUrl:string};
|
||||||
constructor( private route: ActivatedRoute, private propertiesService:EnvironmentSpecificService) {
|
constructor( private route: ActivatedRoute, private propertiesService:EnvironmentSpecificService, private _communityService:CommunityService ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.route.queryParams.subscribe(data => {
|
this.route.queryParams.subscribe(data => {
|
||||||
|
|
||||||
if(data['community'] && data['community']!=""){
|
if((data['communityId'] && data['communityId']!="") || (data['community'] && data['community']!="") ){
|
||||||
this.community = {id: data['community'], name: "Egi Federation", logoUrl:"https:\/\/egi.eu/wp-content/uploads/2016/05/cropped-logo_site-1-300x300.png"};
|
this.menuItems=[];
|
||||||
|
this._communityService.getCommunity('https://dev-openaire.d4science.org/openaire/community/'+((data['communityId'])?data['communityId']:data['community'])).subscribe (
|
||||||
|
community => {
|
||||||
|
this.community = community;
|
||||||
|
// this.params = {community: encodeURIComponent('"'+community.queryId+'"')};
|
||||||
|
this.community = {id: data['communityId'], name: (this.community.title)?this.community.title:this.community.shortTitle, logoUrl:this.community.logoUrl};
|
||||||
|
|
||||||
this.userMenuItems = [ new MenuItem("","My profile","","",false,[],[],{}),
|
this.userMenuItems = [ new MenuItem("","My profile","","",false,[],[],{}),
|
||||||
new MenuItem("","My claims","","/myclaims",false,[],["/myclaims"],{}),
|
new MenuItem("","My claims","","/myclaims",false,[],["/myclaims"],{}),
|
||||||
new MenuItem("","Manage all claims","","/claims",true,[],["/claims"],{}),]
|
new MenuItem("","Manage all claims","","/claims",true,[],["/claims"],{}),]
|
||||||
|
|
||||||
this.menuItems= [{
|
this.menuItems= [{
|
||||||
rootItem: new MenuItem("dashboard","Dashboard","","/community",false,[],[],{community:"egi||EGI Federation"}),
|
rootItem: new MenuItem("dashboard","Dashboard","","/community",false,[],[],{communityId:this.community.id}),
|
||||||
items: []
|
items: []
|
||||||
},
|
},
|
||||||
{rootItem: new MenuItem("search","Search","","",false,[],[],{}),
|
{rootItem: new MenuItem("search","Search","","",false,[],[],{}),
|
||||||
items: [new MenuItem("","Publications","","/search/find/publications",false,["publication"],["/search/find/publications"],{community: "%22egi%7C%7CEGI%20Federation%22"}),
|
items: [new MenuItem("","Publications","","/search/find/publications",false,["publication"],["/search/find/publications"],{community: encodeURIComponent('"'+community.queryId+'"')}),
|
||||||
new MenuItem("","Research Data","","/search/find/datasets",false,["dataset"],["/search/find/datasets"],{community: "%22egi%7C%7CEGI%20Federation%22"}),
|
new MenuItem("","Research Data","","/search/find/datasets",false,["dataset"],["/search/find/datasets"],{community: encodeURIComponent('"'+community.queryId+'"')}),
|
||||||
new MenuItem("","Software","","/search/find/software",false,["software"],["/search/find/software"],{community: "%22egi%7C%7CEGI%20Federation%22"}),
|
new MenuItem("","Software","","/search/find/software",false,["software"],["/search/find/software"],{community: encodeURIComponent('"'+community.queryId+'"')}),
|
||||||
new MenuItem("","Projects","","/search/find/projects/",false,["project"],["/search/find/projects"],{community: "%22egi%7C%7CEGI%20Federation%22"}),
|
// new MenuItem("","Projects","","/search/find/projects/",false,["project"],["/search/find/projects"],{community: encodeURIComponent('"'+community.queryId+'"')}),
|
||||||
new MenuItem("","Content Providers","","/search/find/dataproviders",false,["datasource"],["/search/find/dataproviders"],{community: "%22egi%7C%7CEGI%20Federation%22"}),
|
// new MenuItem("","Content Providers","","/search/find/dataproviders",false,["datasource"],["/search/find/dataproviders"],{community: "%22egi%7C%7CEGI%20Federation%22"}),
|
||||||
new MenuItem("","Organizations","","/search/find/organizations/",false,["organization"],["/search/find/organizations"],{community: "%22egi%7C%7CEGI%20Federation%22"}),
|
// new MenuItem("","Organizations","","/search/find/organizations/",false,["organization"],["/search/find/organizations"],{community: "%22egi%7C%7CEGI%20Federation%22"}),
|
||||||
]},
|
]},
|
||||||
{
|
{
|
||||||
rootItem: new MenuItem("share","Share","","",false,[],["/participate/deposit-publications","/participate/deposit-datasets"],{community:"egi||EGI Federation"}),
|
rootItem: new MenuItem("monitor","Monitor","","/statistics",false,[],["/statistics"],{communityId:this.community.id}),
|
||||||
items: [new MenuItem("","Publications","","/participate/deposit-publications",false,["publication"],["/participate/deposit-publications"],{community:"egi||EGI Federation"}),
|
items: []
|
||||||
new MenuItem("","Research Data","","/participate/deposit-datasets",false,["dataset"],["/participate/deposit-datasets"],{community:"egi||EGI Federation"})]
|
},
|
||||||
|
{
|
||||||
|
rootItem: new MenuItem("share","Share","","",false,[],["/participate/deposit-publications","/participate/deposit-datasets"],{communityId:this.community.id}),
|
||||||
|
items: [new MenuItem("","Publications","","/participate/deposit-publications",false,["publication"],["/participate/deposit-publications"],{communityId:this.community.id}),
|
||||||
|
new MenuItem("","Research Data","","/participate/deposit-datasets",false,["dataset"],["/participate/deposit-datasets"],{communityId:this.community.id})]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
rootItem: new MenuItem("link","Link","","/participate/claim",false,[],["/participate/claim"],{community:"egi||EGI Federation"}),
|
rootItem: new MenuItem("link","Link","","/participate/claim",false,[],["/participate/claim"],{community:"egi||EGI Federation"}),
|
||||||
items: []
|
items: []
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
});
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
this.community = null;
|
this.community = null;
|
||||||
this.userMenuItems = [ new MenuItem("","My profile","","",false,[],[],{}),
|
this.userMenuItems = [ new MenuItem("","My profile","","",false,[],[],{}),
|
||||||
|
|
|
@ -24,10 +24,10 @@
|
||||||
<div class="uk-container uk-margin-top uk-margin-bottom">
|
<div class="uk-container uk-margin-top uk-margin-bottom">
|
||||||
<div class="uk-child-width-1-3@m uk-text-center " uk-grid>
|
<div class="uk-child-width-1-3@m uk-text-center " uk-grid>
|
||||||
<div *ngFor="let item of communitiesResults; let i = index">
|
<div *ngFor="let item of communitiesResults; let i = index">
|
||||||
<div class="uk-card uk-card-default">
|
<div class="uk-card uk-card-default uk-margin-bottom">
|
||||||
<span *ngIf= "item.logoUrl != null">
|
<span *ngIf= "item.logoUrl != null">
|
||||||
<div class="uk-card-media-top">
|
<div class="uk-card-media-top">
|
||||||
<img src="{{item.logoUrl}}" alt="A logo goes here">
|
<img src="{{item.logoUrl}}" alt="A logo goes here" class="uk-height-small uk-responsive-height ">
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
<div class="uk-card-body">
|
<div class="uk-card-body">
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
<results-comp [(results)]=softwareResults resultType="software" [community]=community [params]=params></results-comp>
|
<results-comp [(results)]=softwareResults resultType="software" [community]=community [params]=params></results-comp>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-grid">
|
<!--div class="uk-grid">
|
||||||
<div class="uk-text-center uk-width-1-2@m uk-width-1-1@s">
|
<div class="uk-text-center uk-width-1-2@m uk-width-1-1@s">
|
||||||
<p class="uk-text-large"> Publications through the years</p>
|
<p class="uk-text-large"> Publications through the years</p>
|
||||||
<img alt="stats" class="uk-responsive-width" src="./assets/stats1.png">
|
<img alt="stats" class="uk-responsive-width" src="./assets/stats1.png">
|
||||||
|
@ -99,7 +99,7 @@
|
||||||
<p class="uk-text-large"> Publications per project</p>
|
<p class="uk-text-large"> Publications per project</p>
|
||||||
<img alt="stats" class="uk-responsive-width" src="./assets/pub-per-pr.png">
|
<img alt="stats" class="uk-responsive-width" src="./assets/pub-per-pr.png">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div-->
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import{StatisticsComponent} from './statistics.component';
|
||||||
|
import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard';
|
||||||
|
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
RouterModule.forChild([
|
||||||
|
{ path: '', component: StatisticsComponent, canActivate: [FreeGuard], canDeactivate: [PreviousRouteRecorder] }
|
||||||
|
|
||||||
|
])
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class StatisticsRoutingModule { }
|
|
@ -0,0 +1,135 @@
|
||||||
|
<div class=" uk-section uk-margin-small-top tm-middle uk-container" id="tm-main">
|
||||||
|
|
||||||
|
<div class="uk-container uk-margin-bottom">
|
||||||
|
|
||||||
|
<article class="uk-article ">
|
||||||
|
<div *ngIf="statistics" class="uk-margin uk-margin-top uk-text-lead">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{{statistics.publications}} publications from
|
||||||
|
<!--span *ngIf="statistics.virtual_organizations && statistics.virtual_organizations > 0"> {{statistics.virtual_organizations}} VOs and</span-->
|
||||||
|
{{statistics.total_projects}} projects.
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{statistics.open_access}} are OA <span *ngIf="statistics.restricted && statistics.restricted > 0">, {{statistics.restricted}} are restricted </span>
|
||||||
|
<span *ngIf="statistics.embargo && statistics.embargo > 0">and {{statistics.embargo}} are still in embargo </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="charts && charts.timelines && statistics">
|
||||||
|
<div class="uk-text-large" >Timelines of research results</div>
|
||||||
|
<ul class="uk-tab uk-margin-top" data-uk-tab="{connect:'#timelinestabs'}">
|
||||||
|
<li (click)="charts.timelines.publications.load = true"><a href="#">Publications</a></li>
|
||||||
|
<li (click)="charts.timelines.datasets.load = true"><a href="#">Research Data</a></li>
|
||||||
|
<li (click)="charts.timelines.software.load = true"><a href="#">Software</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul id="timelinestabs" class="uk-switcher uk-margin">
|
||||||
|
<li>
|
||||||
|
<div *ngIf="charts.timelines.publications.load && statistics.publications > 0">
|
||||||
|
<i-frame [url]=charts.timelines.publications.url width="1000" height="450"></i-frame>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="statistics.publications == 0" class="uk-alert uk-alert-primary">
|
||||||
|
No publications available
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div *ngIf="charts.timelines.datasets.load && statistics.datasets > 0">
|
||||||
|
<i-frame [url]=charts.timelines.datasets.url width="1000" height="450"></i-frame>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="statistics.datasets == 0" class="uk-alert uk-alert-primary">
|
||||||
|
No research data available
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div *ngIf="charts.timelines.software.load && statistics.software > 0">
|
||||||
|
<i-frame [url]=charts.timelines.software.url width="1000" height="450"></i-frame>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="statistics.software == 0" class="uk-alert uk-alert-primary">
|
||||||
|
No software available
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="charts && charts.projectPublications && statistics && statistics.publications > 0">
|
||||||
|
<div class="uk-text-large" >Publications per projects</div>
|
||||||
|
<ul class="uk-tab uk-margin-top" data-uk-tab="{connect:'#publicationtabs'}">
|
||||||
|
<li (click)="charts.projectPublications.columns.load = true"><a href="#">Columns</a></li>
|
||||||
|
<li (click)="charts.projectPublications.pie.load = true"><a href="#">Pie</a></li>
|
||||||
|
<li (click)="charts.projectPublications.table.load = true"><a href="#">Table</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul id="publicationtabs" class="uk-switcher uk-margin">
|
||||||
|
<li>
|
||||||
|
<div *ngIf="charts.projectPublications.columns.load">
|
||||||
|
<i-frame [url]=charts.projectPublications.columns.url width="1000" height="450"></i-frame>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div *ngIf="charts.projectPublications.pie.load">
|
||||||
|
<i-frame [url]=charts.projectPublications.pie.url width="1000" height="450"></i-frame>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div *ngIf="charts.projectPublications.table.load">
|
||||||
|
<i-frame [url]=charts.projectPublications.table.url width="1000" height="450"></i-frame>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="charts && charts.projectDatasets && statistics && statistics.datasets > 0">
|
||||||
|
<div class="uk-text-large" >Research data per projects</div>
|
||||||
|
<ul class="uk-tab uk-margin-top" data-uk-tab="{connect:'#datasettabs'}">
|
||||||
|
<li (click)="charts.projectDatasets.columns.load = true"><a href="#">Columns</a></li>
|
||||||
|
<li (click)="charts.projectDatasets.pie.load = true"><a href="#">Pie</a></li>
|
||||||
|
<li (click)="charts.projectDatasets.table.load = true"><a href="#">Table</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul id="datasettabs" class="uk-switcher uk-margin">
|
||||||
|
<li>
|
||||||
|
<div *ngIf="charts.projectDatasets.columns.load">
|
||||||
|
<i-frame [url]=charts.projectDatasets.columns.url width="1000" height="450"></i-frame>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div *ngIf="charts.projectDatasets.pie.load">
|
||||||
|
<i-frame [url]=charts.projectDatasets.pie.url width="1000" height="450"></i-frame>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div *ngIf="charts.projectDatasets.table.load">
|
||||||
|
<i-frame [url]=charts.projectDatasets.table.url width="1000" height="450"></i-frame>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="charts && charts.projectSoftware && statistics && statistics.software > 0">
|
||||||
|
<div class="uk-text-large" >Software per projects</div>
|
||||||
|
<ul class="uk-tab uk-margin-top" data-uk-tab="{connect:'#softwaretabs'}">
|
||||||
|
<li (click)="charts.projectSoftware.columns.load = true"><a href="#">Columns</a></li>
|
||||||
|
<li (click)="charts.projectSoftware.pie.load = true"><a href="#">Pie</a></li>
|
||||||
|
<li (click)="charts.projectSoftware.table.load = true"><a href="#">Table</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul id="softwaretabs" class="uk-switcher uk-margin">
|
||||||
|
<li>
|
||||||
|
<div *ngIf="charts.projectSoftware.columns.load">
|
||||||
|
<i-frame [url]=charts.projectSoftware.columns.url width="1000" height="450"></i-frame>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div *ngIf="charts.projectSoftware.pie.load">
|
||||||
|
<i-frame [url]=charts.projectSoftware.pie.url width="1000" height="450"></i-frame>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div *ngIf="charts.projectSoftware.table.load">
|
||||||
|
<i-frame [url]=charts.projectSoftware.table.url width="1000" height="450"></i-frame>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
|
@ -0,0 +1,140 @@
|
||||||
|
|
||||||
|
import {Component} from '@angular/core';
|
||||||
|
import {Observable} from 'rxjs/Observable';
|
||||||
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
|
import {Location} from '@angular/common';
|
||||||
|
import "rxjs/add/observable/zip";
|
||||||
|
import { EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
||||||
|
import { ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes';
|
||||||
|
|
||||||
|
import {Properties} from '../utils/properties';
|
||||||
|
import {CommunityService} from "../community/community.service";
|
||||||
|
import {CommunitiesService} from "../communities/communities.service";
|
||||||
|
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
||||||
|
import {Meta} from '../openaireLibrary/sharedComponents/metaService';
|
||||||
|
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
|
||||||
|
import{ StatisticsService} from '../utils/services/statistics.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'statistics',
|
||||||
|
templateUrl: 'statistics.component.html',
|
||||||
|
})
|
||||||
|
export class StatisticsComponent {
|
||||||
|
public piwiksub: any;
|
||||||
|
public subfunders: any;
|
||||||
|
|
||||||
|
public pageTitle = "OpenAIRE"
|
||||||
|
|
||||||
|
properties:EnvProperties;
|
||||||
|
public communityId = null;
|
||||||
|
public communityInfo = null;
|
||||||
|
public statistics = null;
|
||||||
|
charts = null;
|
||||||
|
constructor (
|
||||||
|
private route: ActivatedRoute,
|
||||||
|
private _router: Router,
|
||||||
|
private location: Location, private _meta: Meta, private _piwikService:PiwikService,
|
||||||
|
private config: ConfigurationService,
|
||||||
|
private _communityService:CommunityService, private _communitiesService:CommunitiesService, private _statisticsService: StatisticsService
|
||||||
|
) {
|
||||||
|
|
||||||
|
var description = "open access, research, scientific publication, European Commission, EC, FP7, ERC, Horizon 2020, H2020, search, projects ";
|
||||||
|
|
||||||
|
var title = "OpenAIRE";
|
||||||
|
|
||||||
|
this._meta.setTitle(title);
|
||||||
|
this._meta.updateMeta("description", description);
|
||||||
|
this._meta.updateProperty("og:description", description);
|
||||||
|
this._meta.updateProperty("og:title", title);
|
||||||
|
console.log("Heree " +document.location.hostname);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public ngOnInit() {
|
||||||
|
this.route.data
|
||||||
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||||
|
this.properties = data.envSpecific;
|
||||||
|
var url = data.envSpecific.baseLink+this._router.url
|
||||||
|
this._meta.updateProperty("og:url", url);
|
||||||
|
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||||
|
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE").subscribe();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
this.route.queryParams.subscribe(
|
||||||
|
communityId => {
|
||||||
|
this.communityId = communityId['communityId'];
|
||||||
|
this._statisticsService.getCommunityStatistics("http://vatopedi.di.uoa.gr:8080/stats/communities/",this.communityId).subscribe (
|
||||||
|
res => {
|
||||||
|
this.statistics = res;
|
||||||
|
console.log(this.statistics);
|
||||||
|
});
|
||||||
|
this.createCharts();
|
||||||
|
});
|
||||||
|
this._communityService.getCommunity('https://dev-openaire.d4science.org/openaire/community/'+this.communityId).subscribe (
|
||||||
|
communityInfo => {
|
||||||
|
this.communityInfo = communityInfo;
|
||||||
|
console.log(communityInfo);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ngOnDestroy() {
|
||||||
|
if(this.piwiksub){
|
||||||
|
this.piwiksub.unsubscribe();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
private createCharts(){
|
||||||
|
this.charts = {
|
||||||
|
timelines: {
|
||||||
|
publications:
|
||||||
|
{url:'https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data=com=query&data={"query":"comTimelinePubs","comId":"'+ this.communityId + '","table":"result","fields":[{"fld":"number","agg":"count","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Publications"],"fieldsheaders":["publications"],"in":[{"f":0,"text":"Yearly"}],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"Publications through the years","subtitle":"","xaxistitle":"Year"}&w=90%&h=83%',
|
||||||
|
load:true},
|
||||||
|
datasets:
|
||||||
|
{url:'https://beta.openaire.eu/stats/chart.php?com=query&data={"query":"comTimelineData","comId":"'+ this.communityId + '","table":"result","fields":[{"fld":"number","agg":"count","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Datasets"],"fieldsheaders":["publications"],"in":[{"f":0,"text":"Yearly"}],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"Research data through the years","subtitle":"","xaxistitle":"Year"}&w=90%&h=83%',
|
||||||
|
load:false},
|
||||||
|
software:{url:'https://beta.openaire.eu/stats/chart.php?com=query&data={"query":"comTimelineSoft","comId":"'+ this.communityId + '","table":"result","fields":[{"fld":"number","agg":"count","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Software"],"fieldsheaders":["publications"],"in":[{"f":0,"text":"Yearly"}],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"Software through the years","subtitle":"","xaxistitle":"Year"}&w=90%&h=83%',
|
||||||
|
load:false}
|
||||||
|
},
|
||||||
|
projectPublications: {
|
||||||
|
columns:
|
||||||
|
{url:'https://beta.openaire.eu/stats/chart.php?com=query&data={"query":"comProjectPubs","comId":"'+ this.communityId + '","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Publications"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"Publications per project","subtitle":"","xaxistitle":"Project"}&w=90%&h=83%',
|
||||||
|
load:true},
|
||||||
|
pie:
|
||||||
|
{url:'https://beta.openaire.eu/stats/chart.php?com=query&data={"query":"comProjectPubs","comId":"'+ this.communityId + '","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Publications"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"Publications per project","subtitle":"","xaxistitle":"Project"}&w=90%&h=83%',
|
||||||
|
display:false},
|
||||||
|
table:{url:'https://beta.openaire.eu/stats/gtable.php?com=query&data={"query":"comProjectPubs","comId":"'+ this.communityId + '","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Publications"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"Publications per project","subtitle":"","xaxistitle":"Project"}&w=90%&h=83%',
|
||||||
|
load:false}
|
||||||
|
},
|
||||||
|
projectDatasets: {
|
||||||
|
columns:
|
||||||
|
{url:'https://beta.openaire.eu/stats/chart.php?com=query&data={"query":"comProjectData","comId":"'+ this.communityId + '","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Datasets"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"Research Data per project","subtitle":"","xaxistitle":"Project"}&w=90%&h=83%',
|
||||||
|
load:true},
|
||||||
|
pie:
|
||||||
|
{url:'https://beta.openaire.eu/stats/chart.php?com=query&data={"query":"comProjectData","comId":"'+ this.communityId + '","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Datasets"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"Research Data project","subtitle":"","xaxistitle":"Project"}&w=90%&h=83%',
|
||||||
|
load:false},
|
||||||
|
table:{url:'https://beta.openaire.eu/stats/gtable.php?com=query&data={"query":"comProjectData","comId":"'+ this.communityId + '","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Datasets"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"Research Data per project","subtitle":"","xaxistitle":"Project"}&w=90%&h=83%',
|
||||||
|
load:false}
|
||||||
|
},
|
||||||
|
projectSoftware: {
|
||||||
|
columns:
|
||||||
|
{url:'https://beta.openaire.eu/stats/chart.php?com=query&data={"query":"comProjectSoft","comId":"'+ this.communityId + '","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Software"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"Software per project","subtitle":"","xaxistitle":"Project"}&w=90%&h=83%',
|
||||||
|
load:true},
|
||||||
|
pie:
|
||||||
|
{url:'https://beta.openaire.eu/stats/chart.php?com=query&data={"query":"comProjectSoft","comId":"'+ this.communityId + '","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Software"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"Software per project","subtitle":"","xaxistitle":"Project"}&w=90%&h=83%',
|
||||||
|
load:false},
|
||||||
|
table:{url:'https://beta.openaire.eu/stats/gtable.php?com=query&data={"query":"comProjectSoft","comId":"'+ this.communityId + '","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Software"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"Software per project","subtitle":"","xaxistitle":"Project"}&w=90%&h=83%',
|
||||||
|
load:false}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
import { NgModule} from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import{StatisticsRoutingModule} from './statistics-routing.module';
|
||||||
|
import{StatisticsComponent} from './statistics.component';
|
||||||
|
import { StatisticsService } from '../utils/services/statistics.service';
|
||||||
|
import { CommunityService } from '../community/community.service';
|
||||||
|
import { CommunitiesService } from '../communities/communities.service';
|
||||||
|
import {IFrameModule} from '../openaireLibrary/utils/iframe.module';
|
||||||
|
|
||||||
|
|
||||||
|
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
||||||
|
import {Meta} from '../openaireLibrary/sharedComponents/metaService';
|
||||||
|
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
|
||||||
|
|
||||||
|
import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard';
|
||||||
|
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule, FormsModule, RouterModule,
|
||||||
|
StatisticsRoutingModule, IFrameModule
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
StatisticsComponent
|
||||||
|
],
|
||||||
|
providers:[
|
||||||
|
FreeGuard, PreviousRouteRecorder, ConfigurationService, Meta, PiwikService, CommunityService, CommunitiesService, StatisticsService
|
||||||
|
],
|
||||||
|
exports: [
|
||||||
|
StatisticsComponent
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class StatisticsModule { }
|
|
@ -0,0 +1,21 @@
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Http, Response, Headers, RequestOptions } from '@angular/http';
|
||||||
|
import { Observable } from 'rxjs/Rx';
|
||||||
|
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class StatisticsService {
|
||||||
|
|
||||||
|
|
||||||
|
constructor(private http:Http) {
|
||||||
|
}
|
||||||
|
|
||||||
|
getCommunityStatistics(url: string, community) {
|
||||||
|
return this.http.get(url+community)
|
||||||
|
.map(res => <any> res.json()).do(res => {console.log(res)}).map(res => res.statistics).do(res => {console.log(res)});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue