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

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

more merging - capabilities doc looking better.

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