Changeset 2697 for TI05-delivery


Ignore:
Timestamp:
04/07/07 09:30:23 (12 years ago)
Author:
domlowe
Message:

adding statuscontroller back into csml_wcs.py

File:
1 edited

Legend:

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

    r2695 r2697  
    1010 
    1111#NOTE, much of this is straight from WMS and needs to be overhauled. 
    12  
    13 try: #python 2.5 
    14     from xml.etree import ElementTree as ET 
    15 except ImportError: 
    16     try: 
    17         # if you've installed it yourself it comes this way 
    18         import ElementTree as ET 
    19     except ImportError: 
    20         # if you've egged it this is the way it comes 
    21         from elementtree import ElementTree as ET 
    22  
    2312import os, time, string, StringIO 
    2413 
     
    2716import ows_server.lib.validators as V 
    2817 
     18from elementtree import ElementTree as ET 
    2919from ows_common import exceptions as OWS_E 
    3020from ows_common.wcs import * 
     
    3323 
    3424from ows_server.lib.csml_util import get_csml_doc, extractToNetCDF 
    35 from ows_server.lib.ndgInterface import interface 
     25from ows_server.lib.csml_cache import csmlCache, extractCache 
     26 
     27from ows_server.controllers.status import StatusController 
    3628 
    3729from email.mime.multipart import MIMEMultipart 
     
    140132         
    141133        #get doc from cache or disk: 
    142         c.dataset = interface.GetParsedCSML(fileoruri) 
     134        c.dataset = csmlCache[fileoruri] 
    143135        if type(c.dataset) is str: 
    144136            #If not a csml datset is some message from exist such as 'access denied'            
     
    158150    # Dimension parameters Time, Elevation, etc. are handled separately 
    159151    def GetCoverage(self, fileoruri, version, format, identifier, boundingbox, timesequence, store=False, status=False): 
    160             #try: 
     152        try: 
    161153                    # Retrieve dataset and selected feature             
    162             rstatus,dataset=interface.GetParsedCSML(fileoruri) 
    163             if not rstatus: raise ValueError(dataset) 
     154            dataset = csmlCache[fileoruri] 
    164155            feature = dataset.getFeature(identifier) 
    165156            if feature is None: 
     
    240231                return Response(content=msg, mimetype='multipart')  
    241232                   
    242         #except Exception, e: 
    243          #   raise Exception,e 
    244           #  if isinstance(e, OWS_E.OwsError): 
    245            #     raise e 
    246             #else: 
    247              #   raise OWS_E.NoApplicableCode(e) 
    248          
    249          
     233        except Exception, e: 
     234            if isinstance(e, OWS_E.OwsError): 
     235                raise e 
     236            else: 
     237                raise OWS_E.NoApplicableCode(e) 
     238         
     239         
Note: See TracChangeset for help on using the changeset viewer.