source: TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/wms_service_metadata.kid @ 2507

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/wms_service_metadata.kid@2507
Revision 2507, 2.4 KB checked in by spascoe, 12 years ago (diff)

Operations metadata inserted correctly for CSML WMS.

Line 
1<?xml version="1.0"?>
2<?python
3"""Convert a OWS common 1.1.0 compliant ServiceMetadata XML tree into
4WMS 1.3.0 compliant wms:Service XML.
5
6@var c.ows_c: A ows:Capabilities XML tree node containing
7    ServiceIdentification and ServiceProvider children.
8"""
9
10from ows_server.lib.wms_capabilities import WmsOwsAdapter
11?>
12<WMS_Capabilities xmlns:py="http://purl.org/kid/ns#"
13                  version="1.3.0"
14                  xmlns="http://www.opengis.net/wms"
15                  xmlns:xlink="http://www.w3.org/1999/xlink"
16                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17                  xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_2_0.xsd">
18<?python
19
20m = WmsOwsAdapter(c.ows_c)
21ops = c.ows_capabilities.operationsMetadata.operationDict
22
23?>
24
25  <Service>
26    <Name>WMS</Name>
27    <Title py:if="m.title" py:content="m.title"/>
28    <Abstract py:for="a in m.abstracts" py:content="a"/>
29    <KeywordList py:if="m.keywords">
30      <Keyword py:for="k in m.keywords" py:content="k"/>
31    </KeywordList>
32    <OnlineResource py:if="m.onlineResource"
33                    xlink:type="simple"
34                    xlink:href="${m.onlineResource}"/>
35    <ContactInformation>
36      <?python ci = m.contactInformation ?>
37      <ContactPersonPrimary>
38        <ContactPerson py:content="ci['person']"/>
39        <ContactOrganization py:content="ci['organization']"/>
40      </ContactPersonPrimary>
41      <ContactAddress>
42        <Address py:for="a in ci['address']" py:content="a"/>
43        <City py:content="ci['city']"/>
44        <StateOrProvince py:content="ci['state_or_province']"/>
45        <PostCode py:content="ci['postcode']"/>
46        <Country py:content="ci['country']"/>
47      </ContactAddress>
48      <ContactVoiceTelephone py:content="ci['telephone']"/>
49      <ContactFacsimile py:content="ci['fax']"/>
50      <ContactElectronicMailAddress py:content="ci['email']"/>
51    </ContactInformation>
52    <Fees py:content="m.fees"/>
53    <AccessConstraints py:content="m.accessConstraints"/>
54  </Service>
55  <Capability>
56    <Request>
57      <GetCapabilities py:if="'GetCapabilities' in ops">
58        <?python caps = ops['GetCapabilities'] ?>
59        <Format py:for="f in caps.parameters['Format'].possibleValues.allowedValues"
60                py:content="f"/>
61        <DCP>
62          <HTTP>
63            <Get py:if="caps.get">
64              <OnlineResource xlink:type="simple" xlink:href="${caps.get.href}"/>
65            </Get>
66            <Post py:if="caps.post">
67              <OnlineResource xlink:type="simple" xlink:href="${caps.post.href}"/>
68            </Post>
69          </HTTP>
70        </DCP>
71      </GetCapabilities>
72    </Request>
73  </Capability>
74</WMS_Capabilities>
Note: See TracBrowser for help on using the repository browser.