Changeset 2501


Ignore:
Timestamp:
22/05/07 13:05:26 (12 years ago)
Author:
spascoe
Message:

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.

Location:
TI05-delivery/ows_framework/trunk
Files:
6 added
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_common/ows_common/domain.py

    r2475 r2501  
    3030 
    3131    """ 
    32     def __init__(self, possibleValues, defaultValue=None, metadata=[], 
    33                  meaning=None, dataType=None, valuesUnit): 
     32    def __init__(self,  defaultValue=None, possibleValues=None, metadata=[], 
     33                 meaning=None, dataType=None, valuesUnit=None): 
     34        if possibleValues is None: 
     35            possibleValues = PossibleValues.anyValue() 
    3436        self.possibleValues = possibleValues 
    3537        self.defaultValue = defaultValue 
     
    8183        k.type = klass.ALLOWED_VALUES 
    8284        k.allowedValues = valueOrRanges 
     85        return k 
    8386 
    8487    @classmethod 
     
    126129 
    127130    """ 
    128     __slots__ = ['reference'] 
    129131 
    130132    def __init__(self, name, reference=None): 
  • TI05-delivery/ows_framework/trunk/ows_common/ows_common/iso19115_subset.py

    r2477 r2501  
    1818 
    1919    """ 
    20     __slots__ = ['lang'] 
    2120     
    2221    def __init__(self, value, lang=None): 
     
    3534 
    3635    """ 
    37     __slots__ = ['codeSpace'] 
    3836 
    3937    def __init__(self, code, codeSpace=None): 
     
    7371 
    7472    """ 
    75     def __init__(self, href, role=None, show=None, title=None, actuate=None 
     73    def __init__(self, href, role=None, show=None, title=None, actuate=None, 
    7674                 arcrole=None): 
    7775        self.href = href 
  • TI05-delivery/ows_framework/trunk/ows_server/development.ini

    r2494 r2501  
    2121session_secret = somesecret 
    2222csml_dir = /research/home/spascoe/host/saturn/data/ddc_data/obs 
     23ows_common_config = %(here)s/eg_ows_capabilities.xml 
    2324 
    2425# If you'd like to fine-tune the individual locations of the cache data dirs 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/csml_api.py

    r2494 r2501  
     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""" 
     6Basic CSML controller. 
     7 
     8@author: Stephen Pascoe 
     9""" 
     10 
    111from ows_server.lib.base import * 
    212import csml.parser 
    313import os 
     14from ows_server.lib.csml import get_csml_doc 
    415 
    5 def get_csml_doc(file): 
    6     """ 
    7     A trivial document retrieval function. 
    8  
    9     This could be replaced with a proper csml server object that supports 
    10     multiple stores (filesystem, exist) and cache's the results for 
    11     performance. 
    12  
    13     """ 
    14     csml_dir = request.environ['paste.config']['app_conf']['csml_dir'] 
    15     path = os.path.join(csml_dir, file) 
    16     if os.path.exists(path+'.csml'): 
    17         f = path+'.csml' 
    18     elif os.path.exists(path+'.xml'): 
    19         f = path +'.xml' 
    20     else: 
    21         raise ValueError("Cannot find CSML file %s" % file) 
    22      
    23     d = csml.parser.Dataset() 
    24     d.parse(f) 
    25          
    26     return d 
    2716 
    2817 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/wms_service_metadata.kid

    r2493 r2501  
    44WMS 1.3.0 compliant wms:Service XML. 
    55 
    6 @param ows_c: A ows:Capabilities XML tree node containing 
     6@var c.ows_c: A ows:Capabilities XML tree node containing 
    77    ServiceIdentification and ServiceProvider children. 
    88""" 
     
    1010from ows_server.lib.wms_capabilities import WmsOwsAdapter 
    1111?> 
    12 <WMS_Capabilities version="1.3.0" 
     12<WMS_Capabilities xmlns:py="http://purl.org/kid/ns#" 
     13                  version="1.3.0" 
    1314                  xmlns="http://www.opengis.net/wms" 
    14                   xmlns:py="http://purl.org/kid/ns#" 
    1515                  xmlns:xlink="http://www.w3.org/1999/xlink" 
    1616                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    1717                  xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_2_0.xsd"> 
     18  <Service py:def="wms_service"> 
     19    <?python m = WmsOwsAdapter(c.ows_c) ?> 
    1820 
    19 <?python m = WmsOwsAdapter(ows_c) ?> 
    20  
    21   <Service> 
    2221    <Name>WMS</Name> 
    2322    <Title py:if="m.title" py:content="m.title"/> 
Note: See TracChangeset for help on using the changeset viewer.