Changeset 5184


Ignore:
Timestamp:
08/04/09 14:57:10 (10 years ago)
Author:
cbyrom
Message:

Simplify backups structure in eXist - putting all backups under a
single toplevel structure.

Location:
ndgCommon/trunk/ndg/common
Files:
8 edited

Legend:

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

    r4987 r5184  
    2929        logging.debug("Building and running xquery") 
    3030        xquery = self.resources.createXQuery(queryType, targetCollection, providerID, localID) 
    31  
    3231        results = self.client.runQuery(xquery, useChunked = useChunked) 
    3332        logging.debug("Returning results from xquery") 
     
    7170            logging.debug("- need to retrieve a %s document" %xqtype) 
    7271 
    73         results = self.buildAndRunQuery(xqtype, targetCollection,  
     72        results = self.buildAndRunQuery(xqtype, targetCollection, 
    7473                                        providerID, localID) 
    7574        if len(results) == 0: 
  • ndgCommon/trunk/ndg/common/src/clients/xmldb/eXist/atomclient.py

    r5079 r5184  
    1919class AtomClient(CRUDClient, AbstractXMLDBAtomClient): 
    2020     
    21     def __init__(self, dbHostName = 'chinook.badc.rl.ac.uk', configFileName ='passwords.txt',  
     21    def __init__(self, dbHostName = 'bora.badc.rl.ac.uk', configFileName ='passwords.txt',  
    2222                 clientType = dc.XML_RPC_CLIENT, loadCollectionData = False,  
    2323                 setUpDB = False): 
  • ndgCommon/trunk/ndg/common/src/clients/xmldb/eXist/atomdbinitialiser.py

    r4925 r5184  
    7474        ''' 
    7575        logging.info("Ensuring required collections are available in eXist") 
    76         for col in [dc.ATOM_COLLECTION_PATH, dc.BACKUP_COLLECTION_PATH]: 
     76        for col in [dc.ATOM_COLLECTION_PATH, dc.BACKUP_COLLECTION_PATH + dc.ATOM_COLLECTION_PATH]: 
    7777            for type in [dc.OLD_COLLECTION_PATH, dc.PUBLISHED_COLLECTION_PATH, \ 
    7878                         dc.SMALL_P_PUBLISHED_COLLECTION_PATH, dc.WORKING_COLLECTION_PATH]: 
  • ndgCommon/trunk/ndg/common/src/clients/xmldb/eXist/crudclient.py

    r4976 r5184  
    9191         
    9292        # Now adjust the collection to map to the backup dir 
    93         collection = collection.replace(dc.ATOM_COLLECTION_PATH,  
    94                                         dc.BACKUP_COLLECTION_PATH) 
    95         collection = collection.replace(dc.NDG_A_COLLECTION_PATH,  
    96                                         dc.NDG_A_COLLECTION_PATH_BACKUP) 
     93        collection = dc.BACKUP_COLLECTION_PATH + collection 
    9794         
    9895        # add timestamp to filename 
     
    132129         
    133130        # Now adjust the collection to map to the backup dir 
    134         collection = collection.replace(dc.BACKUP_COLLECTION_PATH, dc.ATOM_COLLECTION_PATH) 
    135         collection = collection.replace(dc.NDG_A_COLLECTION_PATH_BACKUP, dc.NDG_A_COLLECTION_PATH) 
     131        collection = collection.replace(dc.BACKUP_COLLECTION_PATH, '') 
    136132         
    137133        self.createDoc(doc, collection, fileName) 
  • ndgCommon/trunk/ndg/common/src/clients/xmldb/eXist/dbconstants.py

    r5018 r5184  
    1919SMALL_P_PUBLISHED_COLLECTION_PATH = "published/" 
    2020WORKING_COLLECTION_PATH = "working/" 
    21 BACKUP_COLLECTION_PATH = "/db/atoms_backup/" 
     21BACKUP_COLLECTION_PATH = '/db/backups' 
    2222GRANULE_COLLECTION_PATH = "data_granules/" 
    2323DEPLOYMENT_COLLECTION_PATH = "deployment_data/" 
     
    2525DE_COLLECTION_PATH = "data_entities/" 
    2626NDG_A_COLLECTION_PATH = "/db/ndg_A_metadata/" 
    27 NDG_A_COLLECTION_PATH_BACKUP = "/db/ndg_A_metadata_backup/" 
    2827DIF_COLLECTION_PATH = "/db/DIF/" 
    2928MOLES_COLLECTION_PATH = '/db/ndg_B_metadata/' 
  • ndgCommon/trunk/ndg/common/src/dal/ndgRetrieve.py

    r5170 r5184  
    181181            target = dc.ATOM_COLLECTION_PATH 
    182182        elif ndgObject.schema == no.ATOM_BACKUP_DOC_TYPE: 
    183             target = dc.BACKUP_COLLECTION_PATH 
     183            target = dc.BACKUP_COLLECTION_PATH + dc.ATOM_COLLECTION_PATH 
    184184        elif ndgObject.schema == no.BROWSE_DIF_DOC_TYPE: 
    185185            target = dc.DIF_COLLECTION_PATH  
  • ndgCommon/trunk/ndg/common/unittests/clients/xmldb/eXist/testatomdbinitialiser.py

    r4942 r5184  
    4646            self.assertFalse(self.utils.ac.isNewCollection(dc.ATOM_COLLECTION_PATH)) 
    4747        except Exception, e: 
    48             self.fail("Should not have thrown an exception") 
     48            self.fail("Should not have thrown an exception: " + e) 
    4949 
    5050 
  • ndgCommon/trunk/ndg/common/unittests/clients/xmldb/eXist/testsearchclient.py

    r4991 r5184  
    170170        doc = self.client.getNDGDoc(tc.VALID_PROVIDER_ID, no.ATOM_BACKUP_DOC_TYPE, 
    171171                                    createdAtom.datasetID,  
    172                                     targetCollection = dc.BACKUP_COLLECTION_PATH) 
     172                                    targetCollection = dc.BACKUP_COLLECTION_PATH + dc.ATOM_COLLECTION_PATH) 
    173173        self.assertNotEquals(doc.find(createdAtom.datasetID), -1) 
    174174        doc1 = self.client.getNDGDoc(tc.VALID_PROVIDER_ID, no.ATOM_DOC_TYPE, 
     
    177177        self.assertNotEquals(doc1.find(createdAtom.datasetID), -1) 
    178178        self.assertNotEquals(doc, doc1) 
    179  
    180179 
    181180         
Note: See TracChangeset for help on using the changeset viewer.