Changeset 2923 for TI05-delivery


Ignore:
Timestamp:
04/10/07 12:09:38 (12 years ago)
Author:
domlowe
Message:

forwarding for describeCoverage and getCoverage operations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/csml_wcsx.py

    r2922 r2923  
    99""" 
    1010 
    11  
    12 try: #python 2.5 
    13     from xml.etree import ElementTree as ET 
    14 except ImportError: 
    15     try: 
    16         # if you've installed it yourself it comes this way 
    17         import ElementTree as ET 
    18     except ImportError: 
    19         # if you've egged it this is the way it comes 
    20         from elementtree import ElementTree as ET 
    21  
    22 import os, time, string, StringIO 
    23  
    2411from ows_server.lib.base import * 
    2512from ows_server.lib.decorators import * 
    2613import ows_server.lib.validators as V 
    27 from ows_server.controllers.csml_wcs1_0 import CsmlWcs10Controller 
    28  
    29 from ows_common import exceptions as OWS_E 
    30 from ows_common.wcs import * 
    31 from ows_common.common import BoundingBox 
    32 from ows_common.domain import ValuesUnit, PossibleValues 
    33  
    34 from ows_server.lib.csml_util import get_csml_doc, extractToNetCDF 
    35 from ows_server.lib.ndgInterface import interface 
    36 from ows_server.models.wcs_CoverageDescription import CoverageDescription 
    37  
    38  
    3914import logging 
    4015logger = logging.getLogger('ows_server.controllers.csml_wcsx') 
     
    4318 
    4419class CsmlWcsxController(OwsController): 
    45     ''' Overarching version independent wcs controller that passes request to correct version of WCS controller (eg 1.0.0 or 1.1.1 '''       
     20    ''' Overarching version independent wcs controller that passes request to correct version of WCS controller (eg 1.0.0 or 1.1.1 etc) '''       
     21     
     22    def _getWCSurl(self,version): 
     23        #todo, may have to change the way this url is constructed to allow for apache forwarding 
     24        if version == '1.0.0': 
     25            u=construct_url(request.environ,request.environ['QUERY_STRING']) 
     26            u=u.replace('wcs','wcs1_0_0') 
     27        elif version == '1.1.0': 
     28            u=construct_url(request.environ,request.environ['QUERY_STRING']) 
     29            u=u.replace('wcs','wcs1_1_0') 
     30        return u 
     31     
    4632     
    4733    @operation 
    4834    @parameter('Version', possibleValues=['1.0.0','1.1.0']) 
    49     def GetCapabilities(self, uri, service = None, version=None, **kwargs): 
     35    def GetCapabilities(self, version=None): 
    5036        """ 
    5137        Use the right controller (correct version) to perform the getCapabilities operation 
    52  
    5338        """ 
    54         #todo, may have to change the way this url is constructed to allow for apache forwarding 
    55         if version == '1.0.0': 
    56             cc=construct_url(request.environ,request.environ['QUERY_STRING']) 
    57             cc=cc.replace('wcs','wcs1_0_0') 
    58         elif version == '1.1.0': 
    59             cc=construct_url(request.environ,request.environ['QUERY_STRING']) 
    60             cc=cc.replace('wcs','wcs1_1_0') 
    61         h.redirect_to(cc) 
     39        newurl=self._getWCSurl(version) 
     40        h.redirect_to(newurl) 
    6241             
    6342    @operation 
    64     @parameter('Service', possibleValues=['WCS'], required=True) 
    65     @parameter('Version', possibleValues=['1.1.0']) 
    66     @parameter('Identifiers', required=True) 
    67     @parameter('Format', possibleValues=['text/xml'], required=True)  #IS THIS MANDATORY 
    68     def DescribeCoverage(self, uri, version, service, identifiers, format='text/xml'): 
    69         #to do 
    70         pass 
     43    @parameter('Version', possibleValues=['1.0.0','1.1.0']) 
     44    def DescribeCoverage(self, version=None): 
     45        """ 
     46        Use the right controller (correct version) to perform the DescribeCoverage operation 
     47        """ 
     48        newurl=self._getWCSurl(version) 
     49        h.redirect_to(newurl) 
    7150         
    7251    @operation 
    73     @parameter('Version', possibleValues=['1.1.0'], required=True) 
    74     @parameter('Identifier', required=True) 
    75     @parameter('BoundingBox', required=True, validator=V.bbox_2or3d) 
    76     @parameter('TimeSequence',required=True, validator=V.iso8601_time) 
    77     @parameter('Format', possibleValues=['application/netcdf'], required=True) 
    78     @parameter('Store', validator = V.boolean('Store')) 
    79     @parameter('Status', validator = V.boolean('Status')) 
    80     #TODO some more parameters to add here 
    81     # Dimension parameters Time, Elevation, etc. are handled separately 
    82     def GetCoverage(self, uri, version, format, identifier, boundingbox, timesequence, store=False, status=False): 
    83         #to do  
    84         pass 
     52    @parameter('Version', possibleValues=['1.0.0','1.1.0']) 
     53    def GetCoverage(self, version=None): 
     54        """ 
     55        Use the right controller (correct version) to perform the GetCoverage operation 
     56        """ 
     57        newurl=self._getWCSurl(version) 
     58        h.redirect_to(newurl) 
Note: See TracChangeset for help on using the changeset viewer.