Revision 44886
Added by Argiro Kokogiannaki over 7 years ago
modules/uoa-services-portal/trunk/portal-2/src/app/test/test.component.ts | ||
---|---|---|
15 | 15 |
@Component({ |
16 | 16 |
selector: 'test', |
17 | 17 |
template: ` |
18 |
<!--i-frame url="https://google.com" width="30%" height="250"></i-frame--> |
|
19 |
<div style ="width:30%; height:250px;" > |
|
20 |
<!--static-autocomplete [(list)]=lan [(filtered)] =filtered [(selected)] =selected [showSelected]=true placeHolderMessage = "Search for languages" title = "Languages:" [multipleSelections]=false ></static-autocomplete--> |
|
21 |
<div> |
|
22 |
<div style ="width:30%; height:250px;" > |
|
18 |
<i-frame [url]=url width="30%" height="250"></i-frame> |
|
23 | 19 |
|
24 |
<div> |
|
25 |
Selected:: |
|
26 |
<span class="row-fluid show-grid auto-complete-choice" *ngFor="let item of selected" > |
|
27 |
<span >{{item.label}} </span> |
|
28 |
</span> |
|
29 |
|
|
30 | 20 |
<div style ="width:80%; height:250px;" > |
31 | 21 |
|
32 | 22 |
<div> |
... | ... | |
63 | 53 |
|
64 | 54 |
public lan; |
65 | 55 |
public types; |
66 |
|
|
56 |
public projectId:string = "arc_________::000dc863f894b1664a9d5f868b7bde9f"; |
|
57 |
// 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'); |
|
58 |
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": ""}'; |
|
67 | 59 |
public user:{password:string,email:string} = {password:"",email:""}; |
68 | 60 |
constructor(private _projectService: OpenaireProjectsService,private _searchProjectsService:SearchProjectsService,private _searchPubService:SearchPublicationsService,private _searchDataService:SearchDatasetsService, private _vocabulariesService: ISVocabulariesService) { |
69 | 61 |
} |
70 | 62 |
ngOnInit() { |
71 | 63 |
// this.lan = this._vocabulariesService.getLanguages(); |
72 |
this.lan = this._vocabulariesService.getVocabularyFromService("dnet:languages.json"); |
|
73 |
this.countries = this._vocabulariesService.getVocabularyFromService("dnet:countries.json"); |
|
64 |
// this.lan = this._vocabulariesService.getVocabularyFromService("dnet:languages.json");
|
|
65 |
// this.countries = this._vocabulariesService.getVocabularyFromService("dnet:countries.json");
|
|
74 | 66 |
|
75 | 67 |
if( typeof localStorage !== 'undefined') { |
76 | 68 |
|
77 | 69 |
this.user.email = localStorage.getItem("email"); |
78 | 70 |
this.user.password = localStorage.getItem("password"); |
79 | 71 |
} |
80 |
//&collectedFrom=openaire____::4a39de251a65e801bb88d3e75b47623f&cl=and |
|
81 |
this._searchDataService.searchDatasets('&fq=collectedfromdatasourceid exact "openaire____::fdb035c8b3e0540a8d9a561a6c44f4de"' ,"&refine=true&fields=resulthostingdatasourceid", 1, 0, ["resulthostingdatasourceid"]).subscribe( |
|
82 |
data => { |
|
72 |
// //&collectedFrom=openaire____::4a39de251a65e801bb88d3e75b47623f&cl=and |
|
73 |
// this._searchDataService.searchDatasets('&fq=collectedfromdatasourceid exact "openaire____::fdb035c8b3e0540a8d9a561a6c44f4de"' ,"&refine=true&fields=resulthostingdatasourceid", 1, 0, ["resulthostingdatasourceid"]).subscribe( |
|
74 |
// data => { |
|
75 |
// |
|
76 |
// console.info("done" +data[0]); |
|
77 |
// |
|
78 |
// }, |
|
79 |
// err => { |
|
80 |
// console.error(err) |
|
81 |
// |
|
82 |
// } |
|
83 |
// ); |
|
84 |
// this._searchPubService.searchPublications('&fq=collectedfromdatasourceid exact "openaire____::fdb035c8b3e0540a8d9a561a6c44f4de"',"&refine=true&fields=resulthostingdatasourceid" , 1, 0, ["resulthostingdatasourceid"]).subscribe( |
|
85 |
// data => { |
|
86 |
// |
|
87 |
// console.info("done" +data[0]); |
|
88 |
// |
|
89 |
// }, |
|
90 |
// err => { |
|
91 |
// console.error(err) |
|
92 |
// |
|
93 |
// } |
|
94 |
// ); |
|
95 |
// this._searchProjectsService.getProjectsforDataProvider("openaire____::db600878200645bd752cf7fd96a37df5",1,10).subscribe( |
|
96 |
// data => { |
|
97 |
// |
|
98 |
// console.info("done" +data[0]); |
|
99 |
// |
|
100 |
// }, |
|
101 |
// err => { |
|
102 |
// console.error(err) |
|
103 |
// |
|
104 |
// } |
|
105 |
// ); |
|
106 |
// console.info("do the test"); |
|
107 |
// this.test(); |
|
108 |
// console.info("after the test"); |
|
83 | 109 |
|
84 |
console.info("done" +data[0]); |
|
85 |
|
|
86 |
}, |
|
87 |
err => { |
|
88 |
console.error(err) |
|
89 |
|
|
90 |
} |
|
91 |
); |
|
92 |
this._searchPubService.searchPublications('&fq=collectedfromdatasourceid exact "openaire____::fdb035c8b3e0540a8d9a561a6c44f4de"',"&refine=true&fields=resulthostingdatasourceid" , 1, 0, ["resulthostingdatasourceid"]).subscribe( |
|
93 |
data => { |
|
94 |
|
|
95 |
console.info("done" +data[0]); |
|
96 |
|
|
97 |
}, |
|
98 |
err => { |
|
99 |
console.error(err) |
|
100 |
|
|
101 |
} |
|
102 |
); |
|
103 |
this._searchProjectsService.getProjectsforDataProvider("openaire____::db600878200645bd752cf7fd96a37df5",1,10).subscribe( |
|
104 |
data => { |
|
105 |
|
|
106 |
console.info("done" +data[0]); |
|
107 |
|
|
108 |
}, |
|
109 |
err => { |
|
110 |
console.error(err) |
|
111 |
|
|
112 |
} |
|
113 |
); |
|
114 |
console.info("do the test"); |
|
115 |
this.test(); |
|
116 |
console.info("after the test"); |
|
117 |
|
|
118 | 110 |
} |
119 | 111 |
test(){ |
120 | 112 |
var sf:SearchFields = new SearchFields(); |
... | ... | |
154 | 146 |
console.info("Save email/ password in local Storage. Email is:" + localStorage.getItem("email")); |
155 | 147 |
|
156 | 148 |
} |
157 |
service(term) { |
|
158 |
var projects = this._projectService.searchForProjectsObs(term, "this.selectedFunderId"); |
|
159 |
console.info("Results: "+ projects); |
|
160 |
for( var i = 0 ; i<projects.length ; i++){ |
|
161 |
|
|
162 |
} |
|
163 |
return projects; |
|
164 |
} |
|
165 |
|
|
166 |
public filtered = []; |
|
167 |
public selected = []; |
|
168 |
keywordChanged($event) { |
|
169 |
console.log("keyword Changed"+this.lan.length+" "+this.lan[0].id+"-"+this.lan[0].label); |
|
170 |
var keyword = $event.value; |
|
171 |
this.filtered = this.types.filter(function(el){ |
|
172 |
return el.label.toLowerCase().indexOf(keyword.toLowerCase()) > -1; |
|
173 |
}.bind(this)); |
|
174 |
|
|
175 |
} |
|
176 |
public countries = [ |
|
177 |
{id: '0', label: "Albania"},{id: '1', label: "Andorra"},{id: '2', label: "Armenia"}, |
|
178 |
{id: '3', label: "Austria"},{id: '4', label: "Azerbaijan"},{id: '5', label: "Belarus"},{id: '6', label: "Belgium"}, |
|
179 |
{id: '7', label: "Bosnia & Herzegovina"},{id: '8', label: "Bulgaria"},{id: '9', label: "Croatia"}, |
|
180 |
{id: '10', label: "Cyprus"},{id: '11', label: "Czech Republic"},{id: '12', label: "Denmark"},{id: '13', label: "Estonia"}, |
|
181 |
{id: '14', label: "Finland"},{id: '15', label: "France"},{id: '16', label: "Georgia"}, |
|
182 |
{id: '17', label: "Germany"},{id: '18', label: "Greece"},{id: '19', label: "Hungary"},{id: '20', label: "Iceland"}, |
|
183 |
{id: '21', label: "Ireland"},{id: '22', label: "Italy"},{id: '23', label: "Kosovo"}, |
|
184 |
{id: '24', label: "Latvia"},{id: '25', label: "Liechtenstein"},{id: '26', label: "Lithuania"},{id: '27', label: "Luxembourg"}]; |
|
185 |
|
|
186 |
|
|
187 |
// "Latvia","Liechtenstein","Lithuania","Luxembourg","Macedonia","Malta", |
|
188 |
// "Moldova","Monaco","Montenegro","Netherlands","Norway","Poland", |
|
189 |
// "Portugal","Romania","Russia","San Marino","Serbia","Slovakia","Slovenia", |
|
190 |
// "Spain","Sweden","Switzerland","Turkey","Ukraine","United Kingdom","Vatican City"]; |
|
191 | 149 |
} |
Also available in: Unified diff
testing iframe with stats