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$
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="no" 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
  <xsl:param name="searchConfigDoc" select="document('searchConfig.xml')"/>  
31
  <xsl:param name="selectSize" select="1"/>
32
  
33
  <!-- Text params for this widget -->
34
  <xsl:param name="north">North</xsl:param>
35
  <xsl:param name="south">South</xsl:param>
36
  <xsl:param name="east">East</xsl:param>
37
  <xsl:param name="west">West</xsl:param>
38
  
39
  <!-- template rule matching source root element -->
40
  <xsl:template match="/">
41
    <div>
42
    <form name="{$formName}" id="{$formName}" method="get">
43
      <input type="hidden" name="version" value="1.0.0"/>
44
      <input type="hidden" name="service" value="WFS"/>
45
      <input type="hidden" name="request" value="GetFeature"/>
46
      <input type="hidden" name="typename" value="service_resources"/>
47
      <input type="hidden" name="outputFormat" value="GML3"/>
48
      
49
      <h3>Keywords</h3>
50
      <input type="text" name="keywords"/>
51
      <h3>Location</h3>
52
      <xsl:call-template name="locations">
53
        <xsl:with-param name="locationsDoc" select="$searchConfigDoc"/>
54
      </xsl:call-template>
55
      <xsl:call-template name="aoiBox"/>
56
      <h3>Service Type</h3>
57
      <select name="serviceType">
58
        <option></option>
59
        <option selected="true">WMS</option>
60
        <option>WFS</option>
61
      </select>
62
      <input class="button" type="reset"/>
63
      <input class="button" type="submit"/>
64
      
65
    </form>
66
    </div>
67
  </xsl:template>
68

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

    
125
</xsl:stylesheet>
(8-8/10)