From f1119e23bc76fbd047006dc1463e141ebe26a5d5 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Wed, 8 Jan 2014 13:15:59 +0000 Subject: [PATCH] --- admin/admin.db | Bin 263168 -> 0 bytes classesphp/funcoes_gerais.php | 2 +- ferramentas/saiku/esquemaxml.php | 6 +++++- ferramentas/saiku/index.js | 2 +- ferramentas/saiku/instal.txt | 28 +++++++++++++--------------- ferramentas/saiku/saiku-server/tomcat/webapps/ROOT/js/saiku/Settings.js | 162 ------------------------------------------------------------------------------------------------------------------------------------------------------------------ mashups/openlayers.php | 3 ++- ms_configura.php | 8 ++++++++ ms_criamapa.php | 4 ++++ testainstal.php | 11 +++++++---- 10 files changed, 41 insertions(+), 185 deletions(-) delete mode 100755 ferramentas/saiku/saiku-server/tomcat/webapps/ROOT/js/saiku/Settings.js diff --git a/admin/admin.db b/admin/admin.db index 4fd588e..7d34c4a 100644 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/classesphp/funcoes_gerais.php b/classesphp/funcoes_gerais.php index 7b89458..ce82930 100644 --- a/classesphp/funcoes_gerais.php +++ b/classesphp/funcoes_gerais.php @@ -2704,7 +2704,7 @@ function cloneInlineSymbol($layern,$nmapa,$mapa){ //recupera um mapfile armazenado no banco de dados de administracao //ver admin/php/mapas.php salvaMapfile function restauraMapaAdmin($id_mapa,$dir_tmp){ - include(dirname(__FILE__)."/../admin/php/conexao.php"); + include(dirname(__FILE__)."/../admin/php/conexao.php"); if(!empty($esquemaadmin)){ $esquemaadmin = str_replace(".","",$esquemaadmin)."."; } diff --git a/ferramentas/saiku/esquemaxml.php b/ferramentas/saiku/esquemaxml.php index 5b7052f..4fba321 100644 --- a/ferramentas/saiku/esquemaxml.php +++ b/ferramentas/saiku/esquemaxml.php @@ -1,5 +1,8 @@ ".var_dump($_SESSION);exit; + $regioes = $m->listaTipoRegiao(); $xml = ""; //cria as dimensoes de tipo temporal $sqlAno = "select nu_ano from i3geo_metaestat.dim_tempo group by nu_ano order by nu_ano"; $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"; $xml .= " - + $sqlAno diff --git a/ferramentas/saiku/index.js b/ferramentas/saiku/index.js index 87d90f1..1aa31ed 100755 --- a/ferramentas/saiku/index.js +++ b/ferramentas/saiku/index.js @@ -140,6 +140,6 @@ i3GEOF.saiku = { i3GEOF.saiku.inicia(divid); }, aplicar: function(){ - window.open("http://localhost:9090"); + window.open("http://localhost:9090?"+i3GEO.configura.sid); } }; diff --git a/ferramentas/saiku/instal.txt b/ferramentas/saiku/instal.txt index 0b73608..1cd8ae6 100644 --- a/ferramentas/saiku/instal.txt +++ b/ferramentas/saiku/instal.txt @@ -1,5 +1,7 @@ Roteiro para instalação e configuração do SAIKU para uso com o i3Geo. +O SAIKU só irá funcionar no Linux!!! + Para mais informações veja em: http://docs.analytical-labs.com/ - 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/ e modifique o valor da porta se achar necessário -- Configure o arquivo de conexão com a fonte de dados - - Copie o arquivo "i3geo" localizado em - - /var/www/i3geo/ferramentas/saiku - - (c:\\ms4w\Apache\htdocs\i3geo\ferramentas\saiku no Windows) +- Fontes de dados - para a pasta: + O i3Geo cria arquivos de fontes de dados em uma pasta temporária. Essa pasta é criada quando o i3Geo é inicializado. + (/tmp/ms_tmp/saikudatasources por padrão) - saiku-server/tomcat/webapps/saiku/WEB-INF/classes/saiku-datasources + Para que o SAIKU veja essa pasta é necessário criar um link simbólico apnotando para ela - Esse arquivo indica qual a fonte de dados que será usada. Altere os valores conforme sua necessidade, por exemplo: + Esse link deve ser criado na pasta /var/www/saiku-server/tomcat/webapps/saiku/WEB-INF/classes - No lugar de localhost coloque o endereço do banco de dados Postgres + Commando do Linux: - No lugar de i3geosaude coloque o nome do banco de dados onde estão as tabelas utilizadas pelo i3Geo + (/var/www/saiku-server é a pasta onde vc inatalou o SAIKU) + (/var/tmp/ms_tmp é a pasta temporária utilizada pelo i3Geo) - No lugar de http://localhost/i3geo/ferramentas/saiku/esquemaxml.php coloque o endereço (URL) completo do arquivo i3geo/ferramentas/saiku/esquemaxml.php + rm -R -f /var/www/saiku-server/tomcat/webapps/saiku/WEB-INF/classes/saiku-datasources + ln -s /tmp/ms_tmp/saiku-datasources /var/www/saiku-server/tomcat/webapps/saiku/WEB-INF/classes/saiku-datasources - No lugar de postgres coloque os nomes de usuário e senha para conexão com o banco de dados - Arquivos alterados @@ -53,6 +51,6 @@ Para mais informações veja em: http://docs.analytical-labs.com/ http://localhost:9090/ - Se tudo estiver ok, deve aparecer ua tela de login. Utilize admin como usuário e admin como senha + Se tudo estiver ok, deve aparecer na tela de login. Utilize admin como usuário e admin como senha diff --git a/ferramentas/saiku/saiku-server/tomcat/webapps/ROOT/js/saiku/Settings.js b/ferramentas/saiku/saiku-server/tomcat/webapps/ROOT/js/saiku/Settings.js deleted file mode 100755 index ae7a298..0000000 --- a/ferramentas/saiku/saiku-server/tomcat/webapps/ROOT/js/saiku/Settings.js +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright 2012 OSBI Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Change settings here - */ - -var Settings = { - //parametros do i3geo - I3GEOURL: window.location.protocol+"//"+window.location.hostname+"/i3geo", - I3GEOSID: window.location.search.replace("?",""), - // - VERSION: "Saiku 2.5", - BIPLUGIN: false, - BASE_URL: "", - TOMCAT_WEBAPP: "/saiku", - REST_MOUNT_POINT: "/rest/saiku/", - DIMENSION_PREFETCH: true, - ERROR_LOGGING: false, - // number of erroneous ajax calls in a row before UI cant recover - ERROR_TOLERANCE: 3, - QUERY_PROPERTIES: { - 'saiku.olap.query.automatic_execution': 'true', - 'saiku.olap.query.nonempty': 'true', - 'saiku.olap.query.nonempty.rows': 'true', - 'saiku.olap.query.nonempty.columns': 'true', - 'saiku.ui.render.mode' : 'table' - }, - /* Valid values for CELLSET_FORMATTER: - * 1) flattened - * 2) flat - */ - CELLSET_FORMATTER: "flattened", - // limits the number of rows in the result - // 0 - no limit - RESULT_LIMIT: 0, - MEMBERS_FROM_RESULT: true, - PLUGINS: [ - "Chart" - ], - TELEMETRY_SERVER: 'http://telemetry.analytical-labs.com:7000', - LOCALSTORAGE_EXPIRATION: 10 * 60 * 60 * 1000 /* 10 hours, in ms */ -}; - -/** - * Extend settings with query parameters - */ -Settings.GET = function () { - var qs = document.location.search; - qs = qs.split("+").join(" "); - var params = {}, - tokens, - re = /[?&]?([^=]+)=([^&]*)/g; - - while (tokens = re.exec(qs)) { - var value = decodeURIComponent(tokens[2]); - if (! isNaN(value)) value = parseInt(value); - if (value === "true") value = true; - if (value === "false") value = false; - params[decodeURIComponent(tokens[1]).toUpperCase()] - = value; - } - - return params; -}(); -_.extend(Settings, Settings.GET); - -Settings.REST_URL = Settings.BASE_URL - + Settings.TOMCAT_WEBAPP - + Settings.REST_MOUNT_POINT; - -// lets assume we dont need a min width/height for table mode -if (Settings.MODE == "table") { - Settings.DIMENSION_PREFETCH = false; - $('body, html').css('min-height',0); - $('body, html').css('min-width',0); - -} - - -/** - * < IE9 doesn't support Array.indexOf - */ -if (!Array.prototype.indexOf) -{ - Array.prototype.indexOf = function(elt /*, from*/) - { - var len = this.length >>> 0; - - var from = Number(arguments[1]) || 0; - from = (from < 0) - ? Math.ceil(from) - : Math.floor(from); - if (from < 0) - from += len; - - for (; from < len; from++) - { - if (from in this && - this[from] === elt) - return from; - } - return -1; - }; -} - -var tagsToReplace = { - '&': '&', - '<': '<', - '>': '>' -}; - -function replaceTag(tag) { - return tagsToReplace[tag] || tag; -} - -function safe_tags_replace(str) { - return str.replace(/[&<>]/g, replaceTag); -} - -if ($.blockUI) { - $.blockUI.defaults.css = {}; - $.blockUI.defaults.overlayCSS = {}; - $.blockUI.defaults.blockMsgClass = 'processing'; - $.blockUI.defaults.fadeOut = 0; - $.blockUI.defaults.fadeIn = 0; - $.blockUI.defaults.ignoreIfBlocked = false; - -} -//original alterado por Edmar Moretti -/* -if (window.location.hostname && (window.location.hostname == "dev.analytical-labs.com" || window.location.hostname == "demo.analytical-labs.com" )) { - Settings.USERNAME = "admin"; - Settings.PASSWORD = "admin"; -} -*/ -Settings.USERNAME = "admin"; -Settings.PASSWORD = "admin"; - -var isIE = (function(){ - var undef, v = 3, div = document.createElement('div'); - - while ( - div.innerHTML = '', - div.getElementsByTagName('i')[0] - ); - - return v> 4 ? v : false; -}()); diff --git a/mashups/openlayers.php b/mashups/openlayers.php index a008c28..b44c854 100644 --- a/mashups/openlayers.php +++ b/mashups/openlayers.php @@ -9,7 +9,8 @@ error_reporting(0); // //recupera um mapa salvo no banco de administracao // -if(!empty($restauramapa)){ +if(!empty($restauramapa)){ + include_once(dirname(__FILE__)."/../classesphp/funcoes_gerais.php"); $xbase = restauraMapaAdmin($restauramapa,$dir_tmp); $m = ms_newMapObj($xbase); $w = $m->web; diff --git a/ms_configura.php b/ms_configura.php index 59e42a3..51eb128 100644 --- a/ms_configura.php +++ b/ms_configura.php @@ -63,6 +63,14 @@ $i3geomaster = array( array("usuario"=>"admin", "senha"=>"admin") ); /* +Variable: saikuUrl + +URL para acessar o aplicativo SAIKU. Se nao estiver instalado, deixe em branco + +Para maiores informacoes sobre como instalar o SAIKU veja em http://localhost/i3geo/ferramentas/saiku/instal.txt +*/ +$saikuUrl = "http://localhost:9090"; +/* Variable: i3georendermode Opcoes que definem a rotina que sera utilizada para enviar ao navegador as imagens geradas de cada camada diff --git a/ms_criamapa.php b/ms_criamapa.php index 2343fbb..356e866 100644 --- a/ms_criamapa.php +++ b/ms_criamapa.php @@ -1213,6 +1213,10 @@ function criaDirMapa($dir_tmp,$cachedir="") $mapfile = $dir_tmp."/".$tmpdirname."/".$tmpdirname.".map"; $tmpimgname = "img".$tmpdirname; @mkdir($dir_tmp."/comum",0777); + //utilizado para armazenar os arquivos de fonte de dados do SAIKU + @mkdir($dir_tmp."/saiku-datasources",0777); + chmod($dir_tmp."/saiku-datasources",0777); + // if($cachedir == ""){ @mkdir($dir_tmp."/cache",0777); chmod($dir_tmp."/cache",0777); diff --git a/testainstal.php b/testainstal.php index f7b7cbb..d84c4da 100644 --- a/testainstal.php +++ b/testainstal.php @@ -101,19 +101,19 @@ include_once("classesphp/funcoes_gerais.php"); $versao = versao(); $versao = $versao["principal"]; $exts = get_loaded_extensions(); +if(!function_exists("ms_GetVersion")) +{echo "

PARECE QUE O MAPSERVER NAO ESTA INSTALADO!!!

";} echo "MapServer (a versão deve ser >= 5.2 para que a sobreposição de temas funcione na interface Google Maps):
"; echo "Versão:
"; -echo ms_GetVersion(); +echo @ms_GetVersion(); echo "

"; var_dump (versao())."

"; -if(!function_exists("ms_GetVersion")) -{echo "PARECE QUE O MAPSERVER NAO ESTA INSTALADO!!!

";} + echo "
---
"; if (get_cfg_var("safe_mode") == 1){ echo "Problema: safe_mode no php.ini deveria estar como 'Off'. O i3Geo não irá funcionar!!!
"; } - //executa as opcoes linux definidas no formulario if(!empty($_POST["criaPastaMstmp"]) && $_POST["criaPastaMstmp"] == "on"){ echo "
Criando a pasta $dir_tmp \n"; @@ -156,6 +156,9 @@ if(!empty($_POST["criaPastaMstmp"]) && $_POST["permPastaI3geo"] == "on"){ echo "...OK\n"; } } +if(empty($saikuUrl)){ + echo "
O aplicativo SAIKU não está instalado. Se você quiser instalar veja mais detalhes em i3geo/ferramentas/saiku/instal.txt
"; +} echo "
Extensões:
"; if (!extension_loaded("curl")){ echo "Problema: não está instalado a curl que pode afetar algumas funcionalidades do i3Geo
"; -- libgit2 0.21.2