source: cows/branches/wcsmerge/cows/pylons/templates/wcs_capabilities_1_0_0.xml @ 4581

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

more merging

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/"
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  <Coverage py:def="markupLayer(ds)">
44    <Name py:content="ds.identifier"/>
45    <Title 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      <BoundingBox SRS="${bb.crs}"
50                   minx="${'%.2f'%bb.lowerCorner[0]}"
51                   miny="${'%.2f'%bb.lowerCorner[1]}"
52                   maxx="${'%.2f'%bb.upperCorner[0]}"
53                   maxy="${'%.2f'%bb.upperCorner[1]}"/>
54    </py:for>
55
56
57  </Coverage>
58
59  <!--! ====================================================================== -->
60
61
62  <Service py:with="sm=c.capabilities; si=c.capabilities.serviceIdentification">
63    <Name>OGC:WMS</Name>
64    <Title py:content="si.titles[0]"/>
65    <Abstract py:if="len(si.abstracts)>0" py:content="si.abstracts[0]"/>
66    <KeywordList>
67      <Keyword py:for="kw in si.keywords"
68               py:content="kw"/>
69    </KeywordList>
70    <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" 
71                    xlink:href="${h.url_for(qualified=True, action='index')}?"/>
72   
73    <ContactInformation py:if="sm.serviceProvider is not None"
74                        py:with="rp=sm.serviceProvider.serviceContact">
75      <ContactPersonPrimary>
76        <ContactPerson py:if="rp is not None" py:content="rp.individualName"/>
77        <ContactOrganization py:content="sm.serviceProvider.providerName"/>
78      </ContactPersonPrimary>
79      <ContactPosition py:content="rp.positionName"/>
80
81      <py:with vars="cn=rp.contactInfo" py:if="cn is not None">
82        <ContactAddress py:if="cn.address is not None">
83          <AddressType>postal</AddressType>
84          <Address>
85            <py:for each="d in cn.address.deliveryPoints">${d}</py:for>
86          </Address>
87          <City py:content="cn.address.city"/>
88          <StateOrProvince py:content="cn.address.administrativeArea"/>
89          <PostCode py:content="cn.address.postalCode"/>
90          <Country py:content="cn.address.country"/>
91        </ContactAddress>
92        <ContactVoiceTelephone py:if="cn.phone is not None"
93                               py:content="cn.phone.voice"/>
94        <ContactFacsimileTelephone py:if="cn.phone is not None"
95                                   py:content="cn.phone.facsimile"/>
96        <ContactElectronicMailAddress py:if="cn.address is not None"
97                                      py:content="cn.address.electronicMailAddress"/>
98      </py:with>
99    </ContactInformation>
100   
101    <Fees py:content="si.fees"/>
102    <AccessConstraints py:content="si.accessConstraints"/>
103  </Service>
104 
105  <!--! These fields are represented in ows_common as service constraints -->
106  <Capability py:with="sm=c.capabilities; om=sm.operationsMetadata">
107    <py:if test="om is not None">
108      <?python ops = ['GetCapabilities', 'GetMap', 'GetFeatureInfo'] ?>
109      <Request>
110        <py:for each="opName in ops" py:if="opName in om.operationDict.keys()">
111          <span py:content="markupOperation(opName, om.operationDict[opName])" py:strip="True"/>
112        </py:for>
113        <py:for each="opName in ops" py:if="opName in om.operationDict.keys()">
114          <?python exceptions = om.operationDict[opName].parameters.get('ExceptionFormat') ?>
115          <Exception py:if="exceptions is not None">
116            <Format py:for="e in exceptions.possibleValues.allowedValues"
117                    py:content="e"/>
118          </Exception>
119        </py:for>
120      </Request>
121    </py:if>
122   
123    <!--!TODO:  capability exceptions -->
124    <Exception><Format>text/xml</Format></Exception>
125
126    <Layer py:if="sm.contents is not None">
127      <Title>Contents</Title>
128      <Layer py:for="ds in sm.contents.datasetSummaries"
129             py:replace="markupLayer(ds)">
130      </Layer>
131    </Layer>
132  </Capability>
133</WCS_Capabilities>
Note: See TracBrowser for help on using the repository browser.