Commit 59100bec9b0fa84fd90d5bab0d091381f65bbd1c

Authored by Renato De Donato
1 parent 1f76071f

localization + basedatalet

controllets/datalet-selection-controllet/datalet-selection-controllet.html
@@ -210,6 +210,7 @@ @@ -210,6 +210,7 @@
210 <paper-menu class="dropdown-content"> 210 <paper-menu class="dropdown-content">
211 <template is="dom-repeat" items={{fields}}> 211 <template is="dom-repeat" items={{fields}}>
212 <paper-item id={{index}} on-tap="_addInput">{{item}}</paper-item> 212 <paper-item id={{index}} on-tap="_addInput">{{item}}</paper-item>
  213 + <!--{{_fieldName(item)}}-->
213 </template> 214 </template>
214 </paper-menu> 215 </paper-menu>
215 </paper-dropdown-menu> 216 </paper-dropdown-menu>
@@ -441,6 +442,7 @@ @@ -441,6 +442,7 @@
441 labels[i].value = this.dataletPreset[labels[i].label]; 442 labels[i].value = this.dataletPreset[labels[i].label];
442 443
443 444
  445 + this.loadPreview = true;
444 this._loadDatalet(this.selectedFields); 446 this._loadDatalet(this.selectedFields);
445 }, 447 },
446 448
@@ -544,7 +546,8 @@ @@ -544,7 +546,8 @@
544 ComponentService.deep_url = this.deepUrl; 546 ComponentService.deep_url = this.deepUrl;
545 ComponentService.getComponent(dataletParams); 547 ComponentService.getComponent(dataletParams);
546 548
547 - this.async(function(){this.$.add_button.removeAttribute("disabled");}, 1111); 549 +// this.async(function(){this.$.add_button.removeAttribute("disabled");}, 1000);
  550 + this.$.add_button.removeAttribute("disabled");
548 }, 551 },
549 552
550 _addDatalet : function(){ 553 _addDatalet : function(){
@@ -590,6 +593,10 @@ @@ -590,6 +593,10 @@
590 $("#dialog_info_input").css("left", pos.left - 4); 593 $("#dialog_info_input").css("left", pos.left - 4);
591 }, 594 },
592 595
  596 + _fieldName : function(field) {
  597 + return field.substring(field.lastIndexOf(",")+1, field.length);;
  598 + },
  599 +
593 _copy : function(o) { 600 _copy : function(o) {
594 var out, v, key; 601 var out, v, key;
595 out = Array.isArray(o) ? new Array(o.length) : {}; 602 out = Array.isArray(o) ? new Array(o.length) : {};
datalets/base-ajax-json-jsonpath-datalet/base-ajax-json-jsonpath-datalet.html
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 @license 2 @license
3 The MIT License (MIT) 3 The MIT License (MIT)
4 4
5 - Copyright (c) 2015 Dipartimento di Informatica - Università di Salerno - Italy 5 + Copyright (c) 2015 Dipartimento di Informatica - Universit� di Salerno - Italy
6 6
7 Permission is hereby granted, free of charge, to any person obtaining a copy 7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal 8 of this software and associated documentation files (the "Software"), to deal
datalets/base-datalet/base-datalet.html
@@ -64,14 +64,20 @@ Example : @@ -64,14 +64,20 @@ Example :
64 text-decoration: underline; 64 text-decoration: underline;
65 } 65 }
66 #base_datalet_container { 66 #base_datalet_container {
  67 + /*display: flex;*/
67 font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif; 68 font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
68 - padding: 16px; 69 + /*color: #212121;*/
  70 + padding-top: 2px;
  71 + /*padding: 16px;*/
  72 + border-top: 2px solid #B6B6B6;
69 } 73 }
70 #base_datalet_rtp { 74 #base_datalet_rtp {
  75 + /*background-color: red;*/
71 display: flex; 76 display: flex;
72 - padding-top: 8px; 77 + padding-top: 4px;
73 } 78 }
74 #rtp { 79 #rtp {
  80 + /*width: 152px;*/
75 padding-top: 8px; 81 padding-top: 8px;
76 padding-right: 8px; 82 padding-right: 8px;
77 font-size: small; 83 font-size: small;
@@ -83,9 +89,16 @@ Example : @@ -83,9 +89,16 @@ Example :
83 #base_datalet_spin { 89 #base_datalet_spin {
84 height:64px; 90 height:64px;
85 width: 100%; 91 width: 100%;
86 - /*position: relative;*/  
87 - /*center: center;*/  
88 - } 92 + }
  93 + /*#base_datalet_info{*/
  94 + /*padding-top: 8px;*/
  95 + /*/!*background-color: green;*!/*/
  96 + /*width: 100%;*/
  97 + /*/!*font-size: small;*!/*/
  98 + /*}*/
  99 + #base_datalet_source_link{
  100 + padding-top: 12px;
  101 + }
89 </style> 102 </style>
90 103
91 <div id="base_datalet_imgWaitDatalet"> 104 <div id="base_datalet_imgWaitDatalet">
@@ -94,7 +107,13 @@ Example : @@ -94,7 +107,13 @@ Example :
94 107
95 <div id="base_datalet_container"> 108 <div id="base_datalet_container">
96 109
97 - <b>Source:</b> <a id="base_datalet_source" target="_blank"></a> (<a id="base_datalet_link" target="_blank">dataset</a>) 110 + <div id="base_datalet_title_description">
  111 + <span id="span_title" style="font-size: small"><b>{{title}}</b><span id="span_description" style="color: #727272"> - {{description}}</span></span>
  112 + </div>
  113 +
  114 + <div id="base_datalet_source_link">
  115 + <b>Source:</b> <a id="base_datalet_source" target="_blank"></a> (<a id="base_datalet_link" target="_blank">dataset</a>)
  116 + </div>
98 117
99 <div id="base_datalet_rtp"> 118 <div id="base_datalet_rtp">
100 <div id="rtp">Powered by ROUTE-TO-PA</div> 119 <div id="rtp">Powered by ROUTE-TO-PA</div>
@@ -122,6 +141,11 @@ Example : @@ -122,6 +141,11 @@ Example :
122 description : { 141 description : {
123 type : String, 142 type : String,
124 value : "" 143 value : ""
  144 + },
  145 +
  146 + hideFooter : {
  147 + type : Boolean,
  148 + value : false
125 } 149 }
126 150
127 }, 151 },
@@ -139,6 +163,20 @@ Example : @@ -139,6 +163,20 @@ Example :
139 value: {} 163 value: {}
140 } 164 }
141 }, 165 },
  166 +
  167 + _setFooter: function() {
  168 + if (this.title == "" && this.description == "")
  169 + this.$.base_datalet_title_description.innerHTML = "";
  170 + else if (this.description == "")
  171 + this.$.span_description.innerHTML = "";
  172 +
  173 + if (this.hideFooter) {
  174 + this.$.base_datalet_source_link.innerHTML = "";
  175 + this.$.base_datalet_rtp.innerHTML = "";
  176 + }
  177 +
  178 + },
  179 +
142 /** 180 /**
143 * It is called after the element�s template has been stamped and all elements inside the element�s local 181 * It is called after the element�s template has been stamped and all elements inside the element�s local
144 * DOM have been configured (with values bound from parents, deserialized attributes, or else default values) 182 * DOM have been configured (with values bound from parents, deserialized attributes, or else default values)
@@ -151,46 +189,51 @@ Example : @@ -151,46 +189,51 @@ Example :
151 * @method ready 189 * @method ready
152 */ 190 */
153 ready: function(){ 191 ready: function(){
154 - //cKan organized with or not catalog  
155 - queryInitial = this.dataUrl.substring(0, this.dataUrl.indexOf("api")); //SOURCE 192 + this._setFooter();
156 193
157 - urlSource = this.dataUrl.split("/")[0] + "//" + this.dataUrl.split("/")[2];  
158 - this.$.base_datalet_source.innerHTML = urlSource;  
159 - this.$.base_datalet_source.setAttribute("href", urlSource); 194 + if(this.dataUrl != undefined) {
160 195
  196 + //cKan organized with or not catalog
  197 + var queryInitial = this.dataUrl.substring(0, this.dataUrl.indexOf("api")); //SOURCE
161 198
162 - //OpenDataSoft check  
163 - if(this.dataUrl.indexOf("/records/") > -1 )  
164 - {  
165 - //Resourceid of a datalet  
166 - var query = this.dataUrl.substring(this.dataUrl.indexOf("?"), this.dataUrl.length);  
167 - var params = this.decomponeQueryString(query);  
168 - resultIssyIdDatalet = params["dataset"];  
169 - resultIssyAPI = "explore/dataset/";  
170 - urlPageDatasetIssy = queryInitial + resultIssyAPI + resultIssyIdDatalet + "/"; 199 + var urlSource = this.dataUrl.split("/")[0] + "//" + this.dataUrl.split("/")[2];
  200 + this.$.base_datalet_source.innerHTML = urlSource;
  201 + this.$.base_datalet_source.setAttribute("href", urlSource);
171 202
172 - this.$.base_datalet_link.setAttribute("href", urlPageDatasetIssy);  
173 - }  
174 - else  
175 - {  
176 - //CKAN portal  
177 - var urlDatalet;  
178 - if(this.dataUrl != undefined) {  
179 - var apiIdResource = "resource_show?id=";  
180 203
181 - //Resourceid of a datalet  
182 - var query = this.dataUrl.substring(this.dataUrl.indexOf("?"), this.dataUrl.length);  
183 - var params = this.decomponeQueryString(query);  
184 - //CKAN  
185 - resultIdDatalet = params["resource_id"]; 204 + //OpenDataSoft check
  205 + if(this.dataUrl.indexOf("/records/") > -1 )
  206 + {
  207 + //Resourceid of a datalet
  208 + var query = this.dataUrl.substring(this.dataUrl.indexOf("?"), this.dataUrl.length);
  209 + var params = this.decomponeQueryString(query);
  210 + var resultIssyIdDatalet = params["dataset"];
  211 + var resultIssyAPI = "explore/dataset/";
  212 + var urlPageDatasetIssy = queryInitial + resultIssyAPI + resultIssyIdDatalet + "/";
186 213
187 - //cKan organized with or not catalog  
188 - queryFinal = this.dataUrl.substring(this.dataUrl.indexOf("api"), this.dataUrl.indexOf("datastore_search")); 214 + this.$.base_datalet_link.setAttribute("href", urlPageDatasetIssy);
  215 + }
  216 + else
  217 + {
  218 + //CKAN portal
  219 + var urlDatalet;
189 220
190 - urlDatalet = queryInitial + queryFinal + apiIdResource + resultIdDatalet;  
191 - this.requestDataletData(urlDatalet);  
192 - } 221 + var apiIdResource = "resource_show?id=";
  222 +
  223 + //Resourceid of a datalet
  224 + var query = this.dataUrl.substring(this.dataUrl.indexOf("?"), this.dataUrl.length);
  225 + var params = this.decomponeQueryString(query);
  226 + //CKAN
  227 + var resultIdDatalet = params["resource_id"];
  228 +
  229 + //cKan organized with or not catalog
  230 + var queryFinal = this.dataUrl.substring(this.dataUrl.indexOf("api"), this.dataUrl.indexOf("datastore_search"));
  231 +
  232 + urlDatalet = queryInitial + queryFinal + apiIdResource + resultIdDatalet;
  233 + this.requestDataletData(urlDatalet);
  234 + }
193 } 235 }
  236 +
194 }, 237 },
195 /** 238 /**
196 * Set the domain url to show in the footer 239 * Set the domain url to show in the footer
@@ -252,7 +295,10 @@ Example : @@ -252,7 +295,10 @@ Example :
252 295
253 this.$.base_datalet_link.setAttribute("href", urlDatalet); 296 this.$.base_datalet_link.setAttribute("href", urlDatalet);
254 } 297 }
255 - } 298 + },
  299 +
  300 +
  301 +
256 }); 302 });
257 </script> 303 </script>
258 </dom-module> 304 </dom-module>
259 \ No newline at end of file 305 \ No newline at end of file
locales/en.l20n
@@ -21,4 +21,24 @@ @@ -21,4 +21,24 @@
21 <addDatalet "ADD"> 21 <addDatalet "ADD">
22 <modifyDatalet "MODIFY"> 22 <modifyDatalet "MODIFY">
23 23
24 -<googlePiechartDescription "The labels of slices.">  
25 \ No newline at end of file 24 \ No newline at end of file
  25 +<cellDescription "The cell of table.">
  26 +<levelDescription "It is the level field that the datalet will use to group the values at corrisponding field number level.">
  27 +
  28 +<categoriesDescription "The chart categories. Its values will be put in the horizontal axis. You need one value for each series.">
  29 +<seriesDescription "The chart series. Its values will be put in the vertical axis.">
  30 +
  31 +<XAxisLabelDescription "The label for the X axis.">
  32 +<YAxisLabelDescription "The label for the Y axis.">
  33 +<suffixDescription "The values suffix (eg units, dollars, euro, ...).">
  34 +
  35 +<pieSeriesDescription "The chart series. Its values will be put on slice of each series.">
  36 +<pieSizeDescription "The size for each series to create a concentric rings.">
  37 +
  38 +<bubbleCategoriesDescription "he chart categories. Its values will be put in the horizontal axis. You need one value for each series.">
  39 +<bubbleYValuesDescription "The chart plots y values. Its values will be put in the vertical axis.">
  40 +<bubbleZValuesDescription "The chart plots z value. Its values represent the size of the bubble.">
  41 +<bubbleSeriesDescription "The chart series. Its values visualize multi- series bubbles chart.">
  42 +
  43 +<LatitudeDescription "It is latitude of the points you want to show in the map.">
  44 +<LongitudeDescription "It is longitude of the points you want to show in the map.">
  45 +<BalloonContentDescription "It is the text associated to the marker or the link to the image related to the camera associated to each points.">
26 \ No newline at end of file 46 \ No newline at end of file
locales/fr.l20n
@@ -13,11 +13,32 @@ @@ -13,11 +13,32 @@
13 <selectedUrl "Selected url"> 13 <selectedUrl "Selected url">
14 14
15 <inputs "INPUTS"> 15 <inputs "INPUTS">
16 -<labels "LABELS / OPTIONS"> 16 +<layouts "LABELS / OPTIONS">
  17 +<baseInfo "BASE INFO">
17 <comment "COMMENT"> 18 <comment "COMMENT">
18 <commentLabel "comment (max 100 characters)"> 19 <commentLabel "comment (max 100 characters)">
19 <dataletPreview "DATALET PREVIEW"> 20 <dataletPreview "DATALET PREVIEW">
20 <addDatalet "ADD"> 21 <addDatalet "ADD">
21 <modifyDatalet "MODIFY"> 22 <modifyDatalet "MODIFY">
22 23
23 -<googlePiechartDescription "The labels of slices.">  
24 \ No newline at end of file 24 \ No newline at end of file
  25 +<cellDescription "The cell of table.">
  26 +<levelDescription "It is the level field that the datalet will use to group the values at corrisponding field number level.">
  27 +
  28 +<categoriesDescription "The chart categories. Its values will be put in the horizontal axis. You need one value for each series.">
  29 +<seriesDescription "The chart series. Its values will be put in the vertical axis.">
  30 +
  31 +<XAxisLabelDescription "The label for the X axis.">
  32 +<YAxisLabelDescription "The label for the Y axis.">
  33 +<suffixDescription "The values suffix (eg units, dollars, euro, ...).">
  34 +
  35 +<pieSeriesDescription "The chart series. Its values will be put on slice of each series.">
  36 +<pieSizeDescription "The size for each series to create a concentric rings.">
  37 +
  38 +<bubbleCategoriesDescription "he chart categories. Its values will be put in the horizontal axis. You need one value for each series.">
  39 +<bubbleYValuesDescription "The chart plots y values. Its values will be put in the vertical axis.">
  40 +<bubbleZValuesDescription "The chart plots z value. Its values represent the size of the bubble.">
  41 +<bubbleSeriesDescription "The chart series. Its values visualize multi- series bubbles chart.">
  42 +
  43 +<LatitudeDescription "It is latitude of the points you want to show in the map.">
  44 +<LongitudeDescription "It is longitude of the points you want to show in the map.">
  45 +<BalloonContentDescription "It is the text associated to the marker or the link to the image related to the camera associated to each points.">
25 \ No newline at end of file 46 \ No newline at end of file
locales/it.l20n
@@ -21,4 +21,24 @@ @@ -21,4 +21,24 @@
21 <addDatalet "AGGIUNGI"> 21 <addDatalet "AGGIUNGI">
22 <modifyDatalet "MODIFICA"> 22 <modifyDatalet "MODIFICA">
23 23
24 -<googlePiechartDescription "Le etichette delle fette.">  
25 \ No newline at end of file 24 \ No newline at end of file
  25 +<cellDescription "The cell of table.">
  26 +<levelDescription "It is the level field that the datalet will use to group the values at corrisponding field number level.">
  27 +
  28 +<categoriesDescription "The chart categories. Its values will be put in the horizontal axis. You need one value for each series.">
  29 +<seriesDescription "The chart series. Its values will be put in the vertical axis.">
  30 +
  31 +<XAxisLabelDescription "The label for the X axis.">
  32 +<YAxisLabelDescription "The label for the Y axis.">
  33 +<suffixDescription "The values suffix (eg units, dollars, euro, ...).">
  34 +
  35 +<pieSeriesDescription "The chart series. Its values will be put on slice of each series.">
  36 +<pieSizeDescription "The size for each series to create a concentric rings.">
  37 +
  38 +<bubbleCategoriesDescription "he chart categories. Its values will be put in the horizontal axis. You need one value for each series.">
  39 +<bubbleYValuesDescription "The chart plots y values. Its values will be put in the vertical axis.">
  40 +<bubbleZValuesDescription "The chart plots z value. Its values represent the size of the bubble.">
  41 +<bubbleSeriesDescription "The chart series. Its values visualize multi- series bubbles chart.">
  42 +
  43 +<LatitudeDescription "It is latitude of the points you want to show in the map.">
  44 +<LongitudeDescription "It is longitude of the points you want to show in the map.">
  45 +<BalloonContentDescription "It is the text associated to the marker or the link to the image related to the camera associated to each points.">
26 \ No newline at end of file 46 \ No newline at end of file
locales/nl.l20n
@@ -13,11 +13,32 @@ @@ -13,11 +13,32 @@
13 <selectedUrl "Selected url"> 13 <selectedUrl "Selected url">
14 14
15 <inputs "INPUTS"> 15 <inputs "INPUTS">
16 -<labels "LABELS / OPTIONS"> 16 +<layouts "LABELS / OPTIONS">
  17 +<baseInfo "BASE INFO">
17 <comment "COMMENT"> 18 <comment "COMMENT">
18 <commentLabel "comment (max 100 characters)"> 19 <commentLabel "comment (max 100 characters)">
19 <dataletPreview "DATALET PREVIEW"> 20 <dataletPreview "DATALET PREVIEW">
20 <addDatalet "ADD"> 21 <addDatalet "ADD">
21 <modifyDatalet "MODIFY"> 22 <modifyDatalet "MODIFY">
22 23
23 -<googlePiechartDescription "The labels of slices.">  
24 \ No newline at end of file 24 \ No newline at end of file
  25 +<cellDescription "The cell of table.">
  26 +<levelDescription "It is the level field that the datalet will use to group the values at corrisponding field number level.">
  27 +
  28 +<categoriesDescription "The chart categories. Its values will be put in the horizontal axis. You need one value for each series.">
  29 +<seriesDescription "The chart series. Its values will be put in the vertical axis.">
  30 +
  31 +<XAxisLabelDescription "The label for the X axis.">
  32 +<YAxisLabelDescription "The label for the Y axis.">
  33 +<suffixDescription "The values suffix (eg units, dollars, euro, ...).">
  34 +
  35 +<pieSeriesDescription "The chart series. Its values will be put on slice of each series.">
  36 +<pieSizeDescription "The size for each series to create a concentric rings.">
  37 +
  38 +<bubbleCategoriesDescription "he chart categories. Its values will be put in the horizontal axis. You need one value for each series.">
  39 +<bubbleYValuesDescription "The chart plots y values. Its values will be put in the vertical axis.">
  40 +<bubbleZValuesDescription "The chart plots z value. Its values represent the size of the bubble.">
  41 +<bubbleSeriesDescription "The chart series. Its values visualize multi- series bubbles chart.">
  42 +
  43 +<LatitudeDescription "It is latitude of the points you want to show in the map.">
  44 +<LongitudeDescription "It is longitude of the points you want to show in the map.">
  45 +<BalloonContentDescription "It is the text associated to the marker or the link to the image related to the camera associated to each points.">
25 \ No newline at end of file 46 \ No newline at end of file