Changeset 7858


Ignore:
Timestamp:
Apr 22, 2010, 11:06:55 AM (15 years ago)
Author:
Pieter Naber
Message:

Handover documentation

Location:
trunk
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/INSTALL

    r7755 r7858  
    11Installing Nodemap 2.0
    22
     3=Introduction=
    34Nodemap2.0 is a PHP based script and will work on a webserver with PHP version 5.
    45
    56All the configuration of the application is done in the "config.php" file.
     7
     8=How to=
     9$svn checkout http://svn.wirelessleiden.nl/svn/projects/NodeMap2.0/trunk NodeMap2.0
     10$cd NodeMap2.0
     11
     12Alter the following config variables:
     13  - $config['node_status_file']         =       'http://watch.wirelessleiden.nl/nagios/export/node-status.csv';
     14  - $config['node_location_file']       =       'http://watch.wirelessleiden.nl/nagios/export/genesis-nodes.conf';
     15  - $config['mail']                                     =       'receipient@example.org';
     16  - $config['googlekey']['example.org'] = 'YOUR_GOOGLE_MAPS_API_KEY';
     17$nano config.php
  • trunk/README

    r7790 r7858  
    3131/src/logfile.txt        -> Main logging file with errors, warnings, etc.
    3232
     33= Hacking =
     34In src/inc/LogHandler.class.php you can edit the logging values:
     35define('LOG_LEVEL_ECHO', SYSLOG_DEBUG);
     36define('LOG_LEVEL_WRITE', SYSLOG_DEBUG);
     37define('LOG_LEVEL_MAIL', SYSLOG_EMERG);
     38
     39Use USB Webserver (www.usbwebserver.com) for testing under Windows systems
     40
     41Use Eclipse (www.eclipse.org) for editing the code for easy auto completion
     42
    3343= Credits =
    3444Application created as a project of Hogeschool Leiden by the students:
  • trunk/src/config.php

    r7847 r7858  
    1010$config['node_status_file']             =       'http://watch.wirelessleiden.nl/nagios/export/node-status.csv';
    1111$config['node_location_file']   =       'http://watch.wirelessleiden.nl/nagios/export/genesis-nodes.conf';
     12
     13// Overall values are using for centering the KML file on a initial location
    1214$config['overall_longitude']    =       4.490153;
    1315$config['overall_latitude']             =       52.161087;
  • trunk/src/inc/KMLFile.class.php

    r7788 r7858  
    197197                        // Looking for "location" of the node
    198198                        if (!$location = $this->findInLocationFile($file, 'location = ', $nodes[0][$i][1])) {
    199                                 trigger_log(SYSLOG_WARNING, 'Could not find the "location" of node "' . $i . '", skipping to next', __FILE__, __LINE__);
     199                                trigger_log(SYSLOG_ERROR, 'Could not find the "location" of node "' . $i . '", skipping to next', __FILE__, __LINE__);
    200200                                continue;
    201201                        }
    202202                        // Looking for "status" of the node
    203203                        if (!$status = $this->findInLocationFile($file, 'status = ', $nodes[0][$i][1])) {
    204                                 trigger_log(SYSLOG_WARNING, 'Could not find the "status" of node "' . $i . '", skipping to next', __FILE__, __LINE__);
     204                                trigger_log(SYSLOG_ERROR, 'Could not find the "status" of node "' . $i . '", skipping to next', __FILE__, __LINE__);
    205205                                continue;
    206206                        }
    207207                        // Looking for "latitude" of the node
    208208                        if (!$latitude = $this->findInLocationFile($file, 'latitude = ', $nodes[0][$i][1])) {
    209                                 trigger_log(SYSLOG_WARNING, 'Could not find the "latitude" of node "' . $i . '", skipping to next', __FILE__, __LINE__);
     209                                trigger_log(SYSLOG_ERROR, 'Could not find the "latitude" of node "' . $i . '", skipping to next', __FILE__, __LINE__);
    210210                                continue;
    211211                        }
    212212                        // Looking for "longitude" of the node
    213213                        if (!$longitude = $this->findInLocationFile($file, 'longitude = ', $nodes[0][$i][1])) {
    214                                 trigger_log(SYSLOG_WARNING, 'Could not find the "longitude" of node "' . $i . '", skipping to next', __FILE__, __LINE__);
     214                                trigger_log(SYSLOG_ERROR, 'Could not find the "longitude" of node "' . $i . '", skipping to next', __FILE__, __LINE__);
    215215                                continue;
    216216                        }
    217217                        // Looking for "interfaces" of the node
    218218                        if (!$interfaces = $this->findInLocationFile($file, 'interfaces = ', $nodes[0][$i][1])) {
    219                                 trigger_log(SYSLOG_WARNING, 'Could not find the "interfaces" of node "' . $i . '", skipping to next', __FILE__, __LINE__);
     219                                trigger_log(SYSLOG_ERROR, 'Could not find the "interfaces" of node "' . $i . '", skipping to next', __FILE__, __LINE__);
    220220                                continue;
    221221                        }
    222222                        // Looking for "masterip" of the node
    223223                        if (!$masterip = $this->findInLocationFile($file, 'masterip = ', $nodes[0][$i][1])) {
    224                                 trigger_log(SYSLOG_WARNING, 'Could not find the "masterip" of node "' . $i . '", skipping to next', __FILE__, __LINE__);
     224                                trigger_log(SYSLOG_ERROR, 'Could not find the "masterip" of node "' . $i . '", skipping to next', __FILE__, __LINE__);
    225225                                continue;
    226226                        }
    227227                        // Looking for "nodetype" of the node
    228228                        if (!$nodetype = $this->findInLocationFile($file, 'nodetype = ', $nodes[0][$i][1])) {
    229                                 trigger_log(SYSLOG_WARNING, 'Could not find the "nodetype" of node "' . $i . '", skipping to next', __FILE__, __LINE__);
     229                                trigger_log(SYSLOG_ERROR, 'Could not find the "nodetype" of node "' . $i . '", skipping to next', __FILE__, __LINE__);
    230230                                continue;
    231231                        }
    232232                        // Looking for "name" of the node
    233233                        if (!$name = $this->findInLocationFile($file, 'name = ', $nodes[0][$i][1])) {
    234                                 trigger_log(SYSLOG_WARNING, 'Could not find the "name" of node "' . $i . '", skipping to next', __FILE__, __LINE__);
     234                                trigger_log(SYSLOG_ERROR, 'Could not find the "name" of node "' . $i . '", skipping to next', __FILE__, __LINE__);
    235235                                continue;
    236236                        }
  • trunk/src/index.php

    r7839 r7858  
    11<?php
    2 require_once('config.php');
    3 require_once($config['root'] . '/map/inc/kmlHandler.php');
    4 require_once($config['root'] . '/map/inc/node_info_start.php');
    5 require_once($config['root'] . '/map/inc/search_node.php');
    6 
    7 // Getting array from kmlHandler
    8 $markers = get_node_array($config['kml_file']);
    9 
    10 // Key is defined to be the domain name if exists
    11 $apikey = $config['googlekey']['default'];
    12 $servername = $_SERVER['SERVER_NAME'];
    13 
    14 # Little hack, does not work with foo.co.uk domains
    15 $servername = implode('.',array_slice(explode('.',$servername),-2));
    16 if (array_key_exists($servername,$config['googlekey'])) {
    17         $apikey = $config['googlekey'][$servername];
    18 }
     2// Redirect to map
     3header('Location: map/');
    194?>
    20 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    21 <html lang="dutch">
    22 <head>
    23 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    24 <title>Nodemap Wireless Leiden</title>
    25 <!-- External stylesheet for all browsers -->
    26 <link href="style/stylesheet.css" rel="stylesheet" type="text/css">
    27 <!-- Using stylesheet2.css when browser is any version of Microsoft Internet Explorer -->
    28 <!--[if IE]>
    29         <link href="style/stylesheet2.css" rel="stylesheet" type="text/css">
    30 <![endif]-->
    31 
    32 <!-- Make our $marker[] array from kmlHandler available to javascript in JSON (No idea on how to this another less ugle way)-->
    33 <script type="text/javascript">
    34 var markers = <?php echo json_encode($markers); ?>;
    35 </script>
    36 
    37 <!-- Loading in the google-api -->
    38 <script
    39         src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=<?php print $apikey;?>"
    40         type="text/javascript"></script>
    41 <!-- Loading in the markerClusterer that will handle the clustering of markers. -->
    42 <script type="text/javascript" src="inc/markerClusterer.js"></script>
    43 <!-- Loading in the javascript that will add the map into #mapcanvas -->
    44 <script type="text/javascript" src="inc/nodemapWL.js"></script>
    45 <script type="text/javascript" src="inc/overlay.js"></script>
    46 <script type="text/javascript" src="inc/iconStyles.js"></script>
    47 
    48 <!-- Loading in the javascript that handles the switching between gebruiker and beheerder -->
    49 <script type="text/javascript" src="inc/gebruiker_beheerder_switch.js"></script>
    50 
    51 </head>
    52 <body onload="suggestMarkers('')">
    53 <!-- Mainwrapper contains all content on the page -->
    54 <div id="mainwrapper"><!-- Mapcanvas is the container where the map will be put in. Height and width of map is specified by size of the div -->
    55 <div id="mapcanvas"><!-- Create the map using the intitialize_map() function from nodemapWL.js -->
    56 <script type="text/javascript">initialize_map();</script> <!--<script type="text/javascript">nodeAdd();</script>-->
    57 </div>
    58 <div id="infowrapper"><!-- Top information space -->
    59 <div id="infotop"><!-- Calling on the node information from an external php file. inc/node_info.php -->
    60 <?php node_info_start(); ?></div>
    61 
    62 <!-- Bottom information space -->
    63 <div id="infobottom"><?php searchNodes(); ?>
    64 <div id="searchlist"></div>
    65 </div>
    66 <!-- The buttons under the searchframe. In a table for positioning. -->
    67 <div id="userpick">
    68 <table>
    69         <tr>
    70                 <!-- onclick events activate functions from within inc/gebruiker_beheerder_switch.js which load in the selected view with node_info.php -->
    71                 <td><input type="button" value="Gebruiker"
    72                         onclick="switchGebruiker();"></td>
    73                 <td><input type="button" value="Beheerder"
    74                         onclick="switchBeheerder();"></td>
    75         </tr>
    76 </table>
    77 </div>
    78 </div>
    79 
    80 <!-- General functions under the map -->
    81 <div id="navigation">
    82 <form action="">
    83 <table>
    84         <tr>
    85                 <!-- First colum -->
    86                 <td><input type="checkbox" value="shownodes"
    87                         onclick="toggleAllNodes();" checked="checked">Toon nodes</td>
    88                 <!-- Second colum -->
    89                 <td><input type="checkbox" value="showrange">Toon dekking <br>
    90                 <input type="checkbox" value="showtraffic">Toon dataverkeer</td>
    91                 <td><input type="checkbox" value="gsearchbar"
    92                         onclick="toggleGoogleSearchMap();">Toon locatie zoeken</td>
    93         </tr>
    94 </table>
    95 </form>
    96 </div>
    97 </div>
    98 </body>
    99 </html>
  • trunk/src/kml-echo.php

    r7799 r7858  
    1212header('Content-Type: text/xml');
    1313echo '<?xml version="1.0" encoding="UTF-8"?>';
     14// XXX: Doesn't show in Google Chrome
    1415
    1516// Let's try reading from files and parsing the data in the files.
  • trunk/src/map/inc/node_info.php

    r7847 r7858  
    66{
    77        setcookie("view", $_GET['view']);
     8        // Hack to make cookies work under Internet Explorer 7:
    89        header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"');
    910        $view = $_GET['view'];
     
    111112                </div>
    112113                <div id="timestamp">
    113                         Laatste update: 15:42 <br>
    114                         Do 25 maart
     114                        Laatste update: TO:DO <br>
     115                        Last update TODO
    115116                </div>
    116117EOF;
     118// TODO: Last update
    117119        }
    118120}       
  • trunk/src/map/inc/node_info_start.php

    r7828 r7858  
    99</div>
    1010<div id="timestamp">
    11         Laatste update: 15:42 <br>
    12         Do 25 maart
     11        Laatste update: TO:DO <br>
     12        Last update TODO
    1313</div>
    1414EOF;
     15// TODO: Last update
    1516}
    1617?>
Note: See TracChangeset for help on using the changeset viewer.