Changeset 4843 for ndgCommon/trunk/ndg


Ignore:
Timestamp:
19/01/09 16:51:33 (11 years ago)
Author:
cbyrom
Message:

Include better management of stored reference collections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ndgCommon/trunk/ndg/common/src/clients/xmldb/eXist/existdbclient.py

    r4828 r4843  
    414414 
    415415        # create the collection, if it doesn't already exist - NB, this won't overwrite anything 
    416         if self.collections is None or not self.collections.get(collection): 
     416        if self.collections is None or not collection in self.collections.values(): 
    417417            self.createCollections([collection]) 
    418418             
     
    422422            logging.error(errorMessage) 
    423423            raise SystemError(errorMessage) 
     424         
     425        # update the stored collections info, if being used 
     426        if self.collections: 
     427            self.collections[fileName] = collection 
    424428         
    425429        logging.info("File added to eXist") 
     
    490494        Get all atom collection paths and store in a dictionary - for easy 
    491495        reference when doing lots of things at once 
    492         @return: dict with key/val of atomID/collectionPath 
     496        @return: dict with key/val of filename/collectionPath 
    493497        ''' 
    494498        logging.info("Retrieving all atom collection paths") 
     
    506510            collection = member.findtext('{http://www.w3.org/2005/Atom}fileName') 
    507511            fileName = collection.split('/')[-1] 
    508             fileName = fileName.split('.')[0] 
     512            fileName = fileName.split('.')[0:-1] 
     513            fileName = '.'.join(fileName) 
    509514            dir = '/'.join(collection.split('/')[0:-1]) 
    510515            colData[fileName] = dir 
Note: See TracChangeset for help on using the changeset viewer.