Ignore:
Timestamp:
16/01/08 15:58:44 (12 years ago)
Author:
spascoe
Message:

Made OwsController? consistent with new OWS Protocol (untested)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/pylons/ows_controller.py

    r3216 r3236  
    6868            action = self.ows_params['request'] 
    6969        except KeyError: 
    70             raise OWS_E.MissingParameterValue('REQUEST parameter not specified', 'REQUEST') 
     70            raise OWS_E.MissingParameterValue('REQUEST parameter not specified', 
     71                                              'REQUEST') 
    7172 
    72         # Check action is a method in self 
    73         if not getattr(self, action): 
    74             raise OWS_E.InvalidParameterValue('request=%s not supported' % action, 'REQUEST') 
     73        # Check action is a method in self and is defined as an OWS operation 
     74        try: 
     75            op = getattr(self, action) 
     76            name = op._ows_name 
     77        except AttributeError: 
     78            raise OWS_E.InvalidParameterValue('request=%s not supported' % action, 
     79                                              'REQUEST') 
     80 
     81        # Check all required parameters are present 
     82        for param in op._ows_required_parameters: 
     83            if param.lower() not in self.ows_params: 
     84                raise OWS_E.MissingParameterValue('%s parameter not specified'%param, 
     85                                                  param) 
    7586 
    7687        # override routes action with request 
    7788        environ['pylons.routes_dict']['action'] = action 
    7889        del self.ows_params['request'] 
     90 
    7991 
    8092    def _loadCapabilities(self): 
Note: See TracChangeset for help on using the changeset viewer.