Changeset 2640 for TI05-delivery


Ignore:
Timestamp:
22/06/07 22:16:42 (12 years ago)
Author:
lawrence
Message:

Modifying the xml handling (to speed it up), not yet complete.
(in ows browse/discovery)

Location:
TI05-delivery/ows_framework/trunk/ows_server/ows_server/models
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/models/DocumentRetrieve.py

    r2639 r2640  
    88# Note that ndgRetreive essentially provides test cases for this code. 
    99 
    10 debug=1 
     10debug=0 
    1111 
    1212def queryReplace(xquery,repository,localID,targetCollection): 
     
    5757            id,summary=self.executeQuery(xquery) 
    5858            hits=summary['hits'] 
    59             print 'bnl',targetCollection,xquery 
    6059             
    6160            if hits!=1: raise ValueError,'%s documents returned for uri %s:%s:%s (in %s)'%(hits,repository,'NDG-B0',localID,targetCollection) 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/models/ndgRetrieve.py

    r2639 r2640  
    1 import DocumentRetrieve, ndgSearch, ndgObject, xmlHandler 
     1import DocumentRetrieve, ndgSearch, ndgObject, xmlHandler2 
    22import cgi,time 
    33from Utilities import myConfig 
    4  
     4debug=1 
    55def ndgRetrieve(uri,config,logger=0,requestor='test',format=''): 
    66     
     
    5858    #if r=='': return 0,'No matching DIF [%s]'%uri.uri 
    5959    #if we got this far, we should have valid xml 
    60     x=xmlHandler.xmlHandler(r,string=1) 
     60    if debug: file('ndgRetrieve.%s.debug.xml'%uri.uri,'w').write(r) 
     61         
     62    x=xmlHandler2.xmlHandler(r,string=1) 
    6163    if uri.schema=='DIF': 
    6264        pass # no access control 
     
    129131         
    130132         
     133    def testXMLdif(self): 
     134        ''' Make sure we can encode and decode at least one DIF properly ''' 
     135        self.setup() 
     136        doc='neodc.nerc.ac.uk__DIF__NEODC_NEXTMAP' 
     137        doc='badc.nerc.ac.uk__DIF__dataent_11738019833217179' 
     138        uri=ndgObject.ndgObject(doc) 
     139        status,xml=ndgRetrieve(uri,self.c) 
     140        if status: s=str(xml) 
     141        print s 
     142         
     143         
     144         
     145         
    131146if __name__=="__main__": 
    132147    unittest.main() 
Note: See TracChangeset for help on using the changeset viewer.