Commit 07763181a909632c7bc3f33ba280f81ceca6a49f
1 parent
71c607d3
Exists in
master
Script para instalação do i3Geo no live dvd da Osgeo
Showing
2 changed files
with
321 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,195 @@ |
| 1 | +<?php | |
| 2 | +// | |
| 3 | +//Abre o Recline com base em um servico enviado pela URL | |
| 4 | +//utilize &url= para indicar a url do servico que retorna os dados no padrao gdocs | |
| 5 | +// | |
| 6 | + | |
| 7 | +//pega a extensao geografica da camada | |
| 8 | +include("../../ms_configura.php"); | |
| 9 | +include("../../classesphp/pega_variaveis.php"); | |
| 10 | +?> | |
| 11 | +<!DOCTYPE html> | |
| 12 | +<html lang="en"> | |
| 13 | +<head> | |
| 14 | +<meta charset="utf-8" /> | |
| 15 | +<title>Recline.js Multiview</title> | |
| 16 | +<link rel="stylesheet" type="text/css" href="../../admin/html/admin.css"> | |
| 17 | +<!-- you do not have to use bootstrap but we use it by default --> | |
| 18 | + | |
| 19 | +<link rel="stylesheet" href="../../pacotes/knightlab/recline/vendor/bootstrap/3.2.0/css/bootstrap.css"> | |
| 20 | +<!-- vendor css --> | |
| 21 | +<link href="../../pacotes/knightlab/recline/vendor/leaflet/0.7.3/leaflet.css" rel="stylesheet"> | |
| 22 | +<link href="../../pacotes/knightlab/recline/vendor/leaflet.markercluster/MarkerCluster.css" rel="stylesheet"> | |
| 23 | +<link href="../../pacotes/knightlab/recline/vendor/leaflet.markercluster/MarkerCluster.Default.css" rel="stylesheet"> | |
| 24 | +<link rel="stylesheet" href="../../pacotes/knightlab/recline/vendor/slickgrid/2.2/slick.grid.css"> | |
| 25 | +<link rel="stylesheet" href="../../pacotes/knightlab/recline/vendor/timeline/css/timeline.css"> | |
| 26 | + | |
| 27 | +<!-- recline css --> | |
| 28 | +<link href="../../pacotes/knightlab/recline/css/map.css" rel="stylesheet"> | |
| 29 | +<link href="../../pacotes/knightlab/recline/css/multiview.css" rel="stylesheet"> | |
| 30 | +<link href="../../pacotes/knightlab/recline/css/slickgrid.css" rel="stylesheet"> | |
| 31 | +<link href="../../pacotes/knightlab/recline/css/flot.css" rel="stylesheet"> | |
| 32 | +<link rel="stylesheet" href="../../pacotes/knightlab/recline/css/timeline.css"> | |
| 33 | + | |
| 34 | +<!-- Vendor JS - general dependencies --> | |
| 35 | +<script src="../../pacotes/knightlab/recline/vendor/jquery/1.7.1/jquery.js" type="text/javascript"></script> | |
| 36 | +<script src="../../pacotes/knightlab/recline/vendor/underscore/1.4.4/underscore.js" type="text/javascript"></script> | |
| 37 | +<!--<script src="vendor/underscore.deferred/0.4.0/underscore.deferred.js" type="text/javascript"></script>--> | |
| 38 | +<script src="../../pacotes/knightlab/recline/vendor/backbone/1.0.0/backbone.js" type="text/javascript"></script> | |
| 39 | +<script src="../../pacotes/knightlab/recline/vendor/mustache/0.5.0-dev/mustache.js" type="text/javascript"></script> | |
| 40 | +<script src="../../pacotes/knightlab/recline/vendor/bootstrap/3.2.0/js/bootstrap.js" type="text/javascript"></script> | |
| 41 | + | |
| 42 | +<!-- Vendor JS - view dependencies --> | |
| 43 | +<script src="../../pacotes/knightlab/recline/vendor/leaflet/0.7.3/leaflet.js" type="text/javascript"></script> | |
| 44 | +<script src="../../pacotes/knightlab/recline/vendor/leaflet.markercluster/leaflet.markercluster.js" type="text/javascript"></script> | |
| 45 | +<script type="text/javascript" src="../../pacotes/knightlab/recline/vendor/flot/jquery.flot.js"></script> | |
| 46 | +<script type="text/javascript" src="../../pacotes/knightlab/recline/vendor/flot/jquery.flot.time.js"></script> | |
| 47 | +<script type="text/javascript" src="../../pacotes/knightlab/recline/vendor/moment/2.0.0/moment.js"></script> | |
| 48 | +<script type="text/javascript" src="../../pacotes/knightlab/recline/vendor/timeline/js/timeline.js"></script> | |
| 49 | + | |
| 50 | +<script src="../../pacotes/knightlab/recline/vendor/slickgrid/2.2/jquery-ui-1.8.16.custom.min.js"></script> | |
| 51 | +<script src="../../pacotes/knightlab/recline/vendor/slickgrid/2.2/jquery.event.drag-2.2.js"></script> | |
| 52 | +<script src="../../pacotes/knightlab/recline/vendor/slickgrid/2.2/jquery.event.drop-2.2.js"></script> | |
| 53 | +<script src="../../pacotes/knightlab/recline/vendor/slickgrid/2.2/slick.core.js"></script> | |
| 54 | +<script src="../../pacotes/knightlab/recline/vendor/slickgrid/2.2/slick.formatters.js"></script> | |
| 55 | +<script src="../../pacotes/knightlab/recline/vendor/slickgrid/2.2/slick.editors.js"></script> | |
| 56 | +<script src="../../pacotes/knightlab/recline/vendor/slickgrid/2.2/slick.grid.js"></script> | |
| 57 | +<script src="../../pacotes/knightlab/recline/vendor/slickgrid/2.2/plugins/slick.rowselectionmodel.js" type="text/javascript"></script> | |
| 58 | +<script src="../../pacotes/knightlab/recline/vendor/slickgrid/2.2/plugins/slick.rowmovemanager.js" type="text/javascript"></script> | |
| 59 | + | |
| 60 | +<!-- Recline JS (combined distribution, all views) --> | |
| 61 | +<script src="../../pacotes/knightlab/recline/dist/recline.js" type="text/javascript"></script> | |
| 62 | +</head> | |
| 63 | +<body class=" yui-skin-sam"> | |
| 64 | + <div class="borda"> | |
| 65 | + <div style="text-align: center"> | |
| 66 | + <a href="http://www.softwarepublico.gov.br" target="_blank" style="color: white;"> | |
| 67 | + <b>ReclineJS</b> | |
| 68 | + </a> | |
| 69 | + </div> | |
| 70 | + </div> | |
| 71 | + <div id=i3geoSelTemaAtivo style="height: 15em; z-index: 3000; display: none" class=" yui-skin-sam"></div> | |
| 72 | + <br> | |
| 73 | + <br> | |
| 74 | + <div class="container-fluid" style="height: 100%"> | |
| 75 | +<style> | |
| 76 | +.recline-slickgrid { | |
| 77 | + height: 300px; | |
| 78 | +} | |
| 79 | +</style> | |
| 80 | + <div class="row"> | |
| 81 | + <div class="col-sm-8"> | |
| 82 | + <div class="data-explorer-here"></div> | |
| 83 | + <div style="clear: both;"></div> | |
| 84 | + </div> | |
| 85 | + </div> | |
| 86 | + | |
| 87 | + <script> | |
| 88 | +//define como variavel global | |
| 89 | +var dadosJ; | |
| 90 | +returnData = function(dataFromJsonp){ | |
| 91 | + dadosJ = dataFromJsonp; | |
| 92 | + jQuery(function($) { | |
| 93 | + window.multiView = null; | |
| 94 | + window.explorerDiv = $('.data-explorer-here'); | |
| 95 | + | |
| 96 | + // create the demo dataset | |
| 97 | + var dataset = createDataset(dadosJ); | |
| 98 | + // now create the multiview | |
| 99 | + // this is rather more elaborate than the minimum as we configure the | |
| 100 | + // MultiView in various ways (see function below) | |
| 101 | + window.multiview = createMultiView(dataset); | |
| 102 | + | |
| 103 | + // last, we'll demonstrate binding to changes in the dataset | |
| 104 | + // this will print out a summary of each change onto the page in the | |
| 105 | + // changelog section | |
| 106 | + dataset.records.bind('all', function(name, obj) { | |
| 107 | + var $info = $('<div />'); | |
| 108 | + $info.html(name + ': ' + JSON.stringify(obj.toJSON())); | |
| 109 | + $('.changelog').append($info); | |
| 110 | + $('.changelog').show(); | |
| 111 | + }); | |
| 112 | + }); | |
| 113 | +}; | |
| 114 | + | |
| 115 | +// create standard demo dataset | |
| 116 | +function createDataset(data) { | |
| 117 | + var dataset = new recline.Model.Dataset(data); | |
| 118 | + return dataset; | |
| 119 | +} | |
| 120 | + | |
| 121 | +// make MultivView | |
| 122 | +// | |
| 123 | +// creation / initialization in a function so we can call it again and again | |
| 124 | +var createMultiView = function(dataset, state) { | |
| 125 | + // remove existing multiview if present | |
| 126 | + var reload = false; | |
| 127 | + if (window.multiView) { | |
| 128 | + window.multiView.remove(); | |
| 129 | + window.multiView = null; | |
| 130 | + reload = true; | |
| 131 | + } | |
| 132 | + | |
| 133 | + var $el = $('<div />'); | |
| 134 | + $el.appendTo(window.explorerDiv); | |
| 135 | + | |
| 136 | + // customize the subviews for the MultiView | |
| 137 | + var views = [ | |
| 138 | + { | |
| 139 | + id: 'grid', | |
| 140 | + label: 'Tabela', | |
| 141 | + view: new recline.View.SlickGrid({ | |
| 142 | + model: dataset, | |
| 143 | + state: { | |
| 144 | + gridOptions: { | |
| 145 | + editable: true, | |
| 146 | + // Enable support for row add | |
| 147 | + enabledAddRow: true, | |
| 148 | + // Enable support for row delete | |
| 149 | + enabledDelRow: true, | |
| 150 | + // Enable support for row ReOrder | |
| 151 | + enableReOrderRow:true, | |
| 152 | + autoEdit: false, | |
| 153 | + enableCellNavigation: true | |
| 154 | + }, | |
| 155 | + columnsEditor: [ | |
| 156 | + { column: 'date', editor: Slick.Editors.Date }, | |
| 157 | + { column: 'sometext', editor: Slick.Editors.Text } | |
| 158 | + ] | |
| 159 | + } | |
| 160 | + }) | |
| 161 | + }, | |
| 162 | + { | |
| 163 | + id: 'graph', | |
| 164 | + label: 'Grafico', | |
| 165 | + view: new recline.View.Graph({ | |
| 166 | + model: dataset | |
| 167 | + | |
| 168 | + }) | |
| 169 | + }, | |
| 170 | + { | |
| 171 | + id: 'map', | |
| 172 | + label: 'Mapa (baseado na tabela)', | |
| 173 | + view: new recline.View.Map({ | |
| 174 | + model: dataset | |
| 175 | + }) | |
| 176 | + } | |
| 177 | + ]; | |
| 178 | + | |
| 179 | + var multiView = new recline.View.MultiView({ | |
| 180 | + model: dataset, | |
| 181 | + el: $el, | |
| 182 | + state: state, | |
| 183 | + views: views | |
| 184 | + }); | |
| 185 | + return multiView; | |
| 186 | +} | |
| 187 | +</script> | |
| 188 | + <?php | |
| 189 | + //inclui os dados via jsonp | |
| 190 | + $url = str_replace("urljson=","",$_SERVER["QUERY_STRING"]); | |
| 191 | + echo "<script src=".$url."&jsonp=returnData"." ></script>"; | |
| 192 | + ?> | |
| 193 | + </div> | |
| 194 | +</body> | |
| 195 | +</html> | ... | ... |
| ... | ... | @@ -0,0 +1,126 @@ |
| 1 | +#!/bin/bash | |
| 2 | +# Copyright (c) 2009-2010 The Open Source Geospatial Foundation. | |
| 3 | +# Licensed under the GNU LGPL version >= 2.1. | |
| 4 | +# | |
| 5 | +# This library is free software; you can redistribute it and/or modify it | |
| 6 | +# under the terms of the GNU Lesser General Public License as published | |
| 7 | +# by the Free Software Foundation, either version 2.1 of the License, | |
| 8 | +# or any later version. This library is distributed in the hope that | |
| 9 | +# it will be useful, but WITHOUT ANY WARRANTY, without even the implied | |
| 10 | +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
| 11 | +# See the GNU Lesser General Public License for more details, either | |
| 12 | +# in the "LICENSE.LGPL.txt" file distributed with this software or at | |
| 13 | +# web page "http://www.fsf.org/licenses/lgpl.html". | |
| 14 | +# | |
| 15 | +# Requires: svn apache2 php5 libapache2-mod-php5 cgi-mapserver mapserver-bin php5-mapscript | |
| 16 | +# php5-gd php5-sqlite php5-curl php5-json php5-odbc php5-pgsql php5-ps php5-xmlrpc php5-xsl php5-imagick php5-mbstring | |
| 17 | +# | |
| 18 | +# Uninstall: | |
| 19 | +# ============ | |
| 20 | +# sudo rm -rf /var/www/html/i3geo | |
| 21 | +# sudo rm -rf /var/www/html/ms_tmp | |
| 22 | +# sudo rm -rf /tmp/ms_tmp | |
| 23 | + | |
| 24 | +./diskspace_probe.sh "`basename $0`" begin | |
| 25 | +BUILD_DIR=`pwd` | |
| 26 | +#### | |
| 27 | + | |
| 28 | + | |
| 29 | +#OSGEO live username is "user" | |
| 30 | +if [ -z "$USER_NAME" ] ; then | |
| 31 | + USER_NAME="user" | |
| 32 | +fi | |
| 33 | + | |
| 34 | +#Repository url | |
| 35 | +I3GEO_DOWNLOAD_URL="http://devel.gvsig.org/svn/i3geo/i3geo60/" | |
| 36 | + | |
| 37 | +#i3GEO dependencies | |
| 38 | +I3GEO_DEPENDENCIES=(svn apache2 php5 libapache2-mod-php5 cgi-mapserver mapserver-bin php5-mapscript php5-gd php5-sqlite php5-curl php5-json php5-odbc php5-pgsql php5-ps php5-xmlrpc php5-xsl php5-imagick php5-mbstring) | |
| 39 | +#R_DEPENDENCIES=(r-cran-maptools) | |
| 40 | + | |
| 41 | +#Installation variables | |
| 42 | +ROOT_DIR="/var/www/html" | |
| 43 | +TMP_DIR="/tmp" | |
| 44 | +LOCAPLIC="$ROOT_DIR/i3geo" | |
| 45 | + | |
| 46 | + | |
| 47 | +#Temporary directory, symbolic link to temporary directory | |
| 48 | +mkdir "$TMP_DIR/ms_tmp" | |
| 49 | +ln -s "$TMP_DIR/ms_tmp" "$ROOT_DIR/ms_tmp" | |
| 50 | +#Temporary directory permissions | |
| 51 | +chown -R www-data:www-data "$TMP_DIR/ms_tmp" | |
| 52 | +chown -R www-data:www-data "$ROOT_DIR/ms_tmp" | |
| 53 | +chmod -R 755 "$TMP_DIR/ms_tmp" | |
| 54 | +chmod -R 755 "$ROOT_DIR/ms_tmp" | |
| 55 | + | |
| 56 | +#add R repository to have the latest version of R | |
| 57 | +#cd /etc/apt/ | |
| 58 | +#echo "deb http://cran.es.r-project.org/bin/linux/debian squeeze-cran/" >> sources.list | |
| 59 | +#apt-key adv --keyserver subkeys.pgp.net --recv-key 381BA480 | |
| 60 | +#apt-get update | |
| 61 | + | |
| 62 | +#Install i3geo dependencies | |
| 63 | +for i in "${I3GEO_DEPENDENCIES[@]}"; do | |
| 64 | + IS_INSTALLED=$(dpkg --get-selections | grep -w $i | grep -w install) | |
| 65 | + if [ -z "$IS_INSTALLED" ]; then | |
| 66 | + echo "Package $i is not installed" | |
| 67 | + echo "Installing $i ..." | |
| 68 | + apt-get -y install "$i" | |
| 69 | + else | |
| 70 | + echo "$i package is allready installed" | |
| 71 | + fi | |
| 72 | +done | |
| 73 | + | |
| 74 | +#Deploy i3geo | |
| 75 | +echo -n "Checkout i3Geo files" | |
| 76 | +cd "$ROOT_DIR" | |
| 77 | +svn checkout "$I3GEO_DOWNLOAD_URL" i3geo | |
| 78 | +echo -n "Done" | |
| 79 | + | |
| 80 | +#Change permissions | |
| 81 | +cd "$ROOT_DIR" | |
| 82 | +chown -R www-data i3geo/ | |
| 83 | +chgrp -R www-data i3geo/ | |
| 84 | +chmod -R 755 i3geo/ | |
| 85 | + | |
| 86 | + | |
| 87 | +# Reload Apache | |
| 88 | +/etc/init.d/apache2 force-reload | |
| 89 | + | |
| 90 | +### install desktop icon ## | |
| 91 | +echo "Installing i3geo desktop icon" | |
| 92 | +if [ ! -e "/usr/local/share/icons/i3Geo_big.png" ] ; then | |
| 93 | + mkdir -p /usr/local/share/icons | |
| 94 | + cp "$ROOT_DIR"/i3geo/imagens/i3Geo_big.png /usr/local/share/icons/ | |
| 95 | +fi | |
| 96 | + | |
| 97 | +#Add Launch icon to desktop | |
| 98 | +if [ ! -e /usr/local/share/applications/i3geo.desktop ] ; then | |
| 99 | + mkdir -p /usr/local/share/applications | |
| 100 | + cat << EOF > /usr/local/share/applications/i3geo.desktop | |
| 101 | +[Desktop Entry] | |
| 102 | +Type=Application | |
| 103 | +Encoding=UTF-8 | |
| 104 | +Name=i3geo | |
| 105 | +Comment=i3geo | |
| 106 | +Categories=Application;Geography;Geoscience;Education; | |
| 107 | +Exec=firefox http://localhost/i3geo | |
| 108 | +Icon=/usr/local/share/icons/i3Geo_big.png | |
| 109 | +Terminal=false | |
| 110 | +StartupNotify=false | |
| 111 | +EOF | |
| 112 | +fi | |
| 113 | + | |
| 114 | +# Add launcher into the Desktop folder | |
| 115 | +USER_HOME="/home/$USER_NAME" | |
| 116 | +USER_DESKTOP="$USER_HOME/Desktop/" | |
| 117 | +# Add desktop icon | |
| 118 | +if [ -d "$USER_DESKTOP" ] ; then | |
| 119 | + echo "Copying icon to desktop at $USER_DESKTOP" | |
| 120 | + cp /usr/local/share/applications/i3geo.desktop "$USER_DESKTOP/i3geo.desktop" | |
| 121 | + chown $USER_NAME:$USER_NAME "$USER_DESKTOP/i3geo.desktop" | |
| 122 | + chmod +x "$USER_DESKTOP/i3geo.desktop" | |
| 123 | +fi | |
| 124 | + | |
| 125 | +#### | |
| 126 | +#"$BUILD_DIR"/diskspace_probe.sh "`basename $0`" end | ... | ... |