Project

General

Profile

1
<?xml version="1.0" encoding="ISO-8859-1"?>
2

    
3
<!--
4
Description: parses an listing of OGC services from the Discovery Portal registry
5
Author:      adair
6
Licence:     LGPL as specified in http://www.gnu.org/copyleft/lesser.html .
7

    
8
$Id: owsCatSearchForm.xsl 3907 2008-03-06 10:27:06Z steven $
9
$Name:  $
10
-->
11

    
12
<xsl:stylesheet version="1.0" 
13
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
14
		xmlns:ogc="http://www.opengis.net/ogc"
15
		xmlns:gml="http://www.opengis.net/gml"
16
    xmlns:xlink="http://www.w3.org/1999/xlink">
17

    
18
  <xsl:output method="xml" omit-xml-declaration="yes" encoding="utf-8" indent="yes"/>
19

    
20
  <!-- The coordinates of the DHTML Layer on the HTML page -->
21
  <xsl:param name="modelTitle"/>
22
  <xsl:param name="modelId"/>
23
  <xsl:param name="widgetId"/>
24
  <xsl:param name="targetModelId"/>
25
  <xsl:param name="targetModel"/>
26
  <xsl:param name="lang">en</xsl:param>
27
  
28
  <xsl:param name="webServiceUrl">http://devgeo.cciw.ca/cgi-bin/mapserv/owscat</xsl:param>
29
  <xsl:param name="formName">owsCatSearch</xsl:param>
30
  <!-- NOTE: it's really bad form to put a hard-coded URL here, but it's the only way to use the document() function in IE -->
31
  <!--xsl:param name="searchConfigDoc" select="document('http://demo.communitymapbuilder.org/mapbuilder-lib-1.0-release/demo/contextEditor/searchConfig.xml')"/-->  
32
  <xsl:param name="searchConfigDoc" select="document('http://geodiscover.cgdi.ca/mapbuilder/demo/contextEditor/searchConfig.xml')"/>  
33
  <xsl:param name="selectSize" select="1"/>
34
  
35
  <!-- Text params for this widget -->
36
  <xsl:param name="north">North</xsl:param>
37
  <xsl:param name="south">South</xsl:param>
38
  <xsl:param name="east">East</xsl:param>
39
  <xsl:param name="west">West</xsl:param>
40
  
41
  <!-- template rule matching source root element -->
42
  <xsl:template match="/">
43
    <div>
44
    <h2>Search for layers</h2>
45
    <form name="{$formName}" id="{$formName}" method="get">
46
      <input type="hidden" name="version" value="1.0.0"/>
47
      <input type="hidden" name="service" value="WFS"/>
48
      <input type="hidden" name="request" value="GetFeature"/>
49
      <input type="hidden" name="typename" value="service_resources"/>
50
      <input type="hidden" name="outputFormat" value="GML3"/>
51
      
52
      <h3>Keywords</h3>
53
      <input type="text" name="keywords"/>
54
      <h3>Location</h3>
55
      <xsl:call-template name="locations">
56
        <xsl:with-param name="locationsDoc" select="$searchConfigDoc"/>
57
      </xsl:call-template>
58
      <xsl:call-template name="aoiBox"/>
59
      <h3>Service Type</h3>
60
      <select name="serviceType">
61
        <option></option>
62
        <option selected="true" value="OGC:WMS">WMS</option>
63
        <option value="OGC:WFS">WFS</option>
64
      </select>
65
      <input class="button" type="reset"/>
66
      <input class="button" type="submit"/>
67
      
68
    </form>
69
    </div>
70
  </xsl:template>
71

    
72
  <xsl:template name="locations">
73
    <xsl:param name="locationsDoc"/>
74
    <div>
75
      <select name="locations" onchange="config.objects.{$widgetId}.setLocation(this.options[this.selectedIndex].value);" size="{$selectSize}">
76
        <xsl:apply-templates select="$locationsDoc/searchConfig[@entryType='productCollection']/locations/location"/>
77
      </select>
78
    </div>
79
  </xsl:template>
80
  
81
  <xsl:template match="location">
82
    <xsl:param name="indent"/>
83
    <xsl:variable name="bbox" select="translate(wens,' ',',')"/>
84
    <option value="{$bbox}"><xsl:value-of select="$indent"/><xsl:value-of select="title[@lang=$lang]"/></option>
85
    <xsl:apply-templates select="location">
86
      <xsl:with-param name="indent"><xsl:value-of select="$indent"/>&#160;&#160;</xsl:with-param>
87
    </xsl:apply-templates>
88
  </xsl:template>
89
  
90
  <xsl:template name="aoiBox">
91
    <p>
92
      <table>
93
        <tr>
94
          <td align="left">or enter</td>
95
          <td><xsl:value-of select="$north"/></td>
96
          <td><xsl:value-of select="$south"/></td>
97
          <td><xsl:value-of select="$east"/></td>
98
          <td><xsl:value-of select="$west"/></td>
99
        </tr>
100
        <tr>
101
          <td>
102
          </td>
103
          <td>
104
            <input name="northCoord" type="text" size="10" class="searchInput"/>
105
          </td>
106
          <td>
107
            <input name="southCoord" type="text" size="10" class="searchInput"/>
108
          </td>
109
          <td>
110
            <input name="eastCoord" type="text" size="10"  class="searchInput"/>
111
          </td>
112
          <td>
113
            <input name="westCoord" type="text" size="10" class="searchInput"/>
114
          </td>
115
        </tr>
116
      </table>
117
    </p>
118
  </xsl:template>
119
  
120
  <xsl:template name="ntsInput">
121
    <p>or enter NTS mapsheet index
122
      <input name="ntsIndex" type="text" size="6" class="searchInput"/>
123
    </p>
124
  </xsl:template>
125
 
126
  <xsl:template match="text()|@*"/>
127

    
128
</xsl:stylesheet>
(12-12/14)