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

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

tests now point at famous test subset, formatting capabilities template

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