changeset 98:a403a5dd5b12

Merge with 93c5bd5a0bb8598e931dda90c4199e154a15ba28
author fknauft
date Wed, 26 Jan 2011 17:28:34 +0100
parents 72091a5cd57e (diff) 93c5bd5a0bb8 (current diff)
children 19983d06abdb
files gis_gui/head.pt gis_gui/intro.pt
diffstat 9 files changed, 53 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/.project	Wed Jan 12 10:32:20 2011 +0100
+++ b/.project	Wed Jan 26 17:28:34 2011 +0100
@@ -7,12 +7,19 @@
 	</projects>
 	<buildSpec>
 		<buildCommand>
-			<name>org.python.pydev.PyDevBuilder</name>
+			<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.common.project.facet.core.builder</name>
 			<arguments>
 			</arguments>
 		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.python.pydev.pythonNature</nature>
+		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+		<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
 	</natures>
 </projectDescription>
--- a/RestDbGisApi.py	Wed Jan 12 10:32:20 2011 +0100
+++ b/RestDbGisApi.py	Wed Jan 26 17:28:34 2011 +0100
@@ -190,24 +190,34 @@
         
         if (gisIdField is None) and (latField is None or lonField is None):
             # no fields given - choose automagically
+            sql = 'SELECT field_name FROM public.gis_table_meta_rows WHERE table_name = %s and gis_type = %s'
             # gis id in metadata first
-            #SQL='SELECT "attribute with gis_id" FROM public.metadata WHERE tablename = %s'
-            sql = 'SELECT field_name FROM public.gis_table_meta_rows WHERE table_name = %s and gis_type = %s'
             res = self.executeSQL(sql, (table,'gis_id'))
             if len(res['rows']) > 0:
                 gisIdField = res['rows'][0][0]
             else:
-                logging.warning("no entry in metadata table for table %s"%table)
-                # try field names
-                if 'latitude' in fieldMap and 'longitude' in fieldMap:
-                    latField = 'latitude'
-                    lonField = 'longitude'
-                elif 'x_coord' in fieldMap and 'y_coord' in fieldMap:
-                    latField = 'x_coord'
-                    lonField = 'y_coord'
-                else:
-                    logging.error("getKMLdata unable to find position fields")
-                    return None
+                # latitude in metadata
+                res = self.executeSQL(sql, (table,'coord_lat'))
+                if len(res['rows']) > 0:
+                    latField = res['rows'][0][0]
+                    # longitude in metadata
+                    res = self.executeSQL(sql, (table,'coord_lon'))
+                    if len(res['rows']) > 0:
+                        lonField = res['rows'][0][0]
+                        
+        if (gisIdField is None) and (latField is None or lonField is None):
+            logging.warning("no entry in metadata table for table %s" % table)
+            # still no fields - try field names
+            if 'latitude' in fieldMap and 'longitude' in fieldMap:
+                latField = 'latitude'
+                lonField = 'longitude'
+            elif 'x_coord' in fieldMap and 'y_coord' in fieldMap:
+                latField = 'x_coord'
+                lonField = 'y_coord'
+            else:
+                logging.error("getKMLdata unable to find position fields")
+                return None
+
         
         # convert field names to row indexes
         gisIdIdx = fieldMap.get(gisIdField,None)
--- a/gis_gui/blocks/layer.html.pt	Wed Jan 12 10:32:20 2011 +0100
+++ b/gis_gui/blocks/layer.html.pt	Wed Jan 26 17:28:34 2011 +0100
@@ -8,11 +8,9 @@
   
   <tal:block metal:fill-slot="menu">
   <ul id="account_menu">
-    <li> Save </li>
-    
+    <li> Save </li>    
     <li> Open </li>
-
-    <li> 
+    <li>  </li>
   </ul>
   </tal:block>
   
--- a/gis_gui/blocks/tablestructure.js	Wed Jan 12 10:32:20 2011 +0100
+++ b/gis_gui/blocks/tablestructure.js	Wed Jan 26 17:28:34 2011 +0100
@@ -14,7 +14,7 @@
         html += "</select>";
         return html;
     }
-    var block = this.addBlock(url, baseId, function() {
+    var block = this.addBlock(url, baseId, null, function() {
         // function after add block finished
         var id = block.id;
         var tbl = $(block.element).find(".datatable");
--- a/gis_gui/home.pt	Wed Jan 12 10:32:20 2011 +0100
+++ b/gis_gui/home.pt	Wed Jan 26 17:28:34 2011 +0100
@@ -41,7 +41,7 @@
       $(document).ready(function(){
       	var blockContainer = $("#moduleslot").get();
         blocks = new guiBlocks(blockContainer);
-       	blocks.addBlock("blocks/home.html?impermanent=false&title=home", "home");
+       	blocks.addBlock("blocks/home.html?title=home&impermanent=false","home");
        	guiBlocks_init();
         // add menubar
         $('div.menubar').livequery(function(){
Binary file gis_gui/icons/mappit_state.png has changed
--- a/gis_gui/intro.pt	Wed Jan 12 10:32:20 2011 +0100
+++ b/gis_gui/intro.pt	Wed Jan 26 17:28:34 2011 +0100
@@ -1,26 +1,30 @@
 <div class="intro">
-	<h2 >Welcome!</h2>
+	<h2>Welcome!</h2>
 	<div class="left_block" align="left">
-		<p> => This website offers you a platform for geographical representation and analysis of historical data. <br/>
-		    => The beta version is available for you to test and evaluate.</p>
+		<p> => This website offers you a platform for geographical representation and analysis of historical data.</p>
+		<p> => The beta version is available for you to test and evaluate.</p>
 		<p> => The diagram below shows which functions are already active.</p>
 	</div>
 	<div class="right_block" align="left">
 		<p>=><a href="./home">Login</a></p>
-		<p>=> First time here? <br/>
+		<p>=> First time here? <br />
 		   Then go to the<a href="#newbie-intro"> end of this page</a>.</p>
+
 	</div>
 </div>
-<div align="center"><img src="./icons/mappit_state.png" width="400" height="300" ></div>
+<div align="center">
+	<img src="./icons/mappit_state.png" width="600" height="450" />
+</div>
 <div class="intro">
 		<h3>Introduction for Newbies</h3>
 		<a name="newbie-intro"></a>
-		<div  align="left" style="padding-left:40px;">
+		<div align="left" style="padding-left:40px;">
 			<p>On this platform you can visualize and analyze the geographical aspects of historical data with spatial references.</p>
 			<p>The system works on the basis of the GoogleMaps API. </p>
-			<p>You can display pre-existing data as maps [Song Yingxing example] or input and process your own data [sample table in Excel]. 
+
+			<p>You can display pre-existing data as maps [Song Yingxing example] or input and process your own data <a href= "../mappit_samples/upload_sample.xml">[sample table, which can be edited using MS-Excel]</a>. 
 			Select your desired features for geographical analysis and save for future use!</p>
-			<p>In the beta phase, data is accessible to all registered users. To prevent your work from being altered or deleted, please save externally.</p> 
-			<p>To test the system, <a href="./home">login</a> as user <b>test</b> with the password <b>test</b> and get started now!</p>
+			<p>In the beta phase, data is accessible to all registered users. To prevent any loss of work, please maintain an external backup.</p> 
+			<p>You can email <a href="mappit@mpiwg-berlin.mpg.de">mappit@mpiwg-berlin.mpg.de</a> to request a personal login, or use the test account (user: test / password: test) to explore the platform right away</p>
 		</div>
 </div>
--- a/gis_gui/lib/blocks.css	Wed Jan 12 10:32:20 2011 +0100
+++ b/gis_gui/lib/blocks.css	Wed Jan 26 17:28:34 2011 +0100
@@ -39,7 +39,7 @@
 }
 
 div.block div.titlebar h1 {
-    font-size:20px;
+    font-size:18px;
     padding-top: 10px;
     padding-bottom: 10px;
     margin:0px;
@@ -130,8 +130,9 @@
     border: 1px solid black;
     background-color: #fff;
     text-align: center;
+    font-size: 14px;
     align: center;
-    height:250px;
+    height:1000px;
     padding:10px;
     margin-left:50px;
     margin-right:50px;
@@ -159,6 +160,7 @@
     height: 150px;
     background-color:#bbbbff;
     text-align: center;
+    margin-bottom: -120px;
 }
 
 #login {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gis_gui/upload_sample.xml	Wed Jan 26 17:28:34 2011 +0100
@@ -0,0 +1,1 @@
+<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 xmlns:html="http://www.w3.org/TR/REC-html40"
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
 <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
  <LastAuthor>admin</LastAuthor>
  <Version>11.1287</Version>
 </DocumentProperties>
 <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
  <AllowPNG/>
  <Colors>
   <Color>
    <Index>16</Index>
    <RGB>#9999FF</RGB>
   </Color>
   <Color>
    <Index>17</Index>
    <RGB>#993366</RGB>
   </Color>
   <Color>
    <Index>18</Index>
    <RGB>#FFFFCC</RGB>
   </Color>
   <Color>
    <Index>19</Index>
    <RGB>#CCFFFF</RGB>
   </Color>
   <Color>
    <Index>20</Index>
    <RGB>#660066</RGB>
   </Color>
   <Color>
    <Index>21</Index>
    <RGB>#FF8080</RGB>
   </Color>
   <Color>
    <Index>22</Index>
    <RGB>#0066CC</RGB>
   </Color>
   <Color>
    <Index>23</Index>
    <RGB>#CCCCFF</RGB>
   </Color>
   <Color>
    <Index>24</Index>
    <RGB>#000080</RGB>
   </Color>
   <Color>
    <Index>25</Index>
    <RGB>#FF00FF</RGB>
   </Color>
   <Color>
    <Index>26</Index>
    <RGB>#FFFF00</RGB>
   </Color>
   <Color>
    <Index>27</Index>
    <RGB>#00FFFF</RGB>
   </Color>
   <Color>
    <Index>28</Index>
    <RGB>#800080</RGB>
   </Color>
   <Color>
    <Index>29</Index>
    <RGB>#800000</RGB>
   </Color>
   <Color>
    <Index>30</Index>
    <RGB>#008080</RGB>
   </Color>
   <Color>
    <Index>31</Index>
    <RGB>#0000FF</RGB>
   </Color>
  </Colors>
 </OfficeDocumentSettings>
 <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
  <WindowHeight>9260</WindowHeight>
  <WindowWidth>21460</WindowWidth>
  <WindowTopX>0</WindowTopX>
  <WindowTopY>0</WindowTopY>
  <Date1904/>
  <AcceptLabelsInFormulas/>
  <ProtectStructure>False</ProtectStructure>
  <ProtectWindows>False</ProtectWindows>
 </ExcelWorkbook>
 <Styles>
  <Style ss:ID="Default" ss:Name="Normal">
   <Alignment ss:Vertical="Bottom"/>
   <Borders/>
   <Font ss:FontName="Verdana"/>
   <Interior/>
   <NumberFormat/>
   <Protection/>
  </Style>
  <Style ss:ID="s21">
   <Font ss:FontName="Verdana" ss:Size="8.0"/>
  </Style>
  <Style ss:ID="s22">
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Verdana" ss:Size="8.0"/>
  </Style>
  <Style ss:ID="s23">
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Verdana" ss:Size="8.0"/>
  </Style>
  <Style ss:ID="s24">
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Verdana" ss:Size="8.0"/>
  </Style>
  <Style ss:ID="s25">
   <Borders>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Verdana" ss:Size="8.0"/>
  </Style>
  <Style ss:ID="s26">
   <Borders>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Verdana" ss:Size="8.0"/>
  </Style>
  <Style ss:ID="s27">
   <Borders>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Verdana" ss:Size="8.0"/>
   <NumberFormat ss:Format="#,##0.000000"/>
  </Style>
  <Style ss:ID="s28">
   <Borders>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Verdana" ss:Size="8.0"/>
  </Style>
  <Style ss:ID="s29">
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Verdana" ss:Size="8.0"/>
   <NumberFormat ss:Format="@"/>
  </Style>
  <Style ss:ID="s30">
   <Borders>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"
     ss:Color="#000000"/>
   </Borders>
   <Font ss:FontName="Verdana" ss:Size="8.0"/>
   <NumberFormat ss:Format="@"/>
  </Style>
  <Style ss:ID="s31">
   <Font ss:FontName="Verdana" ss:Size="8.0"/>
   <NumberFormat ss:Format="@"/>
  </Style>
 </Styles>
 <Worksheet ss:Name="Tabelle1">
  <Table ss:ExpandedColumnCount="8" ss:ExpandedRowCount="7" x:FullColumns="1"
   x:FullRows="1" ss:StyleID="s21" ss:DefaultRowHeight="11.0">
   <Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="58.0"/>
   <Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="67.0"/>
   <Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="66.0" ss:Span="1"/>
   <Column ss:Index="5" ss:StyleID="s31" ss:AutoFitWidth="0" ss:Width="39.0"/>
   <Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="66.0"/>
   <Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="61.0" ss:Span="1"/>
   <Row ss:AutoFitHeight="0">
    <Cell ss:StyleID="s22"><Data ss:Type="String">External ID</Data></Cell>
    <Cell ss:StyleID="s23"><Data ss:Type="String">Location Name</Data></Cell>
    <Cell ss:StyleID="s23"><Data ss:Type="String">X-Coordinate</Data></Cell>
    <Cell ss:StyleID="s23"><Data ss:Type="String">Y-Coordinate</Data></Cell>
    <Cell ss:StyleID="s29"><Data ss:Type="String">GIS ID</Data></Cell>
    <Cell ss:StyleID="s23"><Data ss:Type="String">Object name</Data></Cell>
    <Cell ss:StyleID="s23"><Data ss:Type="String">Build after</Data></Cell>
    <Cell ss:StyleID="s24"><Data ss:Type="String">Area in sqm</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0">
    <Cell ss:StyleID="s25"><Data ss:Type="String">ERD-0815</Data></Cell>
    <Cell ss:StyleID="s26"><Data ss:Type="String">Beijing</Data></Cell>
    <Cell ss:StyleID="s27"><Data ss:Type="Number">39.914722</Data></Cell>
    <Cell ss:StyleID="s27"><Data ss:Type="Number">116.390556</Data></Cell>
    <Cell ss:StyleID="s30"><Data ss:Type="String"> 110000</Data></Cell>
    <Cell ss:StyleID="s26"><Data ss:Type="String">Forbidden City</Data></Cell>
    <Cell ss:StyleID="s26"><Data ss:Type="Number">1406.0</Data></Cell>
    <Cell ss:StyleID="s28"><Data ss:Type="Number">720000.0</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Span="3"/>
   <Row ss:Index="7" ss:AutoFitHeight="0">
    <Cell ss:Index="3"><Data ss:Type="String">*</Data></Cell>
   </Row>
  </Table>
  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>
    <Header x:Margin="0.511805555555556"/>
    <Footer x:Margin="0.511805555555556"/>
    <PageMargins x:Bottom="0.984027777777778" x:Left="0.747916666666667"
     x:Right="0.747916666666667" x:Top="0.984027777777778"/>
   </PageSetup>
   <Unsynced/>
   <Print>
    <ValidPrinterInfo/>
    <PaperSizeIndex>9</PaperSizeIndex>
    <HorizontalResolution>300</HorizontalResolution>
    <VerticalResolution>300</VerticalResolution>
   </Print>
   <Zoom>150</Zoom>
   <PageLayoutZoom>0</PageLayoutZoom>
   <Selected/>
   <Panes>
    <Pane>
     <Number>3</Number>
     <ActiveRow>11</ActiveRow>
     <ActiveCol>1</ActiveCol>
    </Pane>
   </Panes>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
 <Worksheet ss:Name="Tabelle2">
  <Table ss:ExpandedColumnCount="0" ss:ExpandedRowCount="0" x:FullColumns="1"
   x:FullRows="1" ss:DefaultRowHeight="12.0"/>
  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>
    <Header x:Margin="0.511805555555556"/>
    <Footer x:Margin="0.511805555555556"/>
    <PageMargins x:Bottom="0.984027777777778" x:Left="0.747916666666667"
     x:Right="0.747916666666667" x:Top="0.984027777777778"/>
   </PageSetup>
   <Unsynced/>
   <Print>
    <ValidPrinterInfo/>
    <PaperSizeIndex>9</PaperSizeIndex>
    <HorizontalResolution>300</HorizontalResolution>
    <VerticalResolution>300</VerticalResolution>
   </Print>
   <PageLayoutZoom>0</PageLayoutZoom>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
 <Worksheet ss:Name="Tabelle3">
  <Table ss:ExpandedColumnCount="0" ss:ExpandedRowCount="0" x:FullColumns="1"
   x:FullRows="1" ss:DefaultRowHeight="12.0"/>
  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>
    <Header x:Margin="0.511805555555556"/>
    <Footer x:Margin="0.511805555555556"/>
    <PageMargins x:Bottom="0.984027777777778" x:Left="0.747916666666667"
     x:Right="0.747916666666667" x:Top="0.984027777777778"/>
   </PageSetup>
   <Unsynced/>
   <Print>
    <ValidPrinterInfo/>
    <PaperSizeIndex>9</PaperSizeIndex>
    <HorizontalResolution>300</HorizontalResolution>
    <VerticalResolution>300</VerticalResolution>
   </Print>
   <PageLayoutZoom>0</PageLayoutZoom>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
</Workbook>
\ No newline at end of file