Changeset 2625 for TI05-delivery/ows_framework
- Timestamp:
- 20/06/07 15:12:26 (12 years ago)
- Location:
- TI05-delivery/ows_framework/trunk/ows_server
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TI05-delivery/ows_framework/trunk/ows_server/development_dom.ini
r2605 r2625 9 9 smtp_server = localhost 10 10 error_email_from = paste@localhost 11 configfile = ows_server/config/ndgDiscovery.config 11 12 12 13 [server:main] -
TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/csml_wcs.py
r2607 r2625 102 102 @parameter('Identifier', required=True) 103 103 @parameter('BoundingBox', required=True, validator=V.bbox_2d) 104 @parameter('TimeSequence',required=True ) #TODO, need validator to handle iso8601 time strings105 @parameter('Format', possibleValues=[' image/netcdf'], required=True)104 @parameter('TimeSequence',required=True, validator=V.iso8601_time) #TODO, need validator to handle iso8601 time strings 105 @parameter('Format', possibleValues=['application/netcdf'], required=True) 106 106 @parameter('Store', possibleValues=['true', 'True', 'TRUE']) 107 107 #TODO some more parameter to add here … … 116 116 117 117 #set bounding box TODO 118 sel = dict(latitude=(boundingbox[1], boundingbox[3]), longitude=(boundingbox[0], boundingbox[2])) 118 sel = dict(latitude=(boundingbox[1], boundingbox[3]), longitude=(boundingbox[0], boundingbox[2])) 119 119 sel['time']=timesequence #needs validating 120 120 … … 127 127 #Depending on if the 'store' parameter is set, either return the netcdf file or a link to it. 128 128 if store is not None: 129 c.hyperlink = 'http://'+request.environ['HTTP_HOST']+'/'+os.path.basename(request.environ['paste.config']['app_conf']['publish_dir'])+'/'+ filename129 c.hyperlink = 'http://'+request.environ['HTTP_HOST']+'/'+os.path.basename(request.environ['paste.config']['app_conf']['publish_dir'])+'/'+os.path.basename(filename) 130 130 c.wcs_request=request.environ['HTTP_REFERER'] 131 131 return render_response('wcs_asynchronous') 132 else: 132 else: 133 133 netcdfFile=open(filename, 'r') 134 134 return Response(content=netcdfFile, mimetype='image/netcdf') -
TI05-delivery/ows_framework/trunk/ows_server/ows_server/lib/validators.py
r2594 r2625 39 39 40 40 return bbox_t 41 42 43 def iso8601_time(timestring): 44 """ 45 Checks if timestring is a valid iso8601 time string or valid iso8601 time interval 46 This is not a complete implementation of the full iso8601 spec (although could be extended to be so). 47 48 """ 49 import xml.utils.iso8601 as isoT 50 #single time value e.g. 2002-03-01T13:00:00Z 51 52 #start and end times: e.g 2002-03-01T13:00:00Z/2003-05-11T15:30:00Z 53 54 def _checkTime(timestring): 55 try: 56 isoT.parse(timestring) 57 return timestring[:-1] #return without the Z 58 except ValueError: 59 timestring=timestring + 'Z' #maybe the Z has just been missed off 60 try: 61 isoT.parse(timestring) 62 return timestring[:-1]#return without the Z 63 except ValueError: 64 raise InvalidParameterValue("Incorrect TimeSequence specification %s" % timestring, 'timeSequence') 65 66 if timestring.find(',') == -1: 67 timelist=timestring.split('/') 68 else: 69 timelist=timestring.split(',') 70 71 if len(timelist) == 1: 72 tOK=_checkTime(timelist[0]) 73 return tOK 74 75 else: 76 newtimelist=[] 77 for t in timelist: 78 newtimelist.append(_checkTime(t)) 79 return tuple(newtimelist) 41 80 42 81 … … 82 121 83 122 return f 84
Note: See TracChangeset
for help on using the changeset viewer.