Commit f1119e23bc76fbd047006dc1463e141ebe26a5d5

Authored by Edmar Moretti
1 parent 9fd1afa4

--no commit message

admin/admin.db
No preview for this file type
classesphp/funcoes_gerais.php
@@ -2704,7 +2704,7 @@ function cloneInlineSymbol($layern,$nmapa,$mapa){ @@ -2704,7 +2704,7 @@ function cloneInlineSymbol($layern,$nmapa,$mapa){
2704 //recupera um mapfile armazenado no banco de dados de administracao 2704 //recupera um mapfile armazenado no banco de dados de administracao
2705 //ver admin/php/mapas.php salvaMapfile 2705 //ver admin/php/mapas.php salvaMapfile
2706 function restauraMapaAdmin($id_mapa,$dir_tmp){ 2706 function restauraMapaAdmin($id_mapa,$dir_tmp){
2707 - include(dirname(__FILE__)."/../admin/php/conexao.php"); 2707 + include(dirname(__FILE__)."/../admin/php/conexao.php");
2708 if(!empty($esquemaadmin)){ 2708 if(!empty($esquemaadmin)){
2709 $esquemaadmin = str_replace(".","",$esquemaadmin)."."; 2709 $esquemaadmin = str_replace(".","",$esquemaadmin).".";
2710 } 2710 }
ferramentas/saiku/esquemaxml.php
1 <?php 1 <?php
2 include(dirname(__FILE__)."/../../admin/php/classe_metaestat.php"); 2 include(dirname(__FILE__)."/../../admin/php/classe_metaestat.php");
  3 +include(dirname(__FILE__)."/../../ms_configura.php");
  4 +$nomeDatasource = $dir_tmp."/saiku-datasources/i3geo";
  5 +//$saikuDatasourceString vem do ms_configura.php
3 $m = new Metaestat(); 6 $m = new Metaestat();
4 $selecaoRegiao = array(); 7 $selecaoRegiao = array();
5 //pega o filtro da sessao PHP aberta pelo i3Geo 8 //pega o filtro da sessao PHP aberta pelo i3Geo
@@ -44,13 +47,14 @@ if(!empty($_COOKIE[&quot;i3GeoPHP&quot;])){ @@ -44,13 +47,14 @@ if(!empty($_COOKIE[&quot;i3GeoPHP&quot;])){
44 $registros = ""; 47 $registros = "";
45 } 48 }
46 //echo "<pre>".var_dump($_SESSION);exit; 49 //echo "<pre>".var_dump($_SESSION);exit;
  50 +
47 $regioes = $m->listaTipoRegiao(); 51 $regioes = $m->listaTipoRegiao();
48 $xml = "<Schema name='i3Geo Metaestat'>"; 52 $xml = "<Schema name='i3Geo Metaestat'>";
49 //cria as dimensoes de tipo temporal 53 //cria as dimensoes de tipo temporal
50 $sqlAno = "select nu_ano from i3geo_metaestat.dim_tempo group by nu_ano order by nu_ano"; 54 $sqlAno = "select nu_ano from i3geo_metaestat.dim_tempo group by nu_ano order by nu_ano";
51 $sqlMes = "select nu_ano,nu_mes,ds_mes_abreviado as mes,nu_ano::text||'-'||nu_mes::text as nu_anomes from i3geo_metaestat.dim_tempo group by nu_ano,nu_mes,mes,nu_anomes order by nu_ano,nu_mes"; 55 $sqlMes = "select nu_ano,nu_mes,ds_mes_abreviado as mes,nu_ano::text||'-'||nu_mes::text as nu_anomes from i3geo_metaestat.dim_tempo group by nu_ano,nu_mes,mes,nu_anomes order by nu_ano,nu_mes";
52 $xml .= " 56 $xml .= "
53 - <Dimension name='Anual' type='TimeDimension' caption='Tempo: Anual'> 57 + <Dimension name='Anual' type='TimeDimension' caption='$teste Tempo: Anual'>
54 <Hierarchy hasAll='true' primaryKey='nu_ano'> 58 <Hierarchy hasAll='true' primaryKey='nu_ano'>
55 <view alias='tempo_ano' ><SQL dialect='generic' >$sqlAno</SQL></view> 59 <view alias='tempo_ano' ><SQL dialect='generic' >$sqlAno</SQL></view>
56 <Level name='Ano' column='nu_ano' type='Numeric' uniqueMembers='true' levelType='TimeYears'/> 60 <Level name='Ano' column='nu_ano' type='Numeric' uniqueMembers='true' levelType='TimeYears'/>
ferramentas/saiku/index.js
@@ -140,6 +140,6 @@ i3GEOF.saiku = { @@ -140,6 +140,6 @@ i3GEOF.saiku = {
140 i3GEOF.saiku.inicia(divid); 140 i3GEOF.saiku.inicia(divid);
141 }, 141 },
142 aplicar: function(){ 142 aplicar: function(){
143 - window.open("http://localhost:9090"); 143 + window.open("http://localhost:9090?"+i3GEO.configura.sid);
144 } 144 }
145 }; 145 };
ferramentas/saiku/instal.txt
1 Roteiro para instalação e configuração do SAIKU para uso com o i3Geo. 1 Roteiro para instalação e configuração do SAIKU para uso com o i3Geo.
2 2
  3 +O SAIKU só irá funcionar no Linux!!!
  4 +
3 Para mais informações veja em: http://docs.analytical-labs.com/ 5 Para mais informações veja em: http://docs.analytical-labs.com/
4 6
5 - Faça o download do SAIKU Server no endereço: http://meteorite.bi/saiku/download 7 - Faça o download do SAIKU Server no endereço: http://meteorite.bi/saiku/download
@@ -14,27 +16,23 @@ Para mais informações veja em: http://docs.analytical-labs.com/ @@ -14,27 +16,23 @@ Para mais informações veja em: http://docs.analytical-labs.com/
14 16
15 e modifique o valor da porta se achar necessário 17 e modifique o valor da porta se achar necessário
16 18
17 -- Configure o arquivo de conexão com a fonte de dados  
18 -  
19 - Copie o arquivo "i3geo" localizado em  
20 -  
21 - /var/www/i3geo/ferramentas/saiku  
22 -  
23 - (c:\\ms4w\Apache\htdocs\i3geo\ferramentas\saiku no Windows) 19 +- Fontes de dados
24 20
25 - para a pasta: 21 + O i3Geo cria arquivos de fontes de dados em uma pasta temporária. Essa pasta é criada quando o i3Geo é inicializado.
  22 + (/tmp/ms_tmp/saikudatasources por padrão)
26 23
27 - saiku-server/tomcat/webapps/saiku/WEB-INF/classes/saiku-datasources 24 + Para que o SAIKU veja essa pasta é necessário criar um link simbólico apnotando para ela
28 25
29 - Esse arquivo indica qual a fonte de dados que será usada. Altere os valores conforme sua necessidade, por exemplo: 26 + Esse link deve ser criado na pasta /var/www/saiku-server/tomcat/webapps/saiku/WEB-INF/classes
30 27
31 - No lugar de localhost coloque o endereço do banco de dados Postgres 28 + Commando do Linux:
32 29
33 - No lugar de i3geosaude coloque o nome do banco de dados onde estão as tabelas utilizadas pelo i3Geo 30 + (/var/www/saiku-server é a pasta onde vc inatalou o SAIKU)
  31 + (/var/tmp/ms_tmp é a pasta temporária utilizada pelo i3Geo)
34 32
35 - No lugar de http://localhost/i3geo/ferramentas/saiku/esquemaxml.php coloque o endereço (URL) completo do arquivo i3geo/ferramentas/saiku/esquemaxml.php 33 + rm -R -f /var/www/saiku-server/tomcat/webapps/saiku/WEB-INF/classes/saiku-datasources
  34 + ln -s /tmp/ms_tmp/saiku-datasources /var/www/saiku-server/tomcat/webapps/saiku/WEB-INF/classes/saiku-datasources
36 35
37 - No lugar de postgres coloque os nomes de usuário e senha para conexão com o banco de dados  
38 36
39 - Arquivos alterados 37 - Arquivos alterados
40 38
@@ -53,6 +51,6 @@ Para mais informações veja em: http://docs.analytical-labs.com/ @@ -53,6 +51,6 @@ Para mais informações veja em: http://docs.analytical-labs.com/
53 51
54 http://localhost:9090/ 52 http://localhost:9090/
55 53
56 - Se tudo estiver ok, deve aparecer ua tela de login. Utilize admin como usuário e admin como senha 54 + Se tudo estiver ok, deve aparecer na tela de login. Utilize admin como usuário e admin como senha
57 55
58 56
ferramentas/saiku/saiku-server/tomcat/webapps/ROOT/js/saiku/Settings.js
@@ -1,162 +0,0 @@ @@ -1,162 +0,0 @@
1 -/*  
2 - * Copyright 2012 OSBI Ltd  
3 - *  
4 - * Licensed under the Apache License, Version 2.0 (the "License");  
5 - * you may not use this file except in compliance with the License.  
6 - * You may obtain a copy of the License at  
7 - *  
8 - * http://www.apache.org/licenses/LICENSE-2.0  
9 - *  
10 - * Unless required by applicable law or agreed to in writing, software  
11 - * distributed under the License is distributed on an "AS IS" BASIS,  
12 - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
13 - * See the License for the specific language governing permissions and  
14 - * limitations under the License.  
15 - */  
16 -  
17 -/**  
18 - * Change settings here  
19 - */  
20 -  
21 -var Settings = {  
22 - //parametros do i3geo  
23 - I3GEOURL: window.location.protocol+"//"+window.location.hostname+"/i3geo",  
24 - I3GEOSID: window.location.search.replace("?",""),  
25 - //  
26 - VERSION: "Saiku 2.5",  
27 - BIPLUGIN: false,  
28 - BASE_URL: "",  
29 - TOMCAT_WEBAPP: "/saiku",  
30 - REST_MOUNT_POINT: "/rest/saiku/",  
31 - DIMENSION_PREFETCH: true,  
32 - ERROR_LOGGING: false,  
33 - // number of erroneous ajax calls in a row before UI cant recover  
34 - ERROR_TOLERANCE: 3,  
35 - QUERY_PROPERTIES: {  
36 - 'saiku.olap.query.automatic_execution': 'true',  
37 - 'saiku.olap.query.nonempty': 'true',  
38 - 'saiku.olap.query.nonempty.rows': 'true',  
39 - 'saiku.olap.query.nonempty.columns': 'true',  
40 - 'saiku.ui.render.mode' : 'table'  
41 - },  
42 - /* Valid values for CELLSET_FORMATTER:  
43 - * 1) flattened  
44 - * 2) flat  
45 - */  
46 - CELLSET_FORMATTER: "flattened",  
47 - // limits the number of rows in the result  
48 - // 0 - no limit  
49 - RESULT_LIMIT: 0,  
50 - MEMBERS_FROM_RESULT: true,  
51 - PLUGINS: [  
52 - "Chart"  
53 - ],  
54 - TELEMETRY_SERVER: 'http://telemetry.analytical-labs.com:7000',  
55 - LOCALSTORAGE_EXPIRATION: 10 * 60 * 60 * 1000 /* 10 hours, in ms */  
56 -};  
57 -  
58 -/**  
59 - * Extend settings with query parameters  
60 - */  
61 -Settings.GET = function () {  
62 - var qs = document.location.search;  
63 - qs = qs.split("+").join(" ");  
64 - var params = {},  
65 - tokens,  
66 - re = /[?&]?([^=]+)=([^&]*)/g;  
67 -  
68 - while (tokens = re.exec(qs)) {  
69 - var value = decodeURIComponent(tokens[2]);  
70 - if (! isNaN(value)) value = parseInt(value);  
71 - if (value === "true") value = true;  
72 - if (value === "false") value = false;  
73 - params[decodeURIComponent(tokens[1]).toUpperCase()]  
74 - = value;  
75 - }  
76 -  
77 - return params;  
78 -}();  
79 -_.extend(Settings, Settings.GET);  
80 -  
81 -Settings.REST_URL = Settings.BASE_URL  
82 - + Settings.TOMCAT_WEBAPP  
83 - + Settings.REST_MOUNT_POINT;  
84 -  
85 -// lets assume we dont need a min width/height for table mode  
86 -if (Settings.MODE == "table") {  
87 - Settings.DIMENSION_PREFETCH = false;  
88 - $('body, html').css('min-height',0);  
89 - $('body, html').css('min-width',0);  
90 -  
91 -}  
92 -  
93 -  
94 -/**  
95 - * < IE9 doesn't support Array.indexOf  
96 - */  
97 -if (!Array.prototype.indexOf)  
98 -{  
99 - Array.prototype.indexOf = function(elt /*, from*/)  
100 - {  
101 - var len = this.length >>> 0;  
102 -  
103 - var from = Number(arguments[1]) || 0;  
104 - from = (from < 0)  
105 - ? Math.ceil(from)  
106 - : Math.floor(from);  
107 - if (from < 0)  
108 - from += len;  
109 -  
110 - for (; from < len; from++)  
111 - {  
112 - if (from in this &&  
113 - this[from] === elt)  
114 - return from;  
115 - }  
116 - return -1;  
117 - };  
118 -}  
119 -  
120 -var tagsToReplace = {  
121 - '&': '&amp;',  
122 - '<': '&lt;',  
123 - '>': '&gt;'  
124 -};  
125 -  
126 -function replaceTag(tag) {  
127 - return tagsToReplace[tag] || tag;  
128 -}  
129 -  
130 -function safe_tags_replace(str) {  
131 - return str.replace(/[&<>]/g, replaceTag);  
132 -}  
133 -  
134 -if ($.blockUI) {  
135 - $.blockUI.defaults.css = {};  
136 - $.blockUI.defaults.overlayCSS = {};  
137 - $.blockUI.defaults.blockMsgClass = 'processing';  
138 - $.blockUI.defaults.fadeOut = 0;  
139 - $.blockUI.defaults.fadeIn = 0;  
140 - $.blockUI.defaults.ignoreIfBlocked = false;  
141 -  
142 -}  
143 -//original alterado por Edmar Moretti  
144 -/*  
145 -if (window.location.hostname && (window.location.hostname == "dev.analytical-labs.com" || window.location.hostname == "demo.analytical-labs.com" )) {  
146 - Settings.USERNAME = "admin";  
147 - Settings.PASSWORD = "admin";  
148 -}  
149 -*/  
150 -Settings.USERNAME = "admin";  
151 -Settings.PASSWORD = "admin";  
152 -  
153 -var isIE = (function(){  
154 - var undef, v = 3, div = document.createElement('div');  
155 -  
156 - while (  
157 - div.innerHTML = '<!--[if gt IE '+(++v)+']><i></i><![endif]-->',  
158 - div.getElementsByTagName('i')[0]  
159 - );  
160 -  
161 - return v> 4 ? v : false;  
162 -}());  
mashups/openlayers.php
@@ -9,7 +9,8 @@ error_reporting(0); @@ -9,7 +9,8 @@ error_reporting(0);
9 // 9 //
10 //recupera um mapa salvo no banco de administracao 10 //recupera um mapa salvo no banco de administracao
11 // 11 //
12 -if(!empty($restauramapa)){ 12 +if(!empty($restauramapa)){
  13 + include_once(dirname(__FILE__)."/../classesphp/funcoes_gerais.php");
13 $xbase = restauraMapaAdmin($restauramapa,$dir_tmp); 14 $xbase = restauraMapaAdmin($restauramapa,$dir_tmp);
14 $m = ms_newMapObj($xbase); 15 $m = ms_newMapObj($xbase);
15 $w = $m->web; 16 $w = $m->web;
ms_configura.php
@@ -63,6 +63,14 @@ $i3geomaster = array( @@ -63,6 +63,14 @@ $i3geomaster = array(
63 array("usuario"=>"admin", "senha"=>"admin") 63 array("usuario"=>"admin", "senha"=>"admin")
64 ); 64 );
65 /* 65 /*
  66 +Variable: saikuUrl
  67 +
  68 +URL para acessar o aplicativo SAIKU. Se nao estiver instalado, deixe em branco
  69 +
  70 +Para maiores informacoes sobre como instalar o SAIKU veja em http://localhost/i3geo/ferramentas/saiku/instal.txt
  71 +*/
  72 +$saikuUrl = "http://localhost:9090";
  73 +/*
66 Variable: i3georendermode 74 Variable: i3georendermode
67 75
68 Opcoes que definem a rotina que sera utilizada para enviar ao navegador as imagens geradas de cada camada 76 Opcoes que definem a rotina que sera utilizada para enviar ao navegador as imagens geradas de cada camada
ms_criamapa.php
@@ -1213,6 +1213,10 @@ function criaDirMapa($dir_tmp,$cachedir=&quot;&quot;) @@ -1213,6 +1213,10 @@ function criaDirMapa($dir_tmp,$cachedir=&quot;&quot;)
1213 $mapfile = $dir_tmp."/".$tmpdirname."/".$tmpdirname.".map"; 1213 $mapfile = $dir_tmp."/".$tmpdirname."/".$tmpdirname.".map";
1214 $tmpimgname = "img".$tmpdirname; 1214 $tmpimgname = "img".$tmpdirname;
1215 @mkdir($dir_tmp."/comum",0777); 1215 @mkdir($dir_tmp."/comum",0777);
  1216 + //utilizado para armazenar os arquivos de fonte de dados do SAIKU
  1217 + @mkdir($dir_tmp."/saiku-datasources",0777);
  1218 + chmod($dir_tmp."/saiku-datasources",0777);
  1219 + //
1216 if($cachedir == ""){ 1220 if($cachedir == ""){
1217 @mkdir($dir_tmp."/cache",0777); 1221 @mkdir($dir_tmp."/cache",0777);
1218 chmod($dir_tmp."/cache",0777); 1222 chmod($dir_tmp."/cache",0777);
testainstal.php
@@ -101,19 +101,19 @@ include_once(&quot;classesphp/funcoes_gerais.php&quot;); @@ -101,19 +101,19 @@ include_once(&quot;classesphp/funcoes_gerais.php&quot;);
101 $versao = versao(); 101 $versao = versao();
102 $versao = $versao["principal"]; 102 $versao = $versao["principal"];
103 $exts = get_loaded_extensions(); 103 $exts = get_loaded_extensions();
  104 +if(!function_exists("ms_GetVersion"))
  105 +{echo "<br><br><span style=color:red >PARECE QUE O MAPSERVER NAO ESTA INSTALADO!!!<br><br>";}
104 echo "MapServer (a vers&atilde;o deve ser &gt;= 5.2 para que a sobreposi&ccedil;&atilde;o de temas funcione na interface Google Maps): <br>"; 106 echo "MapServer (a vers&atilde;o deve ser &gt;= 5.2 para que a sobreposi&ccedil;&atilde;o de temas funcione na interface Google Maps): <br>";
105 echo "Vers&atilde;o:<br>"; 107 echo "Vers&atilde;o:<br>";
106 -echo ms_GetVersion(); 108 +echo @ms_GetVersion();
107 echo "<br><br>"; 109 echo "<br><br>";
108 var_dump (versao())."<br><br>"; 110 var_dump (versao())."<br><br>";
109 -if(!function_exists("ms_GetVersion"))  
110 -{echo "<span style=color:red >PARECE QUE O MAPSERVER NAO ESTA INSTALADO!!!<br><br>";} 111 +
111 echo "<br>---<br>"; 112 echo "<br>---<br>";
112 113
113 if (get_cfg_var("safe_mode") == 1){ 114 if (get_cfg_var("safe_mode") == 1){
114 echo "<span style=color:red >Problema: safe_mode no php.ini deveria estar como 'Off'. O i3Geo n&atilde;o ir&aacute; funcionar!!!<br></span>"; 115 echo "<span style=color:red >Problema: safe_mode no php.ini deveria estar como 'Off'. O i3Geo n&atilde;o ir&aacute; funcionar!!!<br></span>";
115 } 116 }
116 -  
117 //executa as opcoes linux definidas no formulario 117 //executa as opcoes linux definidas no formulario
118 if(!empty($_POST["criaPastaMstmp"]) && $_POST["criaPastaMstmp"] == "on"){ 118 if(!empty($_POST["criaPastaMstmp"]) && $_POST["criaPastaMstmp"] == "on"){
119 echo "<br>Criando a pasta $dir_tmp \n"; 119 echo "<br>Criando a pasta $dir_tmp \n";
@@ -156,6 +156,9 @@ if(!empty($_POST[&quot;criaPastaMstmp&quot;]) &amp;&amp; $_POST[&quot;permPastaI3geo&quot;] == &quot;on&quot;){ @@ -156,6 +156,9 @@ if(!empty($_POST[&quot;criaPastaMstmp&quot;]) &amp;&amp; $_POST[&quot;permPastaI3geo&quot;] == &quot;on&quot;){
156 echo "...OK\n"; 156 echo "...OK\n";
157 } 157 }
158 } 158 }
  159 +if(empty($saikuUrl)){
  160 + echo "<br>O aplicativo <b>SAIKU</b> n&atilde;o est&aacute; instalado. Se voc&ecirc; quiser instalar veja mais detalhes em <a href=ferramentas/saiku/instal.txt >i3geo/ferramentas/saiku/instal.txt</a><br>";
  161 +}
159 echo "<br><pre>Extens&otilde;es:<br>"; 162 echo "<br><pre>Extens&otilde;es:<br>";
160 if (!extension_loaded("curl")){ 163 if (!extension_loaded("curl")){
161 echo "<span style=color:red >Problema: n&atilde;o est&aacute; instalado a curl que pode afetar algumas funcionalidades do i3Geo<br></span>"; 164 echo "<span style=color:red >Problema: n&atilde;o est&aacute; instalado a curl que pode afetar algumas funcionalidades do i3Geo<br></span>";