Changeset 3368 for TI05-delivery


Ignore:
Timestamp:
11/02/08 14:01:22 (12 years ago)
Author:
spascoe
Message:

About to change some things so commiting current state.

File:
1 edited

Legend:

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

    r3364 r3368  
    1515from ows_common.util import negotiate_version 
    1616from ows_common.pylons.decorators import ows_operation 
     17 
     18# Import exceptions template 
     19# This won't work if you haven't enabled Kid importing (already done by pylons) 
     20from ows_common.pylons.templates import exception_report 
    1721 
    1822try: 
     
    4246        if 'pylons' in EXCEPTION_TYPE: 
    4347            self._fixOwsAction(environ) 
    44             return super(OwsController, self).__call__(environ, start_response) 
     48            return super(OwsControllerBase, self).__call__(environ, start_response) 
    4549        else: 
    4650            try: 
    4751                self._fixOwsAction(environ) 
    48                 return super(OwsController, self).__call__(environ, start_response) 
     52                return super(OwsControllerBase, self).__call__(environ, start_response) 
    4953            except OWS_E.OwsError, e: 
    5054                logger.exception(e) 
    5155 
    52                 r=render('exception_report', report=e.report, format='xml') 
    53                 r.headers['content-type'] = 'text/xml' 
    54                 return r 
     56                response.write(exception_report.serialize(report=e.report)) 
     57                response.headers['content-type'] = 'text/xml' 
     58                return response 
    5559 
    5660 
    5761    def _fixOwsAction(self, environ): 
     62        rdict = environ['pylons.routes_dict'] 
     63         
    5864        # Override the Routes action from the request query parameter 
    5965        try: 
     
    7783                                                  param) 
    7884 
     85 
    7986        # override routes action with request 
    80         environ['pylons.routes_dict']['action'] = action 
     87        rdict['action'] = action 
    8188        del self.ows_params['request'] 
     89 
     90        # Add ows parameters to routes 
     91        for param in self.ows_params: 
     92            rdict[param] = self.ows_params[param] 
    8293 
    8394 
     
    102113        """ 
    103114        Get the capabilities template. 
     115        Override in subclases to return a valid template name. 
    104116 
    105117        @param version: the version as a sequence of numbers 
Note: See TracChangeset for help on using the changeset viewer.