Changeset 2522 for TI07-MOLES

29/05/07 17:36:43 (12 years ago)

Sundry minor improvements in layout etc.

6 edited


  • TI07-MOLES/trunk/PythonCode/wsgi/

    r2487 r2522  
    77from Utilities import myConfig,mailError 
    88from ndgObject import ndgObject 
     9from Date import * 
    1011class DiscoveryGUI: 
    5960        advanced=int(self.inputs['advanced']) 
     61        self.advanced=advanced 
    6163        self.html='' 
    7072                        'sourceLimit'] 
    7173            self.__checkform(expected) 
    72             if self.message!='': return 
     74            if self.message!='': return self.error() 
    7476            if int(self.inputs['sourceLimit']): 
    8385            if int(self.inputs['spaceLimit']): 
    8486                bbox=[self.inputs['bboxN'],self.inputs['bboxS'],self.inputs['bboxW'],self.inputs['bboxE']] 
     87                self.__checkbox(bbox) 
     88                if self.message!='': return self.error() 
    8589            else: 
    8690                bbox=None 
    8993                dateRange=[(self.inputs['startDateDay'],self.inputs['startDateMon'],self.inputs['startDateYear']), 
    9094                           (self.inputs['endDateDay'],self.inputs['endDateMon'],self.inputs['endDateYear'])] 
     95                self.__checkdates(dateRange)                  
     96                if self.message!='': return self.error() 
    9198            else: 
    9299                dateRange=None 
    94101            self.doText(self.inputs['searchString'],self.inputs['textTarget'], 
    95102                        self.inputs['start'],self.inputs['howmany'],scope=scope,dateRange=dateRange,bbox=bbox) 
    97104        return 
     107    def __checkbox(self,bbox): 
     108        if float(bbox[0])>90.0 or float(bbox[1])<-90. or float(bbox[2])<-180. or float(bbox[3])>180.: 
     109            self.message='Invalid bounding box dimensions entered (limits 90,-90,-180,180)' 
    99111    def __checkform(self,expected): 
    105117                self.html='<p>%s</p>'%self.message 
     119    def __checkdates(self,dateRange): 
     120        ''' Check input dates for sanity ''' 
     121        print dateRange,ValidDate(dateRange[0]),ValidDate(dateRange[1]) 
     122        if not ValidDate(dateRange[0])*ValidDate(dateRange[1]): 
     123            self.message='Input dates are not valid' 
     124        elif JulDay(dateRange[0])>=JulDay(dateRange[1]): 
     125            self.message='Second date must be after first date' 
    107127    def __setState(self,id,searchString,hits,offset,stride): 
    108128        ''' Sets the discovery state to be used by external routines ''' 
    110130        return DiscoveryState(id,searchString,self.environ,hits,offset,stride) 
     133    def error(self): 
     134        ''' Return a useful error message ''' 
     135        self.html='<div class="error"><p>%s</p></div>'%self.message 
     136        if self.advanced: 
     137            self.advancedInterface() 
     138        else: 
     139            self.standardInterface() 
    112142    def doText(self,searchString,textTarget,start,howmany,scope=None,dateRange=None,bbox=None): 
    113143        ''' Carry out a text search for <searchString>  
  • TI07-MOLES/trunk/PythonCode/wsgi/layout/help.html

    r2413 r2522  
    2 <h3> NDG Search Interface </h3> 
     2<h3> NERC Data Discovery</h3> 
    44<h4> Background </h4> 
    6 <p>The NDG serach interface allows one to search the contents of the NERC DataGrid catalogue. 
     6<p> This is an interface which allows one to search the contents of the NERC DataGrid catalogue. 
    77The catalogue is populated with "discovery" metadata, not with data themselves, but the 
    88response sets include links which should lead the user to the datasets of interest</p> 
    1010<p> The metadata has been harvested from data providers, normally daily. Not all data providers are  
    11 within the NERC datagrid, and not all will provide the same data services.</p> 
     11within the NERC datagrid, and not all will provide the same data services. It is currently not possibleto provide a list of data providers which are indexed, as the membership is volatile. An easy way to find out if the data provider you care about is indexed is to search for it by name. You can limit the result set to NERC data centres or the Marine Data and Information Partnership via the advanced search page. </p> 
    1313<h4> Searching </h4> 
    15 <p> Free text searches may use xpath wild carding, such as ... </p> 
     15<p> Currently the interface provides free text searching by default, although geographical and temporal constraints can be imposed via the advanced search page. </p> 
     16<p> The current interface allows multiple words to be entered, in which case the search 
     17uses AND to link these together (they do not have to be adjacent). The search is not case sensitive.</p> 
     18<p> The current geographical and temporal searches are "outer-bound' constraints, overlaps will not be returned. A future version will provide more sophisticated alternatives.  
     19<p> The author search is designed to find data creators. Users should be aware that most data centres do not adequately populate all their records with enough information to identify the 
     20authors. We hope that this will change! </p> 
    1722<h4> Understanding the Result sets </h4> 
    19 <p> The links in each response entry are  
     24<p> The summary result set provdes a title, and perhaps a formal citation, along with a piece of the dataset abstract (and if possible the geographic and temporal domains) along with some important links. The links in each response entry are </p> 
    2126<li> D - to a reformatted version of the discovery metadata harvested from the original data centre</li> 
    2429<li> B - if present, should link to a service allowing browsing of context metadata </li> 
    26 Note that unless the original data provider is within the NERC DataGrid, A and B services are unlikely 
    27 to appear, although services with similar functionality may appear as R links. </p> 
     31Note that 
     32<ul><li> unless the original data provider is within the NERC DataGrid, A and B services are unlikely 
     33to appear, although services with similar functionality may appear as R links. </li> 
     34<li>the operators of this service have no control over the content, so there may be many rendering and other problems. Feel free to email us and let us know, and we'll try and get any such problems corrected. </li> 
  • TI07-MOLES/trunk/PythonCode/wsgi/layout/ndg.css

    r2517 r2522  
    6868div.AdvancedSearch{margin-top: 10px; margin-bottom: 10 px;} 
    6969div.stridePosition{margin-top: 2px; margin-bottom: 2px; background-color: wheat;} 
     70div.error{margin-top:2px; margin-bottom: 2px; background-color:tomato;  
     71        padding-left:10px; padding-right:10px;} 
    7173div.searchMethod {margin-top: 7px; margin-bottom: 8px;} 
  • TI07-MOLES/trunk/PythonCode/wsgi/ndgDiscovery.config

    r2518 r2522 
    76 what 
    77 what 
    7878icon: %(layout)s/B.gif 
    7979icon_alt: B Service 
    8181service_name: B 
    8282instance: http://SERVICEHOST/retrieve?repository=EXISTHOST&format=SCHEMA&type=html&uri= 
    83 what 
    85 what 
    98 what 
    99 what 
  • TI07-MOLES/trunk/PythonCode/wsgi/

    r2491 r2522  
    9191            failure=0 
    9292        except Exception,e: 
     93            raise Exception,e 
    9394            response+='''<p> Unable to fufill request, probably an error in the metadata record.  
    9495            NDG staff have been advised. Please try another search. </p>''' 
  • TI07-MOLES/trunk/PythonCode/wsgi/

    r2517 r2522  
    252252        if r[0:3]=='<p>':raise ValueError,r 
     254    def testBODC(self): 
     255        ''' Tests the link to BODC exist ''' 
     256        uri='' 
     257        inputs={'repository':'','uri':uri,'format':'NDG-B1','type':'xml'} 
     258        ctype,r=retriever._present(inputs,'text/html',browse=1) 
     259        if r[0:3]=='<p>':raise ValueError,r 
    254261    def testCHstub(self): 
    255262        ''' test link to local repository for NDG-B0''' 
Note: See TracChangeset for help on using the changeset viewer.