Commit b6fb516cf6c40614d8a668a29752f392e8096afc
1 parent
6d6cdcad
Exists in
master
and in
7 other branches
--no commit message
Showing
1 changed file
with
10 additions
and
7 deletions
Show diff stats
ferramentas/saiku/esquemaxml.php
| ... | ... | @@ -88,6 +88,7 @@ $xmlTempo = dimensoesTemporais(); |
| 88 | 88 | $filhosDaRegiao = array(); |
| 89 | 89 | $VirtualCubeDimensionDaRegiao = array(); |
| 90 | 90 | $VirtualCubeMeasureDaRegiao = array(); |
| 91 | +$nivelDaDimensao = array(); | |
| 91 | 92 | |
| 92 | 93 | $dimRegioes = dimensoesGeo(); |
| 93 | 94 | |
| ... | ... | @@ -197,7 +198,7 @@ function criaConexaoEsquema(){ |
| 197 | 198 | } |
| 198 | 199 | else{ |
| 199 | 200 | $urlXmlEsquema = $_GET["xmlesquema"]; |
| 200 | - //cria um nome de arquivo reaproveitável | |
| 201 | + //cria um nome de arquivo reaproveitável | |
| 201 | 202 | $nomeConexao = md5($_GET["xmlesquema"]); |
| 202 | 203 | } |
| 203 | 204 | //$arquivoXmlEsquema = dirname($map_file)."/".$nomeConexao.".xml"; |
| ... | ... | @@ -434,11 +435,11 @@ function dimensoesGeo(){ |
| 434 | 435 | $temp = converte($regiao["nome_tipo_regiao"]); |
| 435 | 436 | $niveisXml1[] = " |
| 436 | 437 | <Level name='".$temp."' column='codigo{$regiao["codigo_tipo_regiao"]}' nameColumn='nome".$regiao["codigo_tipo_regiao"]."' |
| 437 | - uniqueMembers='true' /> | |
| 438 | + uniqueMembers='false' /> | |
| 438 | 439 | "; |
| 439 | 440 | $niveisXml2[] = " |
| 440 | 441 | <Level name='".$temp." - GeoCod #".$regiao["codigo_tipo_regiao"]."' column='codigo{$regiao["codigo_tipo_regiao"]}' nameColumn='codigo".$regiao["codigo_tipo_regiao"]."' |
| 441 | - uniqueMembers='true' /> | |
| 442 | + uniqueMembers='false' /> | |
| 442 | 443 | "; |
| 443 | 444 | //juncoes |
| 444 | 445 | while($caminho){ |
| ... | ... | @@ -515,7 +516,7 @@ function dimensoesGeo(){ |
| 515 | 516 | return $xmlRegioes; |
| 516 | 517 | } |
| 517 | 518 | function dimensoesOutras(){ |
| 518 | - global $m; | |
| 519 | + global $m,$nivelDaDimensao; | |
| 519 | 520 | $parametros = $m->listaTodosParametros(); |
| 520 | 521 | $dimOutras = array(); |
| 521 | 522 | foreach($parametros as $p){ |
| ... | ... | @@ -535,7 +536,7 @@ function dimensoesOutras(){ |
| 535 | 536 | $k = $d["esquemadb"]."_".$d["tabela"]."_".$d["coluna"]; |
| 536 | 537 | $xml3 .= " |
| 537 | 538 | <Dimension name='".$k."' caption='".converte($d["nome"])."'> |
| 538 | - <Hierarchy hasAll='false' primaryKey='codigo'> | |
| 539 | + <Hierarchy hasAll='true' primaryKey='codigo'> | |
| 539 | 540 | "; |
| 540 | 541 | //cria uma view juntando as tabelas da hierarquia de regioes |
| 541 | 542 | $colunas = "dim.{$d['coluna']}::text as codigo, "; |
| ... | ... | @@ -544,15 +545,16 @@ function dimensoesOutras(){ |
| 544 | 545 | $xml3 .= "<view alias='".$k."' ><SQL dialect='generic' >$sql</SQL></view>"; |
| 545 | 546 | $xml3 .= "<Level name='".converte($d["nome"])."' |
| 546 | 547 | column='codigo' |
| 547 | - nameColumn='nome' uniqueMembers='true' /> | |
| 548 | + nameColumn='nome' uniqueMembers='false' /> | |
| 548 | 549 | "; |
| 550 | + $nivelDaDimensao[$k] = converte($d["nome"]); | |
| 549 | 551 | $xml3 .= "</Hierarchy> |
| 550 | 552 | </Dimension>"; |
| 551 | 553 | } |
| 552 | 554 | return $xml3; |
| 553 | 555 | } |
| 554 | 556 | function dimensoesTabelas(){ |
| 555 | - global $dimRegioes, $filhosDaRegiao, $m, $VirtualCubeDimension, $VirtualCubeMeasure, $chavesRegiao, $medidas, $codigo_tipo_regiao, $VirtualCubeDimensionDaRegiao, $VirtualCubeMeasureDaRegiao; | |
| 557 | + global $nivelDaDimensao,$dimRegioes, $filhosDaRegiao, $m, $VirtualCubeDimension, $VirtualCubeMeasure, $chavesRegiao, $medidas, $codigo_tipo_regiao, $VirtualCubeDimensionDaRegiao, $VirtualCubeMeasureDaRegiao; | |
| 556 | 558 | |
| 557 | 559 | $xml = ""; |
| 558 | 560 | $tbs = array(); |
| ... | ... | @@ -623,6 +625,7 @@ function dimensoesTabelas(){ |
| 623 | 625 | array_push($VirtualCubeDimensionDaRegiao[$c["codigo_tipo_regiao"]],"<VirtualCubeDimension name='{$k}' />"); |
| 624 | 626 | } |
| 625 | 627 | } |
| 628 | + | |
| 626 | 629 | } |
| 627 | 630 | //$dimEnsoes[] = '<DimensionUsage foreignKey="coduf" name="codigo_tipo_regiao_2" source="codigo_tipo_regiao_2"/>'; |
| 628 | 631 | ... | ... |