source: TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/pylons/templates/wms_capabilities_1_1_1.xml @ 3487

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/pylons/templates/wms_capabilities_1_1_1.xml@3487
Revision 3487, 4.5 KB checked in by spascoe, 12 years ago (diff)
Line 
1<?xml version="1.0"?>
2<!DOCTYPE WMT_MS_Capabilities SYSTEM
3 "http://www.digitalearth.gov/wmt/xml/capabilities_1_1_1.dtd">
4
5<?python
6
7from genshi.builder import tag, Element
8from ows_common.pylons.genshi_util import RenameElementFilter
9from genshi import QName
10
11?>
12
13<WMT_MS_Capabilities xmlns:py="http://genshi.edgewall.org/"
14                     xmlns:xlink="http://www.w3.org/1999/xlink"
15                     version="1.1.1">
16
17  <!--! ====================================================================== -->
18  <!--!
19      To change the tag name we need to wrap a markup macro in a python
20      function
21  -->
22
23  <Operation py:def="_opContent(op)">
24    <Format py:for="f in op.parameters['Format'].possibleValues.allowedValues" py:content="f"/>
25    <DCPType><HTTP>
26      <Get><OnlineResource xlink:href="${op.get.href}"/></Get>
27    </HTTP></DCPType>
28  </Operation>
29  <?python
30 
31  def markupOperation(opName, op):
32    """Render an OWS operation description for the Capabilities section.
33    """
34
35    return RenameElementFilter(QName(opName))(_opContent(op))
36
37  ?>
38
39  <Layer py:def="markupLayer(ds)">
40    <Name py:content="ds.identifier"/>
41    <Title py:content="ds.titles[0]"/>
42    <Abstract py:if="len(ds.abstracts)>0" py:content="ds.abstracts[0]"/>
43    <py:for each="bb in ds.boundingBoxes">
44      <BoundingBox SRS="${bb.crs}"
45                   minx="${bb.lowerCorner[0]}"
46                   miny="${bb.lowerCorner[1]}"
47                   maxx="${bb.upperCorner[0]}"
48                   maxy="${bb.upperCorner[1]}"/>
49    </py:for>
50
51    <!-- TODO Attribution from metadata -->
52    <!-- TODO AuthorityURL from metadata -->
53    <!-- TODO FeatureListURL from metadata -->
54    <!-- TODO Identifier from metadata -->
55    <!-- TODO DataURL from metadata -->
56    <!-- TODO MetadataURL from metadata -->
57    <!-- TODO Style -->
58    <!-- TODO ScaleHint -->
59    <py:for each="d_n, d in ds.dimensions.iteritems()">
60      <Dimension name="${d_n}" units="${d.valuesUnit.uoms[0]}"
61                 unitSymbol="${d.unitSymbol}"/>
62      <Extent name="${d_n}" default="${d.defaultValue}" nearestValue="d.nearestValue"
63              py:content="' '.join(d.possibleValues.allowedValues)"/>
64    </py:for>
65  </Layer>
66
67  <!--! ====================================================================== -->
68
69
70  <Service py:with="sm=c.capabilities; si=c.capabilities.serviceIdentification">
71    <Name>WMS</Name>
72    <Title py:content="si.titles[0]"/>
73    <Abstract py:if="len(si.abstracts)>0" py:content="si.abstracts[0]"/>
74    <KeywordList>
75      <Keyword py:for="kw in si.keywords"
76               py:content="kw"/>
77    </KeywordList>
78    <!--! <OnlineResource xlink:type="simple" xlink:href="${h.url_for()}"/> -->
79   
80    <ContactInformation py:if="sm.serviceProvider is not None"
81                        py:with="rp=sm.serviceProvider.serviceContact">
82      <ContactPersonPrimary>
83        <ContactPerson py:if="rp is not None" py:content="rp.individualName"/>
84        <ContactOrganisation py:content="sm.serviceProvider.providerName"/>
85      </ContactPersonPrimary>
86      <ContactPosition py:content="rp.positionName"/>
87
88      <py:with vars="cn=rp.contactInfo" py:if="cn is not None">
89        <ContactAddress py:if="cn.address is not None">
90          <AddressType>postal</AddressType>
91          <Address>
92            <py:for each="d in cn.address.deliveryPoints">${d}</py:for>
93          </Address>
94          <City py:content="cn.address.city"/>
95          <StateOrProvince py:content="cn.address.administrativeArea"/>
96          <PostCode py:content="cn.address.postalCode"/>
97          <Country py:content="cn.address.country"/>
98        </ContactAddress>
99        <ContactVoiceTelephone py:if="cn.phone is not None"
100                               py:content="cn.phone.voice"/>
101        <ContactFacsimileTelephone py:if="cn.phone is not None"
102                                   py:content="cn.phone.facsimile"/>
103        <ContactElectronicMailAddress py:if="cn.address is not None"
104                                      py:content="cn.address.electronicMailAddress"/>
105      </py:with>
106    </ContactInformation>
107   
108    <Fees py:content="si.fees"/>
109    <AccessConstraints py:content="si.accessConstraints"/>
110  </Service>
111 
112  <!--! These fields are represented in ows_common as service constraints -->
113  <Capability py:with="sm=c.capabilities; om=sm.operationsMetadata">
114    <py:if test="om is not None">
115      <py:for each="opName, op in om.operationDict.items()">
116        <Request py:content="markupOperation(opName, op)"/>
117        <?python exceptions = op.parameters.get('ExceptionFormat') ?>
118        <Exception py:if="exceptions is not None">
119          <Format py:for="e in exceptions.possibleValues.allowedValues"
120                  py:content="e"/>
121        </Exception>
122      </py:for>
123    </py:if>
124   
125    <Layer py:if="sm.contents is not None">
126      <Title>Contents</Title>
127      <Layer py:for="ds in sm.contents.datasetSummaries"
128             py:replace="markupLayer(ds)"/>
129    </Layer>
130  </Capability>
131</WMT_MS_Capabilities>
Note: See TracBrowser for help on using the repository browser.