Commit 8d261aa1227a647a43ac7b09c255313a4acbfeb9

Authored by Renato De Donato
1 parent 9a8ed768

creator

controllet.html 0 → 100644
  1 +<script type="text/javascript" src="controllets/shared_js/jquery-1.11.2.min.js"></script>
  2 +<script type="text/javascript" src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
  3 +<link rel="import" href="controllets/data-sevc-controllet/demo-data-sevc-controllet.html" />
  4 +
  5 +<style>
  6 + #controllet paper-material {
  7 + overflow: hidden;
  8 + }
  9 +</style>
  10 +
  11 +<script type="text/javascript">
  12 + $(document).ready(function () {
  13 + var datasets = {"result":{
  14 + "providers":{"1":{"title":"CKAN","api_url":"http://ckan.routetopa.eu","image_hash":"11","id":"1"}},
  15 + "datasets":[
  16 + {"w":1,"provider_name":"p:1","organization_name":"SPOD","package_name":"isislab","resource_name":"SPOD SUPER HEROES","url":"http:\/\/ckan.routetopa.eu\/\/api/action\/datastore_search?resource_id=642ceea8-711e-4124-b450-0d23010c44e6","metas":"{\"organization\":\"SPOD\",\"description\":\"This is a test datasets.\",\"format\":\"CSV\"}"},
  17 + {"w":1,"provider_name":"p:1","organization_name":"SPOD","package_name":"isislab","resource_name":"Wonders of the World","url":"http:\/\/ckan.routetopa.eu\/\/api\/action\/datastore_search?resource_id=1d9c8e62-47ab-40d5-8943-b4c3bca14b50","metas":"{\"organization\":\"SPOD\",\"description\":\"This is a test datasets.\",\"format\":\"CSV\"}"},
  18 + {"w":1,"provider_name":"p:1","organization_name":"SPOD","package_name":"isislab","resource_name":"Animal Sounds","url":"http:\/\/ckan.routetopa.eu\/\/api\/action\/datastore_search?resource_id=1d9c8e62-47ab-40d5-8943-b4c3bca14b50","metas":"{\"organization\":\"SPOD\",\"description\":\"This is a test datasets.\",\"format\":\"CSV\"}"}
  19 + ]}};
  20 +
  21 + var controllet = document.getElementById("controllet");
  22 + controllet.setAttribute("datasets", JSON.stringify(datasets));
  23 +
  24 + window.addEventListener("data-sevc-controllet.dataletCreated", function(e){parent.createHTML(e);});
  25 + });
  26 +
  27 + //http://ckan.routetopa.eu/api/action/datastore_search?resource_id=1d9c8e62-47ab-40d5-8943-b4c3bca14b50
  28 +
  29 +</script>
  30 +
  31 +<demo-data-sevc-controllet id="controllet"
  32 + deep-url="http://172.16.15.38/DEEalerProvider/DEEP/"
  33 + datalets-list-url="http://172.16.15.38/DEEalerProvider/DEEP/datalets-list"
  34 + >
  35 +</demo-data-sevc-controllet>
  36 +
  37 +<!--datasets='{"result":{"providers":{"1":{"title":"CKAN","api_url":"http:\/\/ckan.routetopa.eu","image_hash":"11","id":"1"}},"datasets":[{"w":1,"provider_name":"p:1","organization_name":"SPOD","package_name":"isislab","resource_name":"EXAMPLE 1","url":"http:\/\/ckan.routetopa.eu\/\/api\/action\/datastore_search?resource_id=642ceea8-711e-4124-b450-0d23010c44e6","metas":"{\"organization\":\"SPOD\",\"description\":\"This is a test datasets.\",\"format\":\"CSV\"}"}, {"w":1,"provider_name":"p:1","organization_name":"SPOD","package_name":"isislab","resource_name":"EXAMPLE 2","url":"http:\/\/ckan2.routetopa.eu\/\/api\/action\/datastore_search?resource_id=642ceea8-711e-4124-b450-0d23010c44e6","metas":"{\"organization\":\"SPOD\",\"description\":\"This is a test datasets.\",\"format\":\"CSV\"}"}, {"w":1,"provider_name":"p:1","organization_name":"SPOD","package_name":"isislab","resource_name":"EXAMPLE 3","url":"http:\/\/ckan3.routetopa.eu\/\/api\/action\/datastore_search?resource_id=642ceea8-711e-4124-b450-0d23010c44e6","metas":"{\"organization\":\"SPOD\",\"description\":\"This is a test datasets.\",\"format\":\"CSV\"}"}]}}'-->
... ...
controllets/cocreation-paper-card-controllet/cocreation-paper-card-controllet.html
... ... @@ -186,10 +186,10 @@
186 186 <iron-icon class="icon-to" icon="alarm-off"></iron-icon>&nbsp; {{to}}
187 187 </div>
188 188 </div>
189   - <template is="dom-if" if="{{!checkRoomType(roomType)}}">
  189 + <template is="dom-if" if="{{!_checkRoomType(roomType)}}">
190 190 <paper-fab mini icon="assessment" class="assessment" noink></paper-fab>
191 191 </template>
192   - <template is="dom-if" if="{{checkRoomType(roomType)}}">
  192 + <template is="dom-if" if="{{_checkRoomType(roomType)}}">
193 193 <paper-fab mini icon="description" class="description" noink></paper-fab>
194 194 </template>
195 195 </div>
... ... @@ -274,15 +274,15 @@
274 274 this.$.explore.innerHTML = cocreation_room_ln["explore_" + cocreation_room_ln["ln"]];
275 275 },
276 276  
277   - _handleDeleteClick: function(e){
  277 + _handleDeleteClick: function(){
278 278 this.fire("cocreation-paper-card-controllet_delete", {roomId: this.roomId});
279 279 },
280 280  
281   - _onExplore: function(e){
  281 + _onExplore: function(){
282 282 window.location = this.roomUrl;
283 283 },
284 284  
285   - checkRoomType: function(type){
  285 + _checkRoomType: function(type){
286 286 return (type == "knowledge") ? true : false;
287 287 }
288 288 })
... ...
controllets/data-sevc-controllet/data-sevc-controllet_old.html deleted
1   -<script src="../shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>
2   -<link rel="stylesheet" href="../shared_js/perfect-scrollbar/css/perfect-scrollbar.min.css">
3   -
4   -<script src="../../locales/controllet_ln.js"></script>
5   -
6   -<link rel="import" href="../../bower_components/polymer/polymer.html">
7   -
8   -<link rel="import" href="../page-slider-controllet/page-slider-controllet.html">
9   -
10   -<link rel="import" href="../select-dataset-controllet/select-dataset-controllet.html">
11   -<link rel="import" href="../select-data-controllet/select-data-controllet.html" />
12   -<link rel="import" href="../select-visualization-controllet/select-visualization-controllet.html" />
13   -
14   -<dom-module id="data-sevc-controllet">
15   -
16   - <template>
17   -
18   - <page-slider-controllet id="slider">
19   -
20   - <neon-animatable>
21   -
22   - <template is="dom-if" if={{!modify}}>
23   - <select-dataset-controllet id="select_dataset" data={{data}} datasets={{datasets}} suggested-datasets={{suggestedDatasets}}></select-dataset-controllet>
24   - </template>
25   -
26   - </neon-animatable>
27   -
28   - <neon-animatable>
29   -
30   - <select-data-controllet id="select_data" data-url={{dataUrl}} preselected-fields={{selectedFields}} datalet-preset="{{dataletPreset}}"></select-data-controllet>
31   -
32   - </neon-animatable>
33   -
34   - <neon-animatable>
35   -
36   - <select-visualization-controllet id="select_visualization" deep-url={{deepUrl}} datalets-list-url={{dataletsListUrl}} data-url={{dataUrl}} preselected-datalet={{selectedDatalet}} datalet-preset={{dataletPreset}}></select-visualization-controllet>
37   -
38   - </neon-animatable>
39   -
40   - </page-slider-controllet>
41   -
42   - </template>
43   -
44   - <script>
45   -
46   - Polymer({
47   -
48   - is : 'data-sevc-controllet',
49   -
50   - listeners : {
51   - 'page-slider-controllet_selected' : '_updateSlider',
52   - 'dataset-selection-controllet_data-url' : '_allowSecondStep',
53   - 'tree-view-controllet_selected-fields' : '_allowThirdStep'
54   - },
55   -
56   - properties : {
57   -
58   - deepUrl : {
59   - type : String,
60   - value : undefined
61   - },
62   -
63   - dataletsListUrl : {
64   - type : String ,
65   - value : undefined
66   - },
67   -
68   - datasets : {
69   - type : Array,
70   - value : undefined
71   - },
72   -
73   - suggestedDatasets : {
74   - type : Array,
75   - value : undefined
76   - },
77   -
78   - dataUrl : {
79   - type : String,
80   - value : undefined
81   - },
82   -
83   - jsonData : {
84   - type : Object,
85   - value : undefined
86   - },
87   -
88   - modify : {
89   - type : Boolean,
90   - value : false
91   - },
92   -
93   - selectedDatalet : {
94   - type : String,
95   - value : undefined
96   - },
97   -
98   - selectedFields : {
99   - type : Array,
100   - value : []
101   - },
102   -
103   - dataletPreset : {
104   - type : Object,
105   - value : []
106   - },
107   -
108   - localization : {
109   - type : String,
110   - value : "en"
111   - }
112   -
113   - },
114   -
115   - ready : function(){
116   - if(this.selectedDatalet){
117   - this.modify = true;
118   - this.$.slider.selected = 1;
119   - this.dataUrl = this.dataletPreset["data-url"];
120   - }
121   - ln["localization"] = this.localization;
122   - },
123   -
124   - _updateSlider : function(e){
125   - switch (e.detail.selected) {
126   - case 0:
127   - slider.setTitle(ln["slide1Title_" + this.localization], ln["slide1Subtitle_" + this.localization]);
128   - slider.chevronLeft("invisible");
129   - slider.chevronRight(false);
130   - if(slider.getPrevSelected() == 1)
131   - slider.chevronRight(true);
132   - break;
133   - case 1:
134   - slider.setTitle(ln["slide2Title_" + this.localization], ln["slide2Subtitle_" + this.localization]);
135   - if(this.modify){
136   - slider.chevronLeft("invisible");
137   - }
138   - else{
139   - slider.chevronLeft(true);
140   - }
141   - slider.chevronRight(false);
142   - this._allowThirdStep({detail: {fields: select_data.getSelectedFields()}});
143   - if(this.modify){
144   - this.$.select_visualization.setFields(select_data.getSelectedFields());
145   - this.$.select_visualization.setFilters(select_data.getFilters());
146   - }
147   - break;
148   - case 2:
149   - slider.setTitle(ln["slide3Title_" + this.localization], ln["slide3Subtitle_" + this.localization]);
150   - slider.chevronLeft(true);
151   - slider.chevronRight("invisible");
152   -
153   - this.$.select_visualization.setFields(select_data.getSelectedFields());
154   - this.$.select_visualization.setFilters(select_data.getFilters());
155   - if(this.modify) {
156   - this.$.select_visualization.show();//resize
157   - }
158   - }
159   - },
160   -
161   - _allowSecondStep : function(e){
162   - if(e.detail.url == "") {
163   - slider.chevronRight(false);
164   - select_dataset.$.selected_url.invalid = false;
165   - return;
166   - }
167   -
168   - this.dataUrl = e.detail.url;
169   -
170   - var that = this;
171   -
172   - $.ajax({
173   - url: e.detail.url,
174   - dataType: "json",
175   - success: function(data){
176   -// this.dataUrl = e.detail.url
177   -// this.jsonData = JSON.stringify(data);
178   - slider.chevronRight(true);
179   - select_dataset.$.selected_url.invalid = false;
180   -
181   - that.$.select_data._init();
182   - },
183   - error: function(){
184   -// this.jsonData = undefined;
185   - slider.chevronRight(false);
186   - select_dataset.$.selected_url.invalid = true;
187   -
188   - that.$.select_data._reset();
189   - }
190   - });
191   -
192   - //NOT HERE ma quando VADO al secondo passo e l'url è cambiato
193   -// this.$.select_data._init();
194   - this.$.select_visualization.reset();
195   - },
196   -
197   - _allowThirdStep : function(e){
198   - if(e.detail.fields.length > 0)
199   - slider.chevronRight(true);
200   - else
201   - slider.chevronRight(false);
202   -
203   - //this.$.select_visualization.reset();
204   - }
205   -
206   - });
207   -
208   - </script>
209   -
210   -</dom-module>
211 0 \ No newline at end of file
controllets/data-sevc-controllet/datalets-modifier-controllet.html deleted
1   -<script src="../shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>
2   -<link rel="stylesheet" href="../shared_js/perfect-scrollbar/css/perfect-scrollbar.min.css">
3   -
4   -<script src="../../locales/controllet_ln.js"></script>
5   -
6   -<link rel="import" href="../../bower_components/polymer/polymer.html">
7   -
8   -<link rel="import" href="../page-slider-controllet/page-slider-controllet.html">
9   -
10   -<link rel="import" href="../select-data-controllet/select-data-controllet.html" />
11   -<link rel="import" href="../select-visualization-controllet/select-visualization-controllet.html" />
12   -
13   -<dom-module id="datalets-modifier-controllet">
14   -
15   - <template>
16   -
17   - <page-slider-controllet id="slider">
18   -
19   - <neon-animatable>
20   -
21   - <select-data-controllet id="select_data"></select-data-controllet>
22   -
23   - </neon-animatable>
24   -
25   - <neon-animatable>
26   -
27   - <select-visualization-controllet id="select_visualization" deep-url={{deepUrl}} datalets-list-url={{dataletsListUrl}}></select-visualization-controllet>
28   -
29   - </neon-animatable>
30   -
31   - </page-slider-controllet>
32   -
33   - </template>
34   -
35   - <script>
36   -
37   - Polymer({
38   -
39   - is : 'datalets-modifier-controllet',
40   -
41   - listeners : {
42   - 'page-slider-controllet_selected' : '_updateSlider',
43   - 'dataset-selection-controllet_data-url' : '_allowSecondStep',
44   - 'tree-view-controllet_selected-fields' : '_allowThirdStep'
45   - },
46   -
47   - properties : {
48   -// dataUrl : {
49   -// type : String,
50   -// value : undefined
51   -// },
52   -
53   - preselectedDatalet : { //datalet
54   - type : String,
55   - value : undefined
56   - },
57   -
58   - preselectedFields : { //fields
59   - type : Array,
60   - value : undefined
61   - },
62   -
63   - dataletPreset : { //params
64   - type : String,
65   - value : undefined
66   - },
67   -
68   - deepUrl : {
69   - type : String,
70   - value : undefined
71   - },
72   -
73   - dataletsListUrl : {
74   - type : String ,
75   - value : undefined
76   - },
77   -
78   - localization : {
79   - type : String,
80   - value : "en"
81   - }
82   -
83   - },
84   -
85   - ready : function(){
86   - if(this.selectedDatalet){
87   - this.modify = true;
88   - this.$.slider.selected = 1;
89   - this.dataUrl = this.dataletPreset["data-url"];
90   - }
91   - ln["localization"] = this.localization;
92   - },
93   -
94   - _updateSlider : function(e){
95   - switch (e.detail.selected) {
96   - case 0:
97   - slider.setTitle(ln["slide1Title_" + this.localization], ln["slide1Subtitle_" + this.localization]);
98   - slider.chevronLeft("invisible");
99   - slider.chevronRight(false);
100   - if(slider.getPrevSelected() == 1)
101   - slider.chevronRight(true);
102   - break;
103   - case 1:
104   - slider.setTitle(ln["slide2Title_" + this.localization], ln["slide2Subtitle_" + this.localization]);
105   - if(this.modify){
106   - slider.chevronLeft("invisible");
107   - }
108   - else{
109   - slider.chevronLeft(true);
110   - }
111   - slider.chevronRight(false);
112   - this._allowThirdStep({detail: {fields: select_data.getSelectedFields()}});
113   - if(this.modify){
114   - this.$.select_visualization.setFields(select_data.getSelectedFields());
115   - this.$.select_visualization.setFilters(select_data.getFilters());
116   - }
117   - break;
118   - case 2:
119   - slider.setTitle(ln["slide3Title_" + this.localization], ln["slide3Subtitle_" + this.localization]);
120   - slider.chevronLeft(true);
121   - slider.chevronRight("invisible");
122   -
123   - this.$.select_visualization.setFields(select_data.getSelectedFields());
124   - this.$.select_visualization.setFilters(select_data.getFilters());
125   - if(this.modify) {
126   - this.$.select_visualization.show();//resize
127   - }
128   - }
129   - },
130   -
131   - _allowSecondStep : function(e){
132   - if(e.detail.url == "") {
133   - slider.chevronRight(false);
134   - select_dataset.$.selected_url.invalid = false;
135   - return;
136   - }
137   -
138   - this.dataUrl = e.detail.url;
139   -
140   - var that = this;
141   -
142   - $.ajax({
143   - url: e.detail.url,
144   - dataType: "json",
145   - success: function(data){
146   -// this.dataUrl = e.detail.url
147   -// this.jsonData = JSON.stringify(data);
148   - slider.chevronRight(true);
149   - select_dataset.$.selected_url.invalid = false;
150   -
151   - that.$.select_data._init();
152   - },
153   - error: function(){
154   -// this.jsonData = undefined;
155   - slider.chevronRight(false);
156   - select_dataset.$.selected_url.invalid = true;
157   -
158   - that.$.select_data._reset();
159   - }
160   - });
161   -
162   - //NOT HERE ma quando VADO al secondo passo e l'url è cambiato
163   -// this.$.select_data._init();
164   - this.$.select_visualization.reset();
165   - },
166   -
167   - _allowThirdStep : function(e){
168   - if(e.detail.fields.length > 0)
169   - slider.chevronRight(true);
170   - else
171   - slider.chevronRight(false);
172   -
173   - //this.$.select_visualization.reset();
174   - }
175   -
176   - });
177   -
178   - </script>
179   -
180   -</dom-module>
181 0 \ No newline at end of file
controllets/data-sevc-controllet/demo-data-sevc-controllet.html 0 → 100644
  1 +<script src="../shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>
  2 +<link rel="stylesheet" href="../shared_js/perfect-scrollbar/css/perfect-scrollbar.min.css">
  3 +
  4 +<script src="../../locales/controllet_ln.js"></script>
  5 +
  6 +<link rel="import" href="../../bower_components/polymer/polymer.html">
  7 +
  8 +<link rel="import" href="../page-slider-controllet/page-slider-controllet.html">
  9 +
  10 +<link rel="import" href="../select-dataset-controllet/demo-select-dataset-controllet.html">
  11 +<link rel="import" href="../select-data-controllet/select-data-controllet.html" />
  12 +<link rel="import" href="../select-visualization-controllet/select-visualization-controllet.html" />
  13 +
  14 +<dom-module id="demo-data-sevc-controllet">
  15 +
  16 + <template>
  17 +
  18 + <page-slider-controllet id="slider">
  19 +
  20 + <neon-animatable>
  21 +
  22 + <demo-select-dataset-controllet id="select_dataset" datasets={{datasets}} suggested-datasets={{suggestedDatasets}}></demo-select-dataset-controllet>
  23 +
  24 + </neon-animatable>
  25 +
  26 + <neon-animatable>
  27 +
  28 + <select-data-controllet id="select_data"></select-data-controllet>
  29 +
  30 + </neon-animatable>
  31 +
  32 + <neon-animatable>
  33 +
  34 + <select-visualization-controllet id="select_visualization" deep-url={{deepUrl}} datalets-list-url={{dataletsListUrl}}></select-visualization-controllet>
  35 +
  36 + </neon-animatable>
  37 +
  38 + </page-slider-controllet>
  39 +
  40 + </template>
  41 +
  42 + <script>
  43 +
  44 + Polymer({
  45 +
  46 + is : 'demo-data-sevc-controllet',
  47 +
  48 + listeners : {
  49 + 'page-slider-controllet_selected' : '_updateSlider',
  50 + 'select-dataset-controllet_data-url' : '_allowSecondStep',
  51 + 'select-fields-controllet_selected-fields' : '_allowThirdStep',
  52 + 'filters-controllet_filters': '_allowThirdStep',
  53 + 'aggregators-controllet_aggregators': '_allowThirdStep',
  54 + 'data-ready': '_dataReady'
  55 + },
  56 +
  57 + properties : {
  58 +
  59 + datasets : {
  60 + type : Object,
  61 + value : undefined
  62 + },
  63 +
  64 + suggestedDatasets : {
  65 + type : Array,
  66 + value : undefined
  67 + },
  68 +
  69 + deepUrl : {
  70 + type : String,
  71 + value : undefined
  72 + },
  73 +
  74 + dataletsListUrl : {
  75 + type : String ,
  76 + value : undefined
  77 + },
  78 +
  79 + localization : {
  80 + type : String,
  81 + value : "en"
  82 + }
  83 +
  84 + },
  85 +
  86 + ready : function(){
  87 + ln["localization"] = this.localization;
  88 + },
  89 +
  90 + _updateSlider : function(e){
  91 + switch (e.detail.selected) {
  92 + case 0:
  93 + this.$.slider.setTitle(ln["slide1Title_" + this.localization], ln["slide1Subtitle_" + this.localization]);
  94 +
  95 + this.$.slider.chevronLeft("invisible");
  96 + this.$.slider.chevronRight(false);
  97 +
  98 + if(this.$.slider.getPrevSelected() == 1)
  99 + this.$.slider.chevronRight(true);
  100 + break;
  101 + case 1:
  102 + this.$.slider.setTitle(ln["slide2Title_" + this.localization], ln["slide2Subtitle_" + this.localization]);
  103 +
  104 + this.$.slider.chevronLeft(true);
  105 + this.$.slider.chevronRight(false);
  106 +
  107 + if(this.$.slider.getPrevSelected() == 2)
  108 + this.$.slider.chevronRight(true);
  109 + break;
  110 + case 2:
  111 + this.$.slider.setTitle(ln["slide3Title_" + this.localization], ln["slide3Subtitle_" + this.localization]);
  112 +
  113 + this.$.slider.chevronLeft(true);
  114 + this.$.slider.chevronRight("invisible");
  115 + }
  116 + },
  117 +
  118 + _allowSecondStep : function(e){
  119 + this.$.slider.chevronRight(false);
  120 +
  121 + var f = Object.create(providerFactory);
  122 + var provider = f.getProvider(e.detail.url);
  123 + var dataUrl = provider.addLimit(e.detail.url);
  124 +
  125 + this.$.select_data.dataUrl = dataUrl;
  126 + this.$.select_data.init();
  127 + this.$.select_visualization.dataUrl = dataUrl;
  128 + this.$.select_visualization.init();
  129 + },
  130 +
  131 + _dataReady : function(e){
  132 + if(e.detail.ready) {
  133 + this.$.slider.chevronRight(true);
  134 + this.$.select_dataset.$.selected_url.invalid = false;
  135 + }
  136 + else
  137 + this.$.select_dataset.$.selected_url.invalid = true;
  138 +
  139 + this.$.select_dataset.showDatasetInfo();
  140 + },
  141 +
  142 + _allowThirdStep : function(){
  143 + this.$.slider.chevronRight(false);
  144 + var selectedFields = this.$.select_data.getSelectedFields();
  145 + var filters = this.$.select_data.getFilters();
  146 + var aggregators = this.$.select_data.getAggregators();
  147 + var data = this.$.select_data.getData();
  148 + if(selectedFields.length > 0) {
  149 + this.$.select_visualization.init();
  150 + this.$.select_visualization.setSelectedFields(selectedFields);
  151 + this.$.select_visualization.setFilters(filters);
  152 + this.$.select_visualization.setAggregators(aggregators);
  153 + this.$.select_visualization.setData(data);
  154 + this.$.slider.chevronRight(true);
  155 + }
  156 + }
  157 +
  158 + });
  159 +
  160 + </script>
  161 +
  162 +</dom-module>
0 163 \ No newline at end of file
... ...
controllets/data-sevc-controllet/static/css/reset.css deleted
1   -::content html {
2   - color: #000;
3   - background: #FFF;
4   -}
5   -
6   -::content body, div, dl, dt, dd, ul, ol, li, h1, h2, h3,
7   -h4, h5, h6, pre, code, form, fieldset, legend,
8   -input, button, textarea, p, blockquote, th, td {
9   - margin: 0;
10   - padding: 0;
11   -}
12   -
13   -::content table {
14   - border-collapse: collapse;
15   - border-spacing: 0;
16   -}
17   -
18   -::content fieldset, img {
19   - border: 0;
20   -}
21   -
22   -::content address, caption, cite, code, dfn, em, strong,
23   -th, var, optgroup {
24   - font-style: inherit;
25   - font-weight: inherit;
26   -}
27   -
28   -::content del, ins {
29   - text-decoration: none;
30   -}
31   -
32   -::content li {
33   - list-style: none;
34   -}
35   -
36   -::content caption, th {
37   - text-align: left;
38   -}
39   -
40   -::content h1, h2, h3, h4, h5, h6 {
41   - font-size: 100%;
42   - font-weight: normal;
43   -}
44   -
45   -::content q:before, q:after {
46   - content: '';
47   -}
48   -
49   -::content abbr, acronym {
50   - border: 0;
51   - font-variant: normal;
52   -}
53   -
54   -::content sup {
55   - vertical-align: baseline;
56   -}
57   -
58   -::content sub {
59   - vertical-align: baseline;
60   -}
61   -
62   -/*because legend doesn't inherit in IE */
63   -::content legend {
64   - color: #000;
65   -}
66   -
67   -::content input, button, textarea, select, optgroup, option {
68   - font-family: inherit;
69   - font-size: inherit;
70   - font-style: inherit;
71   - font-weight: inherit;
72   -}
73   -
74   -/*@purpose To enable resizing for IE */
75   -/*@branch For IE6-Win, IE7-Win */
76   -::content input, button, textarea, select {
77   - *font-size: 100%;
78   -}
79 0 \ No newline at end of file
controllets/data-sevc-controllet/static/images/UnderConstruction.png deleted

97.5 KB

controllets/data-sevc-controllet/static/images/or.png deleted

733 Bytes

controllets/datalet-selection-controllet/datalet-selection-controllet.html deleted
1   -<link rel="import" href="../../bower_components/polymer/polymer.html" />
2   -
3   -<link rel="import" href="../../bower_components/paper-material/paper-material.html" />
4   -
5   -<link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
6   -<link rel="import" href="../../bower_components/paper-menu/paper-menu.html">
7   -<link rel="import" href="../../bower_components/paper-item/paper-item.html">
8   -
9   -<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
10   -<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">
11   -<link rel="import" href="../../bower_components/iron-icon/iron-icon.html">
12   -
13   -<link rel="import" href="../../bower_components/paper-input/paper-textarea.html">
14   -<link rel="import" href="../../bower_components/paper-input/paper-input.html">
15   -
16   -<link rel="import" href="../../bower_components/paper-button/paper-button.html">
17   -
18   -<link rel="import" href="../../bower_components/paper-dialog/paper-dialog.html">
19   -
20   -<link rel="import" href="../items-vslider-controllet/items-vslider-controllet.html" />
21   -
22   -<script src="../../../DEEPCLIENT/js/deepClient.js"></script>
23   -
24   -<dom-module id="datalet-selection-controllet">
25   -
26   - <template>
27   -
28   - <style is="custom-style">
29   - :host {
30   - --paper-dropdown-menu-icon: {
31   - color: #2196F3;
32   - };
33   - }
34   -
35   - #datalet_selection_container {
36   - display: flex;
37   - font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
38   - font-size: 16px;
39   - margin-top: 8px;
40   - }
41   -
42   - #items_vslider_controllet {
43   - position: relative;
44   - min-width: 172px;
45   - }
46   -
47   - #datalet_selection_inputs {
48   - position: relative;
49   - height: 100vh;
50   - margin-left: 32px;
51   - min-width: 258px;
52   - }
53   -
54   - #datalet_selection_labels {
55   - position: relative;
56   - height: 100vh;
57   - margin-left: 32px;
58   - min-width: 258px;
59   - }
60   -
61   - #datalet_selection_column {
62   - position: relative;
63   - width: 100%;
64   - margin-left: 32px;
65   - }
66   -
67   - #datalet_selection_datalet {
68   - position: relative;
69   - height: 100vh;
70   - width: 100%;
71   - }
72   -
73   - #datalet_selection_datalet_placeholder {
74   - padding: 16px;
75   - }
76   -
77   - .inputs{
78   - position: relative;
79   - }
80   -
81   - .input_header {
82   - height: 32px;
83   - padding-top: 16px;
84   - text-align: center;
85   - font-weight: 700;
86   - background-color: #B6B6B6;
87   - }
88   -
89   - #expert_container {
90   - display: none;
91   - }
92   -
93   - #expert_header {
94   - display: none;
95   -
96   - height: 32px;
97   - padding-top: 16px;
98   - margin-top: 8px;
99   - text-align: center;
100   - font-weight: 700;
101   - color: #00BCD4;
102   - cursor: pointer;
103   - }
104   -
105   - .field_nema {
106   - height: 40px;
107   - padding-top: 8px;
108   -
109   - margin-top: 8px;
110   - padding-left: 16px;
111   - font-weight: 700;
112   - color: #2196F3;
113   - background-color: #E0E0E0;
114   - }
115   -
116   - .info_button {
117   - position: absolute;
118   - top: 18px;
119   - right: 0px;
120   - }
121   -
122   - paper-input {
123   - display: inline-block;
124   - height: 48px;
125   - /*padding: 0px 8px;*/
126   - width: 210px;
127   - padding-left: 8px;
128   - padding-bottom: 8px;
129   - --paper-input-container-focus-color: #2196F3;
130   - }
131   -
132   - paper-input.base_input {
133   - width: 242px;
134   - }
135   -
136   - paper-textarea {
137   - width: 242px;
138   - padding-left: 8px;
139   - padding-bottom: 4px;
140   - --paper-input-container-focus-color: #2196F3;
141   - }
142   -
143   - paper-dropdown-menu {
144   - height: 48px;
145   - width: 210px;;
146   - padding-left: 8px;
147   - padding-bottom: 8px;
148   - --paper-input-container-focus-color: #2196F3;
149   - }
150   -
151   - paper-item.iron-selected {
152   - background-color: #2196F3;
153   - color: #FFFFFF;
154   - }
155   -
156   - paper-icon-button {
157   - color: #2196F3;
158   - --paper-icon-button-ink-color: #2196F3;
159   - margin: 0px;
160   - }
161   -
162   - paper-button {
163   - position: absolute;
164   - bottom: 16px;
165   - right: 11px;
166   -
167   - height: 48px;
168   - width: 172px;
169   - background-color: #00BCD4;
170   - color: white;
171   - font-weight: 700;
172   - padding: 16px;
173   - }
174   -
175   - paper-button:hover {
176   - background-color: #00AABF;
177   -
178   - box-shadow: 0px 8px 12px #888;
179   - -webkit-box-shadow: 0px 8px 12px #888;
180   - -moz-box-shadow: 0px 8px 12px #888;
181   - }
182   -
183   - paper-button[disabled] {
184   - background-color: #B6B6B6;
185   - }
186   -
187   - #dialog_info_input {
188   - border: 2px solid #2196F3;
189   - background-color: #E0E0E0;
190   - min-width: 248px;
191   - }
192   - </style>
193   -
194   - <iron-ajax id="selectedDatalet_request" on-response="_handleSelectedDatalet"></iron-ajax>
195   -
196   - <div id="datalet_selection_container">
197   -
198   - <div id="items_vslider_controllet">
199   - <items-vslider-controllet id="vslider" datalets-list-url={{dataletsListUrl}} preselected-datalet={{preselectedDatalet}}></items-vslider-controllet>
200   - </div>
201   -
202   - <paper-material id="datalet_selection_inputs" elevation="5">
203   - <div class="input_header"><span id="inputs"></span></div>
204   - <template is="dom-repeat" items="{{inputs}}" index-as="ddl_index">
205   - <div class="inputs">
206   - <paper-dropdown-menu id={{ddl_index}} label={{_getLabelName(item.name)}}>
207   - <paper-menu class="dropdown-content">
208   - <template is="dom-repeat" items={{fields}}>
209   - <paper-item id={{index}} on-tap="_addInput">{{_fieldName(item)}}</paper-item>
210   - <!--{{_fieldName(item)}}-->
211   - </template>
212   - </paper-menu>
213   - </paper-dropdown-menu>
214   - <div class="info_button">
215   - <paper-icon-button id={{item.name}} on-click="_showInfo" icon="info-outline" title="{{_getLabelName(item.name)}} info"></paper-icon-button>
216   - </div>
217   - </div>
218   - </template>
219   -
220   - <!-- EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE -->
221   -
222   - <div id="expert_header" on-click="_showExpertMode"><span id="groupBy"></span></div>
223   -
224   - <div id="expert_container">
225   -
226   - <div class="inputs">
227   - <paper-dropdown-menu id="group_by">
228   - <paper-menu class="dropdown-content">
229   - <template is="dom-repeat" items={{fields}}>
230   - <paper-item id={{index}} on-tap="_showGroupedFields">{{_fieldName(item)}}</paper-item>
231   - </template>
232   - </paper-menu>
233   - </paper-dropdown-menu>
234   - <div class="info_button">
235   - <paper-icon-button id="gb" on-click="_addOrder" icon="unfold-more" title=""></paper-icon-button>
236   - </div>
237   - </div>
238   -
239   - <template is="dom-repeat" items="{{groupedFields}}">
240   - <div class="inputs">
241   - <paper-dropdown-menu id="calculate_{{index}}" label="{{_calculateLabel()}}">
242   - <paper-menu class="dropdown-content">
243   - <!--foreach functions-->
244   - <paper-item id="0" on-tap="_addGroupByInput">{{_operationName(0)}} {{_fieldName(item)}}</paper-item>
245   - <paper-item id="1" on-tap="_addGroupByInput">{{_operationName(1)}} {{_fieldName(item)}}</paper-item>
246   - <paper-item id="2" on-tap="_addGroupByInput">{{_operationName(2)}} {{_fieldName(item)}}</paper-item>
247   - <paper-item id="3" on-tap="_addGroupByInput">{{_operationName(3)}} {{_fieldName(item)}}</paper-item>
248   - <paper-item id="4" on-tap="_addGroupByInput">{{_operationName(4)}} {{_fieldName(item)}}</paper-item>
249   - <paper-item id="5" on-tap="_addGroupByInput">{{_operationName(5)}} {{_fieldName(item)}}</paper-item>
250   - <paper-item id="6" on-tap="_addGroupByInput">{{_operationName(6)}} {{_fieldName(item)}}</paper-item>
251   - </paper-menu>
252   - </paper-dropdown-menu>
253   - <div class="info_button">
254   - <paper-icon-button id={{_fieldName(item)}} on-click="_addOrder" icon="unfold-more" title=""></paper-icon-button>
255   - </div>
256   - </div>
257   - </template>
258   -
259   - </div>
260   -
261   - <!-- EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE -->
262   -
263   - </paper-material>
264   -
265   - <paper-material id="datalet_selection_labels" elevation="5">
266   - <div class="input_header"><span id="baseInfo"></span></div>
267   -
268   - <div class="inputs">
269   - <paper-input id="base_title" maxlength="32" class="base_input"></paper-input>
270   - </div>
271   -
272   - <div class="inputs">
273   - <paper-textarea id="base_description" maxlength="100" class="base_input"></paper-textarea>
274   - </div>
275   -
276   - <div class="input_header"><span id="layouts"></span></div>
277   -
278   - <template is="dom-repeat" items="{{labels}}" index-as="index">
279   - <div class="inputs">
280   - <paper-input label={{_getLabelName(item.name)}}></paper-input>
281   - <div class="info_button">
282   - <paper-icon-button id={{item.name}} on-click="_showInfo" icon="info-outline" title="{{_getLabelName(item.name)}} info"></paper-icon-button>
283   - </div>
284   - </div>
285   - </template>
286   - </paper-material>
287   -
288   -
289   - <div id="datalet_selection_column">
290   -
291   - <paper-material id="datalet_selection_datalet" elevation="5">
292   - <div class="input_header"><span id="dataletPreview"></span></div>
293   - <div id="datalet_selection_datalet_placeholder"></div>
294   -
295   - </paper-material>
296   -
297   - <paper-button id="add_button" disabled raised on-click="_addDatalet"></paper-button>
298   -
299   - </div>
300   -
301   - <paper-dialog id="dialog_info_input">
302   - <h2 id="dialog_name"></h2>
303   - <p id="dialog_description"></p>
304   - </paper-dialog>
305   -
306   - </div>
307   -
308   - </template>
309   -
310   - <script>
311   -
312   - Polymer({
313   -
314   - is : 'datalet-selection-controllet',
315   -
316   - properties : {
317   -
318   - deepUrl : {
319   - type : String,
320   - value : undefined
321   - },
322   -
323   - dataletsListUrl : {
324   - type : String,
325   - value : undefined
326   - },
327   -
328   - selectedDatalet : {
329   - type : String,
330   - value : undefined
331   - },
332   -
333   - preselectedDatalet : {
334   - type : String,
335   - value : undefined
336   - },
337   -
338   - loadPreview : {
339   - type : Boolean,
340   - value : false
341   - },
342   -
343   - type : {
344   - type : String,
345   - value : undefined
346   - },
347   -
348   - inputs : {
349   - type : Array,
350   - value : []
351   - },
352   -
353   - labels : {
354   - type : Array,
355   - value : []
356   - },
357   -
358   - filters : {
359   - type : Array,
360   - value : []
361   - },
362   -
363   - aggregators : {
364   - type : Array,
365   - value : []
366   - },
367   -
368   - orders : {
369   - type : Array,
370   - value : []
371   - },
372   -
373   - fields : {
374   - type : Array,
375   - value : []
376   - },
377   -
378   - selectedFields : {
379   - type : Array,
380   - value : []
381   - },
382   -
383   - groupedFields : {
384   - type : Array,
385   - value : []
386   - },
387   -
388   - dataletPreset : {
389   - type : Object,
390   - value : []
391   - },
392   -
393   -// selectableFields : {
394   -// type : Array,
395   -// value : []
396   -// },
397   -
398   - dataUrl : {
399   - type : String,
400   - value : undefined
401   - },
402   -
403   - params:{
404   - type: Object,
405   - value: undefined
406   - },
407   -
408   - expert : {
409   - type : Boolean,
410   - value : false
411   - },
412   -
413   - functions : {
414   - type : Array,
415   - value : ["COUNT", "SUM", "MIN", "MAX", "AVG", "FIRST", "LAST"]
416   - },
417   -
418   - modify : {
419   - type : Boolean,
420   - value : false
421   - }
422   -
423   - },
424   -
425   - listeners: {
426   - 'items-vslider-controllet_selected-datalet': '_selectDatalet',
427   -// 'tree-view-controllet_selected-fields': '_updateSelectedFields'
428   - 'change': '_paramsChanged'
429   - },
430   -
431   - _showExpertMode : function() {
432   - if(!this.expert) {
433   - this.$.expert_header.style.color = "#000000";
434   - this.$.expert_header.style.background = "#B6B6B6";
435   - this.$.expert_container.style.display = "block";
436   - }
437   - else {
438   - this.$.expert_header.style.color = "#00BCD4";
439   - this.$.expert_header.style.background = "#FFFFFF";
440   - this.$.expert_container.style.display = "none";
441   - }
442   -
443   - this.expert = !this.expert;
444   - },
445   -
446   - _showGroupedFields : function(e) {
447   - var index = e.target.id;
448   - var temp = [];
449   -
450   -// var isSelected = false;
451   -// for (var i = 0; i < this.selectedFields.length; i++) {
452   -// if (this.selectedFields[i]) {
453   -// if (this.selectedFields[i].indexOf(this.fields[index]) > -1) {
454   -// isSelected = true;
455   -// }
456   -// else {
457   -// temp.push(this.selectedFields[i]);
458   -// }
459   -// }
460   -// }
461   -//
462   -// if (isSelected)
463   -// this.groupedFields = this._copy(temp);
464   -// else
465   -// this.groupedFields =[];
466   -
467   - for (var i = 0; i < this.selectedFields.length; i++) {
468   - if (this.selectedFields[i]) {
469   - if (i != index) {
470   - temp.push(this.selectedFields[i]);
471   - }
472   - }
473   - }
474   -
475   - this.groupedFields = this._copy(temp);
476   -
477   - this.async(function() {
478   - var ddls = document.getElementsByTagName("paper-dropdown-menu");
479   - for (var i = 0; i < ddls.length; i++){
480   - var id = ddls[i].id;
481   - if(id.indexOf("calculate") > -1) {
482   - $(ddls[i]).find("paper-menu")[0].select(-1);
483   - $(ddls[i]).find("paper-menu")[0].select(0);
484   - }
485   - }
486   - }, 0);
487   -
488   - this._addGroupByInput();
489   - },
490   -
491   - ready : function() {
492   - this._resize();
493   - $(this.$.datalet_selection_inputs).perfectScrollbar();
494   - $(this.$.datalet_selection_labels).perfectScrollbar();
495   - $(this.$.datalet_selection_datalet).perfectScrollbar();
496   -
497   - this.params = {'data-url' : this.dataUrl};
498   -
499   - //this.modify = true;//da eliminare in futuro
500   - if(this.preselectedDatalet){
501   - if(this.modify)
502   - this._preselectDatalet();
503   -
504   - this.modify = true;
505   - this.preselectedDatalet = undefined;
506   - }
507   - },
508   -
509   - attached : function() {
510   - this._resize();
511   - var that = this;
512   - window.addEventListener("resize", function() { that._resize(); });
513   -
514   - this._translate();
515   - },
516   -
517   - setFilters : function(filters) {
518   - this.filters = filters;
519   - },
520   -
521   - setFields : function(fields) {
522   - this.fields = fields;
523   - },
524   -
525   - reset : function() {
526   - this.selectedDatalet = undefined;//non va!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
527   - this.preselectedDatalet = undefined;
528   - this.type = undefined;
529   - this.inputs = [];
530   - this.labels = [];
531   - this.$.expert_header.style.display = "none";
532   - this.expert = true;
533   - this._showExpertMode();
534   - this.loadPreview = false;
535   - this.$.datalet_selection_datalet_placeholder.innerHTML = "";
536   - this._resetGroupBy();
537   - },
538   -
539   - _translate : function(){
540   -
541   - this.$.add_button.innerHTML = ln["addDatalet_" + ln["localization"]];
542   - this.$.inputs.innerHTML = ln["inputs_" + ln["localization"]];
543   - this.$.baseInfo.innerHTML = ln["baseInfo_" + ln["localization"]];
544   - this.$.layouts.innerHTML = ln["layouts_" + ln["localization"]];
545   - this.$.dataletPreview.innerHTML = ln["dataletPreview_" + ln["localization"]];
546   -
547   - this.$.base_title.label = ln["title_" + ln["localization"]];
548   - this.$.base_description.label = ln["description_" + ln["localization"]];
549   -
550   - this.$.groupBy.innerHTML = ln["groupBy_" + ln["localization"]];
551   - this.$.group_by.setAttribute("label", ln["groupBy_" + ln["localization"]]);
552   -
553   - if(this.modify)
554   - this.$.add_button.innerHTML = ln["modifyDatalet_" + ln["localization"]];
555   - },
556   -
557   - _selectDatalet : function(e){
558   - this.$.add_button.setAttribute("disabled", "true");
559   -
560   - this.selectedDatalet = e.detail.datalet;
561   -
562   - this.$.datalet_selection_datalet_placeholder.innerHTML = "";
563   -
564   - if(!this.selectedDatalet){
565   - this.type = undefined;
566   - this.inputs = [];
567   - this.labels = [];
568   - this.$.expert_header.style.display = "none";
569   - this.expert = true;
570   - this._showExpertMode();
571   - this.loadPreview = false;
572   - }
573   - else{
574   - this.$.selectedDatalet_request.url = this.deepUrl + e.detail.datalet + "-datalet";
575   - this.$.selectedDatalet_request.generateRequest();
576   - this.$.expert_header.style.display = "block";
577   - }
578   - },
579   -
580   - _preselectDatalet : function() {
581   - this.type = "undefined";
582   - this.$.selectedDatalet_request.url = this.deepUrl + this.preselectedDatalet + "-datalet";
583   - this.$.selectedDatalet_request.generateRequest();
584   -
585   - this.selectedDatalet = this.preselectedDatalet;
586   - this.selectedFields = this._copy(this.fields);
587   -
588   -// this.filters = JSON.parse(this.dataletPreset["filters"]);
589   -// this.aggregators = JSON.parse(this.dataletPreset["aggregators"]);
590   -// this.orders = JSON.parse(this.dataletPreset["orders"]);
591   -
592   - this.async(function() {
593   - this.selectedFields = this._copy(this.fields);
594   -
595   - //set info labels options
596   - var textarea = this.$.datalet_selection_labels.querySelectorAll("paper-textarea");
597   - textarea[0].value = this.dataletPreset["description"];
598   -
599   - var inputs = this.$.datalet_selection_labels.querySelectorAll("paper-input");
600   - inputs[0].value = this.dataletPreset["title"];
601   -
602   - for (var i = 1; i < inputs.length; i++)
603   - inputs[i].value = this.dataletPreset[this.labels[i-1].name];
604   -
605   - //set inputs --> prima apri GB e riempi CALCULATE e poi gli ORDERBY???
606   - var ddls = document.getElementsByTagName("paper-dropdown-menu");
607   - for (var i = 0; i < ddls.length; i++) {
608   - var id = ddls[i].id;
609   - if (!isNaN(id)) {
610   -// id = parseInt(id);
611   - $(ddls[i]).find("paper-menu")[0].select(id);
612   - }
613   - else if (id.indexOf("group_by") > -1) {
614   - ;
615   - }
616   - else if (id.indexOf("calculate") > -1) {
617   - ;
618   - }
619   - }
620   -
621   - this.loadPreview = true;
622   - this._loadDatalet(this.selectedFields);
623   - }, 300);
624   - },
625   -
626   - _handleSelectedDatalet : function(e){
627   -
628   - if(this.type != e.detail.response.type) {
629   -
630   - this.inputs = [];
631   - this.labels = [];
632   -
633   - var inputs = e.detail.response.idm.inputs.input;
634   -
635   - if (inputs.constructor == Object) {//not Array && inputs.input.selection == "*"
636   - var name = inputs.name;
637   - var description = inputs.description;
638   - var selection = inputs.selection;
639   - inputs = [];
640   - for (var i in this.fields)
641   - inputs.push({name: name + " " + i, description: description, selection: selection});
642   - }
643   -
644   - this.async(function(){
645   - this.type = e.detail.response.type;
646   - this.inputs = inputs;
647   - this.labels = e.detail.response.idm.inputs.layouts.input;
648   -
649   - this.selectedFields = new Array(inputs.length);
650   - },0);
651   -
652   - this._resetGroupBy();
653   -
654   - this.loadPreview = false;
655   - }
656   -
657   - else if (this.loadPreview)
658   - this._loadDatalet(this.selectedFields);
659   - },
660   -
661   - _resetGroupBy : function(){
662   - $(this.$.group_by).find("paper-menu")[0].select(-1);
663   - this.groupedFields = [];
664   - this.aggregators = [];
665   - },
666   -
667   - _addGroupByInput : function(){
668   - this.async(function() {//codice reprlicato!
669   - var selectedFields = this.selectedFields;
670   -
671   - var load = true;
672   -
673   - if(this.inputs[0].selection == "*"){
674   - var temp = [];
675   - for (var i = 0; i < selectedFields.length; i++)
676   - if(selectedFields[i])
677   - temp.push(selectedFields[i]);
678   - selectedFields = temp;
679   - }
680   - else {
681   - for (var i = 0; i < selectedFields.length; i++)
682   - if (!selectedFields[i]) {
683   - load = false;
684   - break;
685   - }
686   - }
687   -
688   - if(load){
689   - this.loadPreview = true;
690   - this._loadDatalet(selectedFields);
691   - }
692   - }, 0);
693   - },
694   -
695   - _addOrder : function(e){
696   - var t = e.target;
697   - if(t.tagName.indexOf("IRON-ICON") > -1)
698   - t = $(e.target).parents("paper-icon-button")[0];
699   -
700   - var icon = t.getAttribute("icon");
701   - var name = t.getAttribute("id");
702   -
703   - if(name.indexOf("gb") > -1){
704   - var selectedItem = $(this.$.group_by).find("paper-menu")[0].selectedItem;
705   - if(selectedItem)
706   - name = selectedItem.textContent.trim();
707   -// name = "[" + selectedItem.textContent.trim() + "]";
708   - else
709   - return;
710   - }// else {
711   -// var i = name;
712   -// var ddl = $("#calculate_"+i);
713   -//
714   -// var label = $(ddl).find("paper-menu")[0].selectedItem.textContent.trim();
715   -// var index = label.split(" ", 2).join(" ").length;
716   -// var field = label.substring(index+1, label.length);
717   -// var operation = label.substring(0, label.indexOf(" "));
718   -// name = operation + "([" + field + "])";
719   -// }
720   -
721   - if(icon.indexOf("unfold-more") > -1){
722   - t.setAttribute("icon", "expand-less");
723   - t.setAttribute("title", ln["sortAscending_" + ln["localization"]]);
724   - var orders = this.orders.filter(function (el) { return el.field !== name; });
725   - orders.push({"field": name, "operation": "ASC"});
726   - this.orders = this._copy(orders);
727   - }
728   - else if(icon.indexOf("expand-less") > -1){
729   - t.setAttribute("icon", "expand-more");
730   - t.setAttribute("title", ln["sortDescending_" + ln["localization"]]);
731   - var orders = this.orders.filter(function (el) { return el.field !== name; });
732   - orders.push({"field": name, "operation": "DESC"});
733   - this.orders = this._copy(orders);
734   - }
735   - else if(icon.indexOf("expand-more") > -1){
736   - t.setAttribute("icon", "unfold-more");
737   - t.setAttribute("title", ln["unsort_" + ln["localization"]]);
738   - var orders = this.orders.filter(function (el) { return el.field !== name; });
739   - this.orders = this._copy(orders);
740   - }
741   -
742   - this._addGroupByInput();//no buoono
743   -// if(load){
744   -// this.loadPreview = true;
745   -// this._loadDatalet(selectedFields);
746   -// }
747   - },
748   -
749   - _addInput : function(e){
750   - var selectedFields = this._copy(this.selectedFields);
751   -
752   -// var index = $(e.target).parents("paper-dropdown-menu")[0].id;
753   -// selectedFields[index] = e.target.innerHTML.trim();
754   -
755   - var ddl_index = $(e.target).parents("paper-dropdown-menu")[0].id;
756   - var index = e.target.id;
757   - selectedFields[ddl_index] = this.fields[index];
758   -
759   - this.selectedFields = this._copy(selectedFields);
760   -
761   - var load = true;
762   -
763   - if(this.inputs[0].selection == "*"){
764   - var temp = [];
765   - for (var i = 0; i < selectedFields.length; i++)
766   - if(selectedFields[i])
767   - temp.push(selectedFields[i]);
768   - selectedFields = temp;
769   - }
770   - else {
771   - for (var i = 0; i < selectedFields.length; i++)