diff --git a/portal-2/src/app/deposit/deposit.component.ts b/portal-2/src/app/deposit/deposit.component.ts index 96a8e3eb..4b3e5b98 100644 --- a/portal-2/src/app/deposit/deposit.component.ts +++ b/portal-2/src/app/deposit/deposit.component.ts @@ -39,7 +39,7 @@ import {SearchOrganizationsService} from '../services/searchOrganizations.servic (selectedValueChanged)="valueChanged($event)"> diff --git a/portal-2/src/app/landingPages/dataProvider/tabs.component.ts b/portal-2/src/app/landingPages/dataProvider/tabs.component.ts index b1970c75..1811e69d 100644 --- a/portal-2/src/app/landingPages/dataProvider/tabs.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/tabs.component.ts @@ -10,6 +10,8 @@ import { SearchProjectsService } from '../../services/searchProjects.service'; import { SearchDataprovidersComponent } from '../../searchPages/simple/searchDataproviders.component'; import { SearchDataprovidersService } from '../../services/searchDataproviders.service'; +import {OpenaireProperties} from '../../utils/properties/openaireProperties'; + @Component({ selector: 'tabs', template: ` @@ -100,8 +102,8 @@ import { SearchDataprovidersService } from '../../services/searchDataproviders.s - - + +
  • @@ -135,6 +137,8 @@ import { SearchDataprovidersService } from '../../services/searchDataproviders.s + +
  • ` @@ -163,6 +167,8 @@ export class TabsComponent { public reloadDataproviders: boolean = true; public reloadRelatedDatasources: boolean = true; public metricsClicked: boolean; + private viewsFrameUrl: string; + private downloadsFrameUrl: string; public searchPublicationsComponent : SearchPublicationsComponent; public searchDatasetsComponent: SearchDatasetsComponent; @@ -188,6 +194,8 @@ export class TabsComponent { this.count(1, 0); this.metricsClicked = false; + this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"dtsrcOpenAIRETimeline", "dtsrcName":"'+this.id+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"dtsrcRepoTimeline", "dtsrcName":"'+this.id+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true'; + this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"dtsrcDownloadsTimeline","dtsrcName":"'+this.id+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"chart","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["spline"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true'; } if(this.resultsBy == "collectedFrom") { diff --git a/portal-2/src/app/landingPages/dataset/dataset.component.html b/portal-2/src/app/landingPages/dataset/dataset.component.html index 710bbcc1..b2373577 100644 --- a/portal-2/src/app/landingPages/dataset/dataset.component.html +++ b/portal-2/src/app/landingPages/dataset/dataset.component.html @@ -99,6 +99,8 @@
  • + +
  • diff --git a/portal-2/src/app/landingPages/dataset/dataset.component.ts b/portal-2/src/app/landingPages/dataset/dataset.component.ts index c3a1da0d..7258e859 100644 --- a/portal-2/src/app/landingPages/dataset/dataset.component.ts +++ b/portal-2/src/app/landingPages/dataset/dataset.component.ts @@ -13,9 +13,28 @@ import {InlineClaimResultComponent} from '../../claimPages/inlineClaims/inlineCl }) export class DatasetComponent { - constructor (private _datasetService: DatasetService, private route: ActivatedRoute) { - console.info('dataset constructor'); - } + public datasetInfo: DatasetInfo; + private showStyle: boolean = false; + private showAllReferences: boolean = false; + private showAllRelResData: boolean = false; + private showAllSimilPubl: boolean = false; + private showAllBioentities: boolean = false; + private datasetId : string ; + private result ; + sub: any; + private metricsClicked: boolean; + private viewsFrameUrl: string; + private downloadsFrameUrl: string; + + /*@ViewChild (InlineClaimProjectComponent) inlineClaimProject : InlineClaimProjectComponent ; + @ViewChild (InlineClaimContextComponent) inlineClaimContext : InlineClaimContextComponent ; + @ViewChild (InlineClaimResultComponent) inlineClaimResult : InlineClaimResultComponent ; + */ + public warningMessage = ""; + public errorMessage = ""; + + constructor (private _datasetService: DatasetService, private route: ActivatedRoute) {} + ngOnInit() { this.sub = this.route.queryParams.subscribe(params => { this.datasetId = params['datasetId']; @@ -28,32 +47,18 @@ export class DatasetComponent { }); this.metricsClicked = false; + this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resOpenAIRETimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"resRepoTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true'; + this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true'; } - public datasetInfo: DatasetInfo; - private showStyle: boolean = false; - private showAllReferences: boolean = false; - private showAllRelResData: boolean = false; - private showAllSimilPubl: boolean = false; - private showAllBioentities: boolean = false; - private datasetId : string ; - private result ; - private metricsClicked: boolean; - - /*@ViewChild (InlineClaimProjectComponent) inlineClaimProject : InlineClaimProjectComponent ; - @ViewChild (InlineClaimContextComponent) inlineClaimContext : InlineClaimContextComponent ; - @ViewChild (InlineClaimResultComponent) inlineClaimResult : InlineClaimResultComponent ; -*/ - public warningMessage = ""; - public errorMessage = ""; ngOnDestroy() { this.sub.unsubscribe(); } - sub: any; + getDatasetInfo(id:string) { this.warningMessage = ''; this.errorMessage="" - console.info("do request"); + this._datasetService.getDatasetInfo(id).subscribe( data => { this.datasetInfo = data; diff --git a/portal-2/src/app/landingPages/metrics.component.ts b/portal-2/src/app/landingPages/metrics.component.ts index f0acb837..2310fda5 100644 --- a/portal-2/src/app/landingPages/metrics.component.ts +++ b/portal-2/src/app/landingPages/metrics.component.ts @@ -1,13 +1,11 @@ import {Component, Input} from '@angular/core'; import {Metrics} from '../utils/entities/metrics'; import {MetricsService } from '../services/metrics.service'; +import {ErrorCodes} from '../utils/properties/openaireProperties'; @Component({ selector: 'metrics', template: ` -
    - Metrics are currently unavailable -
    @@ -21,27 +19,37 @@ import {MetricsService } from '../services/metrics.service';
    Total Views:
    {{metrics.totalViews}}
    + + + + + + + + - - + + @@ -52,8 +60,8 @@ import {MetricsService } from '../services/metrics.service'; - + @@ -64,10 +72,10 @@ import {MetricsService } from '../services/metrics.service'; @@ -79,11 +87,15 @@ export class MetricsComponent { @Input() id: string; @Input() type: string; @Input() name: string = ""; - metrics: Metrics; + private metrics: Metrics; + private errorCodes:ErrorCodes; + private status: number; constructor (private _metricsService: MetricsService) {} ngOnInit() { + this.errorCodes = new ErrorCodes(); + this.status = this.errorCodes.LOADING; this.getMetrics(); } @@ -99,9 +111,14 @@ export class MetricsComponent { this._metricsService.getMetrics(this.id, this.type).subscribe( data => { this.metrics = data; + this.status = this.errorCodes.DONE; }, err => { console.log(err); + this.status = this.errorCodes.ERROR; + if(err.status == '404') { + this.status = this.errorCodes.NOT_AVAILABLE; + } } ); } diff --git a/portal-2/src/app/landingPages/project/project.component.html b/portal-2/src/app/landingPages/project/project.component.html index a630a3d6..b649d778 100644 --- a/portal-2/src/app/landingPages/project/project.component.html +++ b/portal-2/src/app/landingPages/project/project.component.html @@ -142,7 +142,9 @@
  • - + + +
  • diff --git a/portal-2/src/app/landingPages/project/project.component.ts b/portal-2/src/app/landingPages/project/project.component.ts index 97d67083..259d72dd 100644 --- a/portal-2/src/app/landingPages/project/project.component.ts +++ b/portal-2/src/app/landingPages/project/project.component.ts @@ -24,8 +24,9 @@ export class ProjectComponent{ public projectInfo: ProjectInfo; private projectName: string; private metricsClicked: boolean; - private statsClicked: boolean; private viewsFrameUrl: string; + private downloadsFrameUrl: string; + private statsClicked: boolean; private chartScientificResultsUrl: string; private chartAccessModeUrl: string; private chartDatasourcesUrl: string; @@ -125,8 +126,9 @@ export class ProjectComponent{ 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.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'); + //this.projectName = (this.projectInfo.acronym != undefined && this.projectInfo.acronym != '') ? this.projectInfo.acronym : this.projectInfo.title; + this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"projViewsTimeline","projTitle":"'+this.projectId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["spline"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true'; + this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"projDownloadsTimeline","projTitle":"'+this.projectId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["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'; //stats tab charts this.chartScientificResultsUrl='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"projScient","projTitle":"'+this.projectId+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "spline", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Publications"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [" "], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=600&h=250'; this.chartAccessModeUrl='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"projOA","projTitle":"'+this.projectId+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Publications"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [" "], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=600&h=250'; diff --git a/portal-2/src/app/landingPages/publication/publication.component.html b/portal-2/src/app/landingPages/publication/publication.component.html index 22d1e5ee..c03073fd 100644 --- a/portal-2/src/app/landingPages/publication/publication.component.html +++ b/portal-2/src/app/landingPages/publication/publication.component.html @@ -231,7 +231,8 @@
  • - + +
  • @@ -250,31 +251,6 @@ -
  • -
    -
    Collected from
    -
    - - View less - -
    -
    - - {{item['name']}} - -
    -
    - - View less - -
    -
    - - View more - -
    -
    -
  • Download from
    @@ -291,13 +267,15 @@ {{key}} + [title]="publicationInfo.downloadFrom.get(key)['accessMode']" + target="_blank"> [{{i+1}}] + href="{{publicationInfo.downloadFrom.get(key)['url']}}" + target="_blank"> {{key}} @@ -327,13 +305,14 @@
    {{key}} - + [{{i+1}}]
    + href="{{publicationInfo.publishedIn.get(key)['url']}}" + target="_blank"> {{key}} @@ -417,6 +396,33 @@
  • + +
  • +
    +
    Collected from
    + +
    + + {{item['name']}} + +
    +
    + + View less + +
    +
    ...
    +
    + + View more + +
    +
    +
  • diff --git a/portal-2/src/app/landingPages/publication/publication.component.ts b/portal-2/src/app/landingPages/publication/publication.component.ts index 364719f5..b5c2d5b5 100644 --- a/portal-2/src/app/landingPages/publication/publication.component.ts +++ b/portal-2/src/app/landingPages/publication/publication.component.ts @@ -20,35 +20,12 @@ export class PublicationComponent { public showAllFundedBy: boolean = false; public showAllPublishedIn: boolean = false; - constructor (private _publicationService: PublicationService, - private route: ActivatedRoute) { - } - ngOnInit() { - this.sub = this.route.queryParams.subscribe(data => { - this.articleId = data['articleId']; - console.info("Article id is :"+this.articleId); - if(this.articleId){ - this.getPublicationInfo(this.articleId); - }else{ - 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'; - -} - - ngOnDestroy() { - this.sub.unsubscribe(); - } sub: any;getPublicationView articleId: string; public publicationInfo: PublicationInfo; private metricsClicked: boolean; private viewsFrameUrl: string; - private openaireViewsFrameUrl: string; + private downloadsFrameUrl: string; public showAllReferences: boolean = false; public showAllRelResData: boolean = false; @@ -62,13 +39,36 @@ export class PublicationComponent { public result ; -/* @ViewChild (InlineClaimProjectComponent) inlineClaimProject : InlineClaimProjectComponent ; + /* @ViewChild (InlineClaimProjectComponent) inlineClaimProject : InlineClaimProjectComponent ; @ViewChild (InlineClaimContextComponent) inlineClaimContext : InlineClaimContextComponent ; @ViewChild (InlineClaimResultComponent) inlineClaimResult : InlineClaimResultComponent ; -*/ + */ public warningMessage = ""; public errorMessage = ""; + constructor (private _publicationService: PublicationService, + private route: ActivatedRoute) {} + + ngOnInit() { + this.sub = this.route.queryParams.subscribe(data => { + this.articleId = data['articleId']; + console.info("Article id is :"+this.articleId); + if(this.articleId){ + this.getPublicationInfo(this.articleId); + }else{ + console.info("Article id not found"); + } + }); + + this.metricsClicked = false; + this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resOpenAIRETimeline", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"resRepoTimeline", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true'; + this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true'; + } + + ngOnDestroy() { + this.sub.unsubscribe(); + } + getPublicationInfo(id:string) { this.warningMessage = ''; this.errorMessage="" diff --git a/portal-2/src/app/searchPages/searchUtils/searchDownload.component.ts b/portal-2/src/app/searchPages/searchUtils/searchDownload.component.ts index d5d4725c..1fd23492 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchDownload.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchDownload.component.ts @@ -37,7 +37,7 @@ export class SearchDownloadComponent { } ngOnInit() { - this.downloadURLAPI = OpenaireProperties.getCsvApi(); + this.downloadURLAPI = OpenaireProperties.getCsvAPIURL(); } confirmClose(data){ diff --git a/portal-2/src/app/searchPages/searchUtils/searchPaging.component.ts b/portal-2/src/app/searchPages/searchUtils/searchPaging.component.ts index ead58de6..c66d459b 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchPaging.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchPaging.component.ts @@ -4,7 +4,7 @@ import {Observable} from 'rxjs/Observable'; @Component({ selector: 'search-paging', template: ` -
    +
    diff --git a/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts b/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts index 26eb675e..2bde4392 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts @@ -5,7 +5,7 @@ import { ErrorCodes} from '../../utils/properties/openaireProperties'; @Component({ selector: 'search-result', template: ` -
    -
    + ` diff --git a/portal-2/src/app/utils/pagingFormatter.component.ts b/portal-2/src/app/utils/pagingFormatter.component.ts index 75fb595b..8cefd4bc 100644 --- a/portal-2/src/app/utils/pagingFormatter.component.ts +++ b/portal-2/src/app/utils/pagingFormatter.component.ts @@ -10,8 +10,10 @@ import {DomSanitizer} from '@angular/platform-browser';
    Total Downloads - Total Publication Downloads - Total Views Total Publication Views Total Downloads + Total Publication Downloads +
    - {{metrics.totalDownloads}} + {{metrics.totalViews}} - {{metrics.totalViews}} + {{metrics.totalDownloads}}
    FromNumber Of Downloads Number Of ViewsNumber Of Downloads
    - {{metrics.infos.get(key).numOfDownloads}} + {{metrics.infos.get(key).numOfViews}} - {{metrics.infos.get(key).numOfViews}} + {{metrics.infos.get(key).numOfDownloads}}