From 0aa8f66f1131d38f908f07d9e5805d75d66a8bc0 Mon Sep 17 00:00:00 2001
From: Edmar Moretti
Date: Tue, 21 Jun 2011 13:06:28 +0000
Subject: [PATCH] Opção de edição dos parâmetros descritivos do gerador de serviços OGC
---
admin/admin.db | Bin 71680 -> 0 bytes
admin/html/ogcws.html | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
admin/index.html | 13 +++++++++++++
admin/js/ogcws.js | 165 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
admin/php/ogcws.php | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
aplicmap/ogcws.map | 190 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------------------------------------------
6 files changed, 479 insertions(+), 77 deletions(-)
create mode 100644 admin/html/ogcws.html
create mode 100644 admin/js/ogcws.js
create mode 100644 admin/php/ogcws.php
diff --git a/admin/admin.db b/admin/admin.db
index e62f7f3..4a2a55a 100644
Binary files a/admin/admin.db and b/admin/admin.db differ
diff --git a/admin/html/ogcws.html b/admin/html/ogcws.html
new file mode 100644
index 0000000..f93a73f
--- /dev/null
+++ b/admin/html/ogcws.html
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
Administração do i3geo - Web Services OGC
+
+
+
Ajuda
+
+
Este formulário permite alterar as configurações de contato do gerador de Web Services
+
As mudanças incluídas aqui afetam o programa i3geo/ogc.php e são armazenadas em i3geo/aplicmpa/ogcws.map
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/index.html b/admin/index.html
index 0295ed8..fde5654 100644
--- a/admin/index.html
+++ b/admin/index.html
@@ -178,6 +178,19 @@ essa criação podem ser obtidos no item "Outras opções".
+Descrição dos serviços OGC
+
+
+
Parâmetros descritivos do gerador de serviços OGC mostrados na função getcapabilities.
+
+
+
+
+
+
Outras opções
diff --git a/admin/js/ogcws.js b/admin/js/ogcws.js
new file mode 100644
index 0000000..6b99a14
--- /dev/null
+++ b/admin/js/ogcws.js
@@ -0,0 +1,165 @@
+/*
+Title: ogcws.js
+
+Funções que controlam os parâmetros do ogcws.map utilizado no gerador de WMS/WFS
+
+Licenca:
+
+GPL2
+
+i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
+
+Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil
+Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br
+
+Este programa é software livre; você pode redistribuí-lo
+e/ou modificá-lo sob os termos da Licença Pública Geral
+GNU conforme publicada pela Free Software Foundation;
+
+Este programa é distribuído na expectativa de que seja útil,
+porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita
+de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA.
+Consulte a Licença Pública Geral do GNU para mais detalhes.
+Você deve ter recebido uma cópia da Licença Pública Geral do
+GNU junto com este programa; se não, escreva para a
+Free Software Foundation, Inc., no endereço
+59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
+
+Arquivo:
+
+i3geo/admin/js/ogcws.js
+*/
+YAHOO.namespace("example.container");
+/*
+Function: initMenu
+
+Inicializa o editor
+
+
+*/
+function initMenu()
+{
+ core_ativaPainelAjuda("ajuda","botaoAjuda");
+ new YAHOO.widget.Button("botao2",{ onclick: { fn: function(){window.open('../../testainstal.php') }} });
+ $parametros = {
+ "simples": [
+ {
+ mensagem: "ows_abstract",
+ cabeca: "Resumo",
+ variavel: "ows_abstract"
+ },
+ {
+ mensagem: "ows_keywordlist",
+ cabeca: "Palavras chave",
+ variavel: "ows_keywordlist"
+ },
+ {
+ mensagem: "ows_fees",
+ cabeca: "Taxas",
+ variavel: "ows_fees"
+ },
+ {
+ mensagem: "ows_accessconstraints",
+ cabeca: "Restrições",
+ variavel: "ows_accessconstraints"
+ },
+ {
+ mensagem: "ows_contactperson",
+ cabeca: "Pessoa de contato",
+ variavel: "ows_contactperson"
+ },
+ {
+ mensagem: "ows_contactorganization",
+ cabeca: "Organização",
+ variavel: "ows_contactorganization"
+ },
+ {
+ mensagem: "ows_contactposition",
+ cabeca: "Cargo",
+ variavel: "ows_contactposition"
+ },
+ {
+ mensagem: "ows_addresstype",
+ cabeca: "Tipo de endereço",
+ variavel: "ows_addresstype"
+ },
+ {
+ mensagem: "ows_address",
+ cabeca: "Endereço",
+ variavel: "ows_address"
+ },
+ {
+ mensagem: "ows_city",
+ cabeca: "Cidade",
+ variavel: "ows_city"
+ },
+ {
+ mensagem: "ows_stateorprovince",
+ cabeca: "Estado",
+ variavel: "ows_stateorprovince"
+ },
+ {
+ mensagem: "ows_postcode",
+ cabeca: "CEP",
+ variavel: "ows_postcode"
+ },
+ {
+ mensagem: "ows_country",
+ cabeca: "País",
+ variavel: "ows_country"
+ },
+ {
+ mensagem: "ows_contactelectronicmailaddress",
+ cabeca: "E-mail",
+ variavel: "ows_contactelectronicmailaddress"
+ },
+ {
+ mensagem: "ows_name",
+ cabeca: "Nome do serviço",
+ variavel: "ows_name"
+ }
+ ]};
+ core_carregando("ativa");
+ core_pegaDados("buscando parâmetros...","../php/ogcws.php?funcao=pegaParametrosConfigura","pegaParametros");
+}
+function pegaParametros(retorno)
+{
+ var ins = ""
+ for (i=0;i<$parametros.simples.length;i++)
+ {
+ ins += ""+$parametros.simples[i].cabeca+" "
+ ins += ""+$parametros.simples[i].mensagem+"
"
+ ins += ""
+ ins += " "
+ }
+ $i("tabela").innerHTML += ins
+ retorno.$postgis_mapa = "Esta variável só pode ser definida editando-se diretamente o arquivo ms_configura.php"
+ for (i=0;i<$parametros.simples.length;i++)
+ {
+ if($i($parametros.simples[i].variavel))
+ {$i($parametros.simples[i].variavel).value = retorno[$parametros.simples[i].variavel];}
+ }
+ core_carregando("desativa");
+}
+/*
+Function: salva
+
+Aplica as alterações feitas em uma variável
+
+
+*/
+function salva(variavel)
+{
+ if(variavel == "$postgis_mapa")
+ {alert("erro")}
+ else
+ {
+ var original = $i(variavel).value;
+ $i(variavel).value = "gravando...";
+ core_pegaDados("gravando...","../php/ogcws.php?funcao=salvaConfigura&variavel="+variavel+"&valor="+original,"")
+ $i(variavel).style.color = ""
+ $i(variavel).value = original;
+ }
+}
+YAHOO.util.Event.addListener(window, "load", initMenu);
\ No newline at end of file
diff --git a/admin/php/ogcws.php b/admin/php/ogcws.php
new file mode 100644
index 0000000..7d774ec
--- /dev/null
+++ b/admin/php/ogcws.php
@@ -0,0 +1,113 @@
+web;
+//faz a busca da função que deve ser executada
+switch (strtoupper($funcao))
+{
+ /*
+ Note:
+
+ Valores que o parâmetro &funcao pode receber. Os parâmetros devem ser enviados na requisição em AJAX.
+ */
+ /*
+ Valor: PEGAPARAMETROSCONFIGURA
+
+ Lista os valores atuais das variáveis registradas no ms_configura
+
+ Retorno:
+
+ {JSON}
+ */
+ case "PEGAPARAMETROSCONFIGURA":
+ $vs = array(
+ "ows_abstract",
+ "ows_keywordlist",
+ "ows_fees",
+ "ows_accessconstraints",
+ "ows_contactperson",
+ "ows_contactorganization",
+ "ows_contactposition",
+ "ows_addresstype",
+ "ows_address",
+ "ows_city",
+ "ows_stateorprovince",
+ "ows_postcode",
+ "ows_country",
+ "ows_contactelectronicmailaddress",
+ "ows_name"
+ );
+ $par = array();
+ foreach ($vs as $v)
+ {
+ $par[$v] = utf8_encode($web->metadata->get($v));
+ }
+ retornaJSON($par);
+ exit;
+ break;
+ /*
+ Valor: SALVACONFIGURA
+
+ Salva um novo valor de uma variável no ms_configura.php
+
+ Parameters:
+
+ variavel - nome da variável
+
+ valor - novo valor
+
+ Retorno:
+
+ {JSON}
+ */
+ case "SALVACONFIGURA":
+ $web->metadata->set($variavel,$valor);
+ $mapa->save($map_file);
+ retornaJSON("ok");
+ exit;
+ break;
+}
+
+?>
\ No newline at end of file
diff --git a/aplicmap/ogcws.map b/aplicmap/ogcws.map
index b783b51..bf32037 100644
--- a/aplicmap/ogcws.map
+++ b/aplicmap/ogcws.map
@@ -1,77 +1,113 @@
-MAP
- NAME "i3geoogc"
- PROJECTION
- "init=epsg:4291"
- END
- IMAGETYPE png
- IMAGECOLOR 255 255 255
- SIZE 450 450
- STATUS ON
- CONFIG "MS_NONSQUARE" "YES"
-
- OUTPUTFORMAT
- NAME "png"
- MIMETYPE "image/png"
- #DRIVER AGG/PNG
- DRIVER GD/PNG
- EXTENSION "png"
- IMAGEMODE RGBA
- TRANSPARENT ON
- FORMATOPTION "INTERLACE=OFF"
- END
- IMAGETYPE png
- CONFIG MS_ERRORFILE "/ms4w/tmp/ms_error.txt"
- DEBUG 5
- EXTENT -76.512593 -36.948432 -29.585185 7.046013
- SYMBOLSET ../symbols/simbolos.sym
- SHAPEPATH "/opt/www/html/geodados"
- FONTSET "../symbols/fontes.txt"
- LEGEND
- IMAGECOLOR 255 255 255
- KEYSIZE 10 10
- KEYSPACING 5 5
- LABEL
- SIZE 10
- FONT "verdana"
- TYPE truetype
- BUFFER 0
- COLOR 0 0 0
- FORCE FALSE
- MINDISTANCE -1
- MINFEATURESIZE -1
- OFFSET 0 0
- PARTIALS FALSE
- END
- POSITION UL
- STATUS on
- END
-
-WEB
- IMAGEPATH "/var/tmp/ms_tmp/"
- IMAGEURL "/ms_tmp/"
- TEMPLATE "none.htm"
- METADATA
- "ows_abstract" "Web services gerados da base de dados do i3Geo. Para chamar um tema especificamente, veja o sistema de ajuda, digitando no navegador web ogc.php?ajuda=, para uma lista compacta de todos os servicos, digite ogc.php?lista=temas"
- "ows_keywordlist" "i3Geo"
- "ows_fees" "none"
- "ows_accessconstraints" "vedado o uso comercial"
- "ows_contactperson" "Web Master"
- "ows_contactorganization" "Coordenação Geral de TI"
- "ows_contactposition" "Administrador do sítio web"
- "ows_addresstype" "uri"
- "ows_address" "http://www.mma.gov.br"
- "ows_city" "Brasilia"
- "ows_stateorprovince" "DF"
- "ows_postcode" ""
- "ows_country" "Brasil"
- "ows_contactelectronicmailaddress" "geoprocessamento@mma.gov.br"
- "ows_getcontext_enabled" "1"
- "ows_context_fid" "i3geo"
- "ows_context_version" "1.0.0"
- "ows_namespace_uri" "http://www.omsug.ca/osgis2004"
- "ows_name" "i3geoogc"
- END
- END
- # start of layer definitions
-
-END
+MAP
+ EXTENT -76.512593 -36.948432 -29.585185 7.046013
+ FONTSET "../symbols/fontes.txt"
+ IMAGECOLOR 255 255 255
+ IMAGETYPE png
+ SYMBOLSET "../symbols/simbolos.sym"
+ SHAPEPATH "/opt/www/html/geodados"
+ SIZE 450 450
+ STATUS ON
+ UNITS METERS
+ CONFIG MS_NONSQUARE "YES"
+ CONFIG MS_ERRORFILE "/ms4w/tmp/ms_error.txt"
+ NAME "i3geoogc"
+
+ DEBUG 5
+ OUTPUTFORMAT
+ NAME "png"
+ MIMETYPE "image/png"
+ DRIVER "GD/PNG"
+ EXTENSION "png"
+ IMAGEMODE "RGBA"
+ TRANSPARENT TRUE
+ FORMATOPTION "INTERLACE=OFF"
+ END
+
+ PROJECTION
+ "init=epsg:4291"
+ END
+ LEGEND
+ IMAGECOLOR 255 255 255
+ KEYSIZE 10 10
+ KEYSPACING 5 5
+ LABEL
+ ANGLE 0.000000
+ ANTIALIAS TRUE
+ FONT "verdana"
+ MAXSIZE 256
+ MINSIZE 4
+ SIZE 10
+ TYPE TRUETYPE
+ BUFFER 0
+ COLOR 0 0 0
+ FORCE FALSE
+ MINDISTANCE -1
+ MINFEATURESIZE -1
+ OFFSET 0 0
+ PARTIALS FALSE
+ END
+ POSITION UL
+ STATUS ON
+ END
+
+ QUERYMAP
+ COLOR 255 255 0
+ SIZE -1 -1
+ STATUS OFF
+ STYLE HILITE
+ END
+
+ SCALEBAR
+ ALIGN CENTER
+ COLOR 0 0 0
+ IMAGECOLOR 255 255 255
+ INTERVALS 4
+ LABEL
+ SIZE MEDIUM
+ TYPE BITMAP
+ BUFFER 0
+ COLOR 0 0 0
+ FORCE FALSE
+ MINDISTANCE -1
+ MINFEATURESIZE -1
+ OFFSET 0 0
+ PARTIALS TRUE
+ END
+ POSITION LL
+ SIZE 200 3
+ STATUS OFF
+ STYLE 0
+ UNITS MILES
+ END
+
+ WEB
+ IMAGEPATH "/var/tmp/ms_tmp/"
+ IMAGEURL "/ms_tmp/"
+ METADATA
+ "ows_country" "Brasil"
+ "ows_keywordlist" "i3Geo"
+ "ows_context_fid" "i3geo"
+ "ows_city" "Brasilia"
+ "ows_contactperson" "Web Master"
+ "ows_addresstype" "uri"
+ "ows_context_version" "1.0.0"
+ "ows_abstract" "Web services gerados da base de dados do i3Geo. Para chamar um tema especificamente, veja o sistema de ajuda, digitando no navegador web ogc.php?ajuda=, para uma lista compacta de todos os servicos, digite ogc.php?lista=temas"
+ "ows_contactposition" "Administrador do sítio web"
+ "ows_stateorprovince" "DF"
+ "ows_contactorganization" "Coordenação Geral de TI"
+ "ows_name" "i3geoogc"
+ "ows_accessconstraints" "vedado o uso comercial"
+ "ows_fees" "none"
+ "ows_contactelectronicmailaddress" "geoprocessamento@mma.gov.br"
+ "ows_getcontext_enabled" "1"
+ "ows_namespace_uri" "http://www.omsug.ca/osgis2004"
+ "ows_address" "http://www.mma.gov.br"
+ "ows_postcode" ""
+ END
+ QUERYFORMAT text/html
+ LEGENDFORMAT text/html
+ BROWSEFORMAT text/html
+ TEMPLATE "none.htm"
+ END
+
+END
--
libgit2 0.21.2