Changeset 1989 for TI07-MOLES


Ignore:
Timestamp:
11/01/07 06:00:15 (12 years ago)
Author:
lawrence
Message:

Modifications to support new exist database layout for discovery
(don't yet work on glue!)

Location:
TI07-MOLES/trunk/PythonCode/wsgi
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/PythonCode/wsgi/DocumentRetrieve.py

    r1955 r1989  
    3333            raise TypeError('DocumentRetrieve code does not yet know how to find specific CSML Documents') 
    3434         
    35         elif schema[0:5] == 'NDG-B': 
     35        elif (schema[0:5] == 'NDG-B' or schema[0:3]=='DIF'): 
    3636             
    3737            # find out what type of object actually exists of this sort 
    3838            # 0 - None, 1 - Activity, 2 - DPT, 3 - ObsStn, 4 - DE 
     39            # if the schema is a DIF, we expect to find a DE from the DIF ingestion to MOLES ... 
    3940             
    4041            # the following xquery can be used to generate a listing of the database 
     
    4647            xquery=ObjectTypeQuery 
    4748            xquery=queryReplace(xquery,repository,localID,targetCollection) 
    48  
     49            print xquery 
    4950            id,summary=self.executeQuery(xquery) 
    5051            hits=summary['hits'] 
    5152             
    52             if hits!=1: raise ('[%s] documents match this query - internal error!'%hits) 
     53            if hits!=1: raise ValueError,'%s documents returned for uri %s:%s:%s'%(hits,repository,'NDG-B0',localID) 
    5354             
    5455            # check output formats 
  • TI07-MOLES/trunk/PythonCode/wsgi/ndgRetrieve.py

    r1933 r1989  
    9494            ok=1 
    9595            bits=uri.split(':') 
     96            bits2=uri.split('__') 
    9697            if len(bits)==3: 
    97                 repository,schema,localID=bits  
     98                repository,schema,localID=bits 
     99            elif len(bits2)==3: 
     100                repository,schema,localID=bits2 
    98101            else: 
    99102                bits=uri.split('/') 
  • TI07-MOLES/trunk/PythonCode/wsgi/ndgSearch.py

    r1958 r1989  
    183183        results=[] 
    184184        for i in indices: 
    185             results.append((filenames[i],responses[i])) 
     185            results.append((filenames[i].strip('.xml'),responses[i])) 
    186186        return results 
    187187         
Note: See TracChangeset for help on using the changeset viewer.