source: TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/exception_report.kid @ 2479

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

Implemented basic query string handling by editing base.BaseController?.
Created an exception report template.
Disabled error document middleware.

Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<?python
3"""
4A OWS exception report.
5
6@param report: An ows_common.exception_report object
7"""
8
9def hide_optionals(attrDict, optionals=None):
10    """
11    Returns a copy of attrDict where any value which is None and in optionals is removed.
12
13    If optionals=None all keys are considered optional.
14
15    @todo: move this to a utils module
16    """
17    od = {}
18    for key, value in attrDict.items():
19        if (value is not None) or (optionals and key not in optionals):
20            od[key] = value
21
22    return od
23?>
24<ExceptionReport xmlns="http://www.opengis.net/ows"
25                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
26                 xmlns:py="http://purl.org/kid/ns#"
27                 xsi:schemaLocation="http://www.opengis.net/ows owsExceptionReport.xsd"
28                 version="${report.version}"
29                 py:attrs="hide_optionals(dict(language=report.lang))">
30<Exception py:for="e in report.exceptions"
31           py:content="e.text"
32           exceptionCode="${e.code}"
33           py:attrs="hide_optionals(dict(locator=e.locator))"/>
34</ExceptionReport>
35                 
Note: See TracBrowser for help on using the repository browser.