Commit 75918d5612d7d6205c8257e9022caaa05b70a5fe

Authored by Renato De Donato
1 parent 042eeb13

ckan limit & ODS rows

controllets/dataset-selection-controllet/dataset-selection-controllet.html
... ... @@ -305,7 +305,7 @@
305 305 $("#info_s_dataset")[0].setAttribute("disabled", "true");
306 306 }
307 307  
308   - this.dataUrl = e.detail.url;
  308 + this.dataUrl = this._addlimitUrl(e.detail.url);
309 309 this.selected=0;
310 310 },
311 311  
... ... @@ -318,7 +318,7 @@
318 318  
319 319 var dataset = this.filteredDatasets[parseInt(e.target.id)]
320 320  
321   - this.dataUrl = dataset.url;
  321 + this.dataUrl = this._addlimitUrl(dataset.url);
322 322  
323 323 if(dataset.description != ""){
324 324 $("#info_dataset")[0].removeAttribute("disabled");
... ... @@ -336,7 +336,7 @@
336 336  
337 337 var dataset = this.suggestedDatasets[parseInt(e.target.id)]
338 338  
339   - this.dataUrl = dataset.url;
  339 + this.dataUrl = this._addlimitUrl(dataset.url);
340 340  
341 341 if(dataset.description != ""){
342 342 $("#info_s_dataset")[0].removeAttribute("disabled");
... ... @@ -363,6 +363,19 @@
363 363 this.fire('dataset-selection-controllet_data-url', {url: this.dataUrl});
364 364 },
365 365  
  366 + _addlimitUrl : function(url){
  367 + //CKAN --> action no limit
  368 + if((url.indexOf("api/action") > -1) && !(url.indexOf("limit") > -1))
  369 + {
  370 + url += "&limit=99999";
  371 + }
  372 + //OpenDataSoft --> action no limit
  373 + if((url.indexOf("api/records") > -1) && !(url.indexOf("rows") > -1)){
  374 + url += "&rows=10000";
  375 + }
  376 + return url;
  377 + },
  378 +
366 379 _resize : function(){
367 380 var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0) - 16;
368 381 h = h - 64 - 8; //height with page scroller
... ...