[mapserver-commits] r11028 - in trunk/msautotest/query: . expected template

svn at osgeo.org svn at osgeo.org
Sun Feb 27 13:52:11 EST 2011


Author: sdlime
Date: 2011-02-27 10:52:11 -0800 (Sun, 27 Feb 2011)
New Revision: 11028

Added:
   trunk/msautotest/query/expected/template_test001.html
   trunk/msautotest/query/template.map
   trunk/msautotest/query/template/html.tmpl
Log:
Start of a test to fully test new-style templated output.

Added: trunk/msautotest/query/expected/template_test001.html
===================================================================
--- trunk/msautotest/query/expected/template_test001.html	                        (rev 0)
+++ trunk/msautotest/query/expected/template_test001.html	2011-02-27 18:52:11 UTC (rev 11028)
@@ -0,0 +1,22 @@
+<html>
+  <head>
+    <title>HTML Test Template</title>
+  </head>
+  <body>
+    <div id="header">
+      This is the header section of the template. It should appear regardless. Many tags can be used here:<br/><br/>
+      mapext: 125000.000000 4785000.000000 789000.000000 5489000.000000<br/>       
+    </div>
+
+    <div class="layer-header">
+      This is the header section of a layer/resultset section. It should appear <b>only</b> if the layer has results.
+    </div>
+    Itasca:ITAS 
+    <div class="layer-footer">
+      This is the footer section of a layer/resultset section. It should appear <b>only</b> if the layer has results.
+    </div>
+
+<div class='nodata'>layer indx_q100kpy4 had no results</div>
+    <div id="footer">This is the footer section of the template. It should appear regardless.</div>
+  </body>
+</html>

Added: trunk/msautotest/query/template/html.tmpl
===================================================================
--- trunk/msautotest/query/template/html.tmpl	                        (rev 0)
+++ trunk/msautotest/query/template/html.tmpl	2011-02-27 18:52:11 UTC (rev 11028)
@@ -0,0 +1,31 @@
+<!-- MapServer Template -->
+<html>
+  <head>
+    <title>HTML Test Template</title>
+  </head>
+  <body>
+    <div id="header">
+      This is the header section of the template. It should appear regardless. Many tags can be used here:<br/><br/>
+      mapext: [mapext]<br/>       
+    </div>
+[resultset layer="bdry_counpy2"]
+    <div class="layer-header">
+      This is the header section of a layer/resultset section. It should appear <b>only</b> if the layer has results.
+    </div>
+    [feature][item name="cty_name"]:[item name="cty_abbr"] [/feature]
+    <div class="layer-footer">
+      This is the footer section of a layer/resultset section. It should appear <b>only</b> if the layer has results.
+    </div>
+[/resultset]
+[resultset layer="indx_q100kpy4" nodata="<div class='nodata'>layer indx_q100kpy4 had no results</div>"]
+    <div class="layer-header">
+      This is the header section of a layer/resultset section. It should appear <b>only</b> if the layer has results.
+    </div>
+    [feature]name:[item name="TILE_NAME"] [/feature]
+    <div class="layer-footer">
+      This is the footer section of a layer/resultset section. It should appear <b>only</b> if the layer has results.
+    </div>
+[/resultset]
+    <div id="footer">This is the footer section of the template. It should appear regardless.</div>
+  </body>
+</html>

Added: trunk/msautotest/query/template.map
===================================================================
--- trunk/msautotest/query/template.map	                        (rev 0)
+++ trunk/msautotest/query/template.map	2011-02-27 18:52:11 UTC (rev 11028)
@@ -0,0 +1,26 @@
+#
+# Test 1: simple mode=query, HTML template 
+# RUN_PARMS: template_test001.html [MAPSERV] QUERY_STRING='map=[MAPFILE]&mode=query&qlayer=bdry_counpy2&mapxy=467000+5259000&qformat=html' > [RESULT_DEMIME]
+#
+MAP
+  NAME 'query'
+  EXTENT 125000 4785000 789000 5489000
+  UNITS METERS
+
+  OUTPUTFORMAT
+    NAME 'html'
+    DRIVER 'TEMPLATE'
+    MIMETYPE 'text/html'
+    FORMATOPTION "FILE=template/html.tmpl"
+  END
+
+  LAYER
+    NAME 'bdry_counpy2'
+    INCLUDE 'include/bdry_counpy2_shapefile.map'
+  END
+
+  LAYER
+    NAME 'indx_q100kpy4'
+    INCLUDE 'include/indx_q100kpy4_shapefile.map'
+  END
+END



More information about the mapserver-commits mailing list