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

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

editing wcs capabilities

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