diff --git a/portal-2/src/app/test/test.component.ts b/portal-2/src/app/test/test.component.ts index 34595762..65631a2c 100644 --- a/portal-2/src/app/test/test.component.ts +++ b/portal-2/src/app/test/test.component.ts @@ -15,17 +15,7 @@ import {SearchFields} from '../utils/properties/searchFields'; @Component({ selector: 'test', template: ` - -
- -
-
- -
-Selected:: - - {{item.label}} - +
@@ -63,57 +53,59 @@ export class TestComponent { public lan; public types; - + public projectId:string = "arc_________::000dc863f894b1664a9d5f868b7bde9f"; + // public url =('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":"id","agg":"sum"},"group":"month","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":0,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"untitled","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'); +public url = '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": ""}'; public user:{password:string,email:string} = {password:"",email:""}; constructor(private _projectService: OpenaireProjectsService,private _searchProjectsService:SearchProjectsService,private _searchPubService:SearchPublicationsService,private _searchDataService:SearchDatasetsService, private _vocabulariesService: ISVocabulariesService) { } ngOnInit() { // this.lan = this._vocabulariesService.getLanguages(); - this.lan = this._vocabulariesService.getVocabularyFromService("dnet:languages.json"); - this.countries = this._vocabulariesService.getVocabularyFromService("dnet:countries.json"); + // this.lan = this._vocabulariesService.getVocabularyFromService("dnet:languages.json"); + // this.countries = this._vocabulariesService.getVocabularyFromService("dnet:countries.json"); if( typeof localStorage !== 'undefined') { this.user.email = localStorage.getItem("email"); this.user.password = localStorage.getItem("password"); } - //&collectedFrom=openaire____::4a39de251a65e801bb88d3e75b47623f&cl=and - this._searchDataService.searchDatasets('&fq=collectedfromdatasourceid exact "openaire____::fdb035c8b3e0540a8d9a561a6c44f4de"' ,"&refine=true&fields=resulthostingdatasourceid", 1, 0, ["resulthostingdatasourceid"]).subscribe( - data => { - - console.info("done" +data[0]); - - }, - err => { - console.error(err) - - } - ); - this._searchPubService.searchPublications('&fq=collectedfromdatasourceid exact "openaire____::fdb035c8b3e0540a8d9a561a6c44f4de"',"&refine=true&fields=resulthostingdatasourceid" , 1, 0, ["resulthostingdatasourceid"]).subscribe( - data => { - - console.info("done" +data[0]); - - }, - err => { - console.error(err) - - } - ); - this._searchProjectsService.getProjectsforDataProvider("openaire____::db600878200645bd752cf7fd96a37df5",1,10).subscribe( - data => { - - console.info("done" +data[0]); - - }, - err => { - console.error(err) - - } - ); - console.info("do the test"); - this.test(); - console.info("after the test"); + // //&collectedFrom=openaire____::4a39de251a65e801bb88d3e75b47623f&cl=and + // this._searchDataService.searchDatasets('&fq=collectedfromdatasourceid exact "openaire____::fdb035c8b3e0540a8d9a561a6c44f4de"' ,"&refine=true&fields=resulthostingdatasourceid", 1, 0, ["resulthostingdatasourceid"]).subscribe( + // data => { + // + // console.info("done" +data[0]); + // + // }, + // err => { + // console.error(err) + // + // } + // ); + // this._searchPubService.searchPublications('&fq=collectedfromdatasourceid exact "openaire____::fdb035c8b3e0540a8d9a561a6c44f4de"',"&refine=true&fields=resulthostingdatasourceid" , 1, 0, ["resulthostingdatasourceid"]).subscribe( + // data => { + // + // console.info("done" +data[0]); + // + // }, + // err => { + // console.error(err) + // + // } + // ); + // this._searchProjectsService.getProjectsforDataProvider("openaire____::db600878200645bd752cf7fd96a37df5",1,10).subscribe( + // data => { + // + // console.info("done" +data[0]); + // + // }, + // err => { + // console.error(err) + // + // } + // ); + // console.info("do the test"); + // this.test(); + // console.info("after the test"); } test(){ @@ -154,38 +146,4 @@ export class TestComponent { console.info("Save email/ password in local Storage. Email is:" + localStorage.getItem("email")); } - service(term) { - var projects = this._projectService.searchForProjectsObs(term, "this.selectedFunderId"); - console.info("Results: "+ projects); - for( var i = 0 ; i -1; - }.bind(this)); - - } - public countries = [ - {id: '0', label: "Albania"},{id: '1', label: "Andorra"},{id: '2', label: "Armenia"}, - {id: '3', label: "Austria"},{id: '4', label: "Azerbaijan"},{id: '5', label: "Belarus"},{id: '6', label: "Belgium"}, - {id: '7', label: "Bosnia & Herzegovina"},{id: '8', label: "Bulgaria"},{id: '9', label: "Croatia"}, - {id: '10', label: "Cyprus"},{id: '11', label: "Czech Republic"},{id: '12', label: "Denmark"},{id: '13', label: "Estonia"}, - {id: '14', label: "Finland"},{id: '15', label: "France"},{id: '16', label: "Georgia"}, - {id: '17', label: "Germany"},{id: '18', label: "Greece"},{id: '19', label: "Hungary"},{id: '20', label: "Iceland"}, - {id: '21', label: "Ireland"},{id: '22', label: "Italy"},{id: '23', label: "Kosovo"}, - {id: '24', label: "Latvia"},{id: '25', label: "Liechtenstein"},{id: '26', label: "Lithuania"},{id: '27', label: "Luxembourg"}]; - - - // "Latvia","Liechtenstein","Lithuania","Luxembourg","Macedonia","Malta", - // "Moldova","Monaco","Montenegro","Netherlands","Norway","Poland", - // "Portugal","Romania","Russia","San Marino","Serbia","Slovakia","Slovenia", - // "Spain","Sweden","Switzerland","Turkey","Ukraine","United Kingdom","Vatican City"]; }