source: TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/csml_wms.py @ 2502

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/csml_wms.py@2502
Revision 2502, 1.5 KB checked in by spascoe, 12 years ago (diff)

Some bug fixes to ows_common. OwsController?._load_capabilities implements
discovery of capabilities from a controller definition.

Line 
1# Copyright (C) 2007 STFC & NERC (Science and Technology Facilities Council).
2# This software may be distributed under the terms of the
3# Q Public License, version 1.0 or later.
4# http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt
5"""
6Example WMS controller driven by CSML.
7
8@author: Stephen Pascoe
9"""
10from ows_server.lib.base import *
11from ows_server.controllers.csml_api import get_csml_doc
12from elementtree import ElementTree as ET
13from ows_common import exceptions as OWS_E
14from ows_common.decorators import *
15from ows_server.lib.csml import get_csml_doc
16
17class CsmlWmsController(OwsController):
18
19    _ows_parameters = {
20        'Format': make_domain(['text/xml']),
21        'ExceptionFormat': make_domain(['text/xml']),
22        }
23
24    #_ows_constraints = {
25        # MaximumLayerLevels
26        # MaximumWidth
27        # MaximumWidth
28    #    }
29   
30    @operation
31    @parameter('Format', possibleValues=['text/xml'])
32    def GetCapabilities(self, file, service, version=None):
33        """
34        @note: format and updatesequence parameters are not supported
35            by this WMS.
36
37        """
38        if service != 'WMS':
39            raise OWS_E.MissingParameterValue('SERVICE parameter not specified',
40                                              'SERVICE')
41       
42        ows_c_file = request.environ['paste.config']['app_conf']['ows_common_config']
43        c.ows_c = ET.parse(ows_c_file).getroot()
44        c.dataset = get_csml_doc(file)
45       
46        return render_response('wms_service_metadata', format='xml')
Note: See TracBrowser for help on using the repository browser.