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

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

Many new ideas in this commit. It's still in a state of flux.
I'm exploring using decorators and class attributes with the prefix "_ows"
to declare properties that need to be in the OWS capabilities document.

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    @parameter('Format', possibleValues=['text/xml'])
31    def GetCapabilities(self, file, service, version=None):
32        """
33        @note: format and updatesequence parameters are not supported
34            by this WMS.
35
36        """
37        if service != 'WMS':
38            raise OWS_E.MissingParameterValue('SERVICE parameter not specified',
39                                              'SERVICE')
40       
41        ows_c_file = request.environ['paste.config']['app_conf']['ows_common_config']
42        c.ows_c = ET.parse(ows_c_file).getroot()
43        c.dataset = get_csml_doc(file)
44       
45        return render_response('wms_service_metadata', format='xml')
Note: See TracBrowser for help on using the repository browser.