Changeset 4638 for exist


Ignore:
Timestamp:
15/12/08 11:58:21 (11 years ago)
Author:
cbyrom
Message:

Adjust retrieval of backup atom docs; these will return more than one
search hit - so don't throw an exception.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • exist/trunk/python/ndgUtils/DocumentRetrieve.py

    r4555 r4638  
    3131 
    3232    ATOM_TYPE = 'ATOM-TYPE' 
     33    ATOM_BACKUP_TYPE = 'ATOM-BACKUP' 
    3334    ATOM = 'ATOM' 
    3435    def __init__(self, repository, pwfile='passwords.txt'): 
     
    4243                           'NDG-B0':'moles','NDG-B1':'molesObjectType','MDIP':'moles2mdip', \ 
    4344                           'NDG-A0':'csml','NumSim':'numsim', self.ATOM:'atom', \ 
    44                            'ATOM-BACKUP':'atom', self.ATOM_TYPE:'atomTypeList'} 
     45                           self.ATOM_BACKUP_TYPE:'atom', self.ATOM_TYPE:'atomTypeList'} 
    4546 
    4647    def _retrieveDoc(self, schema, xqtype, targetCollection, repository, localID): 
     
    5455 
    5556        id,summary=self.executeQuery(xquery) 
    56         if summary['hits'] != 1: 
     57        # NB, backups will inevitably return lots of docs - only retrieve the top one 
     58        # for the moment - since this is not really needed atm 
     59        if summary['hits'] != 1 and schema != self.ATOM_BACKUP_TYPE: 
    5760            raise ValueError('Unable to obtain single %s document [%s] (hits=%s)'\ 
    5861                             %(schema,localID,summary['hits'])) 
Note: See TracChangeset for help on using the changeset viewer.