Commit 52c4c8b4715f3fe4c364e23e6b6d10e17aaed391

Authored by Edmar Moretti
1 parent 07460dff

$1

ferramentas/saiku/esquemaxml.php
@@ -115,16 +115,25 @@ $xml .= " @@ -115,16 +115,25 @@ $xml .= "
115 </Hierarchy> 115 </Hierarchy>
116 </Dimension> 116 </Dimension>
117 "; 117 ";
  118 +//as dimensoes sao duplicadas
  119 +//uma delas contem o geocodigo que permite a geracao do mapa
  120 +$xml1 = "";
  121 +$xml2 = "";
118 foreach($regioes as $regiao){ 122 foreach($regioes as $regiao){
119 $caminho = $m->hierarquiaPath($regiao["codigo_tipo_regiao"]); 123 $caminho = $m->hierarquiaPath($regiao["codigo_tipo_regiao"]);
120 - $xml .= " 124 + $xml1 .= "
121 <Dimension name='codigo_tipo_regiao_".$regiao["codigo_tipo_regiao"]."' caption='Onde:".converte($regiao["nome_tipo_regiao"])."'> 125 <Dimension name='codigo_tipo_regiao_".$regiao["codigo_tipo_regiao"]."' caption='Onde:".converte($regiao["nome_tipo_regiao"])."'>
122 <Hierarchy hasAll='true' primaryKey='codigo'> 126 <Hierarchy hasAll='true' primaryKey='codigo'>
123 "; 127 ";
  128 + $xml2 .= "
  129 + <Dimension name='codigo_tipo_regiao_".$regiao["codigo_tipo_regiao"]."_geocod' caption='GeoCod:".converte($regiao["nome_tipo_regiao"])."'>
  130 + <Hierarchy hasAll='true' primaryKey='codigo'>
  131 + ";
124 //cria uma view juntando as tabelas da hierarquia de regioes 132 //cria uma view juntando as tabelas da hierarquia de regioes
125 $n = count($caminho); 133 $n = count($caminho);
126 $colunas = array(); 134 $colunas = array();
127 - $niveis = array(); 135 + $niveis1 = array();
  136 + $niveis2 = array();
128 $sql = "SELECT __COLUNAS__ FROM {$regiao['esquemadb']}.{$regiao['tabela']} AS regiao "; 137 $sql = "SELECT __COLUNAS__ FROM {$regiao['esquemadb']}.{$regiao['tabela']} AS regiao ";
129 $colunas[] = "regiao.{$regiao['identificador']} AS codigo "; 138 $colunas[] = "regiao.{$regiao['identificador']} AS codigo ";
130 $colunas[] = "regiao.{$regiao['colunanomeregiao']} AS nome"; 139 $colunas[] = "regiao.{$regiao['colunanomeregiao']} AS nome";
@@ -137,16 +146,26 @@ foreach($regioes as $regiao){ @@ -137,16 +146,26 @@ foreach($regioes as $regiao){
137 AS j$i ON j$i.{$r['identificador']}::text = {$tabelaAnt}.{$r['identificador']}::text 146 AS j$i ON j$i.{$r['identificador']}::text = {$tabelaAnt}.{$r['identificador']}::text
138 "; 147 ";
139 $tabelaAnt = "j".$i; 148 $tabelaAnt = "j".$i;
140 - $niveis[] = " 149 + $niveis1[] = "
141 <Level name='".converte($r["nome_tipo_regiao"])."' 150 <Level name='".converte($r["nome_tipo_regiao"])."'
142 column='j$i{$r['identificador']}' 151 column='j$i{$r['identificador']}'
143 nameColumn='j$i{$r["colunanomeregiao"]}' uniqueMembers='false'/> 152 nameColumn='j$i{$r["colunanomeregiao"]}' uniqueMembers='false'/>
144 "; 153 ";
  154 + $niveis2[] = "
  155 + <Level name='".converte($r["nome_tipo_regiao"])." - GeoCod'
  156 + column='j$i{$r['identificador']}'
  157 + nameColumn='j$i{$r["identificador"]}' uniqueMembers='false'/>
  158 + ";
145 } 159 }
146 - $niveis[] = " 160 + $niveis1[] = "
147 <Level name='".converte($regiao["nome_tipo_regiao"])."' 161 <Level name='".converte($regiao["nome_tipo_regiao"])."'
148 column='codigo' 162 column='codigo'
149 - nameColumn='nome' uniqueMembers='true'> 163 + nameColumn='nome' uniqueMembers='true' />
  164 + ";
  165 + $niveis2[] = "
  166 + <Level name='".converte($regiao["nome_tipo_regiao"])." - GeoCod'
  167 + column='codigo'
  168 + nameColumn='codigo' uniqueMembers='true' />
150 "; 169 ";
151 //verifica outras colunas 170 //verifica outras colunas
152 $vis = $regiao['colunasvisiveis']; 171 $vis = $regiao['colunasvisiveis'];
@@ -169,10 +188,15 @@ foreach($regioes as $regiao){ @@ -169,10 +188,15 @@ foreach($regioes as $regiao){
169 $sql .= " WHERE regiao.".$rs["sql"]; 188 $sql .= " WHERE regiao.".$rs["sql"];
170 } 189 }
171 190
172 - $xml .= " 191 + $xml1 .= "
173 <view alias='view_codigo_tipo_regiao_".$regiao["codigo_tipo_regiao"]."' ><SQL dialect='generic' >$sql</SQL></view> 192 <view alias='view_codigo_tipo_regiao_".$regiao["codigo_tipo_regiao"]."' ><SQL dialect='generic' >$sql</SQL></view>
174 "; 193 ";
175 - $xml .= implode(" ",$niveis); 194 + $xml2 .= "
  195 + <view alias='view_codigo_tipo_regiao_".$regiao["codigo_tipo_regiao"]."_GeoCod' ><SQL dialect='generic' >$sql</SQL></view>
  196 + ";
  197 + $xml1 .= implode(" ",$niveis1);
  198 + $xml2 .= implode(" ",$niveis2);
  199 + /*
176 //verifica se existem propriedades (colunas adicionais) 200 //verifica se existem propriedades (colunas adicionais)
177 if($vis != ""){ 201 if($vis != ""){
178 //apelidos 202 //apelidos
@@ -193,13 +217,17 @@ foreach($regioes as $regiao){ @@ -193,13 +217,17 @@ foreach($regioes as $regiao){
193 "; 217 ";
194 } 218 }
195 } 219 }
196 - //fecha os elementos. LEVEL deve ser fechado pois o ultimo recebe as propriedades  
197 - $xml .= "  
198 - </Level> 220 + */
  221 + $xml1 .= "
  222 + </Hierarchy>
  223 + </Dimension>
  224 + ";
  225 + $xml2 .= "
199 </Hierarchy> 226 </Hierarchy>
200 </Dimension> 227 </Dimension>
201 "; 228 ";
202 } 229 }
  230 +$xml .= $xml1.$xml2;
203 //junta as medidas conforme o nome da tabela utilizada 231 //junta as medidas conforme o nome da tabela utilizada
204 $medidas = $m->listaMedidaVariavel(); 232 $medidas = $m->listaMedidaVariavel();
205 $tbs = array(); 233 $tbs = array();
@@ -223,6 +251,9 @@ foreach($tbs as $tb){ @@ -223,6 +251,9 @@ foreach($tbs as $tb){
223 $VirtualCubeDimension[] = " 251 $VirtualCubeDimension[] = "
224 <VirtualCubeDimension name='codigo_tipo_regiao_{$c["codigo_tipo_regiao"]}' /> 252 <VirtualCubeDimension name='codigo_tipo_regiao_{$c["codigo_tipo_regiao"]}' />
225 "; 253 ";
  254 + $VirtualCubeDimension[] = "
  255 + <VirtualCubeDimension name='codigo_tipo_regiao_{$c["codigo_tipo_regiao"]}_geocod' />
  256 + ";
226 //verifica as dimensoes do tipo tempo 257 //verifica as dimensoes do tipo tempo
227 $dimTempo = array(); 258 $dimTempo = array();
228 foreach($tb as $medida){ 259 foreach($tb as $medida){
@@ -233,30 +264,6 @@ foreach($tbs as $tb){ @@ -233,30 +264,6 @@ foreach($tbs as $tb){
233 if($parametro["tipo"] < 5){ 264 if($parametro["tipo"] < 5){
234 $parComposto[] = $parametro["coluna"]; 265 $parComposto[] = $parametro["coluna"];
235 } 266 }
236 - /*  
237 - if($parametro["tipo"] == 1){  
238 - if(count($parametros) == 1){  
239 - $VirtualCubeDimension[] = "  
240 - <VirtualCubeDimension name='Anual' />  
241 - ";  
242 - $dimTempo[] = "  
243 - <DimensionUsage foreignKey='".$parametro["coluna"]."_' name='Anual' source='Anual'/>  
244 - ";  
245 - }  
246 - $parComposto[] = $parametro["coluna"];  
247 - }  
248 - if($parametro["tipo"] == 2){  
249 - $parComposto[] = $parametro["coluna"];  
250 - if(count($parametros) == 2){  
251 - $VirtualCubeDimension[] = "  
252 - <VirtualCubeDimension name='Mensal' />  
253 - ";  
254 - $dimTempo[] = "  
255 - <DimensionUsage foreignKey='".implode("_",$parComposto)."_' name='Mensal' source='Mensal'/>  
256 - ";  
257 - }  
258 - }  
259 - */  
260 } 267 }
261 $VirtualCubeDimension[] = " 268 $VirtualCubeDimension[] = "
262 <VirtualCubeDimension name='Tempo' /> 269 <VirtualCubeDimension name='Tempo' />
@@ -264,7 +271,6 @@ foreach($tbs as $tb){ @@ -264,7 +271,6 @@ foreach($tbs as $tb){
264 $dimTempo[] = " 271 $dimTempo[] = "
265 <DimensionUsage foreignKey='".implode("_",$parComposto)."_' name='Tempo' source='Tempo'/> 272 <DimensionUsage foreignKey='".implode("_",$parComposto)."_' name='Tempo' source='Tempo'/>
266 "; 273 ";
267 - //echo "<pre>";var_dump($parametro);exit;  
268 } 274 }
269 $xml .= " 275 $xml .= "
270 <Cube cache='false' name='{$c["esquemadb"]}{$c["tabela"]}'>"; 276 <Cube cache='false' name='{$c["esquemadb"]}{$c["tabela"]}'>";
@@ -275,6 +281,7 @@ foreach($tbs as $tb){ @@ -275,6 +281,7 @@ foreach($tbs as $tb){
275 $xml .= " 281 $xml .= "
276 <view alias='view_{$c["esquemadb"]}{$c["tabela"]}' ><SQL dialect='generic' >$sql</SQL></view> 282 <view alias='view_{$c["esquemadb"]}{$c["tabela"]}' ><SQL dialect='generic' >$sql</SQL></view>
277 <DimensionUsage foreignKey='".$c["colunaidgeo"]."' name='codigo_tipo_regiao_".$c["codigo_tipo_regiao"]."' source='codigo_tipo_regiao_".$c["codigo_tipo_regiao"]."'/> 283 <DimensionUsage foreignKey='".$c["colunaidgeo"]."' name='codigo_tipo_regiao_".$c["codigo_tipo_regiao"]."' source='codigo_tipo_regiao_".$c["codigo_tipo_regiao"]."'/>
  284 + <DimensionUsage foreignKey='".$c["colunaidgeo"]."' name='codigo_tipo_regiao_".$c["codigo_tipo_regiao"]."_geocod' source='codigo_tipo_regiao_".$c["codigo_tipo_regiao"]."_geocod'/>
278 "; 285 ";
279 286
280 $xml .= implode(" ",array_unique($dimTempo)); 287 $xml .= implode(" ",array_unique($dimTempo));
ferramentas/saiku/saiku-server/tomcat/webapps/WEB-INF/classes/saiku.properties 0 → 100755
@@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
  1 +# SAIKU PROPERTIES
  2 +
  3 +
  4 +saiku.olap.nonempty = true
  5 +saiku.web.export.csv.name = saiku-export
  6 +saiku.web.export.excel.name = saiku-export
  7 +saiku.web.export.excel.format = xlsx
  8 +saiku.web.export.excel.numberformat=#.##0,00
  9 +
  10 +saiku.format.numberformat=#.##0,00
  11 +
  12 +# SET FIXED LOCALE, otherwise JVM locale
  13 +#saiku.format.default.locale=de_AT
  14 +#saiku.format.default.locale=en
  15 +#saiku.format.default.locale=lt
0 \ No newline at end of file 16 \ No newline at end of file
mashups/openlayers.js
@@ -1601,10 +1601,10 @@ i3GEO.editorOL = { @@ -1601,10 +1601,10 @@ i3GEO.editorOL = {
1601 } 1601 }
1602 } 1602 }
1603 YAHOO.editorOL.container.panel.show(); 1603 YAHOO.editorOL.container.panel.show();
1604 - if(i3GEO.configura)  
1605 - {$i("panelpropriedadesEditor").getElementsByTagName("div")[2].style.overflow = "auto";}  
1606 - else  
1607 - {$i("panelpropriedadesEditor").getElementsByTagName("div")[1].style.overflow = "auto";} 1604 + temp = $i("panelpropriedadesEditor").getElementsByTagName("div")
  1605 + if(temp && temp[2]){
  1606 + temp[2].style.overflow = "auto";
  1607 + }
1608 }, 1608 },
1609 listaGeometrias: function(){ 1609 listaGeometrias: function(){
1610 if(!document.getElementById("panellistagEditor")){ 1610 if(!document.getElementById("panellistagEditor")){
mashups/openlayers_compacto.js
@@ -4606,10 +4606,10 @@ temp.onclick = function(){i3GEO.janela.minimiza(&quot;panelpropriedadesEditor&quot;);}; @@ -4606,10 +4606,10 @@ temp.onclick = function(){i3GEO.janela.minimiza(&quot;panelpropriedadesEditor&quot;);};
4606 } 4606 }
4607 } 4607 }
4608 YAHOO.editorOL.container.panel.show(); 4608 YAHOO.editorOL.container.panel.show();
4609 -if(i3GEO.configura)  
4610 -{$i("panelpropriedadesEditor").getElementsByTagName("div")[2].style.overflow = "auto";}  
4611 -else  
4612 -{$i("panelpropriedadesEditor").getElementsByTagName("div")[1].style.overflow = "auto";} 4609 +temp = $i("panelpropriedadesEditor").getElementsByTagName("div")
  4610 +if(temp && temp[2]){
  4611 +temp[2].style.overflow = "auto";
  4612 +}
4613 }, 4613 },
4614 listaGeometrias: function(){ 4614 listaGeometrias: function(){
4615 if(!document.getElementById("panellistagEditor")){ 4615 if(!document.getElementById("panellistagEditor")){
mashups/openlayers_compacto.js.php
@@ -4606,10 +4606,10 @@ temp.onclick = function(){i3GEO.janela.minimiza(&quot;panelpropriedadesEditor&quot;);}; @@ -4606,10 +4606,10 @@ temp.onclick = function(){i3GEO.janela.minimiza(&quot;panelpropriedadesEditor&quot;);};
4606 } 4606 }
4607 } 4607 }
4608 YAHOO.editorOL.container.panel.show(); 4608 YAHOO.editorOL.container.panel.show();
4609 -if(i3GEO.configura)  
4610 -{$i("panelpropriedadesEditor").getElementsByTagName("div")[2].style.overflow = "auto";}  
4611 -else  
4612 -{$i("panelpropriedadesEditor").getElementsByTagName("div")[1].style.overflow = "auto";} 4609 +temp = $i("panelpropriedadesEditor").getElementsByTagName("div")
  4610 +if(temp && temp[2]){
  4611 +temp[2].style.overflow = "auto";
  4612 +}
4613 }, 4613 },
4614 listaGeometrias: function(){ 4614 listaGeometrias: function(){
4615 if(!document.getElementById("panellistagEditor")){ 4615 if(!document.getElementById("panellistagEditor")){