source: cows/trunk/cows/pylons/templates/wcs_capabilities_1_0_0.xml @ 4751

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows/trunk/cows/pylons/templates/wcs_capabilities_1_0_0.xml@4751
Revision 4751, 4.6 KB checked in by domlowe, 12 years ago (diff)

more template changes

Line 
1<?xml version="1.0"?>
2<!DOCTYPE WMT_MS_Capabilities SYSTEM
3 "http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd">
4
5<?python
6
7from cows.pylons.genshi_util import RenameElementFilter
8from genshi import QName
9import webhelpers as h
10
11?>
12
13<!--! TODO: This currently looks like WMS, change to WCS based on old kid template -->
14
15<WCS_Capabilities xmlns:py="http://genshi.edgewall.org/" xmlns="http://www.opengis.net/wcs" xmlns:gml="http://www.opengis.net/gml"
16                     version="1.0.0">
17
18  <!--! ====================================================================== -->
19  <!--!
20      To change the tag name we need to wrap a markup macro in a python
21      function
22  -->
23
24  <Operation py:def="_opContent(op)">
25    <Format py:for="f in op.parameters['Format'].possibleValues.allowedValues" py:content="f"/>
26    <DCPType><HTTP>
27      <Get>
28        <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" 
29                        xlink:href="${op.get.href}"/>
30      </Get>
31    </HTTP></DCPType>
32  </Operation>
33  <?python
34 
35  def markupOperation(opName, op):
36    """Render an OWS operation description for the Capabilities section.
37    """
38
39    return RenameElementFilter(QName(opName))(_opContent(op))
40
41  ?>
42
43  <CoverageOfferingBrief py:def="markupLayer(ds)">
44    <name py:content="ds.identifier"/>
45    <label py:content="ds.titles[0]"/>
46    <abstract py:if="len(ds.abstracts)>0" py:content="ds.abstracts[0]"/>
47    <SRS py:for="crs in ds.CRSs" py:content="crs"/>
48    <py:for each="bb in ds.boundingBoxes">
49          <lonLatEnvelope>
50                  <gml:pos>${'%.2f'%bb.lowerCorner[0]} ${'%.2f'%bb.lowerCorner[1]}</gml:pos>
51                  <gml:pos>${'%.2f'%bb.upperCorner[0]} ${'%.2f'%bb.upperCorner[1]}</gml:pos>
52                  <gml:timePosition>${ds.timeLimits[0] + 'Z'}</gml:timePosition>
53                  <gml:timePosition>${ds.timeLimits[1] + 'Z'}</gml:timePosition>
54          </lonLatEnvelope>     
55    </py:for>
56  </CoverageOfferingBrief>
57
58  <!--! ====================================================================== -->
59
60
61  <Service py:with="sm=c.capabilities; si=c.capabilities.serviceIdentification"> 
62    <description py:if="len(si.abstracts)>0" py:content="si.abstracts[0]"/>
63        <name>OGC:WMS</name>
64    <label py:content="si.titles[0]"/>
65    <keywords py:if="len(si.keywords) is not 0">
66      <keyword py:for="kw in si.keywords"
67               py:content="kw"/>
68    </keywords>
69
70    <responsibleParty py:if="sm.serviceProvider is not None"
71                        py:with="rp=sm.serviceProvider.serviceContact">
72        <individualName py:if="rp is not None" py:content="rp.individualName"/>
73        <organisationName py:content="sm.serviceProvider.providerName"/>
74      <positionName py:content="rp.positionName"/>
75
76     <py:with vars="cn=rp.contactInfo" py:if="cn is not None">
77<contactInfo>
78                <phone>
79                        <voice py:if="cn.phone is not None"
80                               py:content="cn.phone.voice"/>
81                        <facsimile py:if="cn.phone is not None"
82                                   py:content="cn.phone.facsimile"/>
83                </phone>
84                <address py:if="cn.address is not None">
85                        <deliveryPoint><py:for each="d in cn.address.deliveryPoints">${d}</py:for></deliveryPoint>
86                        <city py:content="cn.address.city"/>
87                        <administrativeArea py:content="cn.address.administrativeArea"/>
88                        <postalCode py:content="cn.address.postalCode"/>
89                        <country  py:content="cn.address.country"/>
90                        <electronicMailAddress  py:if="cn.address is not None"
91                                      py:content="cn.address.electronicMailAddress"/>
92                </address>
93    </contactInfo>
94    </py:with>
95    </responsibleParty>
96   
97    <fees py:content="si.fees"/>
98    <accessConstraints py:content="si.accessConstraints"/>
99  </Service>
100 
101  <!--! These fields are represented in ows_common as service constraints -->
102  <Capability py:with="sm=c.capabilities; om=sm.operationsMetadata">
103    <py:if test="om is not None">
104      <?python ops = ['GetCapabilities', 'DescribeCoverage', 'GetCoverage'] ?>
105      <Request>
106        <py:for each="opName in ops" py:if="opName in om.operationDict.keys()">
107          <span py:content="markupOperation(opName, om.operationDict[opName])" py:strip="True"/>
108        </py:for>
109        <py:for each="opName in ops" py:if="opName in om.operationDict.keys()">
110          <?python exceptions = om.operationDict[opName].parameters.get('ExceptionFormat') ?>
111          <Exception py:if="exceptions is not None">
112            <Format py:for="e in exceptions.possibleValues.allowedValues"
113                    py:content="e"/>
114          </Exception>
115        </py:for>
116      </Request>
117    </py:if>
118   
119    <!--!TODO:  capability exceptions -->
120    <Exception><Format>text/xml</Format></Exception>
121        </Capability>
122        <py:with vars="sm=c.capabilities">
123    <ContentMetadata py:if="sm.contents is not None">
124      <Title>Contents</Title>
125      <CoverageOfferingBrief py:for="ds in sm.contents.datasetSummaries"
126             py:replace="markupLayer(ds)">
127      </CoverageOfferingBrief>
128    </ContentMetadata>
129        </py:with>
130</WCS_Capabilities>
Note: See TracBrowser for help on using the repository browser.